512502539433f8076b904c1280a7978b2215594f
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-02-12  Tim Horton  <timothy_horton@apple.com>
2
3         Crash under RemoteLayerTreeDrawingArea::flushLayers() when closing a tab
4         https://bugs.webkit.org/show_bug.cgi?id=141541
5
6         Reviewed by Benjamin Poulain.
7
8         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
9         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
10         The WebPage pointer can become stale between when it is retrieved
11         and dereferenced. Retrieve it by ID inside the dispatch_async block
12         instead of outside of it.
13
14 2015-02-12  Antti Koivisto  <antti@apple.com>
15
16         WebKit persistent cache uses a lot of threads
17         https://bugs.webkit.org/show_bug.cgi?id=141520
18
19         Reviewed by Andreas Kling.
20
21         Parallel retrieves are limited but stores are not. We may end up with lots of backround io
22         dispatch queue threads if they don't complete fast enough.
23
24         This patch adds pending state for write operations similar to what retrieves already have
25         and limits to number of active operations.
26
27         * NetworkProcess/cache/NetworkCacheStorage.h:
28
29             Combine StoreOperation and UpdateOperation and rename to WriteOperation.
30             Rename RetrieveOperation to ReadOperation.
31             The idea is to emphasize that these are disk operations.
32
33         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
34         (WebKit::NetworkCacheStorage::dispatchReadOperation):
35         (WebKit::NetworkCacheStorage::dispatchPendingReadOperations):
36         (WebKit::retrieveFromMemory):
37         (WebKit::NetworkCacheStorage::retrieve):
38         (WebKit::NetworkCacheStorage::store):
39         (WebKit::NetworkCacheStorage::update):
40         (WebKit::NetworkCacheStorage::dispatchPendingWriteOperations):
41
42             Only allow 3 parallel writes.
43
44         (WebKit::NetworkCacheStorage::dispatchFullWriteOperation):
45         (WebKit::NetworkCacheStorage::dispatchHeaderWriteOperation):
46
47             More informative names.
48
49         (WebKit::NetworkCacheStorage::dispatchRetrieveOperation): Deleted.
50         (WebKit::NetworkCacheStorage::dispatchPendingRetrieveOperations): Deleted.
51         (WebKit::retrieveActive): Deleted.
52
53 2015-02-12  Carlos Garcia Campos  <cgarcia@igalia.com>
54
55         [GTK] Add API to allow overriding the default color chooser implementation
56         https://bugs.webkit.org/show_bug.cgi?id=98935
57
58         Reviewed by Gustavo Noronha Silva.
59
60         Add API to allow the user to override the default UI of color
61         chooser. Similar to the file chooser API, a new run-color-chooser
62         signal is added to WebKitWebView that passes a WebKitColorChooserRequest
63         parameter to the signal.
64
65         Initial patch by Arnaud Renevier <a.renevier@sisa.samsung.com>.
66
67         * PlatformGTK.cmake: Add new files to compilation.
68         * UIProcess/API/gtk/PageClientImpl.cpp:
69         (WebKit::PageClientImpl::createColorPicker): Create a
70         WebKitColorChooser is the view widget is a WebKitWebView or a
71         WebColorPicker otherwise,
72         * UIProcess/API/gtk/WebKitColorChooser.cpp: Added.
73         (WebKit::WebKitColorChooser::create):
74         (WebKit::WebKitColorChooser::WebKitColorChooser):
75         (WebKit::WebKitColorChooser::~WebKitColorChooser):
76         (WebKit::WebKitColorChooser::endPicker): Chain up to parent class
77         when not having a request, or finish the request if we have one.
78         (WebKit::WebKitColorChooser::colorChooserRequestFinished):
79         (WebKit::WebKitColorChooser::colorChooserRequestRGBAChanged):
80         (WebKit::WebKitColorChooser::showColorPicker): Create a new
81         WebKitColorChooserRequest and emit WebKitWebView::run-color-chooser.
82         If the signal is not handled, fallback to the default color
83         chooser dialog implemented by the parent class.
84         * UIProcess/API/gtk/WebKitColorChooser.h: Added.
85         * UIProcess/API/gtk/WebKitColorChooserRequest.cpp: Added.
86         (webkitColorChooserRequestGetProperty):
87         (webkitColorChooserRequestSetProperty):
88         (webkit_color_chooser_request_class_init):
89         (webkit_color_chooser_request_set_rgba):
90         (webkit_color_chooser_request_get_rgba):
91         (webkit_color_chooser_request_get_element_rectangle):
92         (webkit_color_chooser_request_finish):
93         (webkit_color_chooser_request_cancel):
94         (webkitColorChooserRequestCreate):
95         * UIProcess/API/gtk/WebKitColorChooserRequest.h: Added.
96         * UIProcess/API/gtk/WebKitColorChooserRequestPrivate.h: Added.
97         * UIProcess/API/gtk/WebKitWebView.cpp:
98         (webkit_web_view_class_init): Add run-color-chooser signal.
99         (webkitWebViewEmitRunColorChooser): Emit run-color-chooser signal.
100         * UIProcess/API/gtk/WebKitWebView.h:
101         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
102         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
103         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for WebKitColorChooserRequest.
104         * UIProcess/API/gtk/webkit2.h: Include WebKitColorChooserRequest.h
105
106 2015-02-11  Enrica Casucci  <enrica@apple.com>
107
108         iOS build fix.
109
110         Unreviewed.
111
112         * UIProcess/ios/WKContentViewInteraction.mm:
113         (-[WKContentView inputAssistantItem]):
114         (-[WKContentView _inputAssistantItem]):
115
116 2015-02-11  Chris Dumez  <cdumez@apple.com>
117
118         [WK2] Add logging to validate the network cache efficacy (Part 2)
119         https://bugs.webkit.org/show_bug.cgi?id=141345
120         <rdar://problem/19632080>
121
122         Reviewed by Sam Weinig.
123
124         Add diagnostic logging messages to validate the network cache efficacy.
125         The following 4 messages are added:
126         - networkCache / retrieval / success
127         - networkCache / retrieval / unhandledRequestFailure
128         - networkCache / retrieval / noLongerInCacheFailure
129         - networkCache / retrieval / unusableCachedEntryFailure
130
131         The messages are sent via IPC from the NetworkProcess to the UIProcess,
132         where the WebPageProxy code already handles diagnostic messages sent by
133         the WebProcess.
134
135 2015-02-11  Tim Horton  <timothy_horton@apple.com>
136
137         REGRESSION (iOS 8): PDFs embedded in <object>/<embed> tag don't load at all
138         https://bugs.webkit.org/show_bug.cgi?id=141457
139         <rdar://problem/18221851>
140
141         Reviewed by Alexey Proskuryakov.
142
143         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
144         (WebKit::WebFrameLoaderClient::objectContentType):
145         On iOS, if we don't know what to do with a PDF-in-object, treat it as an image.
146
147 2015-02-11  ChangSeok Oh  <changseok.oh@collabora.com>
148
149         Activate ReliefLogger of a memory pressure handler for linux system.
150         https://bugs.webkit.org/show_bug.cgi?id=123611
151
152         Reviewed by Anders Carlsson.
153
154         * Shared/WebProcessCreationParameters.cpp:
155         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
156         Make the parameter, shouldEnableMemoryPressureReliefLogging shareable with COCOA else systems.
157         (WebKit::WebProcessCreationParameters::encode): ditto.
158         (WebKit::WebProcessCreationParameters::decode): ditto.
159         * Shared/WebProcessCreationParameters.h:
160         * UIProcess/WebProcessPool.cpp:
161         (WebKit::WebProcessPool::createNewWebProcess): Set shouldEnableMemoryPressureReliefLogging
162         to true for linux system.
163         * WebProcess/WebProcess.cpp:
164         (WebKit::WebProcess::initializeWebProcess): Pass the shouldEnableMemoryPressureReliefLogging value
165         to MemoryPressureHandler::ReliefLogger::setLoggingEnabled().
166
167 2015-02-11  Yusuke Suzuki  <utatane.tea@gmail.com>
168
169         [GTK][EFL] Suppress a warning of unused params
170         https://bugs.webkit.org/show_bug.cgi?id=141474
171
172         Reviewed by Darin Adler.
173
174         Drop unused argument name, `directoryName`.
175
176         * UIProcess/API/APIWebsiteDataStore.cpp:
177         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
178
179 2015-02-11  Carlos Garcia Campos  <cgarcia@igalia.com>
180
181         [GTK] Add default color chooser implementation using GtkColorChooserDialog
182         https://bugs.webkit.org/show_bug.cgi?id=141392
183
184         Reviewed by Gustavo Noronha Silva.
185
186         * PlatformGTK.cmake: Add new files to compilation.
187         * UIProcess/API/gtk/PageClientImpl.cpp:
188         (WebKit::PageClientImpl::createColorPicker): Call WebColorPickerGtk::create().
189         * UIProcess/gtk/WebColorPickerGtk.cpp: Added.
190         (WebKit::WebColorPickerGtk::create):
191         (WebKit::WebColorPickerGtk::WebColorPickerGtk):
192         (WebKit::WebColorPickerGtk::~WebColorPickerGtk):
193         (WebKit::WebColorPickerGtk::cancel): Set initial color.
194         (WebKit::WebColorPickerGtk::endPicker): Destroy the color chooser dialog.
195         (WebKit::WebColorPickerGtk::didChooseColor): Notify the client.
196         (WebKit::WebColorPickerGtk::colorChooserDialogRGBAChangedCallback):
197         Update the selected color.
198         (WebKit::WebColorPickerGtk::colorChooserDialogResponseCallback):
199         Cancel or finish the operation depending on the dialog response.
200         (WebKit::WebColorPickerGtk::showColorPicker): Create a
201         GtkColorChooserDialog to handle the color picker operation.
202         * UIProcess/gtk/WebColorPickerGtk.h: Added.
203         (WebKit::WebColorPickerGtk::initialColor):
204
205 2015-02-11  Commit Queue  <commit-queue@webkit.org>
206
207         Unreviewed, rolling out r179910.
208         https://bugs.webkit.org/show_bug.cgi?id=141464
209
210         Caused assertions on debug bots (Requested by ap on #webkit).
211
212         Reverted changeset:
213
214         "[WK2] Add logging to validate the network cache efficacy
215         (Part 2)"
216         https://bugs.webkit.org/show_bug.cgi?id=141345
217         http://trac.webkit.org/changeset/179910
218
219 2015-02-10  Chris Dumez  <cdumez@apple.com>
220
221         [WK2] Add logging to validate the network cache efficacy (Part 2)
222         https://bugs.webkit.org/show_bug.cgi?id=141345
223         <rdar://problem/19632080>
224
225         Reviewed by Antti Koivisto.
226
227         Add diagnostic logging messages to validate the network cache efficacy.
228         The following 4 messages are added:
229         - networkCache / retrieval / success
230         - networkCache / retrieval / unhandledRequestFailure
231         - networkCache / retrieval / noLongerInCacheFailure
232         - networkCache / retrieval / unusableCachedEntryFailure
233
234         The messages are sent via IPC from the NetworkProcess to the UIProcess,
235         where the WebPageProxy code already handles diagnostic messages sent by
236         the WebProcess.
237
238 2015-02-10  Conrad Shultz  <conrad_shultz@apple.com>
239
240         Clients need the ability to hook into immediate action lifecycle
241         https://bugs.webkit.org/show_bug.cgi?id=141449
242
243         Reviewed by Tim Horton.
244
245         * UIProcess/API/Cocoa/WKViewPrivate.h:
246         Expose new methods.
247
248         * UIProcess/API/mac/WKView.mm:
249         (-[WKView _prepareForImmediateActionAnimation]):
250         (-[WKView _cancelImmediateActionAnimation]):
251         (-[WKView _completeImmediateActionAnimation]):
252         Stub implementations.
253
254         * UIProcess/mac/WKImmediateActionController.mm:
255         (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
256         Send -_prepareForImmediateActionAnimation.
257         (-[WKImmediateActionController immediateActionRecognizerDidCancelAnimation:]):
258         Send -_cancelImmediateActionAnimation.
259         (-[WKImmediateActionController immediateActionRecognizerDidCompleteAnimation:]):
260         Send -_completeImmediateActionAnimation.
261
262 2015-02-10  Dan Bernstein  <mitz@apple.com>
263
264         <rdar://problem/19770264> Starting a navigation gesture dismisses the keyboard
265
266         Reviewed by Tim Horton.
267
268         * UIProcess/ios/ViewGestureControllerIOS.mm:
269         (WebKit::ViewGestureController::beginSwipeGesture): Reordered the view hierarchy changes,
270         such that m_liveSwipeView will not momentarily move out of the window, because that causes
271         the window’s first responder to be set to nil (if it was a descendant of m_liveSwipView).
272
273 2015-02-10  Enrica Casucci  <enrica@apple.com>
274
275         Hit testing is misplaced when selecting on wikipedia page.
276         https://bugs.webkit.org/show_bug.cgi?id=141410
277         rdar://problem/19768211
278
279         Reviewed by Simon Fraser.
280
281         When loading a new document into the same WebPage object, we need
282         to clear the assisted node, since there is no guarantee that the
283         node will be blurred. The bug was caused by the use of a stale
284         assisted node to constrain the point where the gesture occurs.
285         The node was still valid, since the previous page was in the cache.
286         I've added a ASSERT to check that, when constraining the point to
287         node rectangle, the node is in the same document as the one we
288         are performing hit test on. When the frame is detached, we clear
289         the assisted node if the node is part of the document is the frame
290         being detached.
291
292         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
293         (WebKit::WebFrameLoaderClient::detachedFromParent2):
294         * WebProcess/WebPage/WebPage.h:
295         * WebProcess/WebPage/ios/WebPageIOS.mm:
296         (WebKit::constrainPoint):
297         (WebKit::WebPage::resetAssistedNodeForFrame):
298
299 2015-02-10  Joseph Pecoraro  <pecoraro@apple.com>
300
301         [Cocoa] NSData over retain in WKBrowsingContextController loadData
302         https://bugs.webkit.org/show_bug.cgi?id=141437
303
304         Reviewed by Anders Carlsson.
305
306         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
307         (-[WKBrowsingContextController loadData:MIMEType:textEncodingName:baseURL:userData:]):
308         API::Data::createWithoutCopying will automatically do the retaining / releasing for us.
309
310 2015-02-10  Zhuo Li  <zachli@apple.com>
311
312         [WK2] Add support for registering url schemes to bypass Content Security Policy.
313         https://bugs.webkit.org/show_bug.cgi?id=140736
314
315         Reviewed by Anders Carlsson.
316
317         * Shared/WebProcessCreationParameters.cpp:
318         (WebKit::WebProcessCreationParameters::encode):
319         (WebKit::WebProcessCreationParameters::decode):
320         * Shared/WebProcessCreationParameters.h:
321         * UIProcess/API/C/WKContext.cpp:
322         (WKContextRegisterURLSchemeAsBypassingContentSecurityPolicy):
323         * UIProcess/API/C/WKContextPrivate.h:
324         * UIProcess/WebProcessPool.cpp:
325         (WebKit::WebProcessPool::createNewWebProcess):
326         (WebKit::WebProcessPool::registerURLSchemeAsBypassingContentSecurityPolicy):
327         * UIProcess/WebProcessPool.h:
328         * WebProcess/WebProcess.cpp:
329         (WebKit::WebProcess::initializeWebProcess):
330         (WebKit::WebProcess::registerURLSchemeAsBypassingContentSecurityPolicy):
331         * WebProcess/WebProcess.h:
332         * WebProcess/WebProcess.messages.in:
333
334 2015-02-10  Sanghyup Lee  <sh53.lee@samsung.com>
335
336         [EFL] Use a variable to set flicking time instead of hardcoding
337         https://bugs.webkit.org/show_bug.cgi?id=138950
338
339         Reviewed by Gyuyoung Kim.
340
341         Currently time of flick gesture animation is hardcoded as one second.
342         This patch added a static variable to increase readability.
343
344         * UIProcess/API/efl/GestureRecognizer.cpp:
345         (WebKit::GestureHandler::GestureHandler):
346         (WebKit::GestureHandler::flickAnimatorCallback):
347         (WebKit::GestureHandler::handleFlick):
348
349 2015-02-09  Enrica Casucci  <enrica@apple.com>
350
351         Selection flickers when trying to change size of selection.
352         https://bugs.webkit.org/show_bug.cgi?id=141404
353         rdar://problem/18824863
354
355         Reviewed by Benjamin Poulain.
356
357         When looking for the contracted range from the current range,
358         we were incorrectly choosing a selection whose rectangle is empty
359         as a best match candidate. This was throwing off all the logic
360         and producing a contracted range whose rectangle was bigger than the
361         expanded range, therefore producing a shrink threshold larger than the
362         growth one.
363
364         * WebProcess/WebPage/ios/WebPageIOS.mm:
365         (WebKit::WebPage::contractedRangeFromHandle):
366
367 2015-02-09  Brian J. Burg  <burg@cs.washington.edu>
368
369         REGRESSION(r179705): 2nd-level inspector availability no longer controlled by DeveloperExtrasEnabled user default
370         https://bugs.webkit.org/show_bug.cgi?id=141343
371
372         Reviewed by Timothy Hatcher.
373
374         The regression was caused by the switch to using WKWebViewConfiguration and
375         its default WebPreferences object, which is used to populate the inspector page's
376         Settings object. This WebPreferences is initialized with no identifier, so
377         only preferences in the FOR_EACH_WEBKIT_DEBUG_*_PREFERENCE macros are populated
378         from NSUserDefaults.
379
380         The simplest fix is to move DeveloperExtrasEnabled into the DEBUG group.
381
382         Previously, each inspector level had a unique identifier such as
383         __WebInspectorPageGroupLevelN__, and the n+1 level inspector was enabled
384         by toggling __WebInspectorPageGroupLevelN__.WebKit2DeveloperExrasEnabled.
385         With the move to the DEBUG group, the preference becomes simply
386         WebKitDeveloperExtrasEnabled, which enables any level of inspector.
387         (This does not clash with Safari's "Show Develop Menu" preference, which uses
388         the key "WebKitDeveloperExtrasEnabledPreferenceKey")
389
390         * Shared/WebPreferencesDefinitions.h:
391
392 2015-02-08  Antti Koivisto  <antti@apple.com>
393
394         Measure cache size more accurately
395         https://bugs.webkit.org/show_bug.cgi?id=141378
396         <rdar://problem/19760224>
397
398         Reviewed by Chris Dumez.
399
400         Estimate the cache disk space usage from the actual entry sizes instead of the item count.
401         This prevents large cache items from making the cache grow beyond its bounds.
402
403         * NetworkProcess/cache/NetworkCacheStorage.h:
404         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
405         (WebKit::NetworkCacheStorage::initialize):
406         (WebKit::NetworkCacheStorage::removeEntry):
407         (WebKit::NetworkCacheStorage::store):
408         (WebKit::NetworkCacheStorage::clear):
409         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
410
411 2015-02-09  Carlos Garcia Campos  <cgarcia@igalia.com>
412
413         REGRESSION(r179705): [GTK] The Web Inspector doesn't work after r179705
414         https://bugs.webkit.org/show_bug.cgi?id=141333
415
416         Reviewed by Žan Doberšek.
417
418         Create an initialize WebPreferences for the inspector page. This
419         was moved from cross-platform code to platform specific code.
420
421         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
422         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
423
424 2015-02-08  Timothy Horton  <timothy_horton@apple.com>
425
426         Null deref in _clearImmediateActionState when closing a view with a DataDetectors popover open
427         https://bugs.webkit.org/show_bug.cgi?id=141377
428         <rdar://problem/19711203>
429
430         Reviewed by Darin Adler.
431
432         * UIProcess/mac/WKImmediateActionController.mm:
433         (-[WKImmediateActionController _clearImmediateActionState]):
434         We can have already detached the page when DataDetectors calls us back
435         in interactionStoppedHandler. While we have kept a strong reference to the
436         page in the interactionStoppedHandler block, _page is nulled out.
437         It's OK to avoid doing this work, in any case, because closing a page
438         tears down the TextIndicator anyway.
439
440 2015-02-08  Chris Dumez  <cdumez@apple.com>
441
442         [WK2] Add logging to validate the network cache efficacy (Part 1)
443         https://bugs.webkit.org/show_bug.cgi?id=141269
444         <rdar://problem/19632080>
445
446         Reviewed by Antti Koivisto.
447
448         Add console logging to validate the network cache efficacy. This will
449         tell us if how the network cache satisties requests, in particular:
450         - Request cannot be handled by the cache
451         - Entry was not in the cache but is no longer there (pruned)
452         - Entry is in the cache but is not usable
453         - Entry is in the cache and is used.
454
455         This patch introduces a SQLite-based network cache statistics storage
456         that is used to store requests we have seen before, and query if we
457         have seen a request before. The storage is lightweight as it only
458         stores hashes in the database, in a background thread.
459
460         The statistics cache is initially bootstapped from the network disk
461         cache so that we have data initially and get as accurate statistics
462         as possible from the start.
463
464         To maintain an acceptable level of performance, we have a hard limit
465         on the number of unique requests that are retained set to 100000.
466
467         Diagnostic logging for this will be added in a follow-up patch.
468
469 2015-02-07  Chris Dumez  <cdumez@apple.com>
470
471         Add Vector::removeFirstMatching() / removeAllMatching() methods taking lambda functions
472         https://bugs.webkit.org/show_bug.cgi?id=141321
473
474         Reviewed by Darin Adler.
475
476         Use new Vector::removeFirstMatching() / removeAllMatching() methods.
477
478 2015-02-07  Tim Horton  <timothy_horton@apple.com>
479
480         Add API::HistoryClient and split some things out of API::NavigationClient
481         https://bugs.webkit.org/show_bug.cgi?id=141264
482
483         Reviewed by Darin Adler.
484
485         * UIProcess/API/APIHistoryClient.h: Added.
486         (API::HistoryClient::~HistoryClient):
487         (API::HistoryClient::didNavigateWithNavigationData):
488         (API::HistoryClient::didPerformClientRedirect):
489         (API::HistoryClient::didPerformServerRedirect):
490         (API::HistoryClient::didUpdateHistoryTitle):
491         * UIProcess/API/APINavigationClient.h:
492         (API::NavigationClient::didNavigateWithNavigationData): Deleted.
493         (API::NavigationClient::didPerformClientRedirect): Deleted.
494         (API::NavigationClient::didPerformServerRedirect): Deleted.
495         (API::NavigationClient::didUpdateHistoryTitle): Deleted.
496         * UIProcess/Cocoa/NavigationState.h:
497         * UIProcess/Cocoa/NavigationState.mm:
498         (WebKit::NavigationState::createHistoryClient):
499         (WebKit::NavigationState::HistoryClient::HistoryClient):
500         (WebKit::NavigationState::HistoryClient::~HistoryClient):
501         (WebKit::NavigationState::HistoryClient::didNavigateWithNavigationData):
502         (WebKit::NavigationState::HistoryClient::didPerformClientRedirect):
503         (WebKit::NavigationState::HistoryClient::didPerformServerRedirect):
504         (WebKit::NavigationState::HistoryClient::didUpdateHistoryTitle):
505         (WebKit::NavigationState::NavigationClient::didNavigateWithNavigationData): Deleted.
506         (WebKit::NavigationState::NavigationClient::didPerformClientRedirect): Deleted.
507         (WebKit::NavigationState::NavigationClient::didPerformServerRedirect): Deleted.
508         (WebKit::NavigationState::NavigationClient::didUpdateHistoryTitle): Deleted.
509         * UIProcess/WebPageProxy.cpp:
510         (WebKit::WebPageProxy::setHistoryClient):
511         (WebKit::WebPageProxy::didNavigateWithNavigationData):
512         (WebKit::WebPageProxy::didPerformClientRedirect):
513         (WebKit::WebPageProxy::didPerformServerRedirect):
514         (WebKit::WebPageProxy::didUpdateHistoryTitle):
515         * UIProcess/WebPageProxy.h:
516         Add a API::HistoryClient and move the few things that belong on it out of API::NavigationClient.
517         Adjust accordingly in WebPageProxy and NavigationState.
518
519         * UIProcess/API/Cocoa/WKWebView.mm:
520         (-[WKWebView initWithFrame:configuration:]):
521         (-[WKWebView setNavigationDelegate:]):
522         (-[WKWebView setUIDelegate:]):
523         (-[WKWebView _setHistoryDelegate:]):
524         Lazily push the NavigationState/UIDelegate clients down to WebPageProxy upon
525         installation of a delegate, so that alternative (C SPI) delegate setters can
526         be separately created.
527
528         * WebKit2.xcodeproj/project.pbxproj:
529
530 2015-02-07  Antti Koivisto  <antti@apple.com>
531
532         And as a further followup restore the 8bit test too.
533
534         * NetworkProcess/cache/NetworkCacheKey.cpp:
535         (WebKit::hashString):
536
537 2015-02-07  Antti Koivisto  <antti@apple.com>
538
539         Use longer hashes for cache keys
540         https://bugs.webkit.org/show_bug.cgi?id=141356
541
542         Rubber-stamped by Darin Adler.
543
544         Folloup and build fix.
545
546         * NetworkProcess/cache/NetworkCacheCoders.h:
547         * NetworkProcess/cache/NetworkCacheKey.cpp:
548         (WebKit::hashString):
549
550             Use containsOnlyASCII instead of is8Bit so both paths always compute the same hash.
551
552         * NetworkProcess/cache/NetworkCacheKey.h:
553
554 2015-02-07  Antti Koivisto  <antti@apple.com>
555
556         Remove a printf.
557
558         * NetworkProcess/cache/NetworkCache.cpp:
559         (WebKit::NetworkCache::retrieve):
560
561 2015-02-07  Antti Koivisto  <antti@apple.com>
562
563         Use longer hashes for cache keys
564         https://bugs.webkit.org/show_bug.cgi?id=141356
565
566         Reviewed by Darin Adler.
567
568         The current key hashes are 32bit. We should use longer hashes to eliminate collisions.
569
570         This patch switches us to using MD5 digests for the cache key hashes. As a result the file names for the cache
571         entries grow from 8 to 32 character.
572
573         Note that we don't need a cryptographic hash (full cache keys are verified against the entries).
574         MD5 just happens to be fast, convenient and available.
575
576         The patch also moves the whole cache hierarchy down to a versioned subdirectory ("WebKitCache/Version 2")
577         and deletes any old style cache files if they exist.
578
579         * NetworkProcess/cache/NetworkCacheCoders.cpp:
580         (WebKit::NetworkCacheCoder<MD5::Digest>::encode):
581         (WebKit::NetworkCacheCoder<MD5::Digest>::decode):
582         * NetworkProcess/cache/NetworkCacheCoders.h:
583         * NetworkProcess/cache/NetworkCacheKey.cpp:
584         (WebKit::NetworkCacheKey::NetworkCacheKey):
585         (WebKit::hashString):
586         (WebKit::NetworkCacheKey::computeHash):
587         (WebKit::NetworkCacheKey::hashAsString):
588         (WebKit::NetworkCacheKey::stringToHash):
589         * NetworkProcess/cache/NetworkCacheKey.h:
590         (WebKit::NetworkCacheKey::shortHash):
591         (WebKit::NetworkCacheKey::toShortHash):
592
593             32bit hash to use in the bloom filter.
594
595         (WebKit::NetworkCacheKey::hashStringLength):
596         * NetworkProcess/cache/NetworkCacheStorage.h:
597
598             Bump the version.
599
600         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
601         (WebKit::traverseCacheFiles):
602         (WebKit::makeVersionedDirectoryPath):
603         (WebKit::NetworkCacheStorage::NetworkCacheStorage):
604         (WebKit::NetworkCacheStorage::initialize):
605         (WebKit::NetworkCacheStorage::removeEntry):
606         (WebKit::NetworkCacheStorage::retrieve):
607         (WebKit::NetworkCacheStorage::store):
608         (WebKit::NetworkCacheStorage::update):
609         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
610         (WebKit::NetworkCacheStorage::deleteOldVersions):
611
612             Wipe out the version 1 cache.
613
614 2015-02-06  Chris Dumez  <cdumez@apple.com>
615
616         Have SQLiteStatement::database() return a reference
617         https://bugs.webkit.org/show_bug.cgi?id=141348
618
619         Reviewed by Andreas Kling.
620
621         Have SQLiteStatement::database() return a reference as it can never
622         return null.
623
624         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
625         (WebKit::SQLiteIDBCursor::internalAdvanceOnce):
626
627 2015-02-06  Alexey Proskuryakov  <ap@apple.com>
628
629         Report network process crashes during layout tests
630         https://bugs.webkit.org/show_bug.cgi?id=139646
631
632         Reviewed by Anders Carlsson.
633
634         Added a way to get network process pid, modeled after how we do this for web process.
635
636         * UIProcess/API/C/mac/WKContextPrivateMac.h:
637         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
638         (WKContextGetNetworkProcessIdentifier):
639         * UIProcess/WebProcessPool.cpp:
640         (WebKit::WebProcessPool::networkProcessCrashed): Don't reset m_networkProcess until
641         after calling the client, so that the client could retrieve its pid.
642         (WebKit::WebProcessPool::networkProcessIdentifier):
643         * UIProcess/WebProcessPool.h:
644
645 2015-02-05  Timothy Hatcher  <timothy@apple.com>
646
647         Support overriding the deviceScaleFactor per WKWebView/WKView
648         https://bugs.webkit.org/show_bug.cgi?id=141311
649
650         Reviewed by Tim Horton.
651
652         * UIProcess/API/Cocoa/WKViewPrivate.h:
653         * UIProcess/API/Cocoa/WKWebView.mm:
654         (-[WKWebView _setOverrideDeviceScaleFactor:]):
655         (-[WKWebView _overrideDeviceScaleFactor]):
656         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
657         * UIProcess/API/mac/WKView.mm:
658         (-[WKView _intrinsicDeviceScaleFactor]):
659         (-[WKView _setOverrideDeviceScaleFactor:]):
660         (-[WKView _overrideDeviceScaleFactor]):
661
662 2015-02-06  Carlos Garcia Campos  <cgarcia@igalia.com>
663
664         [GTK] Remove WebKitWebView::close-notification signal
665         https://bugs.webkit.org/show_bug.cgi?id=141330
666
667         Reviewed by Gustavo Noronha Silva.
668
669         In favor of a WebKitNotification::closed signal and
670         webkit_notification_close() method that both applications and
671         WebKit can use to close a notification. This also fixes the
672         onclose event that was not fired when the notification was
673         closed. It also brings back padding space in WebKitWebViewClass.
674
675         * UIProcess/API/gtk/WebKitNotification.cpp:
676         (webkit_notification_class_init): Add WebKitNotification::closed signal.
677         (webkit_notification_close): Emit WebKitNotification::closed.
678         * UIProcess/API/gtk/WebKitNotification.h:
679         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
680         (WebKitNotificationProvider::notificationCloseCallback): Callback
681         for WebKitNotification::closed signal that notifies the WebProcess
682         and removes the notification from the map.
683         (WebKitNotificationProvider::show): Connect to WebKitNotification::closed.
684         (WebKitNotificationProvider::cancelNotificationByID): Call webkit_notification_close().
685         * UIProcess/API/gtk/WebKitNotificationProvider.h:
686         * UIProcess/API/gtk/WebKitWebView.cpp:
687         (notifyNotificationClosed): The user closed the annotation, call
688         webkit_notification_close().
689         (webNotificationClosed): The WebKitNotification has been closed,
690         close the libnotify notification if it hasn't been closed yet.
691         (webkitWebViewShowNotification): Create the libnotifiy
692         notification if needed and associate it to the WebKitNotification
693         as user data. Connect to the closed signal of both, the libnotifiy
694         notification and the WebKit notification.
695         (webkitWebViewCloseNotification): Deleted.
696         (webkit_web_view_class_init): Remove close-notification signal and
697         the default hanlder.
698         (webkitWebViewEmitCloseNotification): Deleted.
699         * UIProcess/API/gtk/WebKitWebView.h:
700         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
701         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add webkit_notification_close.
702
703 2015-02-06  Carlos Garcia Campos  <cgarcia@igalia.com>
704
705         ASSERTION FAILED: !m_adoptionIsRequired in WTF::RefCountedBase::ref
706         https://bugs.webkit.org/show_bug.cgi?id=141035
707
708         Reviewed by Sergio Villar Senin.
709
710         Rename PrinterListGtk::singleton() as PrinterListGtk::getOrCreate(), and
711         make it return nullptr when the shared PrinterListGtk object is
712         still being created. This can happen if the nested loop used by
713         gtk_enumerate_printers dispatches a GSource that starts a new
714         synchronous print operation. In that case we just ignore the
715         second print operation, since there's already one ongoing.
716
717         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
718         (WebKit::WebChromeClient::print): Return early if
719         PrinterListGtk::getOrCreate() return nullptr.
720         * WebProcess/WebPage/gtk/PrinterListGtk.cpp:
721         (WebKit::PrinterListGtk::getOrCreate): Return nullptr if the
722         PrinterListGtk is still enumerating the printers.
723         (WebKit::PrinterListGtk::PrinterListGtk): Initialize
724         m_enumeratingPrinters to true before calling
725         gtk_enumerate_printers, and to false once it finishes.
726         (WebKit::PrinterListGtk::singleton): Deleted.
727         (WebKit::PrinterListGtk::enumeratePrintersFunction): Deleted.
728         * WebProcess/WebPage/gtk/PrinterListGtk.h:
729         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp: Add an
730         assertion here since PrinterListGtk::getOrCreate() should never
731         return nullptr at this point.
732
733 2015-02-05  Tim Horton  <timothy_horton@apple.com>
734
735         Null deref in ViewGestureController::beginSwipeGesture when swiping while script is navigating
736         https://bugs.webkit.org/show_bug.cgi?id=141308
737         <rdar://problem/18460046>
738
739         Reviewed by Simon Fraser.
740
741         * UIProcess/mac/ViewGestureControllerMac.mm:
742         (WebKit::ViewGestureController::trackSwipeGesture):
743         If script navigates (history.back, probably other cases too) while in the middle of
744         building up enough scroll events to start a swipe, it can destroy the history item
745         that we were planning to swipe to. If this happens, bail from the swipe.
746
747 2015-02-05  Alexey Proskuryakov  <ap@apple.com>
748
749         Don't pass architecture to development plug-in XPC services
750         https://bugs.webkit.org/show_bug.cgi?id=141309
751
752         Reviewed by Anders Carlsson.
753
754         We now have separate services for 32-bit and 64-bit.
755
756         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
757         (WebKit::reexec):
758         (WebKit::XPCServiceEventHandler):
759         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
760         (WebKit::connectToReExecService):
761
762 2015-02-05  Chris Dumez  <cdumez@apple.com>
763
764         Use deleteEmptyDirectory() in NetworkCacheStorage::clear()
765         https://bugs.webkit.org/show_bug.cgi?id=141314
766
767         Reviewed by Antti Koivisto.
768
769         Use deleteEmptyDirectory() in NetworkCacheStorage::clear() to simplify
770         the code a little bit.
771
772         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
773         (WebKit::NetworkCacheStorage::clear):
774
775 2015-02-05  Joseph Pecoraro  <pecoraro@apple.com>
776
777         [iOS] Remove False Positive dispatch_source Leak in WebMemoryPressureHandler singleton
778         https://bugs.webkit.org/show_bug.cgi?id=141307
779
780         Reviewed by Anders Carlsson.
781
782         * UIProcess/ios/WebMemoryPressureHandlerIOS.h:
783         * UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
784         (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
785         We want to keep the dispatch_source around, so just tie it to the
786         singleton so that it is not reported as a leak.
787
788 2015-02-05  Antti Koivisto  <antti@apple.com>
789
790         Switch to file backed buffer when resource is cached to disk
791         https://bugs.webkit.org/show_bug.cgi?id=141295
792
793         Reviewed by Chris Dumez.
794
795         Wire the DidCacheResource mechanism to the new disk cache.
796
797         * NetworkProcess/NetworkResourceLoader.cpp:
798         (WebKit::NetworkResourceLoader::didFinishLoading):
799
800             Send DidCacheResource message to the web process so it can switch the resource to file backing.
801
802         * NetworkProcess/cache/NetworkCache.cpp:
803         (WebKit::NetworkCache::store):
804         (WebKit::NetworkCache::update):
805         * NetworkProcess/cache/NetworkCache.h:
806         * NetworkProcess/cache/NetworkCacheStorage.h:
807         (WebKit::DispatchPtr::DispatchPtr):
808         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
809         (WebKit::NetworkCacheStorage::Data::Data):
810         (WebKit::mapFile):
811         (WebKit::decodeEntry):
812         (WebKit::retrieveActive):
813         (WebKit::NetworkCacheStorage::retrieve):
814         (WebKit::NetworkCacheStorage::store):
815
816             Map files larger than a memory page after a successful store.
817
818         (WebKit::NetworkCacheStorage::update):
819         (WebKit::encodeEntry): Deleted.
820
821 2015-02-05  Chris Dumez  <cdumez@apple.com>
822
823         [WK2] Properly check for mmap() error case
824         https://bugs.webkit.org/show_bug.cgi?id=141304
825
826         Reviewed by Anders Carlsson.
827
828         mmap() returns MAP_FAILED, which is (void*)-1, not a null pointer in
829         case of failure. This patch updates several wrong error checks in
830         WebKit2.
831
832         * Platform/IPC/ArgumentEncoder.cpp:
833         (IPC::allocBuffer):
834         (IPC::ArgumentEncoder::reserve):
835         * Platform/IPC/mac/ConnectionMac.mm:
836         (IPC::Connection::sendOutgoingMessage):
837
838 2015-02-05  Brian J. Burg  <burg@cs.washington.edu>
839
840         Clean up WebInspectorProxy and use simpler inspector levels design
841         https://bugs.webkit.org/show_bug.cgi?id=141135
842
843         Reviewed by Timothy Hatcher.
844
845         Inspector levels used to be managed by keeping a set of WebPageGroup
846         instances and doing pointer comparisons to check whether the inspected
847         view is itself a web inspector instance. This is unnecessary, as we
848         can maintain a mapping from WebPageProxy* to its corresponding level.
849
850         When an inspector instance is created, it is inserted into the mapping
851         along with its level. An inspector's level is 1 unless its inspected page
852         is in the mapping, then it is one greater that the inspected page's level.
853
854         The level is provided by inspectorLevel(), rather than a member variable.
855         WebInspectorProxy is created in the constructor of WebPageProxy. Thus, there
856         would be no chance to add the inspector page's level to the mapping before the
857         next level inspector tries to look it up when initializing its members.
858
859         This patch introduces other miscellaneous cleanups, such as naming m_page
860         to m_inspectedPage, using Ref and using an enum class for the attachment side.
861
862         * UIProcess/API/C/WKInspector.cpp:
863         (WKInspectorGetPage):
864         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
865         (resizeWebKitWebViewBaseFromAllocation):
866         * UIProcess/InspectorServer/efl/WebInspectorServerEfl.cpp:
867         * UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp:
868         * UIProcess/WebInspectorProxy.cpp:
869         (WebKit::pageLevelMap):
870         (WebKit::WebInspectorProxy::WebInspectorProxy):
871         (WebKit::WebInspectorProxy::inspectorLevel):
872         (WebKit::WebInspectorProxy::inspectorPageGroupIdentifier):
873         (WebKit::WebInspectorProxy::inspectorPagePreferences):
874         (WebKit::WebInspectorProxy::invalidate):
875         (WebKit::WebInspectorProxy::isFront):
876         (WebKit::WebInspectorProxy::connect):
877         (WebKit::WebInspectorProxy::show):
878         (WebKit::WebInspectorProxy::hide):
879         (WebKit::WebInspectorProxy::close):
880         (WebKit::WebInspectorProxy::didRelaunchInspectorPageProcess):
881         (WebKit::WebInspectorProxy::showConsole):
882         (WebKit::WebInspectorProxy::showResources):
883         (WebKit::WebInspectorProxy::showMainResourceForFrame):
884         (WebKit::WebInspectorProxy::attachBottom):
885         (WebKit::WebInspectorProxy::attachRight):
886         (WebKit::WebInspectorProxy::attach):
887         (WebKit::WebInspectorProxy::detach):
888         (WebKit::WebInspectorProxy::togglePageProfiling):
889         (WebKit::WebInspectorProxy::isInspectorPage):
890         (WebKit::decidePolicyForNavigationAction):
891         (WebKit::WebInspectorProxy::remoteFrontendConnected):
892         (WebKit::WebInspectorProxy::remoteFrontendDisconnected):
893         (WebKit::WebInspectorProxy::dispatchMessageFromRemoteFrontend):
894         (WebKit::WebInspectorProxy::eagerlyCreateInspectorPage):
895         (WebKit::WebInspectorProxy::createInspectorPage):
896         (WebKit::WebInspectorProxy::didClose):
897         (WebKit::WebInspectorPageGroups::singleton): Deleted.
898         (WebKit::WebInspectorPageGroups::inspectorLevel): Deleted.
899         (WebKit::WebInspectorPageGroups::isInspectorPageGroup): Deleted.
900         (WebKit::WebInspectorPageGroups::inspectorPageGroupLevel): Deleted.
901         (WebKit::WebInspectorPageGroups::inspectorPageGroupForLevel): Deleted.
902         (WebKit::WebInspectorPageGroups::createInspectorPageGroup): Deleted.
903         (WebKit::WebInspectorProxy::~WebInspectorProxy): Deleted.
904         (WebKit::WebInspectorProxy::inspectorPageGroup): Deleted.
905         (WebKit::WebInspectorProxy::setAttachedWindowHeight): Deleted.
906         (WebKit::WebInspectorProxy::enableRemoteInspection): Deleted.
907         (WebKit::WebInspectorProxy::open): Deleted.
908         * UIProcess/WebInspectorProxy.h:
909         (WebKit::WebInspectorProxy::create):
910         (WebKit::WebInspectorProxy::inspectedPage):
911         (WebKit::WebInspectorProxy::page): Deleted.
912         * UIProcess/efl/WebInspectorProxyEfl.cpp:
913         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
914         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
915         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
916         (WebKit::WebInspectorProxy::dockButtonClicked):
917         (WebKit::WebInspectorProxy::createInspectorWindow):
918         (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
919         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
920         (WebKit::WebInspectorProxy::platformAttach):
921         (WebKit::WebInspectorProxy::platformDetach):
922         (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight):
923         (WebKit::WebInspectorProxy::platformSetAttachedWindowWidth):
924         * UIProcess/mac/WebInspectorProxyMac.mm:
925         (-[WKWebInspectorProxyObjCAdapter attachRight:]):
926         (-[WKWebInspectorProxyObjCAdapter attachBottom:]):
927         (WebKit::WebInspectorProxy::createInspectorWindow):
928         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
929         (WebKit::WebInspectorProxy::platformBringToFront):
930         (WebKit::WebInspectorProxy::windowFrameDidChange):
931         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
932         (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
933         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
934         (WebKit::WebInspectorProxy::platformAttach):
935         (WebKit::WebInspectorProxy::platformDetach):
936         (-[WKWebInspectorProxyObjCAdapter close]): Deleted.
937
938 2015-02-05  Chris Dumez  <cdumez@apple.com>
939
940         [WK2][Cocoa] Populate m_contentsFilter bloom filter from the main dispatch queue NetworkCacheStorage::initialize()
941         https://bugs.webkit.org/show_bug.cgi?id=141297
942
943         Reviewed by Antti Koivisto.
944
945         Populate m_contentsFilter bloom filter from the main dispatch queue
946         NetworkCacheStorage::initialize() to avoid thread-safety issues.
947
948         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
949         (WebKit::NetworkCacheStorage::initialize):
950
951 2015-02-05  Chris Dumez  <cdumez@apple.com>
952
953         Use deleteFile() in NetworkCacheStorageCocoa.mm
954         https://bugs.webkit.org/show_bug.cgi?id=141299
955
956         Reviewed by Antti Koivisto.
957
958         Use deleteFile() in NetworkCacheStorageCocoa.mm to simplify the code
959         a bit.
960
961         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
962         (WebKit::NetworkCacheStorage::removeEntry):
963         (WebKit::NetworkCacheStorage::clear):
964         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
965
966 2015-02-04  Antti Koivisto  <antti@apple.com>
967
968         Avoid copying std::functions across threads in NetworkCacheStorage
969         https://bugs.webkit.org/show_bug.cgi?id=141273
970
971         Reviewed by Andreas Kling.
972
973         The current approach is risky. There is possiblity that captured variables are
974         deleted in an unexpected thread.
975
976         * NetworkProcess/cache/NetworkCache.cpp:
977         (WebKit::NetworkCache::retrieve):
978
979             The capture trick here is no longer needed.
980
981         * NetworkProcess/cache/NetworkCacheStorage.h:
982
983             For each cache operation we create Retrive/Store/UpdateOperation object kept alive by the active operation map.
984             This object captures all parameters of the operation including the lambda. When the operation completes
985             the object is removed from the map in the main thread, ensuring safe destruction.
986
987         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
988         (WebKit::NetworkCacheStorage::dispatchRetrieveOperation):
989         (WebKit::NetworkCacheStorage::dispatchPendingRetrieveOperations):
990         (WebKit::retrieveActive):
991
992             Instead of maintaining a separate write cache we just look through the active write and update maps.
993
994         (WebKit::NetworkCacheStorage::retrieve):
995
996             Use fixed sized priority array rather than a dynamic one. Vector<Deque<std::unique_ptr>> doesn't quite work.
997
998         (WebKit::NetworkCacheStorage::store):
999         (WebKit::NetworkCacheStorage::update):
1000         (WebKit::NetworkCacheStorage::clear):
1001
1002 2015-02-05  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar <calvaris@igalia.com>
1003
1004         [Streams API] Implement a barebone ReadableStream interface
1005         https://bugs.webkit.org/show_bug.cgi?id=141045
1006
1007         Reviewed by Benjamin Poulain.
1008
1009         * CMakeLists.txt:
1010         * Configurations/FeatureDefines.xcconfig:
1011
1012 2015-02-04  Joseph Pecoraro  <pecoraro@apple.com>
1013
1014         [iOS] Selection callout does not follow selection when double-tap scrolling
1015         https://bugs.webkit.org/show_bug.cgi?id=141214
1016
1017         Reviewed by Benjamin Poulain.
1018
1019         Implement the delegate that gets called after UIScrollView
1020         setContentOffset animations. When scrolling to a rect, do the normal
1021         willScroll, didScroll actions to update the selection assistant.
1022
1023         * UIProcess/API/Cocoa/WKWebView.mm:
1024         (-[WKWebView _scrollToRect:origin:minimumScrollDistance:]):
1025         (-[WKWebView scrollViewDidEndScrollingAnimation:]):
1026
1027 2015-02-04  Simon Fraser  <simon.fraser@apple.com>
1028
1029         [iOS WK2] Layers that are created and destroyed in the same transaction shouldn't be encoded
1030         https://bugs.webkit.org/show_bug.cgi?id=141228
1031
1032         Reviewed by Tim Horton.
1033         
1034         With UI-side compositing, it was possible for layers to get created and
1035         destroyed in the same transaction (e.g. two layouts before a single layer
1036         tree commit). When that happened we would encode layer creation properties
1037         but not encode layer properties, since the layer would be unreachable.
1038         
1039         Fix by removing deleted layers from the created layers list, which is
1040         converted into a map for easy searching.
1041
1042         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
1043         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
1044         (WebKit::RemoteLayerTreeContext::layerWasCreated):
1045         (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed):
1046         (WebKit::RemoteLayerTreeContext::buildTransaction):
1047
1048 2015-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1049
1050         Build with seccomp filters broken since r179409
1051         https://bugs.webkit.org/show_bug.cgi?id=141206
1052
1053         Reviewed by Darin Adler.
1054
1055         Fix build by renaming SeccompBrokerClient::shared to SeccompBrokerClient::singleton.
1056
1057         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
1058         (WebKit::SeccompBrokerClient::singleton):
1059         (WebKit::SeccompBroker::initialize):
1060         (WebKit::SeccompBrokerClient::shared):
1061         (WebKit::SeccompBroker::runLoop):
1062
1063 2015-02-04  Simon Fraser  <simon.fraser@apple.com>
1064
1065         [iOS WK2] Assert in ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren() on tab switching
1066         https://bugs.webkit.org/show_bug.cgi?id=141223
1067         rdar://problem/18458993
1068
1069         Reviewed by Tim Horton.
1070
1071         It's possible to submit a RemoteLayerTree transaction that contains data
1072         about a created layer, but doesn't have any properties for that layer. This
1073         happens when the newly created layer isn't reached during the traversal that
1074         gathers layer properties (i.e. it's not rooted). However, whether we create
1075         a scrolling layer or not requires having properties; they are missing, so we
1076         create a normal layer, but then the scrolling tree commit asserts that we
1077         should have a scrolling layer.
1078         
1079         Fix by making scrolling layers have a corresponding layer type, which is
1080         stored in layer creation properties. This required exposing layer types
1081         up through GraphicsLayer, but that allows for some nice cleanup:
1082         
1083         1. No need to have the hokey shouldUseTiledBacking() GraphicsLayerClient hack
1084            for creating the page tiled layer.
1085         2. The notion of "custom behaviors" can be removed from GraphicsLayer entirely.
1086
1087         * Shared/mac/RemoteLayerBackingStore.mm:
1088         (WebKit::RemoteLayerBackingStore::drawInContext):
1089         * Shared/mac/RemoteLayerTreeTransaction.h:
1090         * Shared/mac/RemoteLayerTreeTransaction.mm:
1091         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
1092         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
1093         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
1094         (WebKit::dumpChangedLayers):
1095         (WebKit::RemoteLayerTreeTransaction::description):
1096         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
1097         (WebKit::RemoteLayerTreeHost::createLayer):
1098         * UIProcess/mac/RemoteLayerTreeHost.mm:
1099         (WebKit::RemoteLayerTreeHost::createLayer):
1100         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
1101         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1102         (WebKit::PlatformCALayerRemote::customBehavior): Deleted.
1103         (WebKit::PlatformCALayerRemote::updateCustomBehavior): Deleted.
1104         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1105         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
1106         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
1107         (WebKit::RemoteLayerTreeContext::createGraphicsLayer):
1108
1109 2015-02-04  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1110
1111         [EFL][WK2] Manage failing API tests
1112         https://bugs.webkit.org/show_bug.cgi?id=141250
1113
1114         Reviewed by Csaba Osztrogonác.
1115
1116         * PlatformEfl.cmake: Skip to test test_ewk2_storage_manager.
1117         * UIProcess/API/efl/tests/test_ewk2_view.cpp: Disable 2 unit test functions.
1118         (TEST_F):
1119
1120 2015-02-04  Chris Dumez  <cdumez@apple.com>
1121
1122         Add removeFirst(value) / removeAll(value) methods to WTF::Vector
1123         https://bugs.webkit.org/show_bug.cgi?id=141192
1124
1125         Reviewed by Benjamin Poulain.
1126
1127         Use new Vector::removeFirst(value) / removeAll(value) API to simplify the
1128         code a bit.
1129
1130         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp:
1131         (WebKit::WebSoupCustomProtocolRequestManager::unregisterSchemeForCustomProtocol):
1132         * UIProcess/PageLoadState.cpp:
1133         (WebKit::PageLoadState::removeObserver):
1134         * UIProcess/WebProcessPool.cpp:
1135         (WebKit::WebProcessPool::~WebProcessPool):
1136         (WebKit::WebProcessPool::disconnectProcess):
1137         * WebProcess/InjectedBundle/API/efl/ewk_extension.cpp:
1138         (EwkExtension::remove):
1139
1140 2015-02-03  Chris Dumez  <cdumez@apple.com>
1141
1142         Unreviewed attempt to fix GTK/EFL build after r179588.
1143
1144         Add new files to CMakeLists.txt.
1145
1146         * CMakeLists.txt:
1147
1148 2015-02-03  Shivakumar JM  <shiva.jm@samsung.com>
1149
1150         Fix build warning in WebKit2/Platform/IPC module.
1151         https://bugs.webkit.org/show_bug.cgi?id=141229
1152
1153         Reviewed by Chris Dumez.
1154
1155         Fix build warning by using UNUSED_PARAM macro.
1156
1157         * Platform/IPC/Connection.cpp:
1158         (IPC::Connection::sendMessage):
1159
1160 2015-02-03  Tim Horton  <timothy_horton@apple.com>
1161
1162         Add WKPageNavigationClient as C SPI around API::NavigationClient, and adopt in WKTR
1163         https://bugs.webkit.org/show_bug.cgi?id=141217
1164
1165         * UIProcess/API/C/WKPageRenderingProgressEventsInternal.h:
1166         Include, not import.
1167
1168 2015-02-03  Tim Horton  <timothy_horton@apple.com>
1169
1170         Add WKPageNavigationClient as C SPI around API::NavigationClient, and adopt in WKTR
1171         https://bugs.webkit.org/show_bug.cgi?id=141217
1172
1173         Reviewed by Sam Weinig.
1174
1175         * Shared/API/c/WKBase.h:
1176         * UIProcess/API/C/WKAPICast.h:
1177         * UIProcess/API/C/WKFrameInfoRef.cpp: Added.
1178         (WKFrameInfoGetTypeID):
1179         * UIProcess/API/C/WKFrameInfoRef.h: Added.
1180         * UIProcess/API/C/WKNavigationActionRef.cpp: Added.
1181         (WKNavigationActionGetTypeID):
1182         * UIProcess/API/C/WKNavigationActionRef.h: Added.
1183         * UIProcess/API/C/WKNavigationRef.cpp: Added.
1184         (WKNavigationGetTypeID):
1185         * UIProcess/API/C/WKNavigationRef.h: Added.
1186         * UIProcess/API/C/WKNavigationResponseRef.cpp: Added.
1187         (WKNavigationResponseGetTypeID):
1188         (WKNavigationResponseCanShowMIMEType):
1189         * UIProcess/API/C/WKNavigationResponseRef.h: Added.
1190         Add tiny C wrappers around API::{FrameInfo, NavigationAction, Navigation, NavigationResponse}.
1191
1192         * UIProcess/API/APINavigationClient.h:
1193         (API::NavigationClient::decidePolicyForPluginLoad):
1194         Add a default implementation of decidePolicyForPluginLoad.
1195
1196         * UIProcess/API/C/WKPage.cpp:
1197         (WKPageSetPageNavigationClient):
1198         * UIProcess/API/C/WKPage.h:
1199         Add WKPageSetPageNavigationClient, which connects API::NavigationClient to
1200         the new WKPageNavigationClient C SPI.
1201         
1202         * UIProcess/API/C/WKPageNavigationClient.h: Added.
1203         Add WKPageNavigationClient, which one can use in place of WKPageLoaderClient
1204         and WKPagePolicyClient and which has the same semantics as the Modern ObjC API
1205         (including things like API::Navigation as WKNavigationRef, etc.)
1206
1207         * UIProcess/API/C/WKPageLoaderClient.h:
1208         * UIProcess/API/C/WKPageRenderingProgressEvents.h: Added.
1209         * UIProcess/API/C/WKPageRenderingProgressEventsInternal.h: Added.
1210         (pageRenderingProgressEvents):
1211         * UIProcess/API/C/WKPluginLoadPolicy.h: Added.
1212         Pull some enums out into their own files (WKPageRenderingProgressEvents is
1213         duplicated from the Modern ObjC API's _WKRenderingProgressEvents, WKPluginLoadPolicy
1214         is pulled out of WKPageLoaderClient).
1215
1216         * UIProcess/WebPageProxy.cpp:
1217         (WebKit::WebPageProxy::findPlugin):
1218         Add an equivalent of pluginLoadPolicy to the NavigationClient.
1219
1220         * WebKit2.xcodeproj/project.pbxproj:
1221
1222 2015-02-03  Timothy Horton  <timothy_horton@apple.com>
1223
1224         Every PageOverlayClientImpl leaks
1225         https://bugs.webkit.org/show_bug.cgi?id=141224
1226         <rdar://problem/19652939>
1227
1228         Reviewed by Simon Fraser.
1229
1230         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
1231         (WKBundlePageOverlayCreate):
1232         * WebProcess/WebPage/WebPageOverlay.cpp:
1233         (WebKit::WebPageOverlay::create):
1234         (WebKit::WebPageOverlay::WebPageOverlay):
1235         (WebKit::WebPageOverlay::pageOverlayDestroyed):
1236         (WebKit::WebPageOverlay::willMoveToPage):
1237         (WebKit::WebPageOverlay::didMoveToPage):
1238         (WebKit::WebPageOverlay::drawRect):
1239         (WebKit::WebPageOverlay::mouseEvent):
1240         (WebKit::WebPageOverlay::didScrollFrame):
1241         (WebKit::WebPageOverlay::actionContextForResultAtPoint):
1242         (WebKit::WebPageOverlay::dataDetectorsDidPresentUI):
1243         (WebKit::WebPageOverlay::dataDetectorsDidChangeUI):
1244         (WebKit::WebPageOverlay::dataDetectorsDidHideUI):
1245         (WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
1246         (WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
1247         (WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
1248         * WebProcess/WebPage/WebPageOverlay.h:
1249         (WebKit::WebPageOverlay::client):
1250         Keep the PageOverlayClientImpl as a unique_ptr instead of a leaked reference,
1251         ensuring that it's cleaned up when the WebPageOverlay is torn down.
1252
1253 2015-02-03  Chris Dumez  <cdumez@apple.com>
1254
1255         Drop ResourceLoadPriorityUnresolved resource load priority and use Optional<> instead
1256         https://bugs.webkit.org/show_bug.cgi?id=141186
1257
1258         Reviewed by Antti Koivisto.
1259
1260         Update code now that ResourceLoadPriorityUnresolved is not longer a
1261         ResourceLoadPriority enum value.
1262
1263         * NetworkProcess/cache/NetworkCache.cpp:
1264         (WebKit::NetworkCache::retrieve):
1265         * WebProcess/Network/WebResourceLoadScheduler.cpp:
1266         (WebKit::WebResourceLoadScheduler::scheduleLoad):
1267
1268 2015-02-03  Enrica Casucci  <enrica@apple.com>
1269
1270         [iOS] Add support for deleteFromInputWithFlags.
1271         https://bugs.webkit.org/show_bug.cgi?id=141216
1272         rdar://problem/19130081
1273
1274         Reviewed by Benjamin Poulain.
1275
1276         Adopts the new method as soon as it is available.
1277         The patch also removes some obsolete code used for staging.
1278
1279         * Platform/spi/ios/UIKitSPI.h:
1280         * UIProcess/ios/WKContentViewInteraction.mm:
1281         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
1282
1283 2015-02-03  Joseph Pecoraro  <pecoraro@apple.com>
1284
1285         [iOS] Selection Callout should not immediately disappear on pages with frequent layouts
1286         https://bugs.webkit.org/show_bug.cgi?id=141210
1287
1288         Reviewed by Enrica Casucci.
1289
1290         In iOS WebKit2 in order to keep caret refreshes in sync with WebCore layouts
1291         the selection assistant is told to update whenever WebKit's layer tree
1292         commits. Unfortunately, for pages with JavaScript animation that are
1293         frequently doing a layout / layer tree update, this would trigger very
1294         frequent selection updates that would keep the caret from blinking and
1295         dismiss any selection callouts.
1296
1297         This change tracks the last selection drawing information so that we can
1298         avoid informing the assistant of a selection updates unless it has changed
1299         visually or needs to redraw (zoom).
1300
1301         * Shared/EditorState.cpp:
1302         Remove include already in header.
1303
1304         * UIProcess/ios/WKContentViewInteraction.h:
1305         * UIProcess/ios/WKContentViewInteraction.mm:
1306         (WebKit::WKSelectionDrawingInfo::WKSelectionDrawingInfo):
1307         (WebKit::operator==):
1308         (WebKit::operator!=):
1309         (-[WKContentView observeValueForKeyPath:ofObject:change:context:]):
1310         When zooming, force the selection update, even though the drawing
1311         information hasn't changed, the views will need to be updated.
1312
1313         (-[WKContentView _updateChangedSelection]):
1314         (-[WKContentView _updateChangedSelection:]):
1315         Monitor EditorState for changes in selection drawing and avoid
1316         informing the selection assistant unless necessary.
1317
1318 2015-02-03  Jeremy Jones  <jeremyj@apple.com>
1319
1320         Prevent flicker when exiting fullscreen by synchronizing transactions.
1321         https://bugs.webkit.org/show_bug.cgi?id=140897
1322
1323         Reviewed by Tim Horton.
1324
1325         Flush transactions before removing layerHost. This allows existing transactions to be completed before the hosting layer disappears.
1326
1327         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1328         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen):
1329
1330 2015-02-03  Brian J. Burg  <burg@cs.washington.edu>
1331
1332         Convert WebInspectorProxy to use WKWebView API for the inspector view
1333         https://bugs.webkit.org/show_bug.cgi?id=141037
1334
1335         Reviewed by Timothy Hatcher.
1336
1337         Use the newer API for PLATFORM(MAC). The main difference is that the
1338         WKWebView's page group cannot be set directly; instead, the group identifier
1339         is passed. Also add some preference setters needed for the inspector.
1340
1341         Refactor some code to not use page groups directly. In a future patch,
1342         the PageGroup-based inspector level system will be simplified. It is
1343         it is no longer necessary to keep a static map of PageGroup instances,
1344         since they are only used to save inspector window preferences. (These used
1345         to prevent all levels of inspector from pausing together when a second-level
1346         inspector hit a breakpoint. This is not necessary with multi-process
1347         web inspectors.)
1348
1349         Also, adjust window resizing behavior when the inspector is docked to
1350         the right. Window width resizes should not affect the width of the inspector
1351         frame. This matches the behavior of height changes when docked to the bottom.
1352
1353         To support 32-bit Mac builds where WKWebView is not defined, share the stub
1354         platformFoo() implementations with PLATFORM(IOS). The stubs are now located
1355         in the platform-independent WebInspectorProxy.cpp.
1356
1357         * UIProcess/API/Cocoa/WKPreferences.mm:
1358         (-[WKPreferences _logsPageMessagesToSystemConsoleEnabled]): Added.
1359         (-[WKPreferences _setLogsPageMessagesToSystemConsoleEnabled:]): Added.
1360         (-[WKPreferences _allowFileAccessFromFileURLs]): Added.
1361         (-[WKPreferences _setAllowFileAccessFromFileURLs:]): Added.
1362         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1363         * UIProcess/WebInspectorProxy.cpp:
1364         (WebKit::WebInspectorProxy::WebInspectorProxy):
1365         (WebKit::WebInspectorProxy::inspectorPagePreferences):
1366         (WebKit::WebInspectorProxy::attach):
1367         (WebKit::WebInspectorProxy::detach):
1368         (WebKit::WebInspectorProxy::setAttachedWindowHeight):
1369         (WebKit::WebInspectorProxy::setAttachedWindowWidth):
1370         (WebKit::WebInspectorProxy::createInspectorPage):
1371         (WebKit::WebInspectorProxy::shouldOpenAttached):
1372         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1373         (WebKit::WebInspectorProxy::platformOpen):
1374         (WebKit::WebInspectorProxy::platformDidClose):
1375         (WebKit::WebInspectorProxy::platformInvalidate):
1376         (WebKit::WebInspectorProxy::platformBringToFront):
1377         (WebKit::WebInspectorProxy::platformHide):
1378         (WebKit::WebInspectorProxy::platformIsFront):
1379         (WebKit::WebInspectorProxy::platformInspectedURLChanged):
1380         (WebKit::WebInspectorProxy::platformSave):
1381         (WebKit::WebInspectorProxy::platformAppend):
1382         (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
1383         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
1384         (WebKit::WebInspectorProxy::platformAttach):
1385         (WebKit::WebInspectorProxy::platformDetach):
1386         (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight):
1387         (WebKit::WebInspectorProxy::platformSetToolbarHeight):
1388         (WebKit::WebInspectorProxy::inspectorPageURL):
1389         (WebKit::WebInspectorProxy::inspectorTestPageURL):
1390         (WebKit::WebInspectorProxy::inspectorBaseURL):
1391         (WebKit::WebInspectorProxy::platformSetAttachedWindowWidth):
1392         (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
1393         * UIProcess/WebInspectorProxy.h:
1394         * UIProcess/ios/WebInspectorProxyIOS.mm: Removed.
1395         * UIProcess/mac/WebInspectorProxyMac.mm:
1396         (-[WKWebInspectorWKWebView _didRelaunchProcess]):
1397         WKWebView doesn't implement this, so remove the super call.
1398         (WebKit::WebInspectorProxy::closeTimerFired):
1399         (WebKit::createDockButton):
1400         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1401         (WebKit::WebInspectorProxy::platformAttach):
1402         (-[WKWebInspectorWKView _didRelaunchProcess]): Deleted.
1403         * WebKit2.xcodeproj/project.pbxproj:
1404
1405 2015-02-03  Antti Koivisto  <antti@apple.com>
1406
1407         Memory cache for resources pending disk write
1408         https://bugs.webkit.org/show_bug.cgi?id=141159
1409
1410         Reviewed by Andreas Kling.
1411
1412         If a resource was requested from the disk cache before it has been written we ended up
1413         loading it again. Add a short lived memory cache to avoid this.
1414
1415         * NetworkProcess/cache/NetworkCache.cpp:
1416         (WebKit::decodeStorageEntry):
1417         * NetworkProcess/cache/NetworkCacheStorage.h:
1418         (WebKit::NetworkCacheStorage::Data::isMap):
1419
1420             Add a way to know whether a Data is backed by map or not. SharedMemory does not work correctly
1421             if it is not a map.
1422
1423         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1424         (WebKit::NetworkCacheStorage::Data::Data):
1425         (WebKit::NetworkCacheStorage::initialize):
1426
1427             Also do some renaming.
1428
1429         (WebKit::decodeEntry):
1430         (WebKit::NetworkCacheStorage::removeEntry):
1431         (WebKit::NetworkCacheStorage::retrieve):
1432         (WebKit::NetworkCacheStorage::store):
1433         (WebKit::NetworkCacheStorage::clear):
1434         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
1435
1436 2015-02-02  Antti Koivisto  <antti@apple.com>
1437
1438         Update cache header after revalidation without rewriting the body data
1439         https://bugs.webkit.org/show_bug.cgi?id=141182
1440
1441         Reviewed by Andreas Kling.
1442
1443         Currently we just rewrite the entire entry after revalidation.
1444
1445         * NetworkProcess/cache/NetworkCache.cpp:
1446         (WebKit::decodeStorageEntry):
1447
1448             Include the strorage entry to the cache response so we can more easily update it.
1449
1450         (WebKit::NetworkCache::update):
1451
1452             Call the storage update function with the new and the exisiting storage entry.
1453
1454         * NetworkProcess/cache/NetworkCache.h:
1455         * NetworkProcess/cache/NetworkCacheStorage.h:
1456         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1457         (WebKit::openFileForKey):
1458
1459             Added an option for opening a file for writing without creating a new one.
1460             Renamed for clarity.
1461
1462         (WebKit::encodeEntryHeader):
1463
1464             Separate header encoding to a function.
1465
1466         (WebKit::encodeEntry):
1467         (WebKit::NetworkCacheStorage::dispatchRetrieveOperation):
1468         (WebKit::NetworkCacheStorage::store):
1469         (WebKit::NetworkCacheStorage::update):
1470
1471             New update function.
1472             If the page-rounded header size would stay unchanged we can just write the new header over the old one.
1473             In the unlikely event it doesn't we rewrite the whole thing.
1474
1475         (WebKit::createIOChannelForKey): Deleted.
1476
1477 2015-02-02  Commit Queue  <commit-queue@webkit.org>
1478
1479         Unreviewed, rolling out r179540.
1480         https://bugs.webkit.org/show_bug.cgi?id=141190
1481
1482         need further investigation to fix !WK_API_ENABLED (32bit)
1483         build. (Requested by brrian_ on #webkit).
1484
1485         Reverted changeset:
1486
1487         "Convert WebInspectorProxy to use WKWebView API for the
1488         inspector view"
1489         https://bugs.webkit.org/show_bug.cgi?id=141037
1490         http://trac.webkit.org/changeset/179540
1491
1492 2015-02-02  Brian J. Burg  <burg@cs.washington.edu>
1493
1494         Convert WebInspectorProxy to use WKWebView API for the inspector view
1495         https://bugs.webkit.org/show_bug.cgi?id=141037
1496
1497         Reviewed by Timothy Hatcher.
1498
1499         Use the newer API for PLATFORM(MAC). The main difference is that the
1500         WKWebView's page group cannot be set directly; instead, the group identifier
1501         is passed. Also add some preference setters needed for the inspector.
1502
1503         Refactor some code to not use page groups directly. In a future patch,
1504         the PageGroup-based inspector level system will be simplified. It is
1505         it is no longer necessary to keep a static map of PageGroup instances,
1506         since they are only used to save inspector window preferences. (These used
1507         to prevent all levels of inspector from pausing together when a second-level
1508         inspector hit a breakpoint. This is not necessary with multi-process
1509         web inspectors.)
1510
1511         Also, adjust window resizing behavior when the inspector is docked to
1512         the right. Window width resizes should not affect the width of the inspector
1513         frame. This matches the behavior of height changes when docked to the bottom.
1514
1515         * UIProcess/API/Cocoa/WKPreferences.mm:
1516         (-[WKPreferences _logsPageMessagesToSystemConsoleEnabled]): Added.
1517         (-[WKPreferences _setLogsPageMessagesToSystemConsoleEnabled:]): Added.
1518         (-[WKPreferences _allowFileAccessFromFileURLs]): Added.
1519         (-[WKPreferences _setAllowFileAccessFromFileURLs:]): Added.
1520         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1521         * UIProcess/WebInspectorProxy.cpp:
1522         (WebKit::WebInspectorProxy::WebInspectorProxy):
1523         (WebKit::WebInspectorProxy::inspectorPagePreferences): Added.
1524         (WebKit::WebInspectorProxy::attach):
1525         (WebKit::WebInspectorProxy::detach):
1526         (WebKit::WebInspectorProxy::setAttachedWindowHeight):
1527         (WebKit::WebInspectorProxy::setAttachedWindowWidth):
1528         (WebKit::WebInspectorProxy::createInspectorPage):
1529         (WebKit::WebInspectorProxy::shouldOpenAttached):
1530         * UIProcess/WebInspectorProxy.h: Use default member initializers.
1531         * UIProcess/mac/WebInspectorProxyMac.mm:
1532         (-[WKWebInspectorWKWebView _didRelaunchProcess]):
1533         WKWebView doesn't implement this, so remove the super call.
1534         (WebKit::WebInspectorProxy::closeTimerFired):
1535         (WebKit::createDockButton):
1536         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1537         (WebKit::WebInspectorProxy::platformAttach):
1538         (-[WKWebInspectorWKView _didRelaunchProcess]): Deleted.
1539
1540 2015-02-02  Chris Dumez  <cdumez@apple.com>
1541
1542         Make NetworkCache's constructor private
1543         https://bugs.webkit.org/show_bug.cgi?id=141181
1544
1545         Reviewed by Antti Koivisto.
1546
1547         Make NetworkCache's constructor private and mark its destructor as
1548         deleted as it is a singleton class.
1549
1550         * NetworkProcess/cache/NetworkCache.cpp:
1551         (WebKit::NetworkCache::NetworkCache): Deleted.
1552         * NetworkProcess/cache/NetworkCache.h:
1553
1554 2015-02-02  Filip Pizlo  <fpizlo@apple.com>
1555
1556         Revert accidental (and super bad) change in r179490.
1557
1558         * WebProcess/com.apple.WebProcess.sb.in:
1559
1560 2015-02-02  Chris Dumez  <cdumez@apple.com>
1561
1562         Access MemoryCache singleton using MemoryCache::singleton()
1563         https://bugs.webkit.org/show_bug.cgi?id=141104
1564
1565         Reviewed by Andreas Kling.
1566
1567         Access MemoryCache singleton using MemoryCache::singleton() static
1568         member function, instead of a free function, as per the recent
1569         coding style discussion on WebKit-dev.
1570
1571 2015-02-02  Jeremy Jones  <jeremyj@apple.com>
1572
1573         Prevent crash when accessing WebAVPlayerController.delegate.
1574         https://bugs.webkit.org/show_bug.cgi?id=140893
1575
1576         Reviewed by Darin Adler.
1577
1578         Plumb new resetMediaState() through IPC interface WebVideoFullscreenManagerProxy.
1579
1580         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
1581         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1582         (WebKit::WebVideoFullscreenManagerProxy::invalidate): remove redundant set to nullptr.
1583         * WebProcess/ios/WebVideoFullscreenManager.h:
1584         * WebProcess/ios/WebVideoFullscreenManager.mm:
1585         (WebKit::WebVideoFullscreenManager::resetMediaState):
1586
1587 2015-02-01  Chris Dumez  <cdumez@apple.com>
1588
1589         Use more references in HistoryItem
1590         https://bugs.webkit.org/show_bug.cgi?id=141133
1591
1592         Reviewed by Andreas Kling.
1593
1594         Use more references in HistoryItem instead of pointers.
1595
1596         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp:
1597         (WebKit::InjectedBundleBackForwardListItem::children):
1598         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
1599         (WebKit::toFrameState):
1600         (WebKit::applyFrameState):
1601         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1602         (WebKit::WebBackForwardListProxy::addItem):
1603         * WebProcess/WebPage/WebBackForwardListProxy.h:
1604
1605 2015-02-01  Dan Bernstein  <mitz@apple.com>
1606
1607         Remove ViewGestureController tracing
1608         https://bugs.webkit.org/show_bug.cgi?id=141137
1609
1610         Reviewed by Tim Horton.
1611
1612         Remove the tracing added in r176133, now that http://webkit.org/b/138750 is fixed.
1613
1614         * UIProcess/ios/ViewGestureControllerIOS.mm:
1615         (WebKit::ViewGestureController::beginSwipeGesture):
1616         (WebKit::ViewGestureController::endSwipeGesture):
1617         (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree):
1618         (WebKit::ViewGestureController::removeSwipeSnapshot):
1619         (WebKit::addLogEntry): Deleted.
1620         (WebKit::dumpLogEntries): Deleted.
1621         * UIProcess/mac/ViewGestureController.h:
1622
1623 2015-01-31  Sam Weinig  <sam@webkit.org>
1624
1625         Remove even more Mountain Lion support
1626         https://bugs.webkit.org/show_bug.cgi?id=141124
1627
1628         Reviewed by Alexey Proskuryakov.
1629
1630         * Configurations/Base.xcconfig:
1631         * Configurations/DebugRelease.xcconfig:
1632         * Configurations/FeatureDefines.xcconfig:
1633         * Configurations/Version.xcconfig:
1634         * Configurations/WebContentService.Development.xcconfig:
1635         * Configurations/WebContentService.xcconfig:
1636         * Configurations/WebKit.xcconfig:
1637         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1638
1639 2015-01-31  Antti Koivisto  <antti@apple.com>
1640
1641         Enable WebKit disk cache on OS X
1642         https://bugs.webkit.org/show_bug.cgi?id=141022
1643
1644         Reviewed by Gavin Barraclough.
1645
1646         * config.h: Flip the switch.
1647
1648 2015-01-31  Antti Koivisto  <antti@apple.com>
1649
1650         Unreviewed, rolling out r179447.
1651
1652         Forgot to include the test.
1653
1654         Reverted changeset:
1655
1656         "Enable WebKit disk cache on OS X"
1657         https://bugs.webkit.org/show_bug.cgi?id=141022
1658         http://trac.webkit.org/changeset/179447
1659
1660 2015-01-31  Antti Koivisto  <antti@apple.com>
1661
1662         Enable WebKit disk cache on OS X
1663         https://bugs.webkit.org/show_bug.cgi?id=141022
1664
1665         Reviewed by Gavin Barraclough.
1666
1667         * config.h: Flip the switch.
1668
1669 2015-01-31  Antti Koivisto  <antti@apple.com>
1670
1671         OSObjectPtr does not work with dispatch_data_t on Maverics
1672         https://bugs.webkit.org/show_bug.cgi?id=141081
1673
1674         Reviewed by Zalan Bujtas.
1675
1676         Previous attempt to special case dispatch_data_t in OSObjectPtr didn't work in all cases
1677         probably due to the context sensitivity of the definition of the dispatch_data_t type.
1678
1679         For now, add DispatchPtr for the cache code and use it.
1680
1681         * NetworkProcess/cache/NetworkCacheStorage.h:
1682         (WebKit::DispatchPtr::DispatchPtr):
1683         (WebKit::DispatchPtr::~DispatchPtr):
1684         (WebKit::DispatchPtr::operator=):
1685         (WebKit::DispatchPtr::get):
1686         (WebKit::DispatchPtr::operator bool):
1687         (WebKit::adoptDispatch):
1688         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1689         (WebKit::NetworkCacheStorage::Data::Data):
1690         (WebKit::NetworkCacheStorage::Data::data):
1691         (WebKit::NetworkCacheStorage::NetworkCacheStorage):
1692         (WebKit::createIOChannelForKey):
1693         (WebKit::decodeEntry):
1694         (WebKit::encodeEntryMetaData):
1695         (WebKit::encodeEntry):
1696
1697 2015-01-30  Tim Horton  <timothy_horton@apple.com>
1698
1699         Add and hook up APINavigationClient
1700         https://bugs.webkit.org/show_bug.cgi?id=140698
1701
1702         Reviewed by Sam Weinig.
1703
1704         Add a single APINavigationClient that NavigationState implements and
1705         WebPageProxy prefers over APILoaderClient and APIPolicyClient.
1706
1707         * UIProcess/API/APILoaderClient.h:
1708         Fix a comment.
1709
1710         * UIProcess/API/APINavigationClient.h: Added.
1711         APINavigationClient is the union of NavigationState's overrides of APILoaderClient and APIPolicyClient.
1712         Names are adjusted to more closely match the Modern API.
1713
1714         * UIProcess/Cocoa/NavigationState.h:
1715         * UIProcess/Cocoa/NavigationState.mm:
1716         Instead of having policy and loader clients, NavigationState has a single navigation client.
1717         Adjust as necessary.
1718
1719         Move as much logic as possible (isMainFrame checks, construction of API objects) out of here
1720         and into WebPageProxy.
1721
1722         * UIProcess/API/Cocoa/WKWebView.mm:
1723         (-[WKWebView initWithFrame:configuration:]):
1724         Install the aforementioned single navigation client.
1725
1726         * UIProcess/WebPageProxy.cpp:
1727         (WebKit::WebPageProxy::setNavigationClient):
1728         Add a navigation client setter.
1729
1730         For all policy and loader client calls, if we have a navigation client, use that;
1731         otherwise, fall back on the policy and loader clients.
1732
1733         * UIProcess/WebPageProxy.h:
1734         * WebKit2.xcodeproj/project.pbxproj:
1735
1736 2015-01-30  Chris Dumez  <cdumez@apple.com>
1737
1738         Update MemoryCache code to use more references instead of pointers
1739         https://bugs.webkit.org/show_bug.cgi?id=141099
1740
1741         Reviewed by Andreas Kling.
1742
1743         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
1744         (WebKit::WebResourceCacheManager::clearCacheForOrigin):
1745
1746 2015-01-30  Chris Dumez  <cdumez@apple.com>
1747
1748         Rename shared() static member functions to singleton() for singleton classes.
1749         https://bugs.webkit.org/show_bug.cgi?id=141088
1750
1751         Reviewed by Ryosuke Niwa and Benjamin Poulain.
1752
1753         Rename shared() static member functions to singleton() for singleton
1754         classes as per the recent coding style change.
1755
1756 2015-01-30  Alexey Proskuryakov  <ap@apple.com>
1757
1758         Build fix.
1759
1760         * Shared/API/c/WKDeprecatedFunctions.cpp:
1761         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1762         The screen font substitution functions still need to be present in the header.
1763
1764 2015-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1765
1766         [GTK] Resize the redirected XComposite again after leaving accelerated compositing mode
1767         https://bugs.webkit.org/show_bug.cgi?id=140935
1768
1769         Reviewed by Sergio Villar Senin.
1770
1771         Since r178414 we don't resize the redirected XComposite window
1772         until we enter accelerated compositing mode, but after leaving it
1773         the redirected window keeps its size. We should resize it to 1x1
1774         again and free the XPixmap and cairo surface to save that memory
1775         while not in accelerated compositing mode.
1776
1777         * UIProcess/API/gtk/PageClientImpl.cpp:
1778         (WebKit::PageClientImpl::enterAcceleratedCompositingMode): Notify
1779         the WebKitWebViewBase.
1780         (WebKit::PageClientImpl::exitAcceleratedCompositingMode): Ditto.
1781         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1782         (webkitWebViewBaseEnterAcceleratedCompositingMode): Resize the
1783         XComposite window to the current drawing area size.
1784         (webkitWebViewBaseExitAcceleratedCompositingMode): Resize the
1785         XComposite window to and empty size.
1786         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
1787         * UIProcess/gtk/RedirectedXCompositeWindow.cpp:
1788         (WebKit::RedirectedXCompositeWindow::RedirectedXCompositeWindow):
1789         Do not initialize m_size since we now handle the empty size as a
1790         especial case. Make sure we always create the X window with at
1791         least 1x1 size.
1792         (WebKit::RedirectedXCompositeWindow::resize): Resize the window to
1793         at least 1x1, but when en empty size is given, call
1794         cleanupPixmapAndPixmapSurface() to release those resources.
1795         (WebKit::RedirectedXCompositeWindow::surface): Create the cairo
1796         surface with at least 1x1 size.
1797
1798 2015-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1799
1800         [GTK] Runtime critical warnings sometimes at start up when using the network process
1801         https://bugs.webkit.org/show_bug.cgi?id=140998
1802
1803         Reviewed by Žan Doberšek.
1804
1805         This is caused by the CustomProtocolManager work queue
1806         theread. This WorkQueue is created when the CustomProtocolManager
1807         object is constructed, but destroyed when it's initialized when
1808         the UI process asks to use the network process. In this case,
1809         sometimes happens that the work queue thread that runs the main
1810         loop is executed once the object has been destroyed and the main
1811         loop pointer is nullptr.
1812
1813         * Platform/WorkQueue.h:
1814         * Platform/gtk/WorkQueueGtk.cpp:
1815         (WorkQueue::platformInitialize): Use a lambda function for the
1816         thread body.
1817         (WorkQueue::platformInvalidate): Detach the worker thread before
1818         deleting the main loop object.
1819         (WorkQueue::startWorkQueueThread): Deleted.
1820         (WorkQueue::workQueueThreadBody): Deleted.
1821
1822 2015-01-29  Beth Dakin  <bdakin@apple.com>
1823
1824         Another follow-on, spotted this mistake. This used to be 
1825         #if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 , so it should now be 
1826         COCOA.
1827
1828         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1829         (WebKit::registerUserDefaultsIfNeeded):
1830
1831 2015-01-29  Beth Dakin  <bdakin@apple.com>
1832
1833         Follow-on, fixing a bad merge from my last change. 
1834
1835         * Shared/WebPreferencesDefinitions.h:
1836
1837 2015-01-29  Beth Dakin  <bdakin@apple.com>
1838
1839         Remove more Mountain Lion code from WebKit2
1840         https://bugs.webkit.org/show_bug.cgi?id=141052
1841
1842         Reviewed by Tim Horton.
1843
1844         * NetworkProcess/NetworkResourceLoader.cpp:
1845         (WebKit::NetworkResourceLoader::sendBufferMaybeAborting):
1846         * NetworkProcess/NetworkResourceLoader.h:
1847         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1848         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1849         * NetworkProcess/mac/NetworkDiskCacheMonitor.mm:
1850         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
1851         (WebKit::NetworkResourceLoader::willCacheResponseAsync):
1852         * Platform/IPC/MessageDecoder.cpp:
1853         * Platform/IPC/MessageDecoder.h:
1854         * Platform/IPC/mac/ConnectionMac.mm:
1855         (IPC::ConnectionTerminationWatchdog::watchdogTimerFired):
1856         (IPC::Connection::open):
1857         (IPC::Connection::receiveSourceEventHandler):
1858         (IPC::Connection::kill):
1859         * Platform/IPC/mac/ImportanceAssertion.h:
1860         * PluginProcess/mac/PluginProcessMac.mm:
1861         (WebKit::PluginProcess::initializeProcessName):
1862         * Shared/WebPreferencesDefinitions.h:
1863         * Shared/mac/ChildProcessMac.mm:
1864         (WebKit::initializeTimerCoalescingPolicy):
1865         (WebKit::ChildProcess::setApplicationIsDaemon):
1866         (WebKit::ChildProcess::platformInitialize):
1867         (WebKit::ChildProcess::setQOS):
1868         * Shared/mac/CookieStorageShim.mm:
1869         (WebKit::CookieStorageShim::initialize):
1870         * UIProcess/API/mac/WKView.mm:
1871         (-[WKView addWindowObserversForWindow:]):
1872         (-[WKView removeWindowObservers]):
1873         (-[WKView _windowDidChangeOcclusionState:]):
1874         * UIProcess/Cocoa/NavigationState.mm:
1875         (WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame):
1876         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1877         (WebKit::registerUserDefaultsIfNeeded):
1878         (WebKit::WebProcessPool::platformInitializeWebProcess):
1879         (WebKit::WebProcessPool::registerNotificationObservers):
1880         (WebKit::WebProcessPool::unregisterNotificationObservers):
1881         (WebKit::privateBrowsingSession):
1882         (WebKit::WebProcessPool::isURLKnownHSTSHost):
1883         (WebKit::WebProcessPool::resetHSTSHosts):
1884         * UIProcess/Databases/mac/DatabaseProcessProxyMac.mm:
1885         (WebKit::shouldUseXPC):
1886         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1887         (WebKit::shouldUseXPC):
1888         * UIProcess/WebProcessPool.h:
1889         * UIProcess/mac/TextCheckerMac.mm:
1890         (WebKit::shouldAutomaticQuoteSubstitutionBeEnabled):
1891         (WebKit::shouldAutomaticDashSubstitutionBeEnabled):
1892         (WebKit::TextChecker::didChangeAutomaticQuoteSubstitutionEnabled):
1893         (WebKit::TextChecker::didChangeAutomaticDashSubstitutionEnabled):
1894         * UIProcess/mac/ViewGestureControllerMac.mm:
1895         (WebKit::ViewGestureController::applyDebuggingPropertiesToSwipeViews):
1896         * UIProcess/mac/WebProcessProxyMac.mm:
1897         (WebKit::shouldUseXPC):
1898         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1899         (InitWebCoreSystemInterface):
1900         * WebProcess/cocoa/WebProcessCocoa.mm:
1901         (WebKit::WebProcess::updateActivePages):
1902         * WebProcess/com.apple.WebProcess.sb.in:
1903         * config.h:
1904
1905 2015-01-29  Sam Weinig  <sam@webkit.org>
1906
1907         Remove support for screen font substitution
1908         https://bugs.webkit.org/show_bug.cgi?id=141038
1909
1910         Reviewed by Tim Horton.
1911
1912         * Shared/API/c/WKDeprecatedFunctions.cpp:
1913         (WKPreferencesSetScreenFontSubstitutionEnabled):
1914         (WKPreferencesGetScreenFontSubstitutionEnabled):
1915         Move now empty preferences SPI to WKDeprecatedFunctions.
1916         
1917         * Shared/WebPreferencesDefinitions.h:
1918         * Shared/WebProcessCreationParameters.cpp:
1919         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
1920         (WebKit::WebProcessCreationParameters::encode):
1921         (WebKit::WebProcessCreationParameters::decode):
1922         * Shared/WebProcessCreationParameters.h:
1923         * UIProcess/API/C/WKPreferences.cpp:
1924         (WKPreferencesSetScreenFontSubstitutionEnabled): Deleted.
1925         (WKPreferencesGetScreenFontSubstitutionEnabled): Deleted.
1926         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1927         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1928         (WebKit::WebProcessPool::platformInitializeWebProcess):
1929         * WebProcess/WebPage/WebPage.cpp:
1930         (WebKit::WebPage::updatePreferences):
1931         * WebProcess/WebProcess.h:
1932         (WebKit::WebProcess::presenterApplicationPid):
1933         (WebKit::WebProcess::shouldForceScreenFontSubstitution): Deleted.
1934         * WebProcess/cocoa/WebProcessCocoa.mm:
1935         (WebKit::WebProcess::platformInitializeWebProcess):
1936         Stop piping screen font substitution setting to the web process.
1937
1938 2015-01-29  Alexey Proskuryakov  <ap@apple.com>
1939
1940         Frequent kernel panics when running WebKit regression tests
1941         https://bugs.webkit.org/show_bug.cgi?id=141043
1942
1943         Reviewed by Sam Weinig.
1944
1945         Split PluginService.Development into 32-bit and 64-bit variants, to better match
1946         production variant. When building FAT, we'll have the right architecture from
1947         the start now, so no need to re-exec into a different architecture.        
1948
1949         * Configurations/PluginService.Development.xcconfig: Removed.
1950         * Configurations/PluginService.32.Development.xcconfig: Copied from Source/WebKit2/Configurations/PluginService.Development.xcconfig.
1951         * Configurations/PluginService.64.Development.xcconfig: Copied from Source/WebKit2/Configurations/PluginService.Development.xcconfig.
1952         Changed to use ONLY_ACTIVE_ARCH instead of CONFIGURATION, so that we build the
1953         right thing even in debug FAT builds.
1954
1955         * Configurations/PluginService.32.xcconfig:
1956         * Configurations/PluginService.64.xcconfig:
1957         While at it, applied the same changes as in Development variants. This means that
1958         FAT builds will now build only the correct architecture for PluginService.64
1959         (it used to build FAT, unnecessarily).
1960
1961         * PluginProcess/EntryPoint/mac/XPCService/PluginService.Development/Info.plist:
1962         Updated to support multiple product names.
1963
1964         * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::serviceName): Launch the
1965         right development service.
1966
1967         * WebKit2.xcodeproj/project.pbxproj: Split the Plugin.Development target into two.
1968
1969 2015-01-29  Tim Horton  <timothy_horton@apple.com>
1970
1971         Fix the build with newer Clang
1972
1973         * NetworkProcess/NetworkConnectionToWebProcess.h:
1974         These should be 'override's.
1975
1976 2015-01-29  Chris Dumez  <cdumez@apple.com>
1977
1978         Clean up / modernize PageCache class
1979         https://bugs.webkit.org/show_bug.cgi?id=141009
1980
1981         Reviewed by Darin Adler.
1982
1983         Clean up / modernize PageCache class.
1984
1985         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1986         (WebKit::WebBackForwardListProxy::removeItem):
1987         (WebKit::WebBackForwardListProxy::close):
1988         * WebProcess/WebPage/WebPage.cpp:
1989         (WebKit::WebPage::goForward):
1990         (WebKit::WebPage::goBack):
1991         (WebKit::WebPage::goToBackForwardItem):
1992         * WebProcess/WebProcess.cpp:
1993         (WebKit::WebProcess::releasePageCache):
1994         * WebProcess/cocoa/WebProcessCocoa.mm:
1995         (WebKit::WebProcess::platformSetCacheModel):
1996         * WebProcess/soup/WebProcessSoup.cpp:
1997         (WebKit::WebProcess::platformSetCacheModel):
1998
1999 2015-01-29  Csaba Osztrogonác  <ossy@webkit.org>
2000
2001         [EFL][GTK] Fix the build after r179326
2002         https://bugs.webkit.org/show_bug.cgi?id=141027
2003
2004         Reviewed by Alexey Proskuryakov.
2005
2006         Guard MessageRecorder implementation with USE(DTRACE)
2007         for platforms not supporting DTrace.
2008
2009         Original patch by Carlos Garcia Campos <cgarcia@igalia.com>
2010
2011         * Platform/IPC/ArgumentCoders.cpp:
2012         * Platform/IPC/ArgumentCoders.h:
2013         * Platform/IPC/Connection.cpp:
2014         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
2015         (IPC::Connection::sendMessage):
2016         (IPC::Connection::sendSyncMessage):
2017         (IPC::Connection::sendSyncMessageFromSecondaryThread):
2018         (IPC::Connection::dispatchSyncMessage):
2019         (IPC::Connection::dispatchMessage):
2020         * Platform/IPC/MessageDecoder.cpp:
2021         (IPC::MessageDecoder::MessageDecoder):
2022         * Platform/IPC/MessageDecoder.h:
2023         * Platform/IPC/MessageEncoder.cpp:
2024         (IPC::MessageEncoder::MessageEncoder):
2025         (IPC::MessageEncoder::encodeHeader):
2026         * Platform/IPC/MessageEncoder.h:
2027         * Platform/IPC/MessageRecorder.h:
2028
2029 2015-01-29  Tim Horton  <timothy_horton@apple.com>
2030
2031         Avoid manually handling quickLookWithEvent: if the immediate action gesture recognizer will do Lookup for us
2032         https://bugs.webkit.orgshow_bug.cgi?id=141018
2033         <rdar://problem/19619999>
2034
2035         * UIProcess/API/mac/WKView.mm:
2036         (-[WKView quickLookWithEvent:]):
2037         Yosemite is 101000, not 10100.
2038
2039 2015-01-28  Tim Horton  <timothy_horton@apple.com>
2040
2041         Add API::{FrameInfo, NavigationAction, NavigationResponse} types
2042         https://bugs.webkit.org/show_bug.cgi?id=140982
2043
2044         Reviewed by Sam Weinig.
2045
2046         Make C++ API objects for WK{FrameInfo, NavigationAction, NavigationResponse}
2047         to wrap around, as a step towards moving Modern API logic down into WebPageProxy.
2048
2049         * Shared/API/APIObject.h:
2050         * Shared/Cocoa/APIObject.mm:
2051         (API::Object::newObject):
2052         * UIProcess/API/APIFrameInfo.cpp: Added.
2053         * UIProcess/API/APIFrameInfo.h: Added.
2054         * UIProcess/API/APINavigationAction.h: Added.
2055         * UIProcess/API/APINavigationResponse.h: Added.
2056         Add API::FrameInfo, API::NavigationAction, and API::NavigationResponse.
2057
2058         * UIProcess/API/Cocoa/WKFrameInfo.mm:
2059         * UIProcess/API/Cocoa/WKFrameInfoInternal.h:
2060         Make WKFrameInfo a WKObject, wrapping a API::FrameInfo.
2061
2062         * UIProcess/API/Cocoa/WKNavigationAction.mm:
2063         * UIProcess/API/Cocoa/WKNavigationActionInternal.h:
2064         Make WKNavigationAction a WKObject, wrapping a API::NavigationAction.
2065
2066         * UIProcess/API/Cocoa/WKNavigationResponse.mm:
2067         * UIProcess/API/Cocoa/WKNavigationResponseInternal.h:
2068         Make WKNavigationResponse a WKObject, wrapping a API::NavigationResponse.
2069
2070         * UIProcess/API/Cocoa/WKUserContentController.mm:
2071         Adopt API::FrameInfo.
2072
2073         * UIProcess/Cocoa/NavigationState.mm:
2074         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
2075         Adopt API::FrameInfo, and reorganize the code slightly.
2076         Adopt API::NavigationAction.
2077
2078         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
2079         Adopt API::FrameInfo.
2080         Adopt API::NavigationResponse.
2081
2082         (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame):
2083         Adopt API::FrameInfo.
2084
2085         * UIProcess/Cocoa/UIDelegate.mm:
2086         (WebKit::UIDelegate::UIClient::createNewPage):
2087         (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
2088         (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
2089         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
2090         Adopt API::FrameInfo.
2091
2092         * WebKit2.xcodeproj/project.pbxproj:
2093
2094 2015-01-28  Antti Koivisto  <antti@apple.com>
2095
2096         http/tests/xmlhttprequest/workers/methods.html sometimes times out with disk cache enabled
2097         https://bugs.webkit.org/show_bug.cgi?id=140976
2098
2099         Reviewed by Chris Dumez.
2100
2101         The previous fix sometimes invoked the completion handler twice. Explicitly track if we
2102         have called it or not.
2103
2104         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2105         (WebKit::NetworkCacheStorage::dispatchRetrieveOperation):
2106
2107         Also move the error case to the done branch. According to the documentation 'done' is always set on error.
2108
2109 2015-01-28  Timothy Horton  <timothy_horton@apple.com>
2110
2111         Add a WebKitMessageRecorder DTrace provider, exposing IPC details to DTrace
2112         https://bugs.webkit.org/show_bug.cgi?id=140673
2113
2114         Reviewed by Sam Weinig.
2115
2116         * Platform/IPC/ArgumentCoders.cpp:
2117         (IPC::ArgumentCoder<uuid_t>::encode):
2118         (IPC::ArgumentCoder<uuid_t>::decode):
2119         * Platform/IPC/ArgumentCoders.h:
2120         Add a uuid_t (simple) argument coder.
2121         Fix a mis-named header-guard #ifdef.
2122
2123         * Platform/IPC/Connection.cpp:
2124         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
2125         (IPC::Connection::dispatchSyncMessage):
2126         Sync message replies inherit the message UUID from the incoming sync message.
2127
2128         (IPC::Connection::sendMessage):
2129         (IPC::Connection::waitForMessage):
2130         (IPC::Connection::sendSyncMessage):
2131         (IPC::Connection::sendSyncMessageFromSecondaryThread):
2132         Record outgoing messages. Because sendSyncMessage calls sendMessage,
2133         we have to explicitly avoid recording the message twice.
2134
2135         (IPC::Connection::dispatchMessage):
2136         Record the incoming message.
2137
2138         (IPC::Connection::remoteProcessID):
2139         Add remoteProcessID(), which tries to determine the pid of the remote process.
2140
2141         * Platform/IPC/Connection.h:
2142         (IPC::Connection::xpcConnection):
2143         This can be const.
2144
2145         (IPC::Connection::isValid):
2146         Make this public.
2147
2148         * Platform/IPC/MessageDecoder.cpp:
2149         (IPC::MessageDecoder::MessageDecoder):
2150         * Platform/IPC/MessageDecoder.h:
2151         (IPC::MessageDecoder::setMessageProcessingToken):
2152         (IPC::MessageDecoder::UUID):
2153         Decode and store the message UUID.
2154         Store a MessageProcessingToken for the lifetime of the MessageDecoder;
2155         this ensures that all time spent processing the incoming message will be
2156         counted against that message.
2157
2158         * Platform/IPC/MessageEncoder.cpp:
2159         (IPC::MessageEncoder::MessageEncoder):
2160         By default, create a new UUID for the message. Alternatively, allow clients
2161         to pass the message UUID in (used for sync message replies).
2162         Store the messageReceiverName and messageName.
2163
2164         (IPC::MessageEncoder::encodeHeader):
2165         Factor encodeHeader() out of the constructors so most of their code can be shared.
2166
2167         (IPC::MessageEncoder::isSyncMessage):
2168         (IPC::MessageEncoder::shouldDispatchMessageWhenWaitingForSyncReply):
2169         Add getters for these flags.
2170
2171         * Platform/IPC/MessageEncoder.h:
2172         (IPC::MessageEncoder::messageReceiverName):
2173         (IPC::MessageEncoder::messageName):
2174         (IPC::MessageEncoder::destinationID):
2175         (IPC::MessageEncoder::UUID):
2176
2177         * Platform/IPC/MessageRecorder.h: Added.
2178         * Platform/IPC/MessageRecorder.cpp: Added.
2179         (MessageRecorder::MessageRecorder):
2180         Add a class that interfaces with a custom DTrace provider to log incoming and outgoing messages.
2181
2182         (MessageRecorder::shared):
2183         (MessageRecorder::isEnabled):
2184         Determine if either of the message probes are enabled. If not, we'll avoid most of the
2185         work associated with MessageRecorder.
2186
2187         (MessageRecorder::recordOutgoingMessage):
2188         (MessageRecorder::recordIncomingMessage):
2189         Build a WebKitMessageRecord and MessageProcessingToken from the Message(De|En)coder.
2190         Once the MessageProcessingToken is deallocated, the probe will be invoked with the WebKitMessageRecord.
2191
2192         (MessageRecorder::MessageProcessingToken::MessageProcessingToken):
2193         (MessageRecorder::MessageProcessingToken::~MessageProcessingToken):
2194         Keep track of when the token is created and destroyed; these are considered the beginning
2195         and ending "processing" times of the message (and as such the token should be kept alive for
2196         exactly as long as the message is being processed).
2197
2198         * Platform/IPC/MessageRecorderProbes.d: Added.
2199         Add a DTrace provider source file with two probes, message_sent and message_received.
2200         The struct must match the struct in MessageRecorder.h.
2201         
2202         * Platform/IPC/ProcessType.h: Added.
2203         Add an enum of process types.
2204
2205         * WebKit2.xcodeproj/project.pbxproj:
2206
2207         * DatabaseProcess/DatabaseProcess.h:
2208         * DatabaseProcess/DatabaseToWebProcessConnection.h:
2209         * NetworkProcess/NetworkConnectionToWebProcess.h:
2210         * NetworkProcess/NetworkProcess.h:
2211         * WebProcess/Databases/WebToDatabaseProcessConnection.h:
2212         * WebProcess/Network/NetworkProcessConnection.h:
2213         * WebProcess/Plugins/PluginProcessConnection.h:
2214         * WebProcess/WebPage/WebInspector.h:
2215         * WebProcess/WebPage/WebInspectorUI.h:
2216         * WebProcess/WebProcess.h:
2217         * UIProcess/Databases/DatabaseProcessProxy.h:
2218         * UIProcess/Network/NetworkProcessProxy.h:
2219         * UIProcess/Plugins/PluginProcessProxy.h:
2220         * UIProcess/WebProcessProxy.h:
2221         * PluginProcess/PluginProcess.h:
2222         * PluginProcess/WebProcessConnection.h:
2223         Annotate Connection::Clients with process types.
2224         
2225 2015-01-28  Joseph Pecoraro  <pecoraro@apple.com>
2226
2227         Web Inspector: Crash closing inspected page with frequent activity
2228         https://bugs.webkit.org/show_bug.cgi?id=140973
2229
2230         Reviewed by Timothy Hatcher.
2231
2232         * WebProcess/WebPage/WebInspector.h:
2233         (WebKit::WebInspector::disconnectFromPage):        
2234         * WebProcess/WebPage/WebPage.cpp:
2235         (WebKit::WebPage::close):
2236         Be sure to close the WebInspector connection through the page
2237         when the page is closing so that the WebKit::WebInspector is
2238         relinquishes itself as the InspectorFrontendChannel.
2239
2240 2015-01-28  Timothy Horton  <timothy_horton@apple.com>
2241
2242         Avoid manually handling quickLookWithEvent: if the immediate action gesture recognizer will do Lookup for us
2243         https://bugs.webkit.org/show_bug.cgi?id=141018
2244         <rdar://problem/19619999>
2245
2246         Reviewed by Beth Dakin.
2247
2248         * UIProcess/API/mac/WKView.mm:
2249         (-[WKView quickLookWithEvent:]):
2250         If we have an immediate action gesture recognizer, just call super and
2251         avoid WebKit's special quickLookWithEvent: implementation.
2252
2253 2015-01-28  Sungmann Cho  <sungmann.cho@navercorp.com>
2254
2255         Remove remaining PLATFORM(WIN) code blocks from WebKit2.
2256         https://bugs.webkit.org/show_bug.cgi?id=140972
2257
2258         Reviewed by Darin Adler.
2259
2260         * WebProcess/Cookies/cf/WebCookieManagerCFNet.cpp:
2261         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
2262
2263 2015-01-28  Beth Dakin  <bdakin@apple.com>
2264
2265         Remove Mountain Lion code from WebKit and WebKit2
2266         https://bugs.webkit.org/show_bug.cgi?id=141010
2267
2268         Reviewed by Sam Weinig.
2269
2270         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2271         * PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm:
2272         * Shared/mac/ChildProcessMac.mm:
2273         (WebKit::ChildProcess::initializeSandbox):
2274         * Shared/mac/WebEventFactory.mm:
2275         (WebKit::phaseForEvent):
2276         * UIProcess/API/mac/WKView.mm:
2277         (-[WKView quickLookWithEvent:]):
2278         (-[WKView updateLayer]):
2279         (-[WKView createFullScreenWindow]):
2280         * UIProcess/Network/NetworkProcessProxy.cpp:
2281         (WebKit::NetworkProcessProxy::didFinishLaunching):
2282         * UIProcess/Network/mac/NetworkProcessProxyMac.mm:
2283         (WebKit::shouldUseXPC):
2284         * UIProcess/WebProcessProxy.cpp:
2285         (WebKit::WebProcessProxy::didFinishLaunching):
2286         * UIProcess/mac/PageClientImpl.mm:
2287         (WebKit::PageClientImpl::isViewVisible):
2288         * WebKit2Prefix.h:
2289         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2290         (InitWebCoreSystemInterface):
2291         * WebProcess/com.apple.WebProcess.sb.in:
2292
2293 2015-01-28  Joseph Pecoraro  <pecoraro@apple.com>
2294
2295         Web Inspector: Crash when closing inspected page
2296         https://bugs.webkit.org/show_bug.cgi?id=140968
2297
2298         Reviewed by Timothy Hatcher.
2299
2300         Handle cases where the corePage could be null. With the Inspector Process
2301         in its own process, messages may come to the WebContentProcess after
2302         the WebCore::Page has itself been destroyed.
2303
2304         * WebProcess/WebPage/WebInspector.cpp:
2305         (WebKit::WebInspector::show):
2306         (WebKit::WebInspector::close):
2307         (WebKit::WebInspector::openInNewTab):
2308         (WebKit::WebInspector::evaluateScriptForTest):
2309         (WebKit::WebInspector::showConsole):
2310         (WebKit::WebInspector::showResources):
2311         (WebKit::WebInspector::showMainResourceForFrame):
2312         (WebKit::WebInspector::startPageProfiling):
2313         (WebKit::WebInspector::stopPageProfiling):
2314         (WebKit::WebInspector::canAttachWindow):
2315         (WebKit::WebInspector::sendMessageToBackend):
2316         (WebKit::WebInspector::remoteFrontendConnected):
2317         (WebKit::WebInspector::remoteFrontendDisconnected):
2318
2319 2015-01-28  Sam Weinig  <sam@webkit.org>
2320
2321         Convert WebPreferences and VisitedLinkProvider to be bridged API::Objects
2322         https://bugs.webkit.org/show_bug.cgi?id=141002
2323
2324         Reviewed by Tim Horton.
2325
2326         * Shared/API/APIObject.h:
2327         Add VisitedLinkProvider type.
2328         
2329         * Shared/Cocoa/APIObject.mm:
2330         (API::Object::newObject):
2331         Allocate WebPreferences and VisitedLinkProvider as their Objective-C counterpart.
2332         
2333         * UIProcess/API/Cocoa/WKPreferences.mm:
2334         (-[WKPreferences init]):
2335         Switch to constructInWrapper.
2336
2337         (-[WKPreferences dealloc]):
2338         Call the WebPreferences destructor.
2339         
2340         (-[WKPreferences _apiObject]):
2341         Add implementation of the WKObject protocol.
2342
2343         * UIProcess/API/Cocoa/WKPreferencesInternal.h:
2344         Convert to using ObjectStorage.
2345
2346         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm:
2347         (-[_WKVisitedLinkProvider init]):
2348         Switch to constructInWrapper.
2349
2350         (-[_WKVisitedLinkProvider dealloc]):
2351         Call the VisitedLinkProvider destructor.
2352
2353         (-[_WKVisitedLinkProvider _apiObject]):
2354         Add implementation of the WKObject protocol.
2355
2356         * UIProcess/API/Cocoa/_WKVisitedLinkProviderInternal.h:
2357         Convert to using ObjectStorage.
2358
2359         * UIProcess/VisitedLinkProvider.cpp:
2360         (WebKit::VisitedLinkProvider::create):
2361         * UIProcess/VisitedLinkProvider.h:
2362         Switch create() to return a Ref.
2363
2364         * UIProcess/WebPreferences.h:
2365         Make the constructor public for use by constructInWrapper.
2366
2367         * UIProcess/WebProcessPool.cpp:
2368         (WebKit::WebProcessPool::createWebPage):
2369         * UIProcess/WebProcessPool.h:
2370         Store the VisitedLinkProvider in a Ref.
2371
2372 2015-01-28  Dana Burkart  <dburkart@apple.com>
2373
2374         Move ASan flag settings from DebugRelease.xcconfig to Base.xcconfig
2375         https://bugs.webkit.org/show_bug.cgi?id=136765
2376
2377         Reviewed by Alexey Proskuryakov.
2378
2379         * Configurations/Base.xcconfig:
2380         * Configurations/DebugRelease.xcconfig:
2381
2382 2015-01-28  Chris Dumez  <cdumez@apple.com>
2383
2384         Fix typo in markPagesForVistedLinkStyleRecalc()
2385         https://bugs.webkit.org/show_bug.cgi?id=140977
2386
2387         Reviewed by Darin Adler.
2388
2389         * WebProcess/WebPage/VisitedLinkTableController.cpp:
2390         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
2391         (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
2392         (WebKit::VisitedLinkTableController::allVisitedLinkStateChanged):
2393         (WebKit::VisitedLinkTableController::removeAllVisitedLinks):
2394
2395 2015-01-27  Antti Koivisto  <antti@apple.com>
2396
2397         http/tests/xmlhttprequest/workers/methods.html sometimes times out with disk cache enabled
2398         https://bugs.webkit.org/show_bug.cgi?id=140976
2399
2400         Reviewed by Chris Dumez.
2401
2402         Running
2403
2404             run-webkit-tests --release -2 http/tests/xmlhttprequest/workers/methods.html --iterations=100
2405
2406         would usually time out an iteration.
2407
2408         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2409         (WebKit::NetworkCacheStorage::dispatchRetrieveOperation):
2410
2411         Using dispatch_io_read with an empty file calls the handler block immediately with done boolean set
2412         without it being an error. We failed to call the completion handler and any synchronous xhr would hang.
2413         We may see an empty cache file if we are just in process of writing it.
2414
2415         Fix by handling this case specifically.
2416
2417 2015-01-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2418
2419         Unreviewed. Add missing file to WebInspector compilation for GTK+.
2420
2421         * PlatformGTK.cmake: Add UserInterface/External/ESLint/eslint.js
2422
2423 2015-01-28  Chris Dumez  <cdumez@apple.com>
2424
2425         Rename pageCache() to PageCache::shared() and return a reference
2426         https://bugs.webkit.org/show_bug.cgi?id=140983
2427
2428         Reviewed by Andreas Kling.
2429
2430         Rename pageCache() to PageCache::shared() as this is a singleton class
2431         and have it return a reference instead of a pointer.
2432
2433         * WebProcess/WebPage/VisitedLinkTableController.cpp:
2434         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
2435         (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
2436         (WebKit::VisitedLinkTableController::allVisitedLinkStateChanged):
2437         (WebKit::VisitedLinkTableController::removeAllVisitedLinks):
2438         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2439         (WebKit::WebBackForwardListProxy::removeItem):
2440         (WebKit::WebBackForwardListProxy::close):
2441         * WebProcess/WebProcess.cpp:
2442         (WebKit::WebProcess::releasePageCache):
2443         * WebProcess/cocoa/WebProcessCocoa.mm:
2444         (WebKit::WebProcess::platformSetCacheModel):
2445         * WebProcess/soup/WebProcessSoup.cpp:
2446         (WebKit::WebProcess::platformSetCacheModel):
2447
2448 2015-01-27  Alexey Proskuryakov  <ap@apple.com>
2449
2450         More build fixes for newer clang.
2451
2452         Rubber-stamped by Anders Carlsson.
2453
2454         Added missing override keywords, marked some deprecated accessibility methods as such.
2455
2456         * PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm:
2457         (WebKit::PluginProcessMainDelegate::doPreInitializationWork): Deleted.
2458         (WebKit::PluginProcessMainDelegate::getExtraInitializationData): Deleted.
2459         (WebKit::PluginProcessMainDelegate::doPostRunWork): Deleted.
2460         * PluginProcess/WebProcessConnection.h:
2461         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2462         (WebKit::WebProcessPool::platformInitializeWebProcess):
2463         * UIProcess/Plugins/PluginProcessProxy.h:
2464         * UIProcess/WebPageProxy.h:
2465         * UIProcess/mac/PageClientImpl.h:
2466         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
2467         (PageOverlayClientImpl::actionContextForResultAtPoint): Deleted.
2468         (PageOverlayClientImpl::dataDetectorsDidPresentUI): Deleted.
2469         (PageOverlayClientImpl::dataDetectorsDidChangeUI): Deleted.
2470         (PageOverlayClientImpl::dataDetectorsDidHideUI): Deleted.
2471         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2472         (WebKit::NetscapePlugin::isBeingAsynchronouslyInitialized): Deleted.
2473         * WebProcess/Plugins/PDF/PDFPlugin.h:
2474         * WebProcess/Plugins/PluginProcessConnection.h:
2475         * WebProcess/Plugins/PluginProxy.h:
2476         (WebKit::PluginProxy::isBeingAsynchronouslyInitialized): Deleted.
2477         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
2478
2479 2015-01-27  Beth Dakin  <bdakin@apple.com>
2480
2481         Immediate action gesture recognizer still doesn't work well with IB
2482         https://bugs.webkit.org/show_bug.cgi?id=140967
2483         -and corresponding-
2484         rdar://problem/19621509
2485
2486         Reviewed by Tim Horton.
2487
2488         We should add (or remove) the gesture recognizer in viewDidMoveToWindow because 
2489         initWithFrame it too early and IB might mess with it.
2490         * UIProcess/API/mac/WKView.mm:
2491         (-[WKView viewDidMoveToWindow]):
2492         (-[WKView initWithFrame:processPool:configuration:webView:]):
2493
2494 2015-01-27  Beth Dakin  <bdakin@apple.com>
2495
2496         Invoking an immediate action on link often dismisses selection
2497         https://bugs.webkit.org/show_bug.cgi?id=140911
2498         -and corresponding-
2499         rdar://problem/19572685
2500
2501         Reviewed by Tim Horton.
2502
2503         Calling _page->setMaintainsInactiveSelection(false) in complete is often 
2504         too soon. Instead, call it in dismissContentRelativeChildWindows. This is more 
2505         similar to the timing for the TextIndicator.
2506         * UIProcess/mac/WKImmediateActionController.mm:
2507         (-[WKImmediateActionController dismissContentRelativeChildWindows]):
2508         (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
2509         (-[WKImmediateActionController immediateActionRecognizerDidCompleteAnimation:]):
2510
2511 2015-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2512
2513         REGRESSION(r166975): [GTK] Page overlays are not drawn anymore after r166975
2514         https://bugs.webkit.org/show_bug.cgi?id=131433
2515
2516         Reviewed by Žan Doberšek.
2517
2518         Implement page overlays for the GTK+ port.
2519
2520         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
2521         Override pure virtual setViewOverlayRootLayer().
2522         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2523         (WebKit::DrawingAreaImpl::display): Remove FIXME and use modern
2524         for loop.
2525         (WebKit::DrawingAreaImpl::attachViewOverlayGraphicsLayer): Remove
2526         ifdefs and use LayerTreeHost::setViewOverlayRootLayer().
2527         * WebProcess/WebPage/LayerTreeHost.h: Add pure virtual setViewOverlayRootLayer().
2528         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
2529         (WebKit::LayerTreeHostGtk::LayerTreeHostGtk): Initialize m_viewOverlayRootLayer.
2530         (WebKit::LayerTreeHostGtk::initialize): Remove FIXME.
2531         (WebKit::LayerTreeHostGtk::setNonCompositedContentsNeedDisplay):
2532         Remove unused old page overlays code.
2533         (WebKit::LayerTreeHostGtk::setNonCompositedContentsNeedDisplayInRect): Ditto.
2534         (WebKit::LayerTreeHostGtk::sizeDidChange): Ditto.
2535         (WebKit::LayerTreeHostGtk::paintContents): Remove FIXME.
2536         (WebKit::LayerTreeHostGtk::flushPendingLayerChanges): Flush
2537         compositing state on m_pageOverlayLayers if present.
2538         (WebKit::LayerTreeHostGtk::setViewOverlayRootLayer): Set m_pageOverlayLayers.
2539         (WebKit::LayerTreeHostGtk::createPageOverlayLayer): Deleted.
2540         (WebKit::LayerTreeHostGtk::destroyPageOverlayLayer): Deleted.
2541         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h: Remove unused old
2542         page overlays code.
2543
2544 2015-01-27  Sungmann Cho  <sungmann.cho@navercorp.com>
2545
2546         Remove remaining PLUGIN_ARCHITECTURE(WIN) code blocks from WebKit2.
2547         https://bugs.webkit.org/show_bug.cgi?id=140912
2548
2549         Reviewed by Anders Carlsson.
2550
2551         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
2552         (WebKit::NetscapePluginModule::tryLoad):
2553         * Shared/Plugins/PluginQuirks.h:
2554         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2555         (WebKit::NetscapePlugin::userAgent):
2556         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2557
2558 2015-01-26  Simon Fraser  <simon.fraser@apple.com>
2559
2560         [iOS WK2] Fix possible crash when -[WKWebView evaluateJavaScript:completionHandler:] was called then the WKWebView is destroyed
2561         https://bugs.webkit.org/show_bug.cgi?id=140203
2562         rdar://problem/19198492
2563
2564         Reviewed by Sam Weinig.
2565         
2566         When handling the OwnerWasInvalidated case in -[WKWebView evaluateJavaScript:completionHandler:],
2567         the block passed to dispatch_async() needs to be retained. Fix by passing the RefPtr
2568         to the lambda.
2569
2570         * UIProcess/API/Cocoa/WKWebView.mm:
2571         (-[WKWebView evaluateJavaScript:completionHandler:]):
2572
2573 2015-01-26  Chris Dumez  <cdumez@apple.com>
2574
2575         Rename Document::body() to Document::bodyOrFrameset() for clarity
2576         https://bugs.webkit.org/show_bug.cgi?id=140902
2577
2578         Reviewed by Andreas Kling.
2579
2580         Rename Document::body() to Document::bodyOrFrameset() for clarity. This
2581         method does not necessarily return an HTMLBodyElement, it can also
2582         return a frameset as per the specification:
2583         http://www.w3.org/TR/html5/dom.html#dom-tree-accessors
2584
2585         This method is often misused internally (the caller is only interested
2586         in the <body> element). I will fix these instances in a follow-up patch,
2587         this patch is only renaming mechanically.
2588
2589 2015-01-26  Antti Koivisto  <antti@apple.com>
2590
2591         Add a user default for disabling network cache
2592         https://bugs.webkit.org/show_bug.cgi?id=140904
2593
2594         Reviewed by Andreas Kling
2595
2596         defaults write com.apple.Safari WebKitNetworkCacheEnabled -bool YES/NO
2597
2598         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2599         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2600         * Shared/Network/NetworkProcessCreationParameters.cpp:
2601         (WebKit::NetworkProcessCreationParameters::encode):
2602         (WebKit::NetworkProcessCreationParameters::decode):
2603         * Shared/Network/NetworkProcessCreationParameters.h:
2604         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2605         (WebKit::registerUserDefaultsIfNeeded):
2606         (WebKit::WebProcessPool::platformInitializeWebProcess):
2607         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2608
2609 2015-01-26  Chris Dumez  <cdumez@apple.com>
2610
2611         First argument to DOM traversal functions should be a reference
2612         https://bugs.webkit.org/show_bug.cgi?id=140895
2613
2614         Reviewed by Antti Koivisto.
2615
2616         First argument to DOM traversal functions should be a reference instead
2617         of a pointer as it is dereferenced without null-check.
2618
2619 2015-01-26  Beth Dakin  <bdakin@apple.com>
2620
2621         Blacklist iBooks for WebKit's default immediate actions
2622         https://bugs.webkit.org/show_bug.cgi?id=140854
2623         -and corresponding-
2624         rdar://problem/19489518
2625
2626         Reviewed by Tim Horton.
2627
2628         Blacklist iBooks.
2629         * UIProcess/mac/WKImmediateActionController.mm:
2630         (-[WKImmediateActionController _updateImmediateActionItem]):
2631
2632 2015-01-26  Myles C. Maxfield  <mmaxfield@apple.com>
2633
2634         [iOS] [SVG -> OTF Converter] Flip the switch off on iOS
2635         https://bugs.webkit.org/show_bug.cgi?id=140860
2636
2637         Reviewed by Darin Adler.
2638
2639         The fonts it makes are grotesque. (See what I did there? Typographic
2640         humor is the best humor.)
2641
2642         * Configurations/FeatureDefines.xcconfig:
2643
2644 2015-01-26  Fabien Vallée  <fvallee@connected-labs.com>
2645
2646         AX: crash in accessibilityRootObjectWrapper method (WebPageAccessibilityObjectAtk.cpp)
2647         <https://bugs.webkit.org/show_bug.cgi?id=140618>
2648
2649         Reviewed by Chris Fleizach.
2650
2651         Check if document()->axObjectCache() is nullptr to fix the crash.
2652         Similar patch has been applied on mac port:
2653         <http://trac.webkit.org/changeset/167136>
2654
2655         Crash occured on <http://itv.mit-xperts.com/hbbtvtest/appmanager/>
2656         (this page needs CEHTML / HbbTV extensions, conditions cannot
2657         be reproduced using regression tests)
2658
2659         * WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp:
2660         (accessibilityRootObjectWrapper):
2661
2662 2015-01-26  Michael Catanzaro  <mcatanzaro@igalia.com>
2663
2664         [GTK] gtkdoc does not appear in DevHelp
2665         https://bugs.webkit.org/show_bug.cgi?id=139369
2666
2667         Reviewed by Philippe Normand.
2668
2669         * PlatformGTK.cmake: Include the API version in the gtkdoc filenames.
2670         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Renamed from Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt.
2671         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Renamed from Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk.types.
2672
2673 2015-01-25  Timothy Horton  <timothy_horton@apple.com>
2674
2675         Unresponsive Web processes sometimes throw ObjC exceptions under didPerformActionMenuHitTest:
2676         https://bugs.webkit.org/show_bug.cgi?id=140859
2677         <rdar://problem/19571057>
2678
2679         Reviewed by Darin Adler.
2680
2681         * UIProcess/mac/WKImmediateActionController.mm:
2682         (-[WKImmediateActionController didPerformActionMenuHitTest:userData:]):
2683         If we've already given up on this gesture (either because it was canceled or the
2684         willBeginAnimation timeout expired), we shouldn't build a new animationController for it.
2685         This is true both because it wouldn't look good to swap animationControllers out
2686         from under the gesture, but also because AppKit throws an exception when you do this
2687         and that breaks a lot of things.
2688
2689 2015-01-24  Chris Dumez  <cdumez@apple.com>
2690
2691         [WK2][Cocoa] Drop WKDiagnosticLoggingResultType defines
2692         https://bugs.webkit.org/show_bug.cgi?id=140838
2693
2694         Reviewed by Sam Weinig.
2695
2696         Drop WKDiagnosticLoggingResultType defines in _WKDiagnosticLoggingDelegate.h
2697         header now that the client-side is correctly using
2698         _WKDiagnosticLoggingResultType instead.
2699
2700         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
2701
2702 2015-01-23  Antti Koivisto  <antti@apple.com>
2703
2704         Implement cache size limit
2705         https://bugs.webkit.org/show_bug.cgi?id=140844
2706
2707         Reviewed by Andreas Kling.
2708
2709         Prevent the cache from growing without bounds. The simple scheme implemented here
2710         estimates the cache size from number of entries. When the estimated size exceeds
2711         the maximum size we randomly clear 1/4 of the entries.
2712
2713         * NetworkProcess/cache/NetworkCacheStorage.h:
2714         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2715         (WebKit::NetworkCacheStorage::NetworkCacheStorage):
2716         (WebKit::NetworkCacheStorage::initialize):
2717         (WebKit::NetworkCacheStorage::removeEntry):
2718         (WebKit::NetworkCacheStorage::store):
2719         (WebKit::NetworkCacheStorage::setMaximumSize):
2720         (WebKit::NetworkCacheStorage::clear):
2721         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
2722         (WebKit::NetworkCacheStorage::initializeKeyFilter): Deleted.
2723
2724 2015-01-23  Timothy Horton  <timothy_horton@apple.com>
2725
2726         Fix the pre-Yosemite build.
2727
2728         * UIProcess/API/mac/WKView.mm:
2729         (-[WKView _dismissContentRelativeChildWindows]):
2730
2731 2015-01-23  Timothy Horton  <timothy_horton@apple.com>
2732
2733         QLPreviewMenuItem popovers don't close when the page scrolls
2734         https://bugs.webkit.org/show_bug.cgi?id=140806
2735         <rdar://problem/19555618>
2736
2737         Reviewed by Beth Dakin.
2738
2739         Now that QLPreviewMenuItem's popover doesn't eat scrolls, we need to dismiss it if the page scrolls.
2740
2741         * UIProcess/API/mac/WKView.mm:
2742         (-[WKView _dismissContentRelativeChildWindows]):
2743         Send _dismissContentRelativeChildWindows on to WKImmediateActionController.
2744
2745         * UIProcess/mac/WKImmediateActionController.h:
2746         * UIProcess/mac/WKImmediateActionController.mm:
2747         (-[WKImmediateActionController _clearImmediateActionState]):
2748         (-[WKImmediateActionController dismissContentRelativeChildWindows]):
2749         (-[WKImmediateActionController _defaultAnimationController]):
2750         Keep track of the active QLPreviewMenuItem, and close it upon scroll.
2751
2752 2015-01-23  Timothy Horton  <timothy_horton@apple.com>
2753
2754         Infinite recursion in _clearImmediateActionState
2755         https://bugs.webkit.org/show_bug.cgi?id=140807
2756         <rdar://problem/19571601>
2757
2758         Reviewed by Anders Carlsson.
2759
2760         * UIProcess/mac/WKImmediateActionController.mm:
2761         (-[WKImmediateActionController _clearImmediateActionState]):
2762         Clear _hasActivatedActionContext before calling didUseActions, because
2763         didUseActions can call _clearImmediateActionState.
2764
2765 2015-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2766
2767         [GTK] Add initial database process support
2768         https://bugs.webkit.org/show_bug.cgi?id=139491
2769
2770         Reviewed by Sergio Villar Senin.
2771
2772         Add initial support for DatabaseProcess, disabled by default for
2773         now.
2774
2775         * CMakeLists.txt: Add required files to compilation.
2776         * DatabaseProcess/DatabaseProcess.cpp:
2777         (WebKit::DatabaseProcess::createDatabaseToWebProcessConnection):
2778         Add the unix domain sockets implementation.
2779         * DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp: Added.
2780         (main):
2781         * DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp: Added.
2782         (WebKit::DatabaseProcessMainUnix):
2783         * DatabaseProcess/unix/DatabaseProcessMainUnix.h: Added.
2784         * PlatformGTK.cmake: Add required files to compilation.
2785         * Shared/ProcessExecutablePath.h:
2786         * Shared/gtk/KeyedDecoder.cpp: Added.
2787         (WebKit::KeyedDecoder::KeyedDecoder):
2788         (WebKit::KeyedDecoder::~KeyedDecoder):
2789         (WebKit::KeyedDecoder::buildDictionaryFromGVariant):
2790         (WebKit::KeyedDecoder::decodeBytes):
2791         (WebKit::KeyedDecoder::decodeBool):
2792         (WebKit::KeyedDecoder::decodeUInt32):
2793         (WebKit::KeyedDecoder::decodeInt32):
2794         (WebKit::KeyedDecoder::decodeInt64):
2795         (WebKit::KeyedDecoder::decodeFloat):
2796         (WebKit::KeyedDecoder::decodeDouble):
2797         (WebKit::KeyedDecoder::decodeString):
2798         (WebKit::KeyedDecoder::beginObject):
2799         (WebKit::KeyedDecoder::endObject):
2800         (WebKit::KeyedDecoder::beginArray):
2801         (WebKit::KeyedDecoder::beginArrayElement):
2802         (WebKit::KeyedDecoder::endArrayElement):
2803         (WebKit::KeyedDecoder::endArray):
2804         * Shared/gtk/KeyedDecoder.h: Added.
2805         * Shared/gtk/KeyedEncoder.cpp: Added.
2806         (WebKit::KeyedEncoder::KeyedEncoder):
2807         (WebKit::KeyedEncoder::~KeyedEncoder):
2808         (WebKit::KeyedEncoder::encodeBytes):
2809         (WebKit::KeyedEncoder::encodeBool):
2810         (WebKit::KeyedEncoder::encodeUInt32):
2811         (WebKit::KeyedEncoder::encodeInt32):
2812         (WebKit::KeyedEncoder::encodeInt64):
2813         (WebKit::KeyedEncoder::encodeFloat):
2814         (WebKit::KeyedEncoder::encodeDouble):
2815         (WebKit::KeyedEncoder::encodeString):
2816         (WebKit::KeyedEncoder::beginObject):
2817         (WebKit::KeyedEncoder::endObject):
2818         (WebKit::KeyedEncoder::beginArray):
2819         (WebKit::KeyedEncoder::beginArrayElement):
2820         (WebKit::KeyedEncoder::endArrayElement):
2821         (WebKit::KeyedEncoder::endArray):
2822         (WebKit::KeyedEncoder::finishEncoding):
2823         * Shared/gtk/KeyedEncoder.h: Added.
2824         * Shared/gtk/ProcessExecutablePathGtk.cpp:
2825         (WebKit::executablePathOfDatabaseProcess):
2826         * UIProcess/Databases/DatabaseProcessProxy.cpp:
2827         (WebKit::DatabaseProcessProxy::didCreateDatabaseToWebProcessConnection):
2828         Add the unix domain sockets implementation.
2829         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
2830         (WebKit::ProcessLauncher::launchProcess): Handle the
2831         DatabaseProcess too.
2832         * UIProcess/gtk/WebContextGtk.cpp:
2833         (WebKit::WebContext::platformDefaultIndexedDBDatabaseDirectory):
2834         * WebProcess/WebProcess.cpp:
2835         (WebKit::WebProcess::ensureWebToDatabaseProcessConnection): Add
2836         the unix domain sockets implementation.
2837
2838 2015-01-22  Benjamin Poulain  <bpoulain@apple.com>
2839
2840         [iOS][WK2] Ignore synthetic click initiated on a previous page
2841         https://bugs.webkit.org/show_bug.cgi?id=139556
2842         rdar://problem/18586008
2843
2844         Reviewed by David Kilzer.
2845
2846         Under the right accumulation of bad luck, a synthetic click could be generated
2847         on a page that never asked for it.
2848
2849         What happened was:
2850         1) Page Foo listen to touch event.
2851         2) In response to touch events, Foo decides to navigate to page Bar
2852            *but* it does not cancel the native gesture recognizers with preventDefault().
2853         3) Page Bar loads.
2854         4) The native gesture recognizer ask us to click, we forward that to the WebProcess
2855            and generate a synthetic mouse event.
2856         -> Bar receives a click.
2857         If you are unlucky enough, it looks like a single tap does a double click.
2858
2859         There are two ways this patch avoids the problem:
2860
2861         First, in the UIProcess, we just cancel the HighlightLongPressGestureRecognizer
2862         on didCommitLoadForMainFrame. This prevents "fast clicks" from accidentally going through.
2863         This is not bullet proof because we get didCommitLoadForMainFrame asynchronously but
2864         killing the timer and gesture seems like a good idea.
2865
2866         Second, we skip any tap command at the WebProcess level when it was issued for
2867         the previous page. This is using the same principle we used for VisibleContentRect:
2868         any input generated before the current layer tree commit is useless for the current page.
2869
2870         We track the commit ID in the UIProcess when we decide to do the tracking or not.
2871         Note that we keep the ID regardless of the tracking state, it does not matter if we have sent
2872         touch events, what matters is what content was on screen when the touch events were handled.
2873
2874         If the user interaction result in a tap, we send the commit ID along the tap commands.
2875         In the WebProcess, we know the actual layer tree commit associated with the current page.
2876         If the tap was generated with a layer ID preceding the current page, we fail the command.
2877
2878         * UIProcess/WebPageProxy.cpp:
2879         (WebKit::WebPageProxy::WebPageProxy):
2880         (WebKit::WebPageProxy::handleTouchEventSynchronously):
2881         (WebKit::WebPageProxy::resetState):
2882         * UIProcess/WebPageProxy.h:
2883         * UIProcess/ios/WKContentView.mm:
2884         (-[WKContentView _didCommitLoadForMainFrame]):
2885         * UIProcess/ios/WKContentViewInteraction.mm:
2886         (-[WKContentView _attemptClickAtLocation:]):
2887         * UIProcess/ios/WebPageProxyIOS.mm:
2888         (WebKit::WebPageProxy::commitPotentialTap):
2889         (WebKit::WebPageProxy::handleTap):
2890         * WebProcess/WebPage/WebPage.cpp:
2891         (WebKit::WebPage::didCommitLoad):
2892         * WebProcess/WebPage/WebPage.h:
2893         * WebProcess/WebPage/WebPage.messages.in:
2894         * WebProcess/WebPage/ios/WebPageIOS.mm:
2895         (WebKit::WebPage::handleTap):
2896         (WebKit::WebPage::commitPotentialTap):
2897
2898 2015-01-22  Chris Dumez  <cdumez@apple.com>
2899
2900         [WK2][Cocoa] Drop WKWebViewConfiguration._featureCounterEnabled SPI.
2901         https://bugs.webkit.org/show_bug.cgi?id=140799
2902
2903         Reviewed by Dan Bernstein.
2904
2905         Drop WKWebViewConfiguration._featureCounterEnabled SPI now that the
2906         client-side has been updated.
2907
2908         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2909         (-[WKWebViewConfiguration _setAllowsAlternateFullscreen:]):
2910         (-[WKWebViewConfiguration _featureCounterEnabled]): Deleted.
2911         (-[WKWebViewConfiguration _setFeatureCounterEnabled:]): Deleted.
2912         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2913
2914 2015-01-22  Antti Koivisto  <antti@apple.com>
2915
2916         Fix ENABLE(NETWORK_CACHE) build
2917
2918         * NetworkProcess/NetworkResourceLoader.cpp:
2919         (WebKit::NetworkResourceLoader::didFinishLoading):
2920
2921 2015-01-22  Timothy Horton  <timothy_horton@apple.com>
2922
2923         UserData decoding of WKTypeRefWrapper always fails
2924         https://bugs.webkit.org/show_bug.cgi?id=140791
2925         <rdar://problem/19438402>
2926
2927         Reviewed by Anders Carlsson.
2928
2929         * Shared/mac/ObjCObjectGraph.mm:
2930         (WebKit::ObjCObjectGraph::decode):
2931         Add a missing break.
2932
2933 2015-01-22  Ryosuke Niwa  <rniwa@webkit.org>
2934
2935         Add a build flag for ES6 class syntax
2936         https://bugs.webkit.org/show_bug.cgi?id=140760
2937
2938         Reviewed by Michael Saboff.
2939
2940         * Configurations/FeatureDefines.xcconfig:
2941
2942 2015-01-22  Chris Dumez  <cdumez@apple.com>
2943
2944         Drop the legacy FeatureCounter class
2945         https://bugs.webkit.org/show_bug.cgi?id=140749
2946
2947         Reviewed by Andreas Kling.
2948
2949         Drop the legacy FeatureCounter class and use DiagnosticLoggingClient
2950         instead.
2951
2952         * Shared/WebPreferencesDefinitions.h:
2953         * UIProcess/API/Cocoa/WKWebView.mm:
2954         (-[WKWebView initWithFrame:configuration:]):
2955         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2956         (-[WKWebViewConfiguration init]):
2957         (-[WKWebViewConfiguration copyWithZone:]):
2958         (-[WKWebViewConfiguration _featureCounterEnabled]):
2959         (-[WKWebViewConfiguration _setFeatureCounterEnabled:]):
2960         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2961         * WebProcess/WebPage/WebPage.cpp:
2962         (WebKit::WebPage::updatePreferences):
2963         * WebProcess/WebPage/ios/WebPageIOS.mm:
2964         (WebKit::WebPage::willStartUserTriggeredZooming):
2965
2966 2015-01-22  Beth Dakin  <bdakin@apple.com>
2967
2968         ibtoold crash below -[WebView close]
2969         https://bugs.webkit.org/show_bug.cgi?id=140782
2970         -and corresponding-
2971         rdar://problem/19558472
2972
2973         Reviewed by Tim Horton.
2974
2975         Retain the NSImmediateActionGestureRecognizer. This should not be necessary, but 
2976         it is because interface builder can mess with our views.
2977         * UIProcess/mac/WKImmediateActionController.h:
2978         * UIProcess/mac/WKImmediateActionController.mm:
2979         (-[WKImmediateActionController willDestroyView:]):
2980         (-[WKImmediateActionController _cancelImmediateAction]):
2981         (-[WKImmediateActionController _cancelImmediateActionIfNeeded]):
2982         (-[WKImmediateActionController _updateImmediateActionItem]):
2983
2984 2015-01-22  David Kilzer  <ddkilzer@apple.com>
2985
2986         [iOS] Fix iphoneos SDK builds for ios-ews queue
2987         <http://webkit.org/b/140748>
2988
2989         Reviewed by Daniel Bates.
2990
2991         * Platform/spi/ios/BKSProcessAssertionSPI.h: Add -invalidate
2992         definition.  Sort @property to the top of BKSProcessAssertion.
2993
2994 2015-01-22  Shivakumar JM  <shiva.jm@samsung.com>
2995
2996         Fix build warning in WebKit2/UIProcess module
2997         https://bugs.webkit.org/show_bug.cgi?id=140758
2998
2999         Reviewed by Csaba Osztrogonác.
3000
3001         Fix build warnings by using UNUSED_PARAM macro
3002
3003         * UIProcess/API/C/WKPageGroup.cpp:
3004         (WKPageGroupAddUserContentFilter):
3005         (WKPageGroupRemoveAllUserContentFilters):
3006
3007 2014-11-06  Carlos Garcia Campos  <cgarcia@igalia.com>
3008
3009         [GTK] Use API::ContextMenuClient and API::InjectedBundle::PageContextMenuClient classes
3010         https://bugs.webkit.org/show_bug.cgi?id=138467
3011
3012         Reviewed by Gustavo Noronha Silva.
3013
3014         * UIProcess/API/gtk/WebKitContextMenu.cpp:
3015         (webkitContextMenuPopulate): Add a version that receives a Vector<WebContextMenuItemData>&.
3016         (webkitContextMenuCreate): Change it to receive a const
3017         Vector<WebContextMenuItemData>& instead of a API::Array* and also
3018         add a another version that receives const Vector<ContextMenuItem>&.
3019         * UIProcess/API/gtk/WebKitContextMenuClient.cpp:
3020         (attachContextMenuClientToView): Use a class derived from
3021         API::ContextMenuClient to implement the context menu client.
3022         (getContextMenuFromProposedMenu): Deleted.
3023         * UIProcess/API/gtk/WebKitContextMenuItem.cpp:
3024         (webkitContextMenuItemCreate): Change it to receive a const
3025         WebContextMenuItemData& and added another version that receives a
3026         const ContextMenuItem&.
3027         * UIProcess/API/gtk/WebKitContextMenuItemPrivate.h:
3028         * UIProcess/API/gtk/WebKitContextMenuPrivate.h:
3029         * UIProcess/API/gtk/WebKitWebView.cpp:
3030         (webkitWebViewPopulateContextMenu): Remove the creation of a
3031         WebHitTestResult::Data, since it receives it now as parameter.
3032         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
3033         * WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.cpp:
3034         (webkitWebHitTestResultCreate): Change it to receive a const
3035         HitTestResult& instead of const InjectedBundleHitTestResult&.
3036         * WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResultPrivate.h:
3037         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
3038         (webkitWebPageCreate): Use a class derived from
3039         API::InjectedBundle::PageContextMenuClient to implement the
3040         context menu client.
3041         (getContextMenuFromDefaultMenu): Deleted.
3042
3043 2015-01-22  Carlos Garcia Campos  <cgarcia@igalia.com>
3044
3045         Unreviewed. Try to fix Debug build after r178889.
3046
3047         * UIProcess/API/C/WKPage.cpp: Include Logging.h.
3048
3049 2015-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3050
3051         Add API::ContextMenuClient and API::InjectedBundle::PageContextMenuClient classes
3052         https://bugs.webkit.org/show_bug.cgi?id=138466
3053
3054         Reviewed by Anders Carlsson.
3055
3056         Move ContextMenuClient to use API classes in both UI and Injected
3057         Bundle APIs.
3058
3059         * CMakeLists.txt: Remove WebPageContextMenuClient.cpp.
3060         * UIProcess/API/APIContextMenuClient.h: Renamed from Source/WebKit2/UIProcess/WebPageContextMenuClient.h.
3061         (API::ContextMenuClient::~ContextMenuClient):
3062         (API::ContextMenuClient::getContextMenuFromProposedMenu):
3063         (API::ContextMenuClient::customContextMenuItemSelected):
3064         (API::ContextMenuClient::contextMenuDismissed):
3065         (API::ContextMenuClient::showContextMenu):
3066         (API::ContextMenuClient::hideContextMenu):
3067         * UIProcess/API/C/WKPage.cpp:
3068         (WKPageSetPageContextMenuClient):
3069         * UIProcess/WebPageContextMenuClient.cpp: Removed.
3070         * UIProcess/WebPageProxy.cpp:
3071         (WebKit::WebPageProxy::WebPageProxy):
3072         (WebKit::WebPageProxy::setContextMenuClient):
3073         (WebKit::WebPageProxy::close):
3074         (WebKit::WebPageProxy::internalShowContextMenu):
3075         (WebKit::WebPageProxy::contextMenuItemSelected):
3076         (WebKit::WebPageProxy::initializeContextMenuClient): Deleted.
3077         * UIProcess/WebPageProxy.h:
3078         * WebKit2.xcodeproj/project.pbxproj: Remove deleted files and add
3079         new files to compilation.
3080         * WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h.
3081         (API::InjectedBundle::PageContextMenuClient::~PageContextMenuClient):
3082         (API::InjectedBundle::PageContextMenuClient::getCustomMenuFromDefaultItems):
3083         (API::InjectedBundle::PageContextMenuClient::prepareForActionMenu):
3084         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3085         (WKBundlePageSetContextMenuClient):
3086         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
3087         (WebKit::InjectedBundlePageContextMenuClient::InjectedBundlePageContextMenuClient):
3088         (WebKit::InjectedBundlePageContextMenuClient::getCustomMenuFromDefaultItems):
3089         (WebKit::InjectedBundlePageContextMenuClient::prepareForActionMenu):
3090         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h:
3091         * WebProcess/WebPage/WebContextMenu.cpp:
3092         (WebKit::WebContextMenu::menuItemsWithUserData):
3093         * WebProcess/WebPage/WebPage.cpp:
3094         (WebKit::WebPage::WebPage):
3095         (WebKit::WebPage::setInjectedBundleContextMenuClient):
3096         (WebKit::WebPage::close):
3097         (WebKit::WebPage::initializeInjectedBundleContextMenuClient): Deleted.
3098         * WebProcess/WebPage/WebPage.h:
3099         (WebKit::WebPage::injectedBundleContextMenuClient):
3100         * WebProcess/WebPage/mac/WebPageMac.mm:
3101         (WebKit::WebPage::performActionMenuHitTestAtLocation):
3102
3103 2015-01-20  Jon Honeycutt  <jhoneycutt@apple.com>
3104
3105         [iOS] WebKitTestRunner: Tests fail due to incorrect web view size
3106
3107         <https://bugs.webkit.org/show_bug.cgi?id=139736>
3108         <rdar://problem/19282196>
3109
3110         This starts happening after we fail to reset the test controller to
3111         consistent values in TestInvocation::invoke(). When we terminate the
3112         web process and relaunch it, the new WebPage object created in the web
3113         process is using the default ViewportConfiguration with dimensions of
3114         1024x768.
3115
3116         The PageClient on iOS currently notifies the WKWebView and the
3117         WKContentView when the web process is relaunched. This patch extends
3118         that to also notify the WKView.
3119
3120         Reviewed by Benjamin Poulain.
3121
3122         * UIProcess/API/Cocoa/WKViewPrivate.h:
3123         Declare -_didRelaunchProcess.
3124
3125         * UIProcess/API/ios/WKViewIOS.mm:
3126         (-[WKView _commonInitializationWithContextRef:pageGroupRef:relatedToPage:]):
3127         Call the new method that accepts a WKView.
3128         (-[WKView _didRelaunchProcess]):
3129         Call -_frameOrBoundsChanged to update the web process's size to the
3130         size of the WKView.
3131
3132         * UIProcess/ios/PageClientImplIOS.h:
3133         Add a constructor that takes a WKView, and add a member var to hold it.
3134
3135         * UIProcess/ios/PageClientImplIOS.mm:
3136         (WebKit::PageClientImpl::PageClientImpl):
3137         Implement the constructor that takes a WKView.
3138         (WebKit::PageClientImpl::didRelaunchProcess):
3139         Tell the WKView that the web process relaunched.
3140
3141         * UIProcess/ios/WKContentView.h:
3142         Declare an initializer that takes a WKView.
3143
3144         * UIProcess/ios/WKContentView.mm:
3145         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
3146         Split out from -[WKContentView initWithFrame:processPool:configuration:webView:].
3147         (-[WKContentView initWithFrame:processPool:configuration:webView:]):
3148         Perform some initialization, including creating the PageClient, and
3149         call the common initializer.
3150         (-[WKContentView initWithFrame:processPool:configuration:wkView:]):
3151         Ditto.
3152
3153 2015-01-21  Sam Weinig  <sam@webkit.org>
3154
3155         Add WKPageGroupRef SPI for user content filters
3156         https://bugs.webkit.org/show_bug.cgi?id=140728
3157
3158         Reviewed by Anders Carlsson.
3159
3160         While Safari is transitioning to WKUserContentController, it is useful
3161         for them to have access to have access to content filters on the page group
3162         where they currently have user content related functionality.
3163
3164         * Shared/WebPageGroupData.cpp:
3165         (WebKit::WebPageGroupData::encode):
3166         (WebKit::WebPageGroupData::decode):
3167         * Shared/WebPageGroupData.h:
3168         * UIProcess/API/C/WKPageGroup.cpp:
3169         (WKPageGroupAddUserContentFilter):
3170         (WKPageGroupRemoveAllUserContentFilters):
3171         * UIProcess/API/C/WKPageGroup.h:
3172         * UIProcess/WebPageGroup.cpp:
3173         (WebKit::WebPageGroup::addUserContentFilter):
3174         (WebKit::WebPageGroup::removeAllUserContentFilters):
3175         * UIProcess/WebPageGroup.h:
3176         * WebProcess/WebPage/WebPageGroupProxy.cpp:
3177         (WebKit::WebPageGroupProxy::WebPageGroupProxy):
3178         (WebKit::WebPageGroupProxy::addUserContentFilter):
3179         (WebKit::WebPageGroupProxy::removeAllUserContentFilters):
3180         * WebProcess/WebPage/WebPageGroupProxy.h:
3181         * WebProcess/WebPage/WebPageGroupProxy.messages.in:
3182
3183 2015-01-21  Beth Dakin  <bdakin@apple.com>
3184
3185         Crash in QuickLook preview delegate method
3186         https://bugs.webkit.org/show_bug.cgi?id=140740
3187         -and corresponding-
3188         rdar://problem/19540806
3189
3190         Reviewed by Tim Horton.
3191
3192         Clear out the delegate.
3193         * UIProcess/mac/WKImmediateActionController.mm:
3194         (-[WKImmediateActionController willDestroyView:]):
3195
3196 2015-01-21  Zan Dobersek  <zdobersek@igalia.com>
3197
3198         AsyncRequestImpl casting in AsyncRequest::completeRequest() is incorrect
3199         https://bugs.webkit.org/show_bug.cgi?id=139724
3200
3201         Reviewed by Darin Adler.
3202
3203         AsyncRequestImpl casting in AsyncRequest::completeRequest() relies on
3204         the parameter pack to properly determine the type of the AsyncRequestImpl
3205         object. The casting result can be incorrect when an argument is passed
3206         by reference while the original object was constructed with a callback
3207         that expects an argument that's passed by value.
3208
3209         To avoid this the AsyncRequestImpl template is now instantiated with
3210         raw types, with callback parameters remaining raw types in case
3211         of being integral (enforcing passing-by-value these arguments when
3212         dispatching), and const references being used otherwise (enforcing
3213         passing-by-reference).
3214
3215         This enables casting AsyncRequest objects to the correct AsyncRequestImpl<>
3216         by running the parameter pack through std::decay.
3217
3218         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
3219         (WebKit::UniqueIDBDatabase::putRecord):
3220         (WebKit::UniqueIDBDatabase::getRecord):
3221         (WebKit::UniqueIDBDatabase::openCursor):
3222         (WebKit::UniqueIDBDatabase::cursorAdvance):
3223         (WebKit::UniqueIDBDatabase::cursorIterate):
3224         (WebKit::UniqueIDBDatabase::count):
3225         (WebKit::UniqueIDBDatabase::deleteRange):
3226         * Shared/AsyncRequest.h:
3227         (WebKit::AsyncRequest::completeRequest):
3228         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
3229         (WebKit::WebIDBServerConnection::getOrEstablishIDBDatabaseMetadata):
3230         (WebKit::WebIDBServerConnection::get):
3231
3232 2015-01-21  Chris Dumez  <cdumez@apple.com>
3233
3234         [WK2] Stop using WKDiagnosticLoggingResultType.h C API header in Cocoa API
3235         https://bugs.webkit.org/show_bug.cgi?id=140655
3236
3237         Reviewed by Anders Carlsson.
3238
3239         Stop using WKDiagnosticLoggingResultType.h C API header in Cocoa API.
3240         Instead, introduce a new _WKDiagnosticLoggingResultType enum in
3241         _WKDiagnosticLoggingDelegate.h.
3242
3243         A few defines mapping WKDiagnosticLoggingResultType enum and its values
3244         to the new _WKDiagnosticLoggingResultType are temporarily added until
3245         the client-side is transitioned.
3246
3247         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
3248         * UIProcess/Cocoa/DiagnosticLoggingClient.mm:
3249         (WebKit::toWKDiagnosticLoggingResultType):
3250         (WebKit::DiagnosticLoggingClient::logDiagnosticMessageWithResult):
3251
3252 2015-01-21  Zan Dobersek  <zdobersek@igalia.com>
3253
3254         [WK2] Use C++ lambdas in ProcessLauncher class
3255         https://bugs.webkit.org/show_bug.cgi?id=138186
3256
3257         Reviewed by Darin Adler.
3258
3259         Replace uses of WTF::bind() in the ProcessLauncher class with C++ lambdas.
3260
3261         * UIProcess/Launcher/efl/ProcessLauncherEfl.cpp:
3262         (WebKit::ProcessLauncher::launchProcess):
3263         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
3264         (WebKit::ProcessLauncher::launchProcess):
3265         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3266         (WebKit::connectToService):
3267         (WebKit::tryPreexistingProcess):
3268         (WebKit::createProcess):
3269
3270 2015-01-21  Zan Dobersek  <zdobersek@igalia.com>
3271
3272         Clean up ViewUpdateDispatcher
3273         https://bugs.webkit.org/show_bug.cgi?id=140619
3274
3275         Reviewed by Darin Adler.
3276
3277         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
3278         (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate):
3279         Replace WTF::bind() with a C++ lambda.
3280         (WebKit::ViewUpdateDispatcher::dispatchVisibleContentRectUpdate):
3281         Use WTF::move() to move the HashMap member into the local variable.
3282
3283 2015-01-21  Csaba Osztrogonác  <ossy@webkit.org>
3284
3285         Remove ENABLE(INSPECTOR) ifdef guards
3286         https://bugs.webkit.org/show_bug.cgi?id=140668
3287
3288         Reviewed by Darin Adler.
3289
3290         * Configurations/FeatureDefines.xcconfig:
3291         * Shared/API/c/WKSharedAPICast.h:
3292         (WebKit::toAPI):
3293         (WebKit::toImpl):
3294         * Shared/WebCoreArgumentCoders.cpp:
3295         (IPC::ArgumentCoder<ResourceRequest>::encode):
3296         (IPC::ArgumentCoder<ResourceRequest>::decode):
3297         * UIProcess/API/C/WKInspector.cpp:
3298         (WKInspectorGetTypeID):
3299         (WKInspectorGetPage):
3300         (WKInspectorIsConnected):
3301         (WKInspectorIsVisible):
3302         (WKInspectorIsFront):
3303         (WKInspectorConnect):
3304         (WKInspectorShow):
3305         (WKInspectorHide):
3306         (WKInspectorClose):
3307         (WKInspectorShowConsole):
3308         (WKInspectorShowResources):
3309         (WKInspectorShowMainResourceForFrame):
3310         (WKInspectorIsAttached):
3311         (WKInspectorAttach):
3312         (WKInspectorDetach):
3313         (WKInspectorIsProfilingPage):
3314         (WKInspectorTogglePageProfiling):
3315         * UIProcess/API/C/WKPage.cpp:
3316         (WKPageGetInspector):
3317         * UIProcess/API/efl/ewk_view.cpp:
3318         (ewk_view_inspector_show):
3319         (ewk_view_inspector_close):
3320         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
3321         (TEST_F):
3322         * UIProcess/PageClient.h:
3323         * UIProcess/WebInspectorProxy.cpp:
3324         * UIProcess/WebInspectorProxy.h:
3325         * UIProcess/WebInspectorProxy.messages.in:
3326         * UIProcess/WebPageProxy.cpp:
3327         (WebKit::WebPageProxy::WebPageProxy):
3328         (WebKit::WebPageProxy::reattachToWebProcess):
3329         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
3330         (WebKit::WebPageProxy::resetState):
3331         * UIProcess/WebPageProxy.h:
3332         * UIProcess/WebPageProxy.messages.in:
3333         * UIProcess/WebProcessProxy.cpp:
3334         (WebKit::WebProcessProxy::getLaunchOptions):
3335         * UIProcess/efl/WebInspectorProxyEfl.cpp:
3336         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3337         * UIProcess/ios/PageClientImplIOS.h:
3338         * UIProcess/ios/PageClientImplIOS.mm:
3339         (WebKit::PageClientImpl::disableInspectorNodeSearch):
3340         * UIProcess/ios/WebInspectorProxyIOS.mm:
3341         * UIProcess/ios/WebPageProxyIOS.mm:
3342         (WebKit::WebPageProxy::disableInspectorNodeSearch):
3343         * UIProcess/mac/WebInspectorProxyMac.mm:
3344         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
3345         (WKBundleInspectorGetTypeID):
3346         (WKBundleInspectorShow):
3347         (WKBundleInspectorClose):
3348         (WKBundleInspectorEvaluateScriptForTest):
3349         (WKBundleInspectorSetPageProfilingEnabled):
3350         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3351         (WKBundlePageGetInspector):
3352         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3353         * WebProcess/WebCoreSupport/WebInspectorClient.h:
3354         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.h:
3355         * WebProcess/WebPage/WebInspector.cpp:
3356         * WebProcess/WebPage/WebInspector.h:
3357         * WebProcess/WebPage/WebInspector.messages.in:
3358         * WebProcess/WebPage/WebInspectorUI.cpp:
3359         * WebProcess/WebPage/WebInspectorUI.h:
3360         * WebProcess/WebPage/WebInspectorUI.messages.in:
3361         * WebProcess/WebPage/WebPage.cpp:
3362         (WebKit::WebPage::WebPage):
3363         (WebKit::WebPage::~WebPage):
3364         (WebKit::WebPage::close):
3365         (WebKit::WebPage::inspectorUI):
3366         (WebKit::WebPage::didReceiveMessage):
3367         * WebProcess/WebPage/WebPage.h:
3368         * WebProcess/WebPage/efl/WebInspectorEfl.cpp:
3369         * WebProcess/WebPage/efl/WebInspectorUIEfl.cpp:
3370         * WebProcess/WebPage/gtk/WebInspectorGtk.cpp:
3371         * WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp:
3372         * WebProcess/WebPage/ios/WebPageIOS.mm:
3373         (WebKit::WebPage::disableInspectorNodeSearch):
3374         * WebProcess/WebPage/mac/WebInspectorMac.mm:
3375         * WebProcess/WebPage/mac/WebInspectorUIMac.mm:
3376         * config.h:
3377
3378 2015-01-20  Martin Hock  <mhock@apple.com>
3379
3380         [iOS][WK2] Redraw find-in-page indicator on rotation
3381         https://bugs.webkit.org/show_bug.cgi?id=140632
3382         <rdar://problem/18858394>
3383
3384         Reviewed by Tim Horton.
3385
3386         * WebProcess/WebPage/FindController.cpp:
3387         (WebKit::FindController::redraw): Add method to redraw find indicator (only used by iOS).
3388         * WebProcess/WebPage/FindController.h:
3389         * WebProcess/WebPage/WebPage.cpp:
3390         (WebKit::WebPage::mainFrameDidLayout):
3391         * WebProcess/WebPage/ios/FindControllerIOS.mm:
3392         (WebKit::FindController::updateFindIndicator): Redraw should not trigger zoom.
3393
3394 2015-01-20  David Kilzer  <ddkilzer@apple.com>
3395
3396         Switch to comparing PLATFORM_NAME in terms of macosx
3397         <http://webkit.org/b/139516>
3398
3399         Reviewed by Timothy Hatcher.
3400
3401         * WebKit2.xcodeproj/project.pbxproj:
3402         * mac/rewrite-availability-macros.sh: Remove the else block that
3403         checked for an unknown PLATFORM_NAME.
3404
3405 2015-01-19  Simon Fraser  <simon.fraser@apple.com>
3406
3407         Add a way to collect scrolling performance data (viewport tile coverage) with UI-side compositing
3408         https://bugs.webkit.org/show_bug.cgi?id=140474
3409
3410         Reviewed by Tim Horton.
3411         
3412         Add a private method to enable scrolling data collection to WKWebView. When enabled, create
3413         a RemoteLayerTreeScrollingPerformanceData object that collects "blank pixel" data on
3414         every layer tree commit and scroll, and stores them in a vector. A second SPI call
3415         allows retrieval of an NSArray of this data.
3416         
3417         To allow RemoteLayerTreeScrollingPerformanceData to find the correct layer which
3418         contains the main tile grid, we set a layer name on the appropriate layer (even
3419         in release builds).
3420
3421         * UIProcess/API/Cocoa/WKWebView.mm:
3422         (-[WKWebView visibleRectInScreenCoordinates]):
3423         (-[WKWebView _didCommitLayerTree:]):
3424         (-[WKWebView scrollViewDidScroll:]):
3425         (-[WKWebView _setScrollPerformanceDataCollectionEnabled:]):
3426         (-[WKWebView _scrollPerformanceDataCollectionEnabled]):
3427         (-[WKWebView _scrollPerformanceData]):
3428         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3429         * UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.h: Added.
3430         (WebKit::RemoteLayerTreeScrollingPerformanceData::BlankPixelCount::BlankPixelCount):
3431         * UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.mm: Added.
3432         (WebKit::RemoteLayerTreeScrollingPerformanceData::RemoteLayerTreeScrollingPerformanceData):
3433         (WebKit::RemoteLayerTreeScrollingPerformanceData::~RemoteLayerTreeScrollingPerformanceData):
3434         (WebKit::RemoteLayerTreeScrollingPerformanceData::didCommitLayerTree):
3435         (WebKit::RemoteLayerTreeScrollingPerformanceData::didScroll):
3436         (WebKit::RemoteLayerTreeScrollingPerformanceData::BlankPixelCount::canCoalesce):
3437         (WebKit::RemoteLayerTreeScrollingPerformanceData::appendBlankPixelCount):
3438         (WebKit::RemoteLayerTreeScrollingPerformanceData::data):
3439         (WebKit::findTileGridContainerLayer):
3440         (WebKit::RemoteLayerTreeScrollingPerformanceData::blankPixelCount):
3441         * UIProcess/WebPageProxy.cpp:
3442         (WebKit::WebPageProxy::WebPageProxy):
3443         (WebKit::WebPageProxy::setScrollPerformanceDataCollectionEnabled):
3444         * UIProcess/WebPageProxy.h:
3445         (WebKit::WebPageProxy::scrollPerformanceDataCollectionEnabled):
3446         (WebKit::WebPageProxy::scrollingPerformanceData):
3447         * WebKit2.xcodeproj/project.pbxproj:
3448
3449 2015-01-19  Dean Jackson  <dino@apple.com>
3450
3451         Support "plus-darker" in mix-blend mode
3452         https://bugs.webkit.org/show_bug.cgi?id=140646
3453         <rdar://problem/19523370>
3454
3455         Reviewed by Simon Fraser.
3456
3457         Output the appropriate blending type when logging.
3458
3459         * Shared/mac/RemoteLayerTreeTransaction.mm:
3460         (WebKit::RemoteLayerTreeTextStream::operator<<):
3461
3462 2015-01-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3463
3464         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.7.4 release.
3465
3466         * gtk/NEWS: Add release notes for 2.7.4.
3467
3468 2015-01-20  Tomas Popela  <tpopela@redhat.com>
3469
3470         [GTK] Add API to set the web view editable into WebKit2 GTK+ API
3471         https://bugs.webkit.org/show_bug.cgi?id=139443
3472
3473         Reviewed by Carlos Garcia Campos.
3474
3475         Provide a way to set the web view editable, without accessing the DOM
3476         and setting the contenteditable attribute to elements.
3477
3478         * UIProcess/API/gtk/WebKitWebView.cpp:
3479         (webkitWebViewSetProperty):
3480         (webkitWebViewGetProperty):
3481         (webkit_web_view_class_init):
3482         (webkit_web_view_is_editable):
3483         (webkit_web_view_set_editable):
3484         * UIProcess/API/gtk/WebKitWebView.h:
3485         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
3486
3487 2015-01-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3488
3489         [GTK] Add an option to create WebKitWebView snapshots with transparent background
3490         https://bugs.webkit.org/show_bug.cgi?id=140617
3491
3492         Reviewed by Gustavo Noronha Silva.
3493
3494         Add WEBKIT_SNAPSHOT_OPTIONS_TRANSPARENT_BACKGROUND flag to not
3495         fill with white the background before rendering the snapshot.
3496
3497         * UIProcess/API/gtk/WebKitWebView.cpp:
3498         (webkit_web_view_get_snapshot): Pass a TransparentBackground
3499         boolean argument to the WEbProcess.
3500         * UIProcess/API/gtk/WebKitWebView.h:
3501         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
3502         (webkitWebPageDidReceiveMessage): Set the FrameView background as
3503         transparent when TransparentBackground option is True before
3504         rendering the snapshot.
3505
3506 2015-01-19  Carlos Garcia Campos  <cgarcia@igalia.com>
3507
3508         [GTK] Add API to change the WebKitWebView background color
3509         https://bugs.webkit.org/show_bug.cgi?id=140610
3510
3511         Reviewed by Gustavo Noronha Silva.
3512
3513         When a color different than the default one (opaque white) is
3514         used, the SetDrawsBackground message is sent to the WebProcess with
3515         a False value to indicate WebCore to not render backgrounds. The
3516         background color passed is saved in the WebPageProxy and used by
3517         the backing store to fill the background before the actual
3518         contents are rendered in the WebView.
3519
3520         * UIProcess/API/gtk/WebKitWebView.cpp:
3521         (webkit_web_view_set_background_color):
3522         (webkit_web_view_get_background_color):
3523         * UIProcess/API/gtk/WebKitWebView.h:
3524         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
3525         * UIProcess/WebPageProxy.cpp:
3526         (WebKit::WebPageProxy::WebPageProxy): Initialize m_backgroundColor member.
3527         * UIProcess/WebPageProxy.h:
3528         (WebKit::WebPageProxy::backgroundColor): Return m_backgroundColor.
3529         (WebKit::WebPageProxy::setBackgroundColor): Set m_backgroundColor.
3530         * UIProcess/cairo/BackingStoreCairo.cpp:
3531         (WebKit::BackingStore::incorporateUpdate): Fill the damage region
3532         with the WebPageProxy background color when the WebProcess is not
3533         rendering backgrounds. If the background color is not fully opaque
3534         we need to clear the region before filling it with the color.
3535
3536 2015-01-19  Myles C. Maxfield  <mmaxfield@apple.com>
3537
3538         [SVG -> OTF Converter] Flip the switch on
3539         https://bugs.webkit.org/show_bug.cgi?id=140592
3540
3541         Reviewed by Antti Koivisto.
3542
3543         * Configurations/FeatureDefines.xcconfig:
3544
3545 2015-01-19  Mark Rowe  <mrowe@apple.com>
3546
3547         <https://webkit.org/b/140504> REGRESSION (r178452): Visited link coloring only appears to work in the first web process
3548
3549         Roll out r178452 since it broke visited link coloring.
3550
3551         Reviewed by Anders Carlsson.
3552
3553         * UIProcess/VisitedLinkProvider.cpp:
3554         (WebKit::VisitedLinkProvider::~VisitedLinkProvider):
3555         (WebKit::VisitedLinkProvider::addProcess):
3556         (WebKit::VisitedLinkProvider::removeProcess):
3557         (WebKit::VisitedLinkProvider::removeAll):
3558         (WebKit::VisitedLinkProvider::webProcessWillOpenConnection):
3559         (WebKit::VisitedLinkProvider::webProcessDidCloseConnection):
3560         (WebKit::VisitedLinkProvider::pendingVisitedLinksTimerFired):
3561         (WebKit::VisitedLinkProvider::resizeTable):
3562         * UIProcess/VisitedLinkProvider.h:
3563         * UIProcess/WebPageProxy.cpp:
3564         (WebKit::WebPageProxy::WebPageProxy):
3565         (WebKit::WebPageProxy::processDidFinishLaunching):
3566         * UIProcess/WebProcessProxy.cpp:
3567         (WebKit::WebProcessProxy::disconnect):
3568         (WebKit::WebProcessProxy::addVisitedLinkProvider):
3569         (WebKit::WebProcessProxy::didDestroyVisitedLinkProvider):
3570         * UIProcess/WebProcessProxy.h:
3571
3572 2015-01-19  Sam Weinig  <sam@webkit.org>
3573
3574         Sprinkle some CTTE on API::PolicyClient and API::FormClient
3575         https://bugs.webkit.org/show_bug.cgi?id=140656
3576
3577         Reviewed by Tim Horton.
3578
3579         - Use references rather than pointers where possible.
3580         - Store and pass the listeners as Refs.
3581         - Make API::FormClient more like API::PolicyClient by making it the
3582           responsibility of the client implementation to call the default policy.
3583
3584         * UIProcess/API/APIFormClient.h:
3585         (API::FormClient::willSubmitForm):
3586         * UIProcess/API/APIPolicyClient.h:
3587         (API::PolicyClient::decidePolicyForNavigationAction):
3588         (API::PolicyClient::decidePolicyForNewWindowAction):
3589         (API::PolicyClient::decidePolicyForResponse):
3590         (API::PolicyClient::unableToImplementPolicy):
3591         * UIProcess/API/C/WKPage.cpp:
3592         (WKPageSetPagePolicyClient):
3593         * UIProcess/API/Cocoa/WKWebView.mm:
3594         (-[WKWebView _setFormDelegate:]):
3595         * UIProcess/API/gtk/WebKitPolicyClient.cpp:
3596         * UIProcess/Cocoa/NavigationState.h:
3597         * UIProcess/Cocoa/NavigationState.mm:
3598         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
3599         (WebKit::NavigationState::PolicyClient::decidePolicyForNewWindowAction):
3600         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
3601         * UIProcess/WebFormClient.cpp:
3602         (WebKit::WebFormClient::willSubmitForm):
3603         * UIProcess/WebFormClient.h:
3604         * UIProcess/WebFrameProxy.cpp:
3605         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
3606         (WebKit::WebFrameProxy::setUpFormSubmissionListenerProxy):
3607         * UIProcess/WebFrameProxy.h:
3608         * UIProcess/WebPageProxy.cpp:
3609         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3610         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
3611         (WebKit::WebPageProxy::decidePolicyForResponse):
3612         (WebKit::WebPageProxy::unableToImplementPolicy):
3613         (WebKit::WebPageProxy::willSubmitForm):
3614
3615 2015-01-18  Sam Weinig  <sam@webkit.org>
3616
3617         Merge API::ProcessPoolConfiguration and _WKProcessPoolConfiguration
3618         https://bugs.webkit.org/show_bug.cgi?id=140601
3619
3620         Reviewed by Anders Carlsson.
3621
3622         - Converts _WKProcessPoolConfiguration to be backed via API::ProcessPoolConfiguration.
3623         - Expands API::ProcessPoolConfiguration to add all the parameters necessary to fully
3624           initialize a WebProcessPool. This allows -[WKProcessPool _initWithConfiguration:] to
3625           be a simple pass through initializer, which in turn allows us to consider WebProcessPools
3626           created on the C++ and Objective-C sides as equivalent.
3627         - Makes WebProcessPool own the reference to the API::ProcessPoolConfiguration (rather than
3628           the WKProcessPool wrapper).
3629
3630         * Shared/Cocoa/APIObject.mm:
3631         (API::Object::newObject):
3632         Create the API::ProcessPoolConfigurations using [_WKProcessPoolConfiguration alloc] as its 
3633         storage..
3634
3635         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3636         (API::ProcessPoolConfiguration::create):
3637         (API::ProcessPoolConfiguration::createWithLegacyOptions):
3638         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
3639         (API::ProcessPoolConfiguration::~ProcessPoolConfiguration):
3640         (API::ProcessPoolConfiguration::copy):
3641         (API::ProcessPoolConfiguration::webProcessPoolConfiguration): Deleted.
3642         * UIProcess/API/APIProcessPoolConfiguration.h:
3643         Add the remaining initialization parameters and add a convenience create function
3644         for configuring legacy WebProcessPools (for use by the C-SPI).
3645
3646         * UIProcess/API/APIWebsiteDataStore.cpp:
3647         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
3648         * UIProcess/API/APIWebsiteDataStore.h:
3649         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
3650         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
3651         (API::WebsiteDataStore::defaultDataStoreConfiguration):
3652         Expose helper for getting the website data directories for use in the ProcessPoolConfiguration.
3653
3654         * UIProcess/API/C/WKContext.cpp:
3655         (WKContextCreate):
3656         (WKContextCreateWithInjectedBundlePath):
3657         (WKContextCreateWithConfiguration):
3658         Use ProcessPoolConfiguration::createWithLegacyOptions() to keep backwards compatibility.
3659
3660         * UIProcess/API/C/WKContextConfigurationRef.cpp:
3661         (WKContextConfigurationCreate):
3662         Update for ProcessPoolConfiguration::create() returning a Ref. Note, this function
3663         was not changed to call ProcessPoolConfiguration::createWithLegacyOptions() since
3664         it has not been around long enough to warrant it.
3665
3666         * UIProcess/API/Cocoa/WKProcessGroup.mm:
3667         (-[WKProcessGroup initWithInjectedBundleURL:]):
3668         Use ProcessPoolConfiguration::createWithLegacyOptions() to keep backwards compatibility.
3669
3670         * UIProcess/API/Cocoa/WKProcessPool.mm:
3671         (-[WKProcessPool description]):
3672         Change to pull the configuration from the underlying API::Object.
3673
3674         (-[WKProcessPool _configuration]):
3675         Change to pull the configuration from the underlying API::Object and call the new
3676         copy() helper on it.
3677         
3678         (-[WKProcessPool _initWithConfiguration:]):
3679         Convert to be a simple pass through to API::Object::constructInWrapper.
3680
3681         (websiteDataDirectoryURL): Deleted.
3682         Moved to APIWebsiteDataStore.h
3683
3684         * UIProcess/API/Cocoa/WKProcessPoolInternal.h:
3685         Removes the _WKProcessPoolConfiguration member, now that it is stored on the WebProcessPool.
3686         
3687         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3688         (-[_WKProcessPoolConfiguration init]):
3689         (-[_WKProcessPoolConfiguration dealloc]):
3690         Added to support API::Object bridging.
3691
3692         (-[_WKProcessPoolConfiguration injectedBundleURL]):
3693         (-[_WKProcessPoolConfiguration setInjectedBundleURL:]):
3694         Convert to getting the URL from the underlying object. Moved the exception
3695         that used to be on creation of the WKProcessPool.
3696
3697         (-[_WKProcessPoolConfiguration maximumProcessCount]):
3698         (-[_WKProcessPoolConfiguration setMaximumProcessCount:]):
3699         Convert to getting the count from the underlying object.
3700
3701         (-[_WKProcessPoolConfiguration cachePartitionedURLSchemes]):
3702         Convert to constructing the NSArray on demand from the underlying Vector.
3703
3704         (-[_WKProcessPoolConfiguration setCachePartitionedURLSchemes:]):
3705         Converts the NSArray to a Vector rather than storing the array.
3706
3707         * UIProcess/API/Cocoa/_WKProcessPoolConfigurationInternal.h: Added.
3708         (API::wrapper):
3709         Add boilerplate for API::Object bridging.
3710
3711         * UIProcess/API/gtk/WebKitWebContext.cpp:
3712         (webkitWebContextConstructed):
3713         Update to use API::ProcessPoolConfiguration::createWithLegacyOptions() to keep backwards compatibility.
3714
3715
3716         * UIProcess/WebInspectorProxy.cpp:
3717         (WebKit::WebInspectorProxy::inspectorProcessPool):
3718         Update to call API::ProcessPoolConfiguration::createWithLegacyOptions().
3719
3720         * UIProcess/WebProcessPool.cpp:
3721         (WebKit::WebProcessPool::create):
3722         (WebKit::websiteDataStoreConfiguration):
3723         (WebKit::WebProcessPool::WebProcessPool):
3724         (WebKit::WebProcessPool::applyPlatformSpecificConfigurationDefaults): Deleted.
3725         This functionality was moved to the constructor of the API::ProcessPoolConfiguration.
3726         * UIProcess/WebProcessPool.h:
3727         Changed to take (and store) a API::ProcessPoolConfiguration rather than the WebProcessPoolConfiguration.
3728
3729         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3730         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
3731         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
3732         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
3733         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
3734         (WebKit::WebProcessPool::platformDefaultWebSQLDatabaseDirectory): Deleted.
3735         (WebKit::WebProcessPool::platformDefaultIndexedDBDatabaseDirectory): Deleted.
3736         (WebKit::WebProcessPool::platformDefaultLocalStorageDirectory): Deleted.
3737         (WebKit::WebProcessPool::platformDefaultMediaKeysStorageDirectory): Deleted.
3738         * UIProcess/efl/WebContextEfl.cpp:
3739         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
3740         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
3741         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
3742         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
3743         (WebKit::WebProcessPool::platformDefaultWebSQLDatabaseDirectory): Deleted.
3744         (WebKit::WebProcessPool::platformDefaultIndexedDBDatabaseDirectory): Deleted.
3745         (WebKit::WebProcessPool::platformDefaultLocalStorageDirectory): Deleted.
3746         (WebKit::WebProcessPool::platformDefaultMediaKeysStorageDirectory): Deleted.
3747         * UIProcess/gtk/WebProcessPoolGtk.cpp:
3748         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
3749         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
3750         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
3751         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
3752         (WebKit::WebProcessPool::platformDefaultWebSQLDatabaseDirectory): Deleted.
3753         (WebKit::WebProcessPool::platformDefaultIndexedDBDatabaseDirectory): Deleted.
3754         (WebKit::WebProcessPool::platformDefaultLocalStorageDirectory): Deleted.
3755         (WebKit::WebProcessPool::platformDefaultMediaKeysStorageDirectory): Deleted.
3756         Renamed to make it clear these were the legacy locations for these directories.
3757
3758         * WebKit2.xcodeproj/project.pbxproj:
3759         Added new files.
3760
3761 2015-01-19  Beth Dakin  <bdakin@apple.com>
3762
3763          Speculative build fix.
3764
3765         * UIProcess/API/mac/WKView.mm:
3766         (-[WKView initWithFrame:processPool:configuration:webView:]):
3767
3768 2015-01-19  Timothy Horton  <timothy_horton@apple.com>
3769
3770         Adjust naming of action menu SPI
3771         https://bugs.webkit.org/show_bug.cgi?id=140644
3772         <rdar://problem/19448129>
3773
3774         Reviewed by Brian Weinstein.
3775
3776         * UIProcess/API/mac/WKView.mm:
3777         (-[WKView initWithFrame:processPool:configuration:webView:]):
3778         * UIProcess/mac/WKActionMenuController.mm:
3779         (-[WKActionMenuController prepareForMenu:withEvent:]):
3780         (-[WKActionMenuController willOpenMenu:withEvent:]):
3781         (-[WKActionMenuController didCloseMenu:withEvent:]):
3782         (-[WKActionMenuController menuNeedsUpdate:]):
3783         (-[WKActionMenuController _updateActionMenuItems]):
3784
3785 2015-01-19  Zan Dobersek  <zdobersek@igalia.com>
3786
3787         [CoordinatedGraphics] Use C++ lambda instead of WTF::bind() in ThreadedCompositor::updateSceneState()
3788         https://bugs.webkit.org/show_bug.cgi?id=140613
3789
3790         Reviewed by Carlos Garcia Campos.
3791
3792         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3793         (WebKit::ThreadedCompositor::updateSceneState): Replace the use of WTF::bind() with a C++ lambda.
3794
3795 2015-01-19  Commit Queue  <commit-queue@webkit.org>
3796
3797         Unreviewed, rolling out r178653.
3798         https://bugs.webkit.org/show_bug.cgi?id=140634
3799
3800         Broke multiple SVG tests on Mountain Lion (Requested by ap on
3801         #webkit).
3802
3803         Reverted changeset:
3804
3805         "[SVG -> OTF Converter] Flip the switch on"
3806         https://bugs.webkit.org/show_bug.cgi?id=140592
3807         http://trac.webkit.org/changeset/178653
3808
3809 2015-01-19  Dean Jackson  <dino@apple.com>
3810
3811         Add "override" to fix the build with newer clangs.
3812
3813         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
3814         (WebKit::WebProcessProxy::transformHandlesToObjects):
3815         (WebKit::WebProcessProxy::transformObjectsToHandles):
3816         * UIProcess/WebProcessProxy.cpp:
3817         (WebKit::WebProcessProxy::transformObjectsToHandles):
3818         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
3819         * WebProcess/cocoa/WebProcessCocoa.mm:
3820         (WebKit::WebProcess::transformHandlesToObjects):
3821         (WebKit::WebProcess::transformObjectsToHandles):
3822
3823 2015-01-19  Myles C. Maxfield  <mmaxfield@apple.com>
3824
3825         [SVG -> OTF Converter] Flip the switch on
3826         https://bugs.webkit.org/show_bug.cgi?id=140592
3827
3828         Reviewed by Antti Koivisto.
3829
3830         * Configurations/FeatureDefines.xcconfig:
3831
3832 2015-01-18  Daniel Bates  <dabates@apple.com>
3833
3834         Attempt to fix the iOS build after <http://trac.webkit.org/changeset/178631>
3835         (https://bugs.webkit.org/show_bug.cgi?id=129441)
3836
3837         * UIProcess/WKInspectorHighlightView.mm:
3838         (-[WKInspectorHighlightView update:]): Substitute HighlightType::Node and
3839         HighlightType::Rects for HighlightTypeNode and HighlightTypeRects, respectively.
3840         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3841         (WebKit::WebInspectorClient::highlight): Pass lvalue reference to WebCore::Highlight
3842         instead of pointer in call to InspectorController::getHighlight().
3843
3844 2015-01-18  Sam Weinig  <sam@webkit.org>
3845
3846         Fix style issues and add availability macros missed in r178634
3847         https://bugs.webkit.org/show_bug.cgi?id=140597
3848
3849         Reviewed by Dan Bernstein.
3850
3851         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
3852         Add missing availability macros.
3853
3854         * UIProcess/API/Cocoa/_WKUserContentFilter.h:
3855         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
3856         (-[_WKUserContentFilter initWithName:serializedRules:]):
3857         (-[_WKUserContentFilter _initWithName:serializedRules:]): Deleted.
3858         Removed unnecessary leading underscore from init method.
3859
3860 2015-01-17  Sam Weinig  <sam@webkit.org>
3861
3862         Add initial experimental user content filtering API
3863         https://bugs.webkit.org/show_bug.cgi?id=140584
3864
3865         Reviewed by Benjamin Poulain.
3866
3867         Moves content filtering from being per-ProcessPool to per-UserContentController.
3868
3869         * Shared/API/APIObject.h:
3870         * Shared/API/c/WKBase.h:
3871         * UIProcess/API/APIUserContentFilter.cpp: Added.
3872         (API::UserContentFilter::UserContentFilter):
3873         (API::UserContentFilter::~UserContentFilter):
3874         * UIProcess/API/APIUserContentFilter.h: Added.
3875         * UIProcess/API/C/WKAPICast.h:
3876         * UIProcess/API/C/WKUserContentFilterRef.cpp: Added.
3877         (WKUserContentFilterGetTypeID):
3878         (WKUserContentFilterCreate):
3879         * UIProcess/API/C/WKUserContentFilterRef.h: Added.
3880         * UIProcess/API/C/WebKit2_C.h:
3881         * UIProcess/API/Cocoa/_WKUserContentFilter.h: Added.
3882         * UIProcess/API/Cocoa/_WKUserContentFilter.mm: Added.
3883         (WKUserContentControllerAddUserContentFilter):
3884         (WKUserContentControllerRemoveAllUserContentFilters):
3885         (-[_WKUserContentFilter _initWithName:ruleList:]):
3886         * UIProcess/API/Cocoa/_WKUserContentFilterInternal.h: Added.
3887         Add a basic UserContentFilter type and expose it via both the Objective-C API (as _WKUserContentFilter)
3888         and via the C SPI (as WKUserContentFilterRef).
3889
3890         * UIProcess/API/C/WKUserContentControllerRef.h:
3891         * UIProcess/API/C/WKUserContentControllerRef.cpp:
3892         Add C-SPI to set and remove WKUserContentFilterRefs.
3893
3894         * UIProcess/API/Cocoa/WKProcessPool.mm:
3895         (-[WKProcessPool _loadContentExtensionWithIdentifier:serializedRules:successCompletionHandler:errorCompletionHandler:]): Deleted.
3896         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3897         * UIProcess/WebProcessPool.cpp:
3898         (WebKit::WebProcessPool::processDidFinishLaunching):
3899         (WebKit::WebProcessPool::loadContentExtension): Deleted.
3900         * UIProcess/WebProcessPool.h:
3901         * WebProcess/WebProcess.cpp:
3902         (WebKit::WebProcess::loadContentExtension): Deleted.
3903         * WebProcess/WebProcess.h:
3904         * WebProcess/WebProcess.messages.in:
3905         Remove the old SPI for loading content filters that was per-ProcessPool. Content filters now follow
3906         the same pattern as UserScripts and UserStyleSheets as being per-UserContentController.
3907
3908         * UIProcess/API/Cocoa/WKUserContentController.mm:
3909         (-[WKUserContentController _addUserContentFilter:]):
3910         (-[WKUserContentController _removeAllUserContentFilters]):
3911         * UIProcess/API/Cocoa/WKUserContentControllerInternal.h:
3912         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h: Added.
3913         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
3914         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
3915         (WebKit::WebUserContentControllerProxy::addProcess):
3916         (WebKit::WebUserContentControllerProxy::addUserContentFilter):
3917         (WebKit::WebUserContentControllerProxy::removeAllUserContentFilters):
3918         * UIProcess/UserContent/WebUserContentControllerProxy.h:
3919         * WebProcess/UserContent/WebUserContentController.cpp:
3920         (WebKit::WebUserContentController::addUserContentFilters):
3921         (WebKit::WebUserContentController::removeAllUserContentFilters):
3922         * WebProcess/UserContent/WebUserContentController.h:
3923         * WebProcess/UserContent/WebUserContentController.messages.in:
3924         Pipe user content filters over to all the WebProcesses that the UserContentController is
3925         connected to.
3926
3927         * WebKit2.xcodeproj/project.pbxproj:
3928         Add new files.
3929
3930 2015-01-17  Chris Dumez  <cdumez@apple.com>
3931
3932         [WK2][iOS] Add Cocoa delegate for logging diagnostic messages
3933         https://bugs.webkit.org/show_bug.cgi?id=140410
3934
3935         Reviewed by Sam Weinig.
3936
3937         Add Cocoa delegate for logging diagnostic messages.
3938
3939         * UIProcess/API/APIDiagnosticLoggingClient.h: Copied from Source/WebKit2/UIProcess/WebPageDiagnosticLoggingClient.h.
3940         (API::DiagnosticLoggingClient::~DiagnosticLoggingClient):
3941         (API::DiagnosticLoggingClient::logDiagnosticMessage):
3942         (API::DiagnosticLoggingClient::logDiagnosticMessageWithResult):
3943         (API::DiagnosticLoggingClient::logDiagnosticMessageWithValue):
3944         * UIProcess/API/C/WKPage.cpp:
3945         (WKPageSetPageDiagnosticLoggingClient):
3946         * UIProcess/API/Cocoa/WKWebView.mm:
3947         (-[WKWebView initWithFrame:configuration:]):
3948         (-[WKWebView _diagnosticLoggingDelegate]):
3949         (-[WKWebView _setDiagnosticLoggingDelegate:]):
3950         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3951         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h: Copied from Source/WebKit2/UIProcess/WebPageDiagnosticLoggingClient.h.
3952         * UIProcess/Cocoa/DiagnosticLoggingClient.h: Copied from Source/WebKit2/UIProcess/WebPageDiagnosticLoggingClient.h.
3953         * UIProcess/Cocoa/DiagnosticLoggingClient.mm: Added.
3954         (WebKit::DiagnosticLoggingClient::DiagnosticLoggingClient):
3955         (WebKit::DiagnosticLoggingClient::delegate):
3956         (WebKit::DiagnosticLoggingClient::setDelegate):
3957         (WebKit::DiagnosticLoggingClient::logDiagnosticMessage):
3958         (WebKit::DiagnosticLoggingClient::logDiagnosticMessageWithResult):
3959         (WebKit::DiagnosticLoggingClient::logDiagnosticMessageWithValue):
3960         * UIProcess/WebPageDiagnosticLoggingClient.cpp:
3961         (WebKit::WebPageDiagnosticLoggingClient::WebPageDiagnosticLoggingClient):
3962         * UIProcess/WebPageDiagnosticLoggingClient.h:
3963         * UIProcess/WebPageProxy.cpp:
3964         (WebKit::WebPageProxy::WebPageProxy):
3965         (WebKit::WebPageProxy::setDiagnosticLoggingClient):
3966         (WebKit::WebPageProxy::close):
3967         (WebKit::WebPageProxy::logDiagnosticMessage):
3968         (WebKit::WebPageProxy::logDiagnosticMessageWithResult):
3969         (WebKit::WebPageProxy::logDiagnosticMessageWithValue):
3970         (WebKit::WebPageProxy::initializeDiagnosticLoggingClient): Deleted.
3971         * UIProcess/WebPageProxy.h:
3972         (WebKit::WebPageProxy::diagnosticLoggingClient):
3973         * WebKit2.xcodeproj/project.pbxproj:
3974
3975 2015-01-17  David Kilzer  <ddkilzer@apple.com>
3976
3977         REGRESSION (r178618): Change to WKWebViewConfiguration broke iOS build
3978         <https://bugs.webkit.org/show_bug.cgi?id=140559>
3979
3980         Blind fix to address the following build failure:
3981
3982             Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:79:7: error: interface type cannot be statically allocated
3983                 T m_value;
3984                   ^
3985                   *
3986             Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:94:55: note: in instantiation of template class 'LazyInitialized<WKWebViewContentProviderRegistry>' requested here
3987                 LazyInitialized<WKWebViewContentProviderRegistry> _contentProviderRegistry;
3988                                                                   ^
3989             Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:53:21: error: assigning to 'WKWebViewContentProviderRegistry *' from incompatible type 'RetainPtr<WKWebViewContentProviderRegistry *>'
3990                         m_value = f();
3991                                 ^ ~~~
3992             Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:222:37: note: in instantiation of function template specialization 'LazyInitialized<WKWebViewContentProviderRegistry>::get<(lambda at Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:222:41)>' requested here
3993                 return _contentProviderRegistry.get([] { return adoptNS([[WKWebViewContentProviderRegistry alloc] init]); });
3994                                                 ^
3995             Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:57:24: error: property 'get' not found on object of type 'WKWebViewContentProviderRegistry *'
3996                     return m_value.get();
3997                                    ^
3998             3 errors generated.
3999
4000         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: Change
4001         _contentProviderRegistry to be a LazyInitialized<RetainPtr<>> to
4002         match other instance variables.
4003
4004 2015-01-16  Sam Weinig  <sam@webkit.org>
4005
4006         Add a basic configuration object for WKView
4007         https://bugs.webkit.org/show_bug.cgi?id=140559
4008
4009         Reviewed by Anders Carlsson.
4010
4011         - Adds WKPageConfigurationRef (backed by API::PageConfiguration). WKWebView configuration
4012           is not yet bridged to this, but that will happen soon. For now, it has a few basic
4013           configuration options.
4014         - Adds WKUserContentControllerRef as C-SPI version of WKUserContentController.
4015         - Adds WKUserScriptRef as C-SPI version of WKUserScript.
4016
4017         * Shared/API/APIObject.h:
4018         * Shared/API/c/WKBase.h:
4019         * Shared/API/c/WKSharedAPICast.h:
4020         (WebKit::toWKUserScriptInjectionTime):
4021         * UIProcess/API/APIPageConfiguration.cpp: Added.
4022         (API::PageConfiguration::PageConfiguration):
4023         (API::PageConfiguration::~PageConfiguration):
4024         (API::PageConfiguration::processPool):
4025         (API::PageConfiguration::setProcessPool):
4026         (API::PageConfiguration::userContentController):
4027         (API::PageConfiguration::setUserContentController):
4028         (API::PageConfiguration::pageGroup):
4029         (API::PageConfiguration::setPageGroup):
4030         (API::PageConfiguration::preferences):
4031         (API::PageConfiguration::setPreferences):
4032         (API::PageConfiguration::relatedPage):
4033         (API::PageConfiguration::setRelatedPage):
4034         (API::PageConfiguration::webPageConfiguration):
4035         * UIProcess/API/APIPageConfiguration.h: Added.
4036         (API::PageConfiguration::create):
4037         * UIProcess/API/APIUserScript.cpp: Added.
4038         (API::generateIdentifier):
4039         (API::UserScript::generateUniqueURL):
4040         * UIProcess/API/APIUserScript.h:
4041         * UIProcess/API/C/WKAPICast.h:
4042         * UIProcess/API/C/WKPageConfigurationRef.cpp: Added.
4043         (WKPageConfigurationGetTypeID):
4044         (WKPageConfigurationCreate):
4045         (WKPageConfigurationGetContext):
4046         (WKPageConfigurationSetContext):
4047         (WKPageConfigurationGetPageGroup):
4048         (WKPageConfigurationSetPageGroup):
4049         (WKPageConfigurationGetUserContentController):
4050         (WKPageConfigurationSetUserContentController):
4051         (WKPageConfigurationGetPreferences):
4052         (WKPageConfigurationSetPreferences):
4053         (WKPageConfigurationGetRelatedPage):
4054         (WKPageConfigurationSetRelatedPage):
4055         * UIProcess/API/C/WKPageConfigurationRef.h: Added.
4056         * UIProcess/API/C/WKUserContentControllerRef.cpp: Added.
4057         (WKUserContentControllerGetTypeID):
4058         (WKUserContentControllerCreate):
4059         (WKUserContentControllerCopyUserScripts):
4060         (WKUserContentControllerAddUserScript):
4061         (WKUserContentControllerRemoveAllUserScripts):
4062         * UIProcess/API/C/WKUserContentControllerRef.h: Added.