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