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