19d38d0c6059b9729b1661d81afe0d1bc773088c
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-04-03  Chris Dumez  <cdumez@apple.com>
2
3         [WK2][iOS] We should prevent NetworkProcess suspension while it has pending SQL transactions
4         https://bugs.webkit.org/show_bug.cgi?id=143278
5         <rdar://problem/20180799>
6
7         Reviewed by Anders Carlsson.
8
9         Prevent NetworkProcess suspension while it has pending SQL transactions,
10         similarly to what we already did for WebProcesses. This patch moves the
11         WebSQLiteDatabaseTracker from WebProcess/ to Shared/ and make it usable
12         by the NetworkProcess class as well.
13
14         Whenever there are locked files to due SQL transactions, the
15         NetworkProcess will send an IPC message to the NetworkProcessProxy
16         which will hold a background process assertion until the NetworkProcess'
17         SQL transactions are complete. This way, it is no longer possible for
18         the NetworkProcess to get suspended while SQL transactions are running
19         and a database file is locked.
20
21         * NetworkProcess/NetworkProcess.cpp:
22         (WebKit::NetworkProcess::initializeNetworkProcess):
23         * NetworkProcess/NetworkProcess.h:
24         * Shared/WebSQLiteDatabaseTracker.cpp: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.cpp.
25         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
26         (WebKit::m_childProcessType):
27         (WebKit::WebSQLiteDatabaseTracker::willBeginFirstTransaction):
28         (WebKit::WebSQLiteDatabaseTracker::didFinishLastTransaction):
29         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
30         * Shared/WebSQLiteDatabaseTracker.h: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.h.
31         * UIProcess/Network/NetworkProcessProxy.cpp:
32         (WebKit::NetworkProcessProxy::didClose):
33         (WebKit::NetworkProcessProxy::setIsHoldingLockedFiles):
34         * UIProcess/Network/NetworkProcessProxy.h:
35         * UIProcess/Network/NetworkProcessProxy.messages.in:
36         * WebKit2.xcodeproj/project.pbxproj:
37         * WebProcess/WebProcess.cpp:
38         (WebKit::WebProcess::WebProcess):
39         (WebKit::WebProcess::initializeConnection):
40         * WebProcess/WebProcess.h:
41
42 2015-04-03  Antti Koivisto  <antti@apple.com>
43
44         Add non-counting Bloom filter implementation
45         https://bugs.webkit.org/show_bug.cgi?id=143366
46
47         Reviewed by Sam Weinig.
48
49         * NetworkProcess/cache/NetworkCacheStorage.h:
50
51 2015-04-03  Zan Dobersek  <zdobersek@igalia.com>
52
53         Fix the EFL and GTK build after r182243
54         https://bugs.webkit.org/show_bug.cgi?id=143361
55
56         Reviewed by Csaba Osztrogonác.
57
58         * PlatformGTK.cmake: Add a custom command that copies the
59         InspectorBackendCommands.js file into the proper directory
60         under DerivedSources/WebInspectorUI/.
61
62 2015-04-03  Philippe Normand  <pnormand@igalia.com>
63
64         Unreviewed, GTK build fix.
65
66         * UIProcess/API/gtk/WebKitContextMenuClient.cpp:
67         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
68         * UIProcess/gtk/WebContextMenuProxyGtk.h:
69
70 2015-04-02  Csaba Osztrogonác  <ossy@webkit.org>
71
72         Typo fix.
73
74         * PlatformGTK.cmake:
75
76 2015-04-02  Csaba Osztrogonác  <ossy@webkit.org>
77
78         URTBF after r182303, stub NativeContextMenuItem implemetations added for EFL and GTK.
79
80         * PlatformEfl.cmake:
81         * PlatformGTK.cmake:
82         * Shared/efl/NativeContextMenuItemEfl.cpp: Added.
83         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
84         * Shared/gtk/NativeContextMenuItemGtk.cpp: Added.
85         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
86
87 2015-04-02  Timothy Horton  <timothy_horton@apple.com>
88
89         De-PLATFORM(IOS)-ify LayerHostingContext::setFencePort
90         https://bugs.webkit.org/show_bug.cgi?id=143342
91
92         * Platform/mac/LayerHostingContext.h:
93         * Platform/mac/LayerHostingContext.mm:
94         Actually, not available on Mavericks. Fix the build.
95
96 2015-04-02  Brady Eidson  <beidson@apple.com>
97
98         Unreviewed: Re-applied change after rollout.
99
100         Expose the "Share" menu for text selections on platforms where it's available.
101         rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318
102
103         * Shared/API/c/WKContextMenuItemTypes.h: Add a constant for the Share menu.
104         * Shared/API/c/WKSharedAPICast.h:
105         (WebKit::toAPI):
106         (WebKit::toImpl):
107
108         * Shared/ContextMenuContextData.cpp:
109         (WebKit::ContextMenuContextData::ContextMenuContextData):
110         (WebKit::ContextMenuContextData::encode):
111         (WebKit::ContextMenuContextData::decode):
112         * Shared/ContextMenuContextData.h:
113         (WebKit::ContextMenuContextData::selectedText):
114
115         Add a "cross platform" menu item wrapper, right now only for NSMenuItem.
116         * Shared/NativeContextMenuItem.h:
117         (WebKit::NativeContextMenuItem::~NativeContextMenuItem):
118         (WebKit::NativeContextMenuItem::nsMenuItem):
119         * Shared/mac/NativeContextMenuItem.mm:
120         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
121
122         Let WebContextMenuItem hold on to a NativeContextMenuItem to maintain full fidelity of the platform.
123         * Shared/WebContextMenuItem.cpp:
124         (WebKit::WebContextMenuItem::WebContextMenuItem):
125         * Shared/WebContextMenuItem.h:
126         (WebKit::WebContextMenuItem::create):
127         (WebKit::WebContextMenuItem::nativeContextMenuItem):
128
129         * UIProcess/API/APIContextMenuClient.h:
130         (API::ContextMenuClient::getContextMenuFromProposedMenu):
131         (API::ContextMenuClient::showContextMenu):
132
133         * UIProcess/API/C/WKPage.cpp:
134         (WKPageSetPageContextMenuClient):
135
136         * UIProcess/WebContextMenuProxy.h:
137
138         * UIProcess/WebPageProxy.cpp:
139         (WebKit::WebPageProxy::internalShowContextMenu): Translate the placeholder item from the web process into the
140           native Share menu before consulting the context menu client. Also create the API items here so the native NSMenuItem
141           can be attached to them.
142
143         * UIProcess/mac/WebContextMenuProxyMac.h:
144         * UIProcess/mac/WebContextMenuProxyMac.mm:
145         (-[WKMenuTarget forwardContextMenuAction:]):
146         (WebKit::nsMenuItem):
147         (WebKit::nsMenuItemVector):
148         (WebKit::WebContextMenuProxyMac::populate):
149         (WebKit::WebContextMenuProxyMac::showContextMenu):
150
151         * WebKit2.xcodeproj/project.pbxproj:
152
153         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
154         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
155         (WebKit::WebContextMenuClient::shareSelectedTextMenuItem): In the web process, mark the Share menu's place in the
156           context menu with a placeholder item. It will be translated into the real Share menu in the UI process.
157
158 2015-04-02  Commit Queue  <commit-queue@webkit.org>
159
160         Unreviewed, rolling out r182293.
161         https://bugs.webkit.org/show_bug.cgi?id=143355
162
163         Broke GTK and EFL builds. (Requested by bfulgham on #webkit).
164
165         Reverted changeset:
166
167         "Expose the "Share" menu for text selections on platforms
168         where it's available."
169         https://bugs.webkit.org/show_bug.cgi?id=143318
170         http://trac.webkit.org/changeset/182293
171
172 2015-04-02  Chris Dumez  <cdumez@apple.com>
173
174         [WK2][NetworkCache] Drop HTTP method from NetworkCache::Key
175         https://bugs.webkit.org/show_bug.cgi?id=143348
176
177         Reviewed by Antti Koivisto.
178
179         Drop HTTP method from NetworkCache::Key as we only cache GET responses
180         for now. Even when we start caching HEAD responses, we likely will not
181         want the method to be part of the key because:
182         - A HEAD response can be used to update the headers of a previously cached response to GET
183         - A cached GET response may be used to satisfy subsequent HEAD requests
184
185         * NetworkProcess/cache/NetworkCache.cpp:
186         (WebKit::NetworkCache::makeCacheKey):
187         * NetworkProcess/cache/NetworkCacheKey.cpp:
188         (WebKit::NetworkCache::Key::Key):
189         (WebKit::NetworkCache::Key::operator=):
190         (WebKit::NetworkCache::Key::computeHash):
191         (WebKit::NetworkCache::Key::operator==):
192         (WebKit::NetworkCache::Key::encode):
193         (WebKit::NetworkCache::Key::decode):
194         * NetworkProcess/cache/NetworkCacheKey.h:
195         (WebKit::NetworkCache::Key::method): Deleted.
196
197 2015-04-02  Jer Noble  <jer.noble@apple.com>
198
199         [Mac][WK2] Fullscreen animation incorrect when initiated on non-primary monitor
200         https://bugs.webkit.org/show_bug.cgi?id=143237
201
202         Reviewed by Brent Fulgham.
203
204         The animation calculations have an implicit assumptions of a screen whose origin is 0,0. Account
205         for the screen origin by passing the window's screen's frame into the zoomAnimation() and maskAnimation()
206         methods.
207
208         * UIProcess/mac/WKFullScreenWindowController.mm:
209         (-[WKFullScreenWindowController initWithWindow:webView:]):
210         (zoomAnimation):
211         (maskAnimation):
212         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
213         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
214
215 2015-04-02  Brady Eidson  <beidson@apple.com>
216
217         Expose the "Share" menu for text selections on platforms where it's available.
218         rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318
219
220         Reviewed by Sam Weinig.
221
222         * Shared/API/c/WKContextMenuItemTypes.h: Add a constant for the Share menu.
223         * Shared/API/c/WKSharedAPICast.h:
224         (WebKit::toAPI):
225         (WebKit::toImpl):
226
227         * Shared/ContextMenuContextData.cpp:
228         (WebKit::ContextMenuContextData::ContextMenuContextData):
229         (WebKit::ContextMenuContextData::encode):
230         (WebKit::ContextMenuContextData::decode):
231         * Shared/ContextMenuContextData.h:
232         (WebKit::ContextMenuContextData::selectedText):
233
234         Add a "cross platform" menu item wrapper, right now only for NSMenuItem.
235         * Shared/NativeContextMenuItem.h:
236         (WebKit::NativeContextMenuItem::~NativeContextMenuItem):
237         (WebKit::NativeContextMenuItem::nsMenuItem):
238         * Shared/mac/NativeContextMenuItem.mm:
239         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
240
241         Let WebContextMenuItem hold on to a NativeContextMenuItem to maintain full fidelity of the platform.
242         * Shared/WebContextMenuItem.cpp:
243         (WebKit::WebContextMenuItem::WebContextMenuItem):
244         * Shared/WebContextMenuItem.h:
245         (WebKit::WebContextMenuItem::create):
246         (WebKit::WebContextMenuItem::nativeContextMenuItem):
247
248         * UIProcess/API/APIContextMenuClient.h:
249         (API::ContextMenuClient::getContextMenuFromProposedMenu):
250         (API::ContextMenuClient::showContextMenu):
251
252         * UIProcess/API/C/WKPage.cpp:
253         (WKPageSetPageContextMenuClient):
254
255         * UIProcess/WebContextMenuProxy.h:
256
257         * UIProcess/WebPageProxy.cpp:
258         (WebKit::WebPageProxy::internalShowContextMenu): Translate the placeholder item from the web process into the
259           native Share menu before consulting the context menu client. Also create the API items here so the native NSMenuItem
260           can be attached to them.
261
262         * UIProcess/mac/WebContextMenuProxyMac.h:
263         * UIProcess/mac/WebContextMenuProxyMac.mm:
264         (-[WKMenuTarget forwardContextMenuAction:]):
265         (WebKit::nsMenuItem):
266         (WebKit::nsMenuItemVector):
267         (WebKit::WebContextMenuProxyMac::populate):
268         (WebKit::WebContextMenuProxyMac::showContextMenu):
269
270         * WebKit2.xcodeproj/project.pbxproj:
271
272         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
273         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
274         (WebKit::WebContextMenuClient::shareSelectedTextMenuItem): In the web process, mark the Share menu's place in the
275           context menu with a placeholder item. It will be translated into the real Share menu in the UI process.
276
277 2015-04-02  Timothy Horton  <timothy_horton@apple.com>
278
279         De-PLATFORM(IOS)-ify LayerHostingContext::setFencePort
280         https://bugs.webkit.org/show_bug.cgi?id=143342
281
282         Reviewed by Myles C. Maxfield.
283
284         * Platform/mac/LayerHostingContext.h:
285         * Platform/mac/LayerHostingContext.mm:
286         (WebKit::LayerHostingContext::setFencePort):
287         There's nothing iOS specific about this.
288
289 2015-04-02  Oliver Hunt  <oliver@apple.com>
290
291         Ensure that we always set network ATS context in the network process
292         https://bugs.webkit.org/show_bug.cgi?id=143343
293
294         Reviewed by Dan Bernstein.
295
296         If a custom cache location or size we were early returning before setting
297         the CFNetwork ATS context. This is clearly an error.
298
299         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
300         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
301
302 2015-04-02  Alexey Proskuryakov  <ap@apple.com>
303
304         Make checkURLReceivedFromWebProcess not rely on details of platform URL implementation.
305         https://bugs.webkit.org/show_bug.cgi?id=143222
306         rdar://problem/19978997
307
308         Reviewed by Sam Weinig.
309
310         * UIProcess/WebProcessProxy.cpp:
311         (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess):
312
313 2015-04-02  Yusuke Suzuki  <utatane.tea@gmail.com>
314
315         Clean up EnumerationMode to easily extend
316         https://bugs.webkit.org/show_bug.cgi?id=143276
317
318         Reviewed by Geoffrey Garen.
319
320         Use default EnumerationMode().
321
322         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
323         (WebKit::NPJSObject::enumerate):
324
325 2015-04-02  Chris Dumez  <cdumez@apple.com>
326
327         [WK2][iOS] Update the WebContent process' sandbox profile for AWD
328         https://bugs.webkit.org/show_bug.cgi?id=143340
329         <rdar://problem/20375170>
330
331         Reviewed by Alexey Proskuryakov.
332
333         Update the WebContent process' sandbox profile for AWD.
334
335         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
336
337 2015-04-01  Antti Koivisto  <antti@apple.com>
338
339         Use std::chrono types to represent time in response and cache classes
340         https://bugs.webkit.org/show_bug.cgi?id=143316
341
342         Reviewed by Andreas Kling.
343
344         * NetworkProcess/NetworkResourceLoader.cpp:
345         (WebKit::NetworkResourceLoader::didFinishLoading):
346         * NetworkProcess/cache/NetworkCache.cpp:
347         (WebKit::NetworkCache::responseHasExpired):
348         (WebKit::NetworkCache::responseNeedsRevalidation):
349         (WebKit::NetworkCache::makeStoreDecision):
350         (WebKit::NetworkCache::Cache::store):
351         * NetworkProcess/cache/NetworkCacheEntry.cpp:
352         (WebKit::NetworkCache::Entry::Entry):
353         (WebKit::NetworkCache::Entry::asJSON):
354         * NetworkProcess/cache/NetworkCacheEntry.h:
355         (WebKit::NetworkCache::Entry::timeStamp):
356         * NetworkProcess/cache/NetworkCacheStorage.cpp:
357         (WebKit::NetworkCache::decodeRecordMetaData):
358         (WebKit::NetworkCache::decodeRecord):
359
360             Sanity check the timestamp on decode.
361
362         (WebKit::NetworkCache::encodeRecordMetaData):
363         (WebKit::NetworkCache::encodeRecordHeader):
364         (WebKit::NetworkCache::Storage::traverse):
365         * NetworkProcess/cache/NetworkCacheStorage.h:
366         * WebProcess/Plugins/PluginView.cpp:
367         (WebKit::lastModifiedDateMS):
368         (WebKit::PluginView::Stream::didReceiveResponse):
369         (WebKit::PluginView::manualLoadDidReceiveResponse):
370         (WebKit::lastModifiedDate): Deleted.
371
372 2015-04-01  Chris Dumez  <cdumez@apple.com>
373
374         [WK2][Cocoa] Add didFailProvisionalLoadWithErrorForFrame callback to WKWebProcessPlugInLoadDelegate
375         https://bugs.webkit.org/show_bug.cgi?id=143319
376         <rdar://problem/19463834>
377
378         Reviewed by Dan Bernstein.
379
380         Add didFailProvisionalLoadWithErrorForFrame callback to
381         WKWebProcessPlugInLoadDelegate so that the client side can track all
382         types page load completions:
383         - didFailProvisionalLoadWithErrorForFrame
384         - didFailLoadWithErrorForFrame
385         - didFinishLoadForFrame
386
387         Note that this event is already exposed on UIProcess side via the
388         WKPageLoaderClient.didFailLoadWithErrorForFrame callback.
389
390         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
391         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
392         (didFailProvisionalLoadWithErrorForFrame):
393         (setUpPageLoaderClient):
394
395 2015-04-01  Enrica Casucci  <enrica@apple.com>
396
397         Injected bundle messages should be at the page level.
398         https://bugs.webkit.org/show_bug.cgi?id=143283
399
400         Reviewed by Alexey Proskuryakov.
401
402         All the messages between the injected bundle and the UI
403         process should be page level messages instead of context.
404         The author of this patch is Tim Horton, I just finished it.
405
406         * UIProcess/API/C/WKPage.cpp:
407         (WKPageSetPageInjectedBundleClient):
408         * UIProcess/API/C/WKPage.h:
409         * UIProcess/API/C/WKPageInjectedBundleClient.h: Added.
410         * UIProcess/API/Cocoa/WKWebView.mm:
411         (-[WKWebView _pageForTesting]):
412         * UIProcess/API/Cocoa/WKWebViewInternal.h:
413         * UIProcess/WebPageInjectedBundleClient.cpp: Added.
414         (WebKit::WebPageInjectedBundleClient::didReceiveMessageFromInjectedBundle):
415         (WebKit::WebPageInjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle):
416         * UIProcess/WebPageInjectedBundleClient.h: Added.
417         * UIProcess/WebPageProxy.cpp:
418         (WebKit::WebPageProxy::setInjectedBundleClient):
419         (WebKit::WebPageProxy::handleMessage):
420         (WebKit::WebPageProxy::handleSynchronousMessage):
421         * UIProcess/WebPageProxy.h:
422         (WebKit::WebPageProxy::injectedBundleClient):
423         * UIProcess/WebPageProxy.messages.in:
424         * UIProcess/WebProcessPool.cpp:
425         (WebKit::WebProcessPool::handleMessage):
426         * WebKit2.xcodeproj/project.pbxproj:
427         * CMakeLists.txt:
428         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
429         (WKBundlePagePostMessage):
430         (WKBundlePagePostSynchronousMessage):
431         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
432         * WebProcess/WebPage/WebPage.cpp:
433         (WebKit::WebPage::postMessage):
434         (WebKit::WebPage::postSynchronousMessage):
435         * WebProcess/WebPage/WebPage.h:
436
437 2015-04-01  Alexey Proskuryakov  <ap@apple.com>
438
439         [iOS] WebContent should have access to the entirety of its caches directory
440         https://bugs.webkit.org/show_bug.cgi?id=143312
441         rdar://problem/20314916
442
443         Reviewed by Oliver Hunt.
444
445         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
446         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
447         * Shared/Network/NetworkProcessCreationParameters.cpp:
448         (WebKit::NetworkProcessCreationParameters::encode):
449         (WebKit::NetworkProcessCreationParameters::decode):
450         * Shared/Network/NetworkProcessCreationParameters.h:
451         * Shared/WebProcessCreationParameters.cpp:
452         (WebKit::WebProcessCreationParameters::encode):
453         (WebKit::WebProcessCreationParameters::decode):
454         * Shared/WebProcessCreationParameters.h:
455         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
456         (WebKit::WebProcessPool::networkingCachesDirectory):
457         (WebKit::WebProcessPool::webContentCachesDirectory):
458         (WebKit::WebProcessPool::openGLCacheDirectory): Deleted.
459         (WebKit::WebProcessPool::networkingHSTSDatabasePath): Deleted.
460         (WebKit::WebProcessPool::webContentHSTSDatabasePath): Deleted.
461         * UIProcess/WebProcessPool.cpp:
462         (WebKit::WebProcessPool::ensureNetworkProcess):
463         (WebKit::WebProcessPool::createNewWebProcess):
464         * UIProcess/WebProcessPool.h:
465         * WebProcess/cocoa/WebProcessCocoa.mm:
466         (WebKit::WebProcess::platformInitializeWebProcess):
467
468 2015-04-01  Timothy Horton  <timothy_horton@apple.com>
469
470         Smart magnification gesture sometimes shoots to the middle of the page
471         https://bugs.webkit.org/show_bug.cgi?id=143296
472         <rdar://problem/18209280>
473
474         Reviewed by Dean Jackson.
475
476         * UIProcess/mac/ViewGestureControllerMac.mm:
477         (WebKit::ViewGestureController::didCollectGeometryForSmartMagnificationGesture):
478         Constrain the target rect to the viewport, and if it had overflowed the viewport,
479         scroll halfway towards the gesture origin.
480
481 2015-03-31  Simon Fraser  <simon.fraser@apple.com>
482
483         Remove scrolling tree dependency on wheel event handler counts, and use fast scrolling even when there are wheel handlers
484         https://bugs.webkit.org/show_bug.cgi?id=143288
485         rdar://problem/16049624
486
487         Reviewed by Beth Dakin.
488
489         Remove the wheel event counting that Document does, and passes into the scrolling tree.
490         The ScrollingTree now just uses the non-fast scrollable region to determine when to
491         fast scroll on pages with wheel event handlers.
492         
493         If a handler includes position:fixed renderers, we just cover the whole document
494         with the slow-scrolling region currently. This could be improved.
495
496         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
497         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
498         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
499         (WebKit::RemoteScrollingTreeTextStream::dump):
500         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
501         (WebKit::WebChromeClient::wheelEventHandlersChanged):
502         (WebKit::WebChromeClient::numWheelEventHandlersChanged): Deleted.
503         * WebProcess/WebCoreSupport/WebChromeClient.h:
504         * WebProcess/WebPage/WebPage.cpp:
505         (WebKit::WebPage::WebPage):
506         (WebKit::WebPage::wheelEventHandlersChanged):
507         (WebKit::WebPage::recomputeShortCircuitHorizontalWheelEventsState):
508         (WebKit::WebPage::numWheelEventHandlersChanged): Deleted.
509         * WebProcess/WebPage/WebPage.h:
510
511 2015-03-31  Dan Bernstein  <mitz@apple.com>
512
513         <rdar://problem/20365675> [iOS] Include Add to Reading List link action only where supported
514         https://bugs.webkit.org/show_bug.cgi?id=143289
515
516         Reviewed by Tim Horton.
517
518         * UIProcess/API/Cocoa/_WKElementAction.h: Excluded _WKElementActionTypeAddToReadingList from
519         the _WKElementActionType enum when Reading List is not supported.
520
521         * UIProcess/API/Cocoa/_WKElementAction.mm:
522         (+[_WKElementAction elementActionWithType:customTitle:]): Made Add to Reading List code
523         conditional on HAVE(SAFARI_SERVICES_FRAMEWORK).
524
525         * UIProcess/ios/WKActionSheetAssistant.mm:
526         (-[WKActionSheetAssistant showImageSheet]): Ditto.
527         (-[WKActionSheetAssistant showLinkSheet]): Ditto.
528
529         * config.h: Defined HAVE_SAFARI_SERVICES_FRAMEWORK.
530
531 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
532
533         TextIndicator for <span> inside an <a> only highlights the <span>, should highlight the whole <a>
534         https://bugs.webkit.org/show_bug.cgi?id=143287
535         <rdar://problem/20318342>
536
537         Reviewed by Beth Dakin.
538
539         * WebProcess/WebPage/mac/WebPageMac.mm:
540         (WebKit::WebPage::performActionMenuHitTestAtLocation):
541         Instead of just highlighting the hit element, highlight the whole
542         element that the link URL comes from.
543
544 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
545
546         WKView should stop using endGestureWithEvent
547         https://bugs.webkit.org/show_bug.cgi?id=143285
548         <rdar://problem/20357007>
549
550         Reviewed by Simon Fraser.
551
552         * UIProcess/API/mac/WKView.mm:
553         (-[WKView magnifyWithEvent:]):
554         (-[WKView endGestureWithEvent:]): Deleted.
555         * UIProcess/mac/ViewGestureController.h:
556         * UIProcess/mac/ViewGestureControllerMac.mm:
557         (WebKit::ViewGestureController::endMagnificationGesture):
558         (WebKit::ViewGestureController::endActiveGesture): Deleted.
559         While there is no visible symptom, it is recommended that we check
560         the phase of normal magnification events instead of using the
561         special gesture end events.
562
563 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
564
565         Swipes occur in the wrong direction in RTL
566         https://bugs.webkit.org/show_bug.cgi?id=143257
567         <rdar://problem/20300862>
568
569         Reviewed by Simon Fraser.
570
571         * UIProcess/ios/ViewGestureControllerIOS.mm:
572         (-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]):
573         When choosing which edge to attach our gesture recognizers to,
574         flip them in RTL.
575
576         (-[WKSwipeTransitionController directionForTransition:]):
577         (WebKit::ViewGestureController::beginSwipeGesture):
578         (WebKit::ViewGestureController::canSwipeInDirection):
579         * UIProcess/mac/ViewGestureController.h:
580         * UIProcess/mac/ViewGestureControllerMac.mm:
581         (WebKit::ViewGestureController::scrollEventCanBecomeSwipe):
582         (WebKit::ViewGestureController::trackSwipeGesture):
583         (WebKit::ViewGestureController::determineLayerAdjacentToSnapshotForParent):
584         (WebKit::ViewGestureController::beginSwipeGesture):
585         (WebKit::ViewGestureController::handleSwipeGesture):
586         Adjust SwipeDirection to be in logical back-forward list direction
587         instead of physical edge direction.
588
589 2015-03-31  Myles C. Maxfield  <mmaxfield@apple.com>
590
591         Move ExpansionBehaviorFlags and TextDirection to their own file
592         https://bugs.webkit.org/show_bug.cgi?id=143273
593
594         Reviewed by Simon Fraser.
595
596         This is a mechanical change. It just moves code around.
597
598         This is getting ready for https://bugs.webkit.org/show_bug.cgi?id=142608
599
600         * Shared/WebPopupItem.h:
601         * UIProcess/API/C/efl/WKAPICastEfl.h:
602         * UIProcess/API/efl/EwkView.h:
603         * UIProcess/WebPopupMenuProxy.h:
604         * UIProcess/efl/WebUIPopupMenuClient.h:
605
606 2015-03-31  Yusuke Suzuki  <utatane.tea@gmail.com>
607
608         Clean up Identifier factories to clarify the meaning of StringImpl*
609         https://bugs.webkit.org/show_bug.cgi?id=143146
610
611         Reviewed by Filip Pizlo.
612
613         Just change to Identifier::fromString.
614
615         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
616         (WebKit::JSNPObject::getOwnPropertyNames):
617         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
618         (WebKit::identifierFromIdentifierRep):
619
620 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
621
622         WebKit briefly shows wrong webpage after swiping back (gigaom.com, or any site on a slow network)
623         https://bugs.webkit.org/show_bug.cgi?id=143256
624         <rdar://problem/19458648>
625
626         Reviewed by Dan Bernstein.
627
628         Instead of allowing a flash of the previous page when the swipe snapshot
629         timeouts fire (removing the snapshot before the new page is loaded), show
630         the snapshotted background color.
631
632         This fixes the problem on iOS, where UI-side compositing makes it easy to fix,
633         but not yet on OS X.
634
635         * UIProcess/API/Cocoa/WKWebView.mm:
636         (baseScrollViewBackgroundColor):
637         (scrollViewBackgroundColor):
638         If the ViewGestureController returns a valid background color, use that
639         instead of the page's background color.
640
641         * UIProcess/API/Cocoa/WKWebViewInternal.h:
642         Expose _updateScrollViewBackground.
643
644         * UIProcess/PageClient.h:
645         * UIProcess/ios/PageClientImplIOS.h:
646         * UIProcess/ios/PageClientImplIOS.mm:
647         (WebKit::PageClientImpl::didChangeBackgroundColor):
648         * UIProcess/mac/PageClientImpl.h:
649         * UIProcess/mac/PageClientImpl.mm:
650         (WebKit::PageClientImpl::didChangeBackgroundColor):
651         * UIProcess/WebPageProxy.cpp:
652         (WebKit::WebPageProxy::didChangeBackgroundColor):
653         * UIProcess/WebPageProxy.h:
654         Add and plumb didChangeBackgroundColor, which calls
655         _updateScrollViewBackground on iOS.
656         
657         * UIProcess/ios/ViewGestureControllerIOS.mm:
658         (WebKit::ViewGestureController::endSwipeGesture):
659         Hide the content of the drawing area until the next commit. This way,
660         even if the snapshot is removed (say, because a timeout fired), we won't
661         ever show the old page content (but we will show background color).
662
663         Store the background color associated with the current snapshot.
664
665         Let WKWebView know that it needs to recompute the background color.
666
667         (WebKit::ViewGestureController::removeSwipeSnapshot):
668         Clear the background color so that the next time we commit, WKWebView
669         will get an invalid color from ViewGestureController and fall back
670         to the page's extended background color instead.
671
672         * UIProcess/mac/ViewGestureController.h:
673         (WebKit::ViewGestureController::backgroundColorForCurrentSnapshot):
674         * UIProcess/mac/ViewGestureControllerMac.mm:
675         (WebKit::ViewGestureController::beginSwipeGesture):
676         (WebKit::ViewGestureController::removeSwipeSnapshot):
677         Keep backgroundColorForCurrentSnapshot up to date on Mac too, even
678         though we don't use it yet.
679
680 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
681
682         [iOS] Rotating PDF in Safari scrolls to the wrong position
683         https://bugs.webkit.org/show_bug.cgi?id=143259
684         <rdar://problem/19872693>
685
686         Reviewed by Dan Bernstein.
687
688         * UIProcess/ios/WKPDFView.mm:
689         (-[WKPDFView web_setMinimumSize:]):
690         Maintan the relative top/left within the rescaled document.
691
692 2015-03-31  Chris Dumez  <cdumez@apple.com>
693
694         [WK2][iOS] Extend ProcessThrottler use to the NetworkProcess
695         https://bugs.webkit.org/show_bug.cgi?id=143249
696         <rdar://problem/20231539>
697
698         Reviewed by Gavin Barraclough.
699
700         Extend ProcessThrottler use to the NetworkProcess instead of only the
701         WebProcesses. This is needed so that the NetworkProcess gets notified
702         before suspension. We now use this notification to free-up memory
703         before suspending by calling the critical memory pressure handler, as
704         we already do for WebProcesses (rdar://problem/20231539). In the
705         future, this infrastructure will be used to delay suspension until the
706         pending SQL transactions are done as well (rdar://problem/20180799).
707
708         Previously, the NetworkProcessProxy would hold a foreground assertion
709         on behalf of the NetworkProcess but would never release that assertion.
710         In this patch, we change this so that WebProcessProxies hold assertions
711         on behalf of the NetworkProcess, and release those assertions before
712         suspending. As a result, the NetworkProcess gets suspended when all
713         WebProcesses are suspended.
714
715         * NetworkProcess/NetworkProcess.cpp:
716         (WebKit::NetworkProcess::processWillSuspend):
717         (WebKit::NetworkProcess::cancelProcessWillSuspend):
718         (WebKit::NetworkProcess::processDidResume):
719         * NetworkProcess/NetworkProcess.h:
720         * NetworkProcess/NetworkProcess.messages.in:
721         * UIProcess/Network/NetworkProcessProxy.cpp:
722         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
723         (WebKit::NetworkProcessProxy::didFinishLaunching):
724         (WebKit::NetworkProcessProxy::sendProcessWillSuspend):
725         (WebKit::NetworkProcessProxy::sendCancelProcessWillSuspend):
726         (WebKit::NetworkProcessProxy::didCancelProcessSuspension):
727         (WebKit::NetworkProcessProxy::sendProcessDidResume):
728         (WebKit::NetworkProcessProxy::processReadyToSuspend):
729         * UIProcess/Network/NetworkProcessProxy.h:
730         (WebKit::NetworkProcessProxy::throttler):
731         * UIProcess/Network/NetworkProcessProxy.messages.in:
732         * UIProcess/ProcessThrottler.cpp:
733         (WebKit::ProcessThrottler::ProcessThrottler):
734         (WebKit::ProcessThrottler::didConnectToProcess):
735         (WebKit::ProcessThrottler::didConnnectToProcess): Deleted.
736         * UIProcess/ProcessThrottler.h:
737         * UIProcess/ProcessThrottlerClient.h: Added.
738         (WebKit::ProcessThrottlerClient::~ProcessThrottlerClient):
739         * UIProcess/WebProcessPool.cpp:
740         (WebKit::WebProcessPool::ensureNetworkProcess):
741         * UIProcess/WebProcessPool.h:
742         * UIProcess/WebProcessProxy.cpp:
743         (WebKit::WebProcessProxy::didFinishLaunching):
744         (WebKit::WebProcessProxy::initializeNetworkProcessActivityToken):
745         (WebKit::WebProcessProxy::sendProcessDidResume):
746         (WebKit::WebProcessProxy::processReadyToSuspend):
747         * UIProcess/WebProcessProxy.h:
748         * WebKit2.xcodeproj/project.pbxproj:
749
750 2015-03-31  Csaba Osztrogonác  <ossy@webkit.org>
751
752         Unreviewed, revert accidental change by r182138.
753
754         * Scripts/generate-forwarding-headers.pl:
755         (createForwardingHeadersForFramework):
756
757 2015-03-31  Carlos Garcia Campos  <cgarcia@igalia.com>
758
759         Unreviewed. Fix GTK+ build with REDIRECTED_XCOMPOSITE_WINDOW disabled in X11 platform.
760
761         Also fix some unused parameter warnings when
762         REDIRECTED_XCOMPOSITE_WINDOW is disabled.
763
764         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
765         (webkitWebViewRenderAcceleratedCompositingResults):
766         (resizeWebKitWebViewBaseFromAllocation):
767
768 2015-03-31  Carlos Garcia Campos  <cgarcia@igalia.com>
769
770         [GTK] DnD icon/widget has odd background
771         https://bugs.webkit.org/show_bug.cgi?id=143217
772
773         Reviewed by Martin Robinson.
774
775         Use gtk_drag_set_icon_surface() to set the drag icon image,
776         instead of DragIcon class.
777
778         * UIProcess/API/gtk/WebKitWebView.cpp:
779         * UIProcess/gtk/DragAndDropHandler.cpp:
780         (WebKit::DragAndDropHandler::startDrag):
781         * UIProcess/gtk/DragAndDropHandler.h:
782
783 2015-03-30  Commit Queue  <commit-queue@webkit.org>
784
785         Unreviewed, rolling out r182172.
786         https://bugs.webkit.org/show_bug.cgi?id=143250
787
788         Since this class is an API object, we don't know for sure when
789         it will be destroyed. (Requested by kling on #webkit).
790
791         Reverted changeset:
792
793         "WebBackForwardList doesn't need to manually clear the
794         snapshot of an entry when removing it."
795         https://bugs.webkit.org/show_bug.cgi?id=143231
796         http://trac.webkit.org/changeset/182172
797
798 2015-03-30  Andreas Kling  <akling@apple.com>
799
800         WebBackForwardList doesn't need to manually clear the snapshot of an entry when removing it.
801         <https://webkit.org/b/143231>
802
803         Reviewed by Tim Horton.
804
805         Now that we don't keep WebBackForwardListItem objects alive forever, it's not necessary
806         to clear the snapshot when removing them from the WebBackForwardList, since the entire
807         object will be deleted shortly after that anyway.
808
809         * UIProcess/WebBackForwardList.cpp:
810         (WebKit::WebBackForwardList::didRemoveItem):
811
812 2015-03-30  Enrica Casucci  <enrica@apple.com>
813
814         [iOS] WebContent crashing at WebCore: WebCore::Range::collectSelectionRects.
815         https://bugs.webkit.org/show_bug.cgi?id=143234
816         <rdar://problem/18571345>
817
818         Reviewed by Tim Horton.
819
820         This is a speculative fix that adds a null check before referencing the range.
821         In both places where the check has been added the range returned by the call
822         that should create it could be null.
823
824         * WebProcess/WebPage/ios/WebPageIOS.mm:
825         (WebKit::WebPage::platformEditorState):
826
827 2015-03-30  Sam Weinig  <sam@webkit.org>
828
829         [Content Extensions] Flesh out the UserContentExtensionStore
830         https://bugs.webkit.org/show_bug.cgi?id=143123
831
832         Reviewed by Benjamin Poulain.
833
834         * Shared/WebCompiledContentExtension.cpp:
835         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
836         * Shared/WebCompiledContentExtensionData.cpp:
837         (WebKit::WebCompiledContentExtensionData::encode):
838         (WebKit::WebCompiledContentExtensionData::decode):
839         * Shared/WebCompiledContentExtensionData.h:
840         (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
841         Switch the order in memory of actions and bytecode (and switch the order of the
842         variables as well, to keep it clear). This will become necessary when streaming
843         the data to disk, as actions are created before the bytecode and we would have to keep them
844         in memory until the bytecode was finished compiling if they didn't come before in the file.
845
846         * UIProcess/API/APIUserContentExtensionStore.h:
847         * UIProcess/API/APIUserContentExtensionStore.cpp:
848         (API::UserContentExtensionStore::defaultStore):
849         Add accessor for the processes default shared store.
850
851         (API::constructedPath):
852         Helper for constructing the path to a file in the store based on identifier.
853
854         (API::encodeContentExtensionMetaData):
855         (API::decodeContentExtensionMetaData):
856         Helpers for encoding/decoding the file metadata (version, bytecode size, actions size).
857
858         (API::openAndMapContentExtension):
859         Helper to open and map a filed back content extension.
860
861         (API::writeDataToFile):
862         Helper to write a Data object to a file.
863
864         (API::compiledToFile):
865         Helper to run the content extension compiler and write it to disk. It first
866         writes it to a temporary file and then does an atomic rename operation to put
867         the file in the final location. Doing this means that if the process crashes while
868         the compile is taking place, the partially written file won't end up in the cache, 
869         but rather, will be cleaned up by the OS.
870  
871         (API::UserContentExtensionStore::lookupContentExtension):
872         API entry point to lookup an extension that has been compiled to disk. On a background queue,
873         it attempts to open and map the extension (based on the identifier passed in) and return it
874         to the caller via the callback function passed in.
875         
876         (API::UserContentExtensionStore::compileContentExtension):
877         API entry point to compile an extension and write it to store. On a background queue, it 
878         compiles the file to disk and if successful, returns the memory mapped data via the callback
879         function passed in.
880
881         (API::UserContentExtensionStore::removeContentExtension):
882         API entry point to remove an extension from the store. On a background queue, it 
883         unlinks the extension (based on the identifier passed in) and tells the caller it completed
884         the action vial the callback function passed in.
885
886         (API::UserContentExtensionStore::synchronousRemoveAllContentExtensions):
887         Helper for testing which synchronously unlinks all the files in the store.
888
889         (API::userContentExtensionStoreErrorCategory):
890         std::error_code adaptor for some generic errors that can happen in the store. We will want
891         to flesh these out further.
892
893         * UIProcess/API/Cocoa/APIUserContentExtensionStoreCocoa.mm: Added.
894         (API::UserContentExtensionStore::defaultStorePath):
895         Helper to get the platform specific path for the store.
896
897         * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
898         (WKUserContentExtensionStoreGetTypeID):
899         Add ENABLE(CONTENT_EXTENSIONS) guards.
900
901         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
902         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
903         (-[_WKUserContentExtensionStore dealloc]):
904         (+[_WKUserContentExtensionStore defaultStore]):
905         (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
906         (-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
907         (-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
908         (-[_WKUserContentExtensionStore _removeAllContentExtensions]):
909         (-[_WKUserContentExtensionStore init]): Deleted.
910         * UIProcess/API/Cocoa/_WKUserContentExtensionStoreInternal.h:
911         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h: Added.
912         SPI wrappers for the store.
913
914         * WebKit2.xcodeproj/project.pbxproj:
915         Add new files.
916
917 2015-03-30  Antti Koivisto  <antti@apple.com>
918
919         Don't cache resources that are very unlikely to be reused
920         https://bugs.webkit.org/show_bug.cgi?id=143226
921
922         Reviewed by Chris Dumez.
923
924         Follow-up to cover Cache-control: no-cache case which also has zero cache lifetime.
925
926         * NetworkProcess/cache/NetworkCache.cpp:
927         (WebKit::NetworkCache::makeStoreDecision):
928
929 2015-03-30  Antti Koivisto  <antti@apple.com>
930
931         Include cache entry worth to json dump
932         https://bugs.webkit.org/show_bug.cgi?id=143202
933
934         Follow-up fix.
935
936         * NetworkProcess/cache/NetworkCacheStorage.cpp:
937         (WebKit::NetworkCache::computeRecordWorth):
938
939             This accidentally gave the error case worth 1 rather than 0 as it should be.
940
941 2015-03-30  Antti Koivisto  <antti@apple.com>
942
943         Don't cache resources that are very unlikely to be reused
944         https://bugs.webkit.org/show_bug.cgi?id=143226
945         <rdar://problem/20347160>
946
947         Reviewed by Geoff Garen.
948
949         We are writing lots of resources to the cache that are never used again.
950
951         In browse-around-randomly test this reduced number of cache entries created by ~20% and bytes written by ~5%.
952
953         * NetworkProcess/cache/NetworkCache.cpp:
954         (WebKit::NetworkCache::makeUseDecision):
955         (WebKit::NetworkCache::makeRetrieveDecision):
956
957             Rename for clarity.
958
959         (WebKit::NetworkCache::makeStoreDecision):
960
961             Store only if the resource has non-zero expiration or has validation headers.
962
963             Very High priority resources (main resources) keep the existing policy to minimize impact
964             on back navigation and tab restore.
965
966         (WebKit::NetworkCache::Cache::retrieve):
967         (WebKit::NetworkCache::Cache::store):
968         (WebKit::NetworkCache::canUse): Deleted.
969         (WebKit::NetworkCache::canRetrieve): Deleted.
970         (WebKit::NetworkCache::canStore): Deleted.
971         * NetworkProcess/cache/NetworkCache.h:
972         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
973         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
974
975 2015-03-30  Tim Horton  <timothy_horton@apple.com>
976
977         Swipe snapshot removed too early (jumps around) on arstechnica and NYT
978         https://bugs.webkit.org/show_bug.cgi?id=143199
979         <rdar://problem/18420467>
980
981         Reviewed by Dan Bernstein.
982
983         Make ViewGestureControllerIOS's snapshot removal timing behave more like the Mac version.
984
985         * UIProcess/API/Cocoa/WKWebView.mm:
986         (-[WKWebView _didCommitLayerTree:]):
987         Let ViewGestureController know when the page has finished state restoration.
988
989         (-[WKWebView _didFinishLoadForMainFrame]):
990         (-[WKWebView _didSameDocumentNavigationForMainFrame:]):
991         Forward these to ViewGestureController.
992
993         * UIProcess/API/Cocoa/WKWebViewInternal.h:
994         * UIProcess/ios/PageClientImplIOS.mm:
995         (WebKit::PageClientImpl::didFinishLoadForMainFrame):
996         Forward didFinishLoadForMainFrame to WKWebView.
997
998         * UIProcess/ios/ViewGestureControllerIOS.mm:
999         (WebKit::ViewGestureController::ViewGestureController):
1000         (WebKit::ViewGestureController::endSwipeGesture):
1001         Split the swipe snapshot removal state into a bunch of bools.
1002
1003         (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree):
1004         (WebKit::ViewGestureController::setRenderTreeSize):
1005         (WebKit::ViewGestureController::removeSwipeSnapshotIfReady):
1006         (WebKit::ViewGestureController::removeSwipeSnapshot):
1007         Unify the snapshot removal logic into one function; removeSwipeSnapshotIfReady
1008         completely owns the decision. For now, we're waiting for everything, but
1009         we can do better in the future (using firstVisuallyNonEmptyLayout like Mac used to).
1010
1011         (WebKit::ViewGestureController::didRestoreScrollPosition):
1012         (WebKit::ViewGestureController::didFinishLoadForMainFrame):
1013         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
1014         (WebKit::ViewGestureController::activeLoadMonitoringTimerFired):
1015         Add more conditions for swipe snapshot removal. We'll now wait for
1016         didFinishLoadForMainFrame (or didSameDocumentNavigationForMainFrame),
1017         for active loads to finish, and for the scroll position to be restored.
1018         This brings the iOS implementation in line with the slightly better Mac
1019         implementation, and also sets the stage for deduplication of all of this code.
1020         
1021         * UIProcess/mac/ViewGestureController.h:
1022         * UIProcess/mac/ViewGestureControllerMac.mm:
1023         (WebKit::ViewGestureController::ViewGestureController):
1024
1025 2015-03-30  Chris Dumez  <cdumez@apple.com>
1026
1027         [WK2][NetworkCache] Add support for "Cache-Control: max-stale" request header
1028         https://bugs.webkit.org/show_bug.cgi?id=143159
1029         <rdar://problem/20333296>
1030
1031         Reviewed by Antti Koivisto.
1032
1033         Add support for "Cache-Control: max-stale" request header:
1034         https://tools.ietf.org/html/rfc7234#section-5.2.1.2
1035
1036         * NetworkProcess/cache/NetworkCache.cpp:
1037         (WebKit::NetworkCache::responseHasExpired):
1038         (WebKit::NetworkCache::requestRequiresRevalidation):
1039         (WebKit::NetworkCache::canUse):
1040
1041 2015-03-30  Csaba Osztrogonác  <ossy@webkit.org>
1042
1043         [EFL][GTK] WebKit2's generate-forwarding-headers.pl should fail if clashing headers found
1044         https://bugs.webkit.org/show_bug.cgi?id=142909
1045
1046         Reviewed by Philippe Normand.
1047
1048         * Scripts/generate-forwarding-headers.pl:
1049         (createForwardingHeadersForFramework):
1050
1051 2015-03-29  Antti Koivisto  <antti@apple.com>
1052
1053         Include cache entry worth to json dump
1054         https://bugs.webkit.org/show_bug.cgi?id=143202
1055
1056         Reviewed by Darin Adler.
1057
1058         This is useful for analyzing cache performance.
1059         Also include the body size, total item count and average worth.
1060
1061         * NetworkProcess/cache/NetworkCache.cpp:
1062         (WebKit::NetworkCache::Cache::traverse):
1063         (WebKit::NetworkCache::Cache::dumpContentsToFile):
1064         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1065         (WebKit::NetworkCache::Entry::asJSON):
1066         * NetworkProcess/cache/NetworkCacheEntry.h:
1067         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1068         (WebKit::NetworkCache::Storage::traverse):
1069
1070             Add flags for specificying what sort of information is needed.
1071
1072         (WebKit::NetworkCache::computeRecordWorth):
1073
1074             Factor to a function.
1075
1076         (WebKit::NetworkCache::deletionProbability):
1077         * NetworkProcess/cache/NetworkCacheStorage.h:
1078
1079 2015-03-29  Simon Fraser  <simon.fraser@apple.com>
1080
1081         Fix iOS scrollperf crash after a web process crash
1082         https://bugs.webkit.org/show_bug.cgi?id=143110
1083
1084         Reviewed by Dean Jackson.
1085         
1086         When we destroy the drawing area after a web process crash, we also need to destroy
1087         the scrollingPerformanceData which has a reference to the drawing area.
1088
1089         * UIProcess/WebPageProxy.cpp:
1090         (WebKit::WebPageProxy::resetState):
1091
1092 2015-03-29  Simon Fraser  <simon.fraser@apple.com>
1093
1094         Convert arguments to ScrollingCoordinator functions to references
1095         https://bugs.webkit.org/show_bug.cgi?id=143198
1096
1097         Reviewed by Darin Adler.
1098
1099         Convert all the FrameView* and ScrollableArea* arguments to ScrollingCoordinator functions to
1100         references, and use references in a few other places.
1101
1102         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
1103         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
1104         (WebKit::RemoteScrollingCoordinator::coordinatesScrollingForFrameView):
1105
1106 2015-03-29  Enrica Casucci  <enrica@apple.com>
1107
1108         [iOS WK2] WKContentView should implement _selectionClipRect
1109         https://bugs.webkit.org/show_bug.cgi?id=143143
1110         rdar://problem/20330075
1111
1112         Reviewed by Benjamin Poulain.
1113
1114         UIKit checks if the text delegate responds to this selector
1115         to retrieve the clipping rectangle for the editable element
1116         where the selection is being create.
1117
1118         * UIProcess/ios/WKContentViewInteraction.mm:
1119         (-[WKContentView _selectionClipRect]):
1120
1121 2015-03-29  Antti Koivisto  <antti@apple.com>
1122
1123         Use st_mtime instead of st_atime to track file access time
1124         https://bugs.webkit.org/show_bug.cgi?id=143200
1125
1126         Reviewed by Darin Adler.
1127
1128         On OS X atime updates automatically on read so calling Storage::traverse() would always ends up updating access times
1129         for all cache entries to the current time. This would make entry worth computation produce unexpected results.
1130         We update mtime manually on successful cache retrieve only so switching to it fixes the problem.
1131
1132         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
1133         (WebKit::NetworkCache::fileTimes):
1134         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
1135         (WebKit::NetworkCache::updateFileAccessTimeIfNeeded): Deleted.
1136         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1137         (WebKit::NetworkCache::Storage::updateFileModificationTime):
1138         (WebKit::NetworkCache::Storage::dispatchReadOperation):
1139         (WebKit::NetworkCache::deletionProbability):
1140         (WebKit::NetworkCache::Storage::updateFileAccessTime): Deleted.
1141         * NetworkProcess/cache/NetworkCacheStorage.h:
1142
1143 2015-03-27  Gwang Yoon Hwang  <yoon@igalia.com>
1144
1145         [TexMap] Seperate BitmapTexture related classes implementations from TextureMapper
1146         https://bugs.webkit.org/show_bug.cgi?id=142386
1147
1148         Reviewed by Žan Doberšek.
1149
1150         TextureMapper and TextureMapperGL are bloated and tightly coupled with
1151         BitmapTexture. We should move these classes to seperated file of their own.
1152         Also, this patch removes friend relationship from TextureMapperGL and  its
1153         subsidiary classes.
1154
1155         The main purpose of this refactoring is to expose BitmapTexturePool to
1156         renderers of platformlayers like Video and Canvas. By doing this, each
1157         renderer can acquire textures from the global texture pool to paint
1158         their contents directly.
1159
1160         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp: Include BitmapTextureGL.h explicitly
1161
1162 2015-03-27  Anders Carlsson  <andersca@apple.com>
1163
1164         Use a typedef for the WKPluginLoadClientPolicy enum
1165         https://bugs.webkit.org/show_bug.cgi?id=143161
1166
1167         Reviewed by Tim Horton.
1168
1169         * UIProcess/API/C/WKPluginLoadPolicy.h:
1170
1171 2015-03-27  Chris Dumez  <cdumez@apple.com>
1172
1173         [WK2][NetworkCache] Use WTF::WorkQueue abstraction inside NetworkCacheStatistics
1174         https://bugs.webkit.org/show_bug.cgi?id=143154
1175
1176         Reviewed by Antti Koivisto.
1177
1178         Use WTF::WorkQueue abstraction inside NetworkCacheStatistics, like we
1179         already do in NetworkCacheStorage.
1180
1181         * NetworkProcess/cache/NetworkCacheStatistics.cpp: Renamed from Source/WebKit2/NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm.
1182         (WebKit::NetworkCache::executeSQLCommand):
1183         (WebKit::NetworkCache::executeSQLStatement):
1184         (WebKit::NetworkCache::Statistics::open):
1185         (WebKit::NetworkCache::Statistics::Statistics):
1186         (WebKit::NetworkCache::Statistics::initialize):
1187         (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
1188         (WebKit::NetworkCache::Statistics::shrinkIfNeeded):
1189         (WebKit::NetworkCache::Statistics::recordRetrievalRequest):
1190         (WebKit::NetworkCache::Statistics::recordNotCachingResponse):
1191         (WebKit::NetworkCache::retrieveDecisionToDiagnosticKey):
1192         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
1193         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
1194         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
1195         (WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
1196         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
1197         (WebKit::NetworkCache::Statistics::markAsRequested):
1198         (WebKit::NetworkCache::Statistics::writeTimerFired):
1199         (WebKit::NetworkCache::Statistics::queryWasEverRequested):
1200         (WebKit::NetworkCache::Statistics::clear):
1201         (WebKit::NetworkCache::Statistics::addHashesToDatabase):
1202         (WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase):
1203         * NetworkProcess/cache/NetworkCacheStatistics.h:
1204         (WebKit::NetworkCache::Statistics::serialBackgroundIOQueue):
1205         * WebKit2.xcodeproj/project.pbxproj:
1206
1207 2015-03-27  Ryosuke Niwa  <rniwa@webkit.org>
1208
1209         Safari clears selection when its window gets activated via mouse down
1210         https://bugs.webkit.org/show_bug.cgi?id=143157
1211
1212         Reviewed by Anders Carlsson.
1213
1214         The bug was caused by PlatformMouseEvent created in WebKit2 not having its event number
1215         even though we were correctly calling setActivationEventNumber in WebPage::acceptsFirstMouse.
1216
1217         Fixed the bug by storing [NSEvent eventNumber] in WebMouseEvent on Mac in WebKit2 as done in WebKit1.
1218
1219         * Shared/WebEvent.h:
1220         (WebKit::WebMouseEvent::eventNumber):
1221         * Shared/WebEventConversion.cpp:
1222         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
1223         * Shared/WebMouseEvent.cpp:
1224         (WebKit::WebMouseEvent::WebMouseEvent):
1225         (WebKit::WebMouseEvent::encode):
1226         (WebKit::WebMouseEvent::decode):
1227         * Shared/mac/WebEventFactory.mm:
1228         (WebKit::WebEventFactory::createWebMouseEvent):
1229
1230 2015-03-27  Anders Carlsson  <andersca@apple.com>
1231
1232         Only do the Connection::setShouldCloseConnectionOnMachExceptions() hack where necessary
1233         https://bugs.webkit.org/show_bug.cgi?id=143141
1234         rdar://problem/19471284
1235
1236         Reviewed by Andreas Kling.
1237
1238         * Platform/IPC/Connection.h:
1239         * Platform/IPC/mac/ConnectionMac.mm:
1240         (IPC::Connection::platformInvalidate):
1241         (IPC::Connection::platformInitialize):
1242         (IPC::Connection::open):
1243         * Shared/ChildProcessProxy.cpp:
1244         (WebKit::ChildProcessProxy::didFinishLaunching):
1245         * UIProcess/Plugins/PluginProcessProxy.cpp:
1246         (WebKit::PluginProcessProxy::didFinishLaunching):
1247
1248 2015-03-27  Tim Horton  <timothy_horton@apple.com>
1249
1250         Implement iOS WebKit2 PDF Find-in-Page
1251         https://bugs.webkit.org/show_bug.cgi?id=143065
1252         <rdar://problem/16793370>
1253
1254         Reviewed by Dan Bernstein.
1255
1256         * Platform/spi/ios/CorePDFSPI.h:
1257         Add some SPI.
1258
1259         * UIProcess/API/Cocoa/WKWebView.mm:
1260         (-[WKWebView _countStringMatches:options:maxCount:]):
1261         (-[WKWebView _findString:options:maxCount:]):
1262         (-[WKWebView _hideFindUI]):
1263         If we have a custom content view, forward find-in-page methods to it.
1264         
1265         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1266         * UIProcess/API/Cocoa/_WKFindOptions.h:
1267         Move _WKFindOptions into its own file.
1268
1269         * UIProcess/Cocoa/WKWebViewContentProvider.h:
1270         Add find-related methods to the WKWebViewContentProvider protocol.
1271
1272         * UIProcess/ios/WKPDFView.mm:
1273         (-[WKPDFView web_initWithFrame:webView:]):
1274         (-[WKPDFView dealloc]):
1275         Maintain a dispatch queue for searching the PDF.
1276
1277         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
1278         Fix a type.
1279
1280         (-[WKPDFView _ensureViewForPage:]):
1281         Split the code to create/parent a page view out from _revalidateViews,
1282         so that the find code can create/parent the targetted UIPDFPageView
1283         in order to install the find highlight in it, but before it is scrolled into view.
1284
1285         (-[WKPDFView _revalidateViews]):
1286         Use the stored page index instead of counting again.
1287         Don't unparent page views that have find-in-page highlights in them, because
1288         we won't know enough to recreate them later.
1289
1290         (-[WKPDFView _computePageAndDocumentFrames]):
1291         Put the page index in PDFPageInfo, for reference elsewhere.
1292
1293         (-[WKPDFView _stringCompareOptionsFromWKFindOptions:]):
1294         (-[WKPDFView _computeMatchesForString:options:maxCount:completionHandler:]):
1295         Asynchronously (and on our serial queue) search the PDF for the given string.
1296         We'll cache the most recent results to avoid searching more than once,
1297         cancel existing searches when another begins (since it's a serial queue,
1298         this ensures we'll only have one search active at a time).
1299
1300         (-[WKPDFView web_countStringMatches:options:maxCount:]):
1301         Count the number of matches for the given string, and inform the FindClient
1302         of the result.
1303
1304         (-[WKPDFView _didFindMatch:]):
1305         When we find a match, create a view for it, highlight the match, and
1306         zoom so that it's in-view.
1307
1308         (-[WKPDFView web_findString:options:maxCount:]):
1309         Incrementally search the document for the given string. We do an incremental
1310         search even if we have all of the results so that we can anchor the search
1311         in the right place if the new string is a prefix of the old string, etc.
1312         Wrap around appropriately when searching past the beginning or end of the
1313         document. If we have all of the results (there were less than maxCount results),
1314         look through the cached matches for the incrementally-found result and
1315         report its index to the client.
1316
1317         (-[WKPDFView web_hideFindUI]):
1318         Dismiss the selection and clear some state so we start the next search afresh.
1319
1320         * WebKit2.xcodeproj/project.pbxproj:
1321
1322 2015-03-27  Andreas Kling  <akling@apple.com>
1323
1324         WebProcessProxy should not retain WebBackForwardListItems forever.
1325         <https://webkit.org/b/143152>
1326         <rdar://problem/19925709>
1327
1328         Reviewed by Anders Carlsson.
1329
1330         Have WebProcessProxy actually forget about a WebBackForwardListItem after it's removed from
1331         the WebBackForwardList.
1332
1333         This ensures that we don't accumulate too many of these objects, which can get quite large
1334         due to the session state encoded in them.
1335
1336         We already have graceful handling of the case where an incoming IPC message references
1337         a removed back/forward list item.
1338
1339         * UIProcess/WebBackForwardList.cpp:
1340         (WebKit::WebBackForwardList::didRemoveItem):
1341         * UIProcess/WebPageProxy.cpp:
1342         (WebKit::WebPageProxy::backForwardRemovedItem):
1343         * UIProcess/WebProcessProxy.cpp:
1344         (WebKit::WebProcessProxy::removeBackForwardItem):
1345         * UIProcess/WebProcessProxy.h:
1346
1347 2015-03-27  Simon Fraser  <simon.fraser@apple.com>
1348
1349         Use the correct timebase to log scrollperf blank pixel counts on iOS
1350         https://bugs.webkit.org/show_bug.cgi?id=143149
1351
1352         Reviewed by Tim Horton.
1353         
1354         MobileSafari and WebKit need to collect scrollperf data using the same timebase;
1355         MobileSafari can't call WTF::monotonicallyIncreasingTime(), so use CFAbsoluteTimeGetCurrent()
1356         everywhere.
1357
1358         * UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.mm:
1359         (WebKit::RemoteLayerTreeScrollingPerformanceData::appendBlankPixelCount):
1360
1361 2015-03-27  Chris Dumez  <cdumez@apple.com>
1362
1363         [WK2][NetworkCache] Rename requestNeedsRevalidation() to requestRequiresRevalidation()
1364         https://bugs.webkit.org/show_bug.cgi?id=143137
1365
1366         Reviewed by Antti Koivisto.
1367
1368         Rename requestNeedsRevalidation() to requestRequiresRevalidation() as I
1369         think it is more accurate. It is not the request that needs revalidating.
1370         The requests just requires us to revalidate the response.
1371
1372         * NetworkProcess/cache/NetworkCache.cpp:
1373         (WebKit::NetworkCache::requestRequiresRevalidation):
1374         (WebKit::NetworkCache::canUse):
1375         (WebKit::NetworkCache::requestNeedsRevalidation): Deleted.
1376
1377 2015-03-27  Oliver Hunt  <oliver@apple.com>
1378
1379         Forward additional CFNetwork ATS information to child processes
1380         https://bugs.webkit.org/show_bug.cgi?id=143136
1381
1382         Reviewed by Anders Carlsson.
1383
1384         Add additional process creation parameter information, and pass it
1385         to the child processes that actually use CFNetwork.
1386
1387         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1388         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1389         * Shared/Network/NetworkProcessCreationParameters.cpp:
1390         (WebKit::NetworkProcessCreationParameters::encode):
1391         (WebKit::NetworkProcessCreationParameters::decode):
1392         * Shared/Network/NetworkProcessCreationParameters.h:
1393         * Shared/Plugins/PluginProcessCreationParameters.cpp:
1394         (WebKit::PluginProcessCreationParameters::encode):
1395         (WebKit::PluginProcessCreationParameters::decode):
1396         * Shared/Plugins/PluginProcessCreationParameters.h:
1397         * Shared/WebProcessCreationParameters.cpp:
1398         (WebKit::WebProcessCreationParameters::encode):
1399         (WebKit::WebProcessCreationParameters::decode):
1400         * Shared/WebProcessCreationParameters.h:
1401         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1402         (WebKit::WebProcessPool::platformInitializeWebProcess):
1403         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1404         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1405         (WebKit::PluginProcessProxy::platformInitializePluginProcess):
1406         * WebProcess/cocoa/WebProcessCocoa.mm:
1407         (WebKit::WebProcess::platformInitializeWebProcess):
1408
1409 2015-03-27  Chris Dumez  <cdumez@apple.com>
1410
1411         [WK2][NetworkCache] We only cache responses with status codes that are cacheable by default
1412         https://bugs.webkit.org/show_bug.cgi?id=143125
1413         <rdar://problem/20321172>
1414
1415         Reviewed by Antti Koivisto.
1416
1417         We Previously only cached responses with status codes that are cacheable
1418         by default [1]. However, RFC 7234 [2] allows us to cache responses with
1419         other status codes, as long as they have explicit headers allowing
1420         caching:
1421         - 'Expires' header field
1422         - 'max-age' response directive
1423
1424         This patch updates our caching policy accordingly to improve efficiency.
1425
1426         [1] http://tools.ietf.org/html/rfc7231#page-48
1427         [2] http://tools.ietf.org/html/rfc7234#section-4.3.2
1428
1429         Test: http/tests/cache/disk-cache/disk-cache-307-status-code.html
1430
1431         * NetworkProcess/cache/NetworkCache.cpp:
1432         (WebKit::NetworkCache::canStore):
1433
1434 2015-03-26  Antti Koivisto  <antti@apple.com>
1435
1436         Respect cache-control directives in request
1437         https://bugs.webkit.org/show_bug.cgi?id=143121
1438         rdar://problem/19714040
1439
1440         Reviewed by Chris Dumez.
1441
1442         Better support for https://tools.ietf.org/html/rfc7234#section-5.2.1
1443
1444         * NetworkProcess/cache/NetworkCache.cpp:
1445         (WebKit::NetworkCache::canUse):
1446
1447             Consider requests with Cache-control: no-cache and max-age=0 expired.
1448
1449         (WebKit::NetworkCache::canStore):
1450
1451             Don't store requests with Cache-control: no-store.
1452
1453         (WebKit::NetworkCache::Cache::store):
1454         * NetworkProcess/cache/NetworkCache.h:
1455         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
1456         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
1457
1458 2015-03-25  Jon Honeycutt  <jhoneycutt@apple.com>
1459
1460         iOS file upload panel menu items need icons
1461         <https://bugs.webkit.org/show_bug.cgi?id=143042>
1462         <rdar://problem/20178678>
1463
1464         Reviewed by Andy Estes.
1465
1466         * Platform/spi/ios/UIKitSPI.h:
1467         Declare new SPI methods _UIImageGetWebKitTakePhotoOrVideoIcon and
1468         _UIImageGetWebKitPhotoLibraryIcon().
1469
1470         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1471         (photoLibraryIcon):
1472         (cameraIcon):
1473         If UIKit SPI exists, use it. Otherwise, return nil.
1474
1475         (-[WKFileUploadPanel _showDocumentPickerMenu]):
1476         Use icons.
1477
1478 2015-03-26  Enrica Casucci  <enrica@apple.com>
1479
1480         OS X build fix after r182037.
1481
1482         Unreviewed.
1483
1484         * UIProcess/API/mac/WKView.mm:
1485         (-[WKView _addFontPanelObserver]):
1486         (-[WKView removeWindowObservers]):
1487         (-[WKView observeValueForKeyPath:ofObject:change:context:]):
1488
1489 2015-03-26  Enrica Casucci  <enrica@apple.com>
1490
1491         iOS build fix after r182037.
1492
1493         Unreviewed.
1494
1495         * UIProcess/API/Cocoa/WKWebView.mm:
1496         (-[WKWebView _setEditable:]):
1497
1498 2015-03-26  Enrica Casucci  <enrica@apple.com>
1499
1500         REGRESSION(r1807689): Slower startup time for WKWebView.
1501         https://bugs.webkit.org/show_bug.cgi?id=143115
1502         rdar://problem/20233711
1503
1504         Reviewed by Anders Carlsson.
1505
1506         In http://trac.webkit.org/changeset/180768 we added an observer to
1507         track visibility of the NSFontPanel to ensure we could fetch the font
1508         information for the current selection when the panel first becomes visible.
1509         It turns out that adding the observer requires the shared font panel
1510         object to be created.
1511         That is apparently a very expensive operation that is regressing
1512         the initialization time for the WKWebView.
1513         We should initialize the NSFontPanel lazily, only when we make the entire
1514         view editable.
1515
1516         * UIProcess/API/Cocoa/WKWebView.mm:
1517         (-[WKWebView _setEditable:]):
1518         * UIProcess/API/mac/WKView.mm:
1519         (-[WKView addWindowObserversForWindow:]):
1520         (-[WKView _addFontPanelObserver]):
1521         (-[WKView removeWindowObservers]):
1522         (-[WKView observeValueForKeyPath:ofObject:change:context:]):
1523         * UIProcess/API/mac/WKViewInternal.h:
1524
1525 2015-03-26  Alex Christensen  <achristensen@webkit.org>
1526
1527         Progress towards CMake on Mac.
1528         https://bugs.webkit.org/show_bug.cgi?id=143112
1529
1530         Reviewed by Chris Dumez.
1531
1532         * CMakeLists.txt:
1533         * PlatformMac.cmake:
1534         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1535
1536 2015-03-26  Chris Dumez  <cdumez@apple.com>
1537
1538         [WK2][Cocoa] Add private API to override the network disk cache size
1539         https://bugs.webkit.org/show_bug.cgi?id=143113
1540         <rdar://problem/20315669>
1541
1542         Reviewed by Antti Koivisto.
1543
1544         Add private API to let the client override the network disk cache size.
1545         By default, the network disk cache is automatically determined based on
1546         the CacheModel and the available disk space. However, for testing
1547         purposes, it can be used for the client-side to be able to override
1548         the disk cache size.
1549
1550         * NetworkProcess/NetworkProcess.cpp:
1551         (WebKit::NetworkProcess::initializeNetworkProcess):
1552         * NetworkProcess/NetworkProcess.h:
1553         * NetworkProcess/cache/NetworkCache.cpp:
1554         (WebKit::NetworkCache::Cache::setMaximumSize):
1555         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1556         (WebKit::NetworkProcess::platformSetCacheModel):
1557         * Shared/Network/NetworkProcessCreationParameters.cpp:
1558         (WebKit::NetworkProcessCreationParameters::encode):
1559         (WebKit::NetworkProcessCreationParameters::decode):
1560         * Shared/Network/NetworkProcessCreationParameters.h:
1561         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1562         (API::ProcessPoolConfiguration::copy):
1563         * UIProcess/API/APIProcessPoolConfiguration.h:
1564         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1565         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1566         (-[_WKProcessPoolConfiguration diskCacheSizeOverride]):
1567         (-[_WKProcessPoolConfiguration setDiskCacheSizeOverride:]):
1568         * UIProcess/WebProcessPool.cpp:
1569         (WebKit::WebProcessPool::WebProcessPool):
1570         (WebKit::WebProcessPool::ensureNetworkProcess):
1571         * UIProcess/WebProcessPool.h:
1572
1573 2015-03-26  Andreas Kling  <akling@apple.com>
1574
1575         [Darwin] Boost the web process QoS level while handling a synchronous IPC message.
1576         <https://webkit.org/b/142988>
1577         <rdar://problem/20264346>
1578
1579         Reviewed by Antti Koivisto and Anders Carlsson.
1580
1581         Add a mechanism for IPC::Connection to boost the main thread for the duration
1582         of processing a synchronous message.
1583
1584         This fixes an issue where the UI process would block on a synchronous request
1585         to the web process that was being carried out at a lower QoS level.
1586
1587         * Platform/IPC/Connection.cpp:
1588         (IPC::Connection::Connection): Save the main thread's pthread_t while we have
1589         a chance to retreive it.
1590
1591         (IPC::Connection::processIncomingMessage): Optionally boost the main thread when
1592         processing an incoming message with the IsSyncMessage flag set.
1593
1594         * Platform/IPC/Connection.h:
1595         (IPC::Connection::setShouldBoostMainThreadOnSyncMessage): Added. When this mode is
1596         enabled, Connection will give a temporary QoS override to the main thread when
1597         receiving a synchronous message. Ownership of the override is handed to the
1598         MessageDecoder, which resets the main thread QoS in its destructor.
1599
1600         * Platform/IPC/MessageDecoder.cpp:
1601         (IPC::MessageDecoder::~MessageDecoder): Remove any QoS override owned by this message.
1602
1603         * Platform/IPC/MessageDecoder.h:
1604         (IPC::MessageDecoder::setQOSClassOverride): Added. Takes ownership of a QoS override
1605         to make sure it stays in effect until this message has been dispatched.
1606
1607         * WebProcess/WebProcess.cpp:
1608         (WebKit::WebProcess::initializeConnection): Set up main thread QoS boosting for the
1609         web process's connection to the UI process.
1610
1611 2015-03-26  Ryosuke Niwa  <rniwa@webkit.org>
1612
1613         Cursor doesn't change back to pointer when leaving Mail
1614         https://bugs.webkit.org/show_bug.cgi?id=132038
1615
1616         Reviewed by Anders Carlsson.
1617
1618         Fixed the bug by adding a cursor rect and making the primary tracking area update the cursor so that
1619         AppKit will reset the cursor as it leaves the WebView.
1620
1621         We use nil cursor here since we manually update the cursor by calling [NSCursor set].
1622
1623         * UIProcess/API/mac/WKView.mm:
1624         (-[WKView initWithFrame:processPool:configuration:webView:]):
1625         * UIProcess/mac/PageClientImpl.mm:
1626         (WebKit::PageClientImpl::recommendedScrollbarStyleDidChange):
1627
1628 2015-03-26  Michael Catanzaro  <mcatanzaro@igalia.com>
1629
1630         [Linux] SeccompFilters: improve the port-agnostic whitelist
1631         https://bugs.webkit.org/show_bug.cgi?id=140064
1632
1633         Reviewed by Žan Doberšek.
1634
1635         Allow the web process to access several files and directories that it
1636         was previously prohibited from accessing. This makes the web process
1637         much less likely to break.
1638
1639         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
1640         (WebKit::SyscallPolicy::addDefaultWebProcessPolicy):
1641
1642 2015-03-26  Antti Koivisto  <antti@apple.com>
1643
1644         Remove unneeded isConditionalRequest check from NetworkResourceLoader
1645         https://bugs.webkit.org/show_bug.cgi?id=143096
1646
1647         Reviewed by Anders Carlsson.
1648
1649         This check is leftover from implementation that allowed disk cache to validate conditional
1650         request itself. The case can't happen as NetworkCache canRetrieve test does not allow
1651         conditional requests in the first place.
1652
1653         * NetworkProcess/NetworkResourceLoader.cpp:
1654         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
1655         (WebKit::isConditionalRequest): Deleted.
1656
1657 2015-03-26  Antti Koivisto  <antti@apple.com>
1658
1659         Rename Storage::Entry to Storage::Record
1660         https://bugs.webkit.org/show_bug.cgi?id=143101
1661
1662         Reviewed by Chris Dumez.
1663
1664         Lets have just one type called Entry in the cache code.
1665
1666         * NetworkProcess/cache/NetworkCache.cpp:
1667         (WebKit::NetworkCache::Cache::retrieve):
1668         (WebKit::NetworkCache::Cache::store):
1669         (WebKit::NetworkCache::Cache::update):
1670         (WebKit::NetworkCache::Cache::traverse):
1671         (WebKit::NetworkCache::Cache::dumpContentsToFile):
1672         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1673         (WebKit::NetworkCache::Entry::Entry):
1674         (WebKit::NetworkCache::Entry::encodeAsStorageRecord):
1675         (WebKit::NetworkCache::Entry::decodeStorageRecord):
1676         (WebKit::NetworkCache::Entry::initializeBufferFromStorageRecord):
1677         (WebKit::NetworkCache::Entry::buffer):
1678         (WebKit::NetworkCache::Entry::shareableResourceHandle):
1679         (WebKit::NetworkCache::Entry::encode): Deleted.
1680         (WebKit::NetworkCache::Entry::decode): Deleted.
1681         (WebKit::NetworkCache::Entry::initializeBufferFromStorageEntry): Deleted.
1682         * NetworkProcess/cache/NetworkCacheEntry.h:
1683         (WebKit::NetworkCache::Entry::sourceStorageRecord):
1684         (WebKit::NetworkCache::Entry::sourceStorageEntry): Deleted.
1685         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1686         (WebKit::NetworkCache::RecordMetaData::RecordMetaData):
1687         (WebKit::NetworkCache::decodeRecordMetaData):
1688         (WebKit::NetworkCache::decodeRecordHeader):
1689         (WebKit::NetworkCache::decodeRecord):
1690         (WebKit::NetworkCache::encodeRecordMetaData):
1691         (WebKit::NetworkCache::encodeRecordHeader):
1692         (WebKit::NetworkCache::Storage::dispatchReadOperation):
1693         (WebKit::NetworkCache::retrieveFromMemory):
1694         (WebKit::NetworkCache::Storage::store):
1695         (WebKit::NetworkCache::Storage::update):
1696         (WebKit::NetworkCache::Storage::traverse):
1697         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
1698         (WebKit::NetworkCache::Storage::dispatchFullWriteOperation):
1699         (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation):
1700         (WebKit::NetworkCache::EntryMetaData::EntryMetaData): Deleted.
1701         (WebKit::NetworkCache::decodeEntryMetaData): Deleted.
1702         (WebKit::NetworkCache::decodeEntryHeader): Deleted.
1703         (WebKit::NetworkCache::decodeEntry): Deleted.
1704         (WebKit::NetworkCache::encodeEntryMetaData): Deleted.
1705         (WebKit::NetworkCache::encodeEntryHeader): Deleted.
1706         * NetworkProcess/cache/NetworkCacheStorage.h:
1707
1708 2015-03-26  Chris Dumez  <cdumez@apple.com>
1709
1710         [WK2] Let the compiler generate the NetworkCache::Key move constructor
1711         https://bugs.webkit.org/show_bug.cgi?id=143079
1712
1713         Reviewed by Antti Koivisto.
1714
1715         Let the compiler generate the NetworkCache::Key move constructor. The
1716         generated one will do exactly the same thing as the one we had except
1717         that it will move the m_hash member as well. I don't see any reason why
1718         we weren't moving this member before (it is an std::array<uint8_t, 16>).
1719
1720         Also have the compiler generate a move assignment operator for
1721         consistency. Although it is not currently useful, it could be at some
1722         point.
1723
1724         * NetworkProcess/cache/NetworkCacheKey.cpp:
1725         (WebKit::NetworkCache::Key::Key): Deleted.
1726         * NetworkProcess/cache/NetworkCacheKey.h:
1727
1728 2015-03-26  Chris Dumez  <cdumez@apple.com>
1729
1730         [WK2][NetworkCache] Compute if a cached response has expired only when actually needed
1731         https://bugs.webkit.org/show_bug.cgi?id=143070
1732
1733         Reviewed by Antti Koivisto.
1734
1735         Compute if a cached response has expired only when actually needed:
1736         - This is not a history navigation
1737         and
1738         - It does not have "Cache-Control: no-cache" header
1739
1740         Previously, we would always determine if the response has expired and
1741         we often end up not using this information.
1742
1743         * NetworkProcess/cache/NetworkCache.cpp:
1744         (WebKit::NetworkCache::responseHasExpired):
1745         (WebKit::NetworkCache::canUse):
1746
1747 2015-03-26  Zan Dobersek  <zdobersek@igalia.com>
1748
1749         Avoid the Vector<> copy in WebTouchEvent constructor
1750         https://bugs.webkit.org/show_bug.cgi?id=143043
1751
1752         Reviewed by Carlos Garcia Campos.
1753
1754         Have the WebTouchEvent accept a Vector<> rvalue.
1755         The relevant code is updated so the Vector<> object is moved
1756         through the call chain and finally into the WebTouchEvent constructor.
1757
1758         * Shared/NativeWebTouchEvent.h:
1759         * Shared/WebEvent.h:
1760         * Shared/WebTouchEvent.cpp:
1761         (WebKit::WebTouchEvent::WebTouchEvent):
1762         * Shared/efl/WebEventFactory.cpp:
1763         (WebKit::WebEventFactory::createWebTouchEvent):
1764         * Shared/gtk/NativeWebTouchEventGtk.cpp:
1765         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
1766         * Shared/gtk/WebEventFactory.cpp:
1767         (WebKit::WebEventFactory::createWebTouchEvent):
1768         * Shared/gtk/WebEventFactory.h:
1769         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1770         (webkitWebViewBaseTouchEvent):
1771
1772 2015-03-25  Chris Dumez  <cdumez@apple.com>
1773
1774         [WK2] WebFrameLoaderClient::dispatchDecidePolicyForResponse() should always call the FramePolicyFunction
1775         https://bugs.webkit.org/show_bug.cgi?id=143036
1776         <rdar://problem/20252438>
1777         <rdar://problem/13811738>
1778
1779         Reviewed by Alexey Proskuryakov.
1780
1781         WebFrameLoaderClient::dispatchDecidePolicyForResponse() should always
1782         call the FramePolicyFunction. Previously, it would fail to do in 2
1783         cases:
1784         - m_frame->page() returns null
1785         or
1786         - webPage->sendSync() returns false
1787
1788         If the FramePolicyFunction is not called, we will fail to clear the
1789         callback in the PolicyChecker and
1790         DocumentLoader::continueAfterContentPolicy() will not be called.
1791
1792         DocumentLoader::continueAfterContentPolicy() is in charge of resetting
1793         m_waitingForContentPolicy flag to false. This could therefore explain
1794         the following assertion being hit in DocumentLoader::detachFromFrame()
1795         (see <rdar://problem/20252438>):
1796         RELEASE_ASSERT(!m_waitingForContentPolicy)
1797
1798         Also, as the PolicyChecker callback is not cleared, it could make it
1799         possible for DocumentLoader::continueAfterContentPolicy() to be called
1800         *after* the load is finished, when later canceling the PolicyCallback:
1801         FrameLoader::stopAllLoaders()
1802          -> PolicyChecker::stopCheck()
1803           -> PolicyCallback::cancel()
1804            -> DocumentLoader::continueAfterContentPolicy(PolicyIgnore)
1805
1806         Calling continueAfterContentPolicy(PolicyIgnore) after the load is
1807         finished would be bad and could explain some of the crashes we've seen
1808         in DocumentLoader::continueAfterContentPolicy() ->
1809         DocumentLoader:: stopLoadingForPolicyChange() (see
1810         <rdar://problem/13811738>).
1811
1812         This patch also applies the same fix to
1813         dispatchDecidePolicyForNewWindowAction() and
1814         dispatchDecidePolicyForNavigationAction() as they use the same pattern.
1815
1816         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1817         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1818         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
1819         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1820
1821 2015-03-25  Tim Horton  <timothy_horton@apple.com>
1822
1823         Add a preference to prevent "user-scalable=no" from having any effect
1824         https://bugs.webkit.org/show_bug.cgi?id=143032
1825
1826         Reviewed by Sam Weinig.
1827
1828         * Shared/WebPreferencesDefinitions.h:
1829         * WebProcess/WebPage/WebPage.cpp:
1830         (WebKit::WebPage::updatePreferences):
1831         Add a preference and push it to the ViewportConfiguration.
1832
1833 2015-03-25  Beth Dakin  <bdakin@apple.com>
1834
1835         REGRESSION (r181660): Force click url preview doesn't have a TextIndicator in Mail
1836         https://bugs.webkit.org/show_bug.cgi?id=143064
1837         -and corresponding-
1838         rdar://problem/20251440
1839
1840         Reviewed by Tim Horton.
1841
1842         The TextIndicator was getting set to nil by the call to 
1843         _dismissContentRelativeChildWindows in mouseDown. That line of code was added by 
1844         http://trac.webkit.org/changeset/177242 to work around a bug in another component 
1845         that has now been resolved, so it no longer appears to be necessary. 
1846
1847         * UIProcess/API/mac/WKView.mm:
1848         (-[WKView mouseDown:]):
1849
1850 2015-03-25  Anders Carlsson  <andersca@apple.com>
1851
1852         Add network and application cache directories to WebsiteDataStore
1853         https://bugs.webkit.org/show_bug.cgi?id=143063
1854
1855         Reviewed by Sam Weinig.
1856
1857         Create a WebKit directory under ~/Library/Caches/<Bundle ID> for non-sandboxed applications,
1858         and ~/Library/Caches for sandboxed applications. Create NetworkCache and OfflineWebApplicationCache
1859         subdirectories. These directories will be used with the modern WebKit API.
1860
1861         * UIProcess/API/APIWebsiteDataStore.h:
1862         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
1863         (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
1864         (API::WebsiteDataStore::defaultDataStoreConfiguration):
1865         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1866         (WebKit::WebsiteDataStore::WebsiteDataStore):
1867         * UIProcess/WebsiteData/WebsiteDataStore.h:
1868
1869 2015-03-25  Sam Weinig  <sam@webkit.org>
1870
1871         Address additional review feedback from https://bugs.webkit.org/show_bug.cgi?id=143059.
1872
1873         * Shared/WebCompiledContentExtension.cpp:
1874         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
1875         * UIProcess/API/C/WKUserContentFilterRef.cpp:
1876         (WKUserContentFilterCreate):
1877         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
1878         (-[_WKUserContentFilter initWithName:serializedRules:]):
1879
1880 2015-03-25  Sam Weinig  <sam@webkit.org>
1881
1882         [Content Extensions] Convert content extension compiling to return error codes and write its output using a client
1883         https://bugs.webkit.org/show_bug.cgi?id=143059
1884
1885         Reviewed by Alex Christensen.
1886
1887         * Shared/WebCompiledContentExtension.cpp:
1888         * Shared/WebCompiledContentExtension.h:
1889         (WebKit::LegacyContentExtensionCompilationClient::LegacyContentExtensionCompilationClient):
1890         (WebKit::LegacyContentExtensionCompilationClient::writeBytecode):
1891         (WebKit::LegacyContentExtensionCompilationClient::writeActions):
1892         Add subclass of ContentExtensionCompilationClient for use with the non-file backed content
1893         extensions.
1894
1895         * UIProcess/API/C/WKUserContentFilterRef.cpp:
1896         (WKUserContentFilterCreate):
1897         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
1898         (-[_WKUserContentFilter initWithName:serializedRules:]):
1899         Update to use the new interface of compileRuleList().
1900
1901 2015-03-25  Ryosuke Niwa  <rniwa@webkit.org>
1902
1903         Web Inspector: Switching tabs to window with inspector open prohibits typing into console
1904         https://bugs.webkit.org/show_bug.cgi?id=126800
1905
1906         Reviewed by Anders Carlsson.
1907
1908         This is a regression from r85356 and r83814. These two patches made WKWebView clear its selection
1909         when WKView resigns the first responder without ever restoring it even if WKView later becomes
1910         the first responder again. This is problematic when a text field or a editing host element had been
1911         focused and selected prior to the resignation since the editing code uses the selection to determine
1912         the editability of the element.
1913
1914         Fixed the bug by restoring selection in [WKView becomeFirstResponder] if the selection is empty.
1915
1916         * UIProcess/API/mac/WKView.mm:
1917         (-[WKView becomeFirstResponder]):
1918         * UIProcess/WebPageProxy.cpp:
1919         (WebKit::WebPageProxy::restoreSelectionInFocusedEditableElement):
1920         * UIProcess/WebPageProxy.h:
1921         * WebProcess/WebPage/WebPage.cpp:
1922         (WebKit::WebPage::restoreSelectionInFocusedEditableElement):
1923         * WebProcess/WebPage/WebPage.h:
1924         * WebProcess/WebPage/WebPage.messages.in:
1925
1926 2015-03-25  Beth Dakin  <bdakin@apple.com>
1927
1928         REGRESSION (r181660): Safari navigates to link after a starting and canceling a 
1929         force preview
1930         https://bugs.webkit.org/show_bug.cgi?id=143057
1931         -and corresponding-
1932         rdar://problem/20251436
1933
1934         Reviewed by Tim Horton.
1935
1936         Always call _page->immediateActionDidUpdate() so that the EventHandler’s 
1937         ImmediateActionStage is appropriately updated.
1938         * UIProcess/mac/WKImmediateActionController.mm:
1939         (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
1940
1941         Update the EventHandler’s ImmediateActionStage.
1942         * WebProcess/WebPage/mac/WebPageMac.mm:
1943         (WebKit::WebPage::immediateActionDidUpdate):
1944
1945 2015-03-25  Antti Koivisto  <antti@apple.com>
1946
1947         Separate entry decoding from validation
1948         https://bugs.webkit.org/show_bug.cgi?id=143052
1949
1950         Reviewed by Chris Dumez.
1951
1952         Make NetworkCache::Cache a class and move it to a file of its own.
1953         Move the encoding/decoding code there.
1954
1955         * NetworkProcess/NetworkProcess.cpp:
1956         (WebKit::fetchDiskCacheEntries):
1957         (WebKit::clearDiskCacheEntries):
1958         * NetworkProcess/NetworkResourceLoader.cpp:
1959         (WebKit::sendReplyToSynchronousRequest):
1960         (WebKit::NetworkResourceLoader::start):
1961         (WebKit::NetworkResourceLoader::sendBufferMaybeAborting):
1962         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
1963         (WebKit::NetworkResourceLoader::validateCacheEntry):
1964         * NetworkProcess/NetworkResourceLoader.h:
1965         * NetworkProcess/cache/NetworkCache.cpp:
1966         (WebKit::NetworkCache::collectVaryingRequestHeaders):
1967         (WebKit::NetworkCache::canUse):
1968
1969             Focused function for deciding if we can use a cache entry and if it needs validation.
1970
1971         (WebKit::NetworkCache::Cache::retrieve):
1972         (WebKit::NetworkCache::Cache::store):
1973         (WebKit::NetworkCache::Cache::update):
1974         (WebKit::NetworkCache::Cache::traverse):
1975         (WebKit::NetworkCache::encodeStorageEntry): Deleted.
1976         (WebKit::NetworkCache::decodeStorageEntry): Deleted.
1977         * NetworkProcess/cache/NetworkCache.h:
1978         * NetworkProcess/cache/NetworkCacheEntry.cpp: Added.
1979         (WebKit::NetworkCache::Entry::Entry):
1980         (WebKit::NetworkCache::Entry::encode):
1981         (WebKit::NetworkCache::Entry::decode):
1982         (WebKit::NetworkCache::Entry::initializeBufferFromStorageEntry):
1983         (WebKit::NetworkCache::Entry::buffer):
1984         (WebKit::NetworkCache::Entry::shareableResourceHandle):
1985         (WebKit::NetworkCache::Entry::needsValidation):
1986         (WebKit::NetworkCache::Entry::setNeedsValidation):
1987         * NetworkProcess/cache/NetworkCacheEntry.h: Added.
1988         (WebKit::NetworkCache::Entry::key):
1989         (WebKit::NetworkCache::Entry::timeStamp):
1990         (WebKit::NetworkCache::Entry::response):
1991         (WebKit::NetworkCache::Entry::varyingRequestHeaders):
1992         (WebKit::NetworkCache::Entry::sourceStorageEntry):
1993         * NetworkProcess/cache/NetworkCacheStatistics.h:
1994         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
1995         (WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
1996         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
1997         * WebKit2.xcodeproj/project.pbxproj:
1998
1999 2015-03-25  David Hyatt  <hyatt@apple.com>
2000
2001         Add a pref to enable the new block-inside-inline model
2002         https://bugs.webkit.org/show_bug.cgi?id=143050
2003
2004         Reviewed by Sam Weinig.
2005
2006         * Shared/WebPreferencesDefinitions.h:
2007         * UIProcess/API/C/WKPreferences.cpp:
2008         (WKPreferencesSetNewBlockInsideInlineModelEnabled):
2009         (WKPreferencesGetNewBlockInsideInlineModelEnabled):
2010         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2011         * WebProcess/WebPage/WebPage.cpp:
2012         (WebKit::WebPage::updatePreferences):
2013
2014 2015-03-25  Zan Dobersek  <zdobersek@igalia.com>
2015
2016         [WK2] WebUserMediaClient::pageDestroyed() virtual method should be marked as override
2017         https://bugs.webkit.org/show_bug.cgi?id=143046
2018
2019         Reviewed by Carlos Garcia Campos.
2020
2021         * WebProcess/WebCoreSupport/WebUserMediaClient.h: Mark the WebUserMediaClient::pageDestroyed()
2022         method, inherited from the WebCore::UserMediaClient, as an override.
2023
2024 2015-03-25  Zan Dobersek  <zdobersek@igalia.com>
2025
2026         [GTK][WK2] WebPageProxy::failedToShowPopupMenu() virtual method should be marked as override
2027         https://bugs.webkit.org/show_bug.cgi?id=143045
2028
2029         Reviewed by Carlos Garcia Campos.
2030
2031         * UIProcess/WebPageProxy.h: Mark the failedToShowPopupMenu(), inherited from
2032         the WebPopupMenuProxy::Client class, as overridden.
2033
2034 2015-03-25  Zan Dobersek  <zdobersek@igalia.com>
2035
2036         [WK2] Clean up DrawingAreaImpl vtable overrides
2037         https://bugs.webkit.org/show_bug.cgi?id=143044
2038
2039         Reviewed by Carlos Garcia Campos.
2040
2041         Declare virtual methods of the DrawingAreaImpl class as overridden where necessary.
2042
2043         * WebProcess/WebPage/DrawingAreaImpl.h:
2044         (WebKit::DrawingAreaImpl::layerTreeStateIsFrozen): Deleted.
2045         (WebKit::DrawingAreaImpl::layerTreeHost): Deleted.
2046
2047 2015-03-24  Ryosuke Niwa  <rniwa@webkit.org>
2048
2049         Inspector doesn't get focused when opened in dock mode
2050         https://bugs.webkit.org/show_bug.cgi?id=143030
2051
2052         Reviewed by Anders Carlsson.
2053
2054         The bug was caused by platformBringToFront and platformAttach calling makeFirstResponder on WKWebView,
2055         which aren't intended to become the first responder. Fixed the bug by calling makeFirstResponder on the WKView
2056         subview of the WKWebView, which is intended to be used as the first responder on behalf of the web view.
2057
2058         * UIProcess/mac/WebInspectorProxyMac.mm:
2059         (WebKit::WebInspectorProxy::platformBringToFront):
2060         (WebKit::WebInspectorProxy::platformAttach):
2061
2062 2015-03-24  Chris Dumez  <cdumez@apple.com>
2063
2064         [WK2] Responses with 302 HTTP Status Code should not be cached
2065         https://bugs.webkit.org/show_bug.cgi?id=143028
2066         <rdar://problem/19714040>
2067
2068         Reviewed by Antti Koivisto.
2069
2070         Responses with 302 HTTP Status Code should not be cached as per
2071         RFC 7231:
2072         http://tools.ietf.org/html/rfc7231#section-6.1
2073
2074         This patch updates our disk cache policy accordingly.
2075
2076         Test: http/tests/cache/disk-cache/disk-cache-302-status-code.html
2077
2078         * NetworkProcess/cache/NetworkCache.cpp:
2079         (WebKit::NetworkCache::canStore):
2080
2081 2015-03-24  Anders Carlsson  <andersca@apple.com>
2082
2083         Fix crash in WebKit::RemoteObjectRegistry::sendInvocation
2084         https://bugs.webkit.org/show_bug.cgi?id=143027
2085         rdar://problem/20208674
2086
2087         Reviewed by Sam Weinig.
2088
2089         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2090         (-[WKWebProcessPlugInBrowserContextController dealloc]):
2091         Make sure to invalidate the _WKRemoteObjectRegistry like we do in the UI process.
2092
2093 2015-03-24  Chris Dumez  <cdumez@apple.com>
2094
2095         [WK2] Responses with 204 HTTP Status Code should be cacheable by default
2096         https://bugs.webkit.org/show_bug.cgi?id=143020
2097         <rdar://problem/20281529>
2098
2099         Reviewed by Antti Koivisto.
2100
2101         Make responses with 204 HTTP Status Code cacheable by default, as
2102         per RFC 7231:
2103         http://tools.ietf.org/html/rfc7231#section-6.3.5
2104
2105         Test: http/tests/cache/disk-cache/disk-cache-204-status-code.html
2106
2107         * NetworkProcess/cache/NetworkCache.cpp:
2108         (WebKit::NetworkCache::canStore):
2109
2110 2015-03-24  Enrica Casucci  <enrica@apple.com>
2111
2112         [iOS] Remove unused keyboard code in WKSelectPopover class.
2113         https://bugs.webkit.org/show_bug.cgi?id=143021
2114
2115         Reviewed by Joseph Pecoraro.
2116
2117         WKSelectPopover created an instance of UIKeyboard that was
2118         initialized in initWithView but never used. Removing the
2119         obsolete code.
2120
2121         * UIProcess/ios/forms/WKFormSelectPopover.mm:
2122         (-[WKSelectPopover initWithView:hasGroups:]):
2123
2124 2015-03-24  Dan Bernstein  <mitz@apple.com>
2125
2126         WebKit2 part of <rdar://problem/20282863> Transforms are flattened in snapshots of on-screen WKWebViews
2127         https://bugs.webkit.org/show_bug.cgi?id=143023
2128
2129         Reviewed by Tim Horton.
2130
2131         * UIProcess/API/Cocoa/WKWebView.mm:
2132         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): If the view is in a
2133         window, use CARenderServerRenderLayerWithTransform to synchronously capture a snapshot of
2134         its layer tree into an IOSurfcae, then call the completion handler with an image created
2135         from the IOSurface.
2136
2137 2015-03-24  Beth Dakin  <bdakin@apple.com>
2138
2139         Add events related to force click gesture
2140         https://bugs.webkit.org/show_bug.cgi?id=142836
2141         -and corresponding-
2142         rdar://problem/20210239
2143
2144         Reviewed by Dean Jackson.
2145
2146         ActionMenuHitTestResult has a new bool indicating whether to not the HitTestResult 
2147         will prevent default. 
2148         * Shared/mac/ActionMenuHitTestResult.h:
2149         * Shared/mac/ActionMenuHitTestResult.mm:
2150         (WebKit::ActionMenuHitTestResult::encode):
2151         (WebKit::ActionMenuHitTestResult::decode):
2152
2153         Send immediateActionDidUpdate and the normalized force over the the WebProcess.
2154         * UIProcess/WebPageProxy.cpp:
2155         (WebKit::WebPageProxy::immediateActionDidUpdate):
2156         * UIProcess/WebPageProxy.h:
2157
2158         We need a dummy animation controller when web content is overriding the default 
2159         behavior.
2160         * UIProcess/mac/WKImmediateActionController.mm:
2161
2162         Send along the update information.
2163         (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
2164
2165         Use the dummy animation controller if default has been prevented.
2166         (-[WKImmediateActionController _defaultAnimationController]):
2167         (-[WKImmediateActionController _updateImmediateActionItem]):
2168
2169         Keep track of whether m_lastActionMenuHitTes prevented the default immediate 
2170         action behavior.
2171         * WebProcess/WebPage/WebPage.cpp:
2172         (WebKit::WebPage::WebPage):
2173         * WebProcess/WebPage/WebPage.h:
2174         * WebProcess/WebPage/WebPage.messages.in:
2175
2176         Call dispatchMouseForceMayBegin() at hit test time.
2177         * WebProcess/WebPage/mac/WebPageMac.mm:
2178         (WebKit::WebPage::performActionMenuHitTestAtLocation):
2179
2180         Call dispatchMouseForceChanged() if appropriate.
2181         (WebKit::WebPage::immediateActionDidUpdate):
2182
2183         Call dispatchMouseForceCancelled() if appropriate.
2184         (WebKit::WebPage::immediateActionDidCancel):
2185
2186         Call dispatchMouseForceDown() if appropriate.
2187         (WebKit::WebPage::immediateActionDidComplete):
2188
2189 2015-03-24  Anders Carlsson  <andersca@apple.com>
2190
2191         Fix designated initializer violations
2192         https://bugs.webkit.org/show_bug.cgi?id=143016
2193         rdar://problem/20268858
2194
2195         Reviewed by Dan Bernstein.
2196
2197         Move -[WKProcessPool _initWithConfiguration:] to a class extension so we can make it the designated initializer.
2198
2199         * UIProcess/API/Cocoa/WKProcessPool.mm:
2200         (-[WKProcessPool _initWithConfiguration:]):
2201         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2202
2203 2015-03-24  Chris Dumez  <cdumez@apple.com>
2204
2205         [WK2] Responses with 404 HTTP Status Code should be cacheable by default
2206         https://bugs.webkit.org/show_bug.cgi?id=143014
2207         <rdar://problem/20280310>
2208
2209         Reviewed by Antti Koivisto.
2210
2211         Make responses with 404 HTTP Status Code cacheable by default, as
2212         per RFC 7231:
2213         http://tools.ietf.org/html/rfc7231#section-6.5.4
2214
2215         Test: http/tests/cache/disk-cache/disk-cache-404-status-code.html
2216
2217         * NetworkProcess/cache/NetworkCache.cpp:
2218         (WebKit::NetworkCache::canStore):
2219
2220 2015-03-24  Chris Dumez  <cdumez@apple.com>
2221
2222         [WK2] Remove NetworkCache FIXME comment about caching responses to OPTIONS requests
2223         https://bugs.webkit.org/show_bug.cgi?id=143009
2224
2225         Reviewed by Andreas Kling.
2226
2227         Remove NetworkCache FIXME comment about caching responses to OPTIONS
2228         method as RFC 7234 says "Responses to the OPTIONS method are not
2229         cacheable" [1].
2230
2231         [1] http://tools.ietf.org/html/rfc7231#page-31
2232
2233         * NetworkProcess/cache/NetworkCache.cpp:
2234         (WebKit::NetworkCache::canRetrieve):
2235
2236 2015-03-24  Chris Dumez  <cdumez@apple.com>
2237
2238         [WK2] NetworkCache retrievals fail for entries with no body
2239         https://bugs.webkit.org/show_bug.cgi?id=142979
2240         <rdar://problem/20264100>
2241
2242         Reviewed by Antti Koivisto.
2243
2244         NetworkCache retrievals were failing for entries with no body because
2245         decodeEntry() doesn't correctly handle this case. In particular, the
2246         following check fails:
2247         "metaData.bodyOffset + metaData.bodySize == fileData.size()".
2248         This is because bodyOffset is pageSize-aligned.
2249
2250         As a result, the following resource on apple.com is stored in the cache
2251         but we fail to reuse it and reload it from the network every time:
2252         http://images.apple.com/home/styles/promos.css
2253
2254         This patch updates decodeEntry() to create a null Data object for the
2255         body if bodySize is 0.
2256
2257         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
2258         (WebKit::NetworkCache::Data::data):
2259         Do not attempt to initialize m_data if m_dispatchData is null as the
2260         call to dispatch_data_create_map() would then crash. We now return
2261         null in this case. This is needed as decodeStorageEntry() in
2262         NetworkCache.cpp constructs a SharedBuffer from
2263         storageEntry.body.data() and the body may be null.
2264
2265         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2266         (WebKit::NetworkCache::decodeEntry):
2267
2268 2015-03-24  Chris Dumez  <cdumez@apple.com>
2269
2270         [WK2] The WebKit network cache does not cache responses with "Content-Disposition: attachment" header
2271         https://bugs.webkit.org/show_bug.cgi?id=142989
2272         <rdar://problem/20265992>
2273
2274         Reviewed by Antti Koivisto.
2275
2276         Update our WebKit network cache policy to cache responses with
2277         "Content-Disposition: attachment" header. There is no reason we cannot
2278         cache these and our memory cache already does.
2279
2280         This was causing a decent amount of cache misses in the wild. I have
2281         noticed for example that when loading disney.com, we fail to cache the
2282         following resources because of this policy:
2283         http://pagead2.googlesyndication.com/pagead/osd.js
2284         http://pagead2.googlesyndication.com/pagead/show_companion_ad.js
2285
2286         Those resources have Cache-Control headers that indicate they are meant
2287         to be cacheable.
2288
2289         Test: http/tests/cache/disk-cache-validation-attachment.html
2290
2291         * NetworkProcess/cache/NetworkCache.cpp:
2292         (WebKit::NetworkCache::canStore):
2293
2294 2015-03-23  Joseph Pecoraro  <pecoraro@apple.com>
2295
2296         Unreviewed, another attempt to fix 32-bit build after r181881.
2297
2298         * UIProcess/WebInspectorProxy.h:
2299
2300 2015-03-23  Joseph Pecoraro  <pecoraro@apple.com>
2301
2302         Unreviewed, attempt to fix 32-bit build after r181881.
2303
2304         * UIProcess/API/Cocoa/WKViewPrivate.h:
2305         * UIProcess/API/mac/WKView.mm:
2306
2307 2015-03-19  Timothy Hatcher  <timothy@apple.com>
2308
2309         Web Inspector: Support attaching to another view other than the WKView
2310         https://bugs.webkit.org/show_bug.cgi?id=142892
2311
2312         Reviewed by Tim Horton.
2313
2314         * UIProcess/API/C/WKInspector.cpp:
2315         (WKInspectorAttach): Drive by fix so it used the last attachment side.
2316
2317         * UIProcess/API/Cocoa/WKViewPrivate.h:
2318         * UIProcess/API/mac/WKView.mm:
2319         (-[WKView _inspectorAttachmentView]): Added.
2320         (-[WKView _setInspectorAttachmentView:]): Added.
2321
2322         * UIProcess/WebInspectorProxy.cpp:
2323         (WebKit::WebInspectorProxy::createInspectorPage):
2324         (WebKit::WebInspectorProxy::attachAvailabilityChanged):
2325         Use platformCanAttach as a final check incase there is a different
2326         attachment view that the platform knows about.
2327
2328         * UIProcess/WebInspectorProxy.h:
2329         (WebKit::WebInspectorProxy::attachmentSide): Added.
2330         (WebKit::WebInspectorProxy::platformCanAttach): Added.
2331
2332         * UIProcess/mac/WebInspectorProxyMac.mm:
2333         (WebKit::WebInspectorProxy::attachmentViewDidChange): Added.
2334         (WebKit::WebInspectorProxy::closeTimerFired):
2335         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2336         (WebKit::WebInspectorProxy::platformCanAttach):
2337         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
2338         (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
2339         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
2340         (WebKit::WebInspectorProxy::platformAttach):
2341         (WebKit::WebInspectorProxy::platformDetach):
2342         Use the _inspectorAttachmentView and change how the frame change notification
2343         is observed and follow the attachment view as it changes.
2344
2345 2015-03-23  Tim Horton  <timothy_horton@apple.com>
2346
2347         Images shared to photos via action menu are padded with zeroes at the end
2348         https://bugs.webkit.org/show_bug.cgi?id=142985
2349
2350         Reviewed by Anders Carlsson.
2351
2352         * Shared/mac/ActionMenuHitTestResult.h:
2353         * Shared/mac/ActionMenuHitTestResult.mm:
2354         (WebKit::ActionMenuHitTestResult::encode):
2355         (WebKit::ActionMenuHitTestResult::decode):
2356         * WebProcess/WebPage/mac/WebPageMac.mm:
2357         (WebKit::WebPage::performActionMenuHitTestAtLocation):
2358         Send the size of the image separately from the SharedMemory.
2359         The SharedMemory's size can be rounded up, so we need to keep the original
2360         size around in order to write the data to disk.
2361
2362         * UIProcess/mac/WKActionMenuController.mm:
2363         (-[WKActionMenuController _hitTestResultImage]):
2364         (-[WKActionMenuController _addImageToPhotos:]):
2365         Use the image size instead of the SharedMemory size.
2366
2367 2015-03-23  Enrica Casucci  <enrica@apple.com>
2368
2369         [iOS] WebContent crash attempting to select text with a gesture at RenderObject::absoluteBoundingBoxRect.
2370         https://bugs.webkit.org/show_bug.cgi?id=142913
2371         rdar://problem/16400033
2372
2373         Reviewed by Sam Weinig.
2374
2375         When looking for the best candidate range at the given position,
2376         we should skip nodes that don't have a renderer.
2377         This is a speculative fix.
2378
2379         * WebProcess/WebPage/ios/WebPageIOS.mm:
2380         (WebKit::WebPage::rangeForWebSelectionAtPosition):
2381
2382 2015-03-23  Alexey Proskuryakov  <ap@apple.com>
2383
2384         REGRESSION (Yosemite): WKView visibility notifications are messed up
2385         https://bugs.webkit.org/show_bug.cgi?id=142945
2386
2387         Reviewed by Tim Horton.
2388
2389         As these notifications cannot be used by NSView subclasses, create a separate
2390         object for observing them.
2391
2392         * UIProcess/API/mac/WKView.mm:
2393         (-[WKWindowVisibilityObserver initWithView:]):
2394         (-[WKWindowVisibilityObserver startObserving:]):
2395         (-[WKWindowVisibilityObserver stopObserving:]):
2396         (-[WKWindowVisibilityObserver _windowDidOrderOnScreen:]):
2397         (-[WKWindowVisibilityObserver _windowDidOrderOffScreen:]):
2398         (-[WKView addWindowObserversForWindow:]):
2399         (-[WKView removeWindowObservers]): Also, don't try to remove NSWindowWillOrderOffScreenNotification,
2400         which we never start to observe.
2401         (-[WKView initWithFrame:processPool:configuration:webView:]):
2402         * UIProcess/API/mac/WKViewInternal.h:
2403
2404 2015-03-23  Anders Carlsson  <andersca@apple.com>
2405
2406         Make platform/mac-wk2/plugins/destroy-during-async-npp-new.html work again.
2407         https://bugs.webkit.org/show_bug.cgi?id=133692
2408         rdar://problem/17255947
2409
2410         Reviewed by Alexey Proskuryakov.
2411
2412         Add plug-in destruction protectors around message receiver code that can call out to NPObjects or JavaScript
2413         where we need the plug-in to stay around after the call.
2414
2415         * Shared/Plugins/NPObjectMessageReceiver.cpp:
2416         (WebKit::NPObjectMessageReceiver::invoke):
2417         (WebKit::NPObjectMessageReceiver::invokeDefault):
2418         (WebKit::NPObjectMessageReceiver::getProperty):
2419         (WebKit::NPObjectMessageReceiver::setProperty):
2420         (WebKit::NPObjectMessageReceiver::construct):
2421
2422 2015-03-23  Anders Carlsson  <andersca@apple.com>
2423
2424         Put the WK_NULLABLE_SPECIFIER in the right place for block parameters
2425         https://bugs.webkit.org/show_bug.cgi?id=142975
2426         rdar://problem/19863930
2427
2428         Reviewed by Dan Bernstein.
2429
2430         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
2431         * UIProcess/API/Cocoa/WKUIDelegate.h:
2432         * UIProcess/API/Cocoa/WKWebView.h:
2433
2434 2015-03-23  Tim Horton  <timothy_horton@apple.com>
2435
2436         Add a share item to the link action menu
2437         https://bugs.webkit.org/show_bug.cgi?id=142961
2438         <rdar://problem/19198374>
2439
2440         Reviewed by Beth Dakin.
2441
2442         * UIProcess/mac/WKActionMenuController.mm:
2443         (-[WKActionMenuController _hitLinkURL]):
2444         Factor out _hitLinkURL from various places.
2445
2446         (-[WKActionMenuController _openURLFromActionMenu:]):
2447         (-[WKActionMenuController _addToReadingListFromActionMenu:]):
2448         (-[WKActionMenuController _defaultMenuItemsForVideo]):
2449         (-[WKActionMenuController _defaultMenuItemsForImage]):
2450         (-[WKActionMenuController _createActionMenuItemForTag:]):
2451         (-[WKActionMenuController _createShareActionMenuItemForTag:withItems:]):
2452         Adopt -[NSMenuItem standardShareMenuItemWithItems].
2453         All of the null-checking is unnecessary as it's impossible to enter
2454         these functions with a null image/etc.
2455
2456         (-[WKActionMenuController _defaultMenuItemsForLink]):
2457         * Shared/API/c/WKActionMenuItemTypes.h:
2458         Add a 'Share' item to the link menu.
2459
2460 2015-03-23  Zan Dobersek  <zdobersek@igalia.com>
2461
2462         [GTK] Use std::abs() in ClickCounter::currentClickCountForGdkButtonEvent()
2463         https://bugs.webkit.org/show_bug.cgi?id=142964
2464
2465         Reviewed by Carlos Garcia Campos.
2466
2467         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2468         (ClickCounter::currentClickCountForGdkButtonEvent): Use the STL's std::abs()
2469         instead of C's abs(). The templated nature of std::abs() ensures the proper
2470         computation that matches the types of the passed-in values, and shuts down
2471         a warning when compiling with Clang.
2472
2473 2015-03-23  Zan Dobersek  <zdobersek@igalia.com>
2474
2475         [GTK][WK2] webkitBackForwardListChanged() should operate on a Vector reference
2476         https://bugs.webkit.org/show_bug.cgi?id=142963
2477
2478         Reviewed by Carlos Garcia Campos.
2479
2480         * UIProcess/API/gtk/WebKitBackForwardList.cpp:
2481         (webkitBackForwardListChanged): This function only reads from the passed-in
2482         Vector of removed items, so only a const lvalue reference to the Vector
2483         is needed.
2484         * UIProcess/API/gtk/WebKitBackForwardListPrivate.h:
2485
2486 2015-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2487
2488         [GTK] Add a configure option to build without Redirected XComposite Window
2489         https://bugs.webkit.org/show_bug.cgi?id=142865
2490
2491         Reviewed by Žan Doberšek.
2492
2493         Use USE(REDIRECTED_XCOMPOSITE_WINDOW) instead of
2494         USE(TEXTURE_MAPPER_GL) && PLATFORM(X11).
2495
2496         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2497         (webkitWebViewBaseRealize): Use the XID of the WebKitWebView
2498         window as native surface handle when REDIRECTED_XCOMPOSITE_WINDOW
2499         is disabled.
2500         (webkitWebViewRenderAcceleratedCompositingResults):
2501         (resizeWebKitWebViewBaseFromAllocation):
2502         (webkitWebViewBaseEnterAcceleratedCompositingMode):
2503         (webkitWebViewBaseExitAcceleratedCompositingMode):
2504         * UIProcess/gtk/RedirectedXCompositeWindow.cpp:
2505         * UIProcess/gtk/RedirectedXCompositeWindow.h:
2506
2507 2015-03-22  Eric Carlson  <eric.carlson@apple.com>
2508
2509         [Mac] Enable WIRELESS_PLAYBACK_TARGET for WK1
2510         https://bugs.webkit.org/show_bug.cgi?id=142940
2511
2512         Reviewed by Sam Weinig.
2513
2514         * WebProcess/WebPage/mac/WebPageMac.mm:
2515         (WebKit::WebPage::playbackTargetSelected): Argument to didChoosePlaybackTarget is now const.
2516
2517 2015-03-22  Anders Carlsson  <andersca@apple.com>
2518
2519         _WKWebsiteDataStore should clear WebSQL databases
2520         https://bugs.webkit.org/show_bug.cgi?id=142947
2521         rdar://problem/20242174
2522
2523         Reviewed by Sam Weinig.
2524
2525         * Shared/WebsiteData/WebsiteDataTypes.h:
2526         Add WebsiteDataTypeWebSQLDatabases.
2527
2528         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2529         (API::WebsiteDataStore::defaultDataStoreConfiguration):
2530         Initialize configuration.webSQLDatabaseDirectory.
2531
2532         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
2533         Add WKWebsiteDataTypeWebSQLDatabases.
2534
2535         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm:
2536         (dataTypesToString):
2537         Handle WKWebsiteDataTypeWebSQLDatabases.
2538
2539         * UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h:
2540         (WebKit::toWebsiteDataTypes):
2541         (WebKit::toWKWebsiteDataTypes):
2542         Handle WKWebsiteDataTypeWebSQLDatabases and WebsiteDataTypes::WebsiteDataTypeWebSQLDatabases.
2543
2544         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2545         (WebKit::WebsiteDataStore::WebsiteDataStore):
2546         Initialize m_webSQLDatabaseDirectory and add a queue member variable.
2547
2548         (WebKit::WebsiteDataStore::fetchData):
2549         Fetch database origins.
2550     
2551         (WebKit::WebsiteDataStore::removeData):
2552         Remove databases.
2553
2554         * UIProcess/WebsiteData/WebsiteDataStore.h:
2555         Add new members.
2556
2557 2015-03-22  Dan Bernstein  <mitz@apple.com>
2558
2559         [iOS] Expose WebPageProxy::setInitialFocus as SPI
2560         https://bugs.webkit.org/show_bug.cgi?id=142951
2561
2562         Reviewed by Anders Carlsson.
2563
2564         * UIProcess/API/Cocoa/WKWebView.mm:
2565         (-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): New SPI.
2566         Just calls through to WKWebContentView, but allows a nil completion handler.
2567         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2568
2569         * UIProcess/API/mac/WKView.mm:
2570         (-[WKView becomeFirstResponder]): Pass an empty lambda for the new callback parameter to
2571         WebPageProxy::setInitialFocus.
2572
2573         * UIProcess/WebPageProxy.cpp:
2574         (WebKit::WebPageProxy::setInitialFocus): Added a void callback parameter and made sure to
2575         call it.
2576         * UIProcess/WebPageProxy.h:
2577
2578         * UIProcess/ios/WKContentViewInteraction.h:
2579         * UIProcess/ios/WKContentViewInteraction.mm:
2580         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
2581         Added. Calls WebPageProxy::setInitialFocus, and once that completes, checks if anything was
2582         focused and if so, becomes first responder, then calls the completion handler.
2583
2584         * WebProcess/WebPage/WebPage.cpp:
2585         (WebKit::WebPage::setInitialFocus): Added a callbackID parameter, and made sure to send the
2586         callback message. Added a temporary change of m_userIsInteracting to true, so that the UI
2587         process won’t ignore any StartAssistingNode message resulting from the focus change.
2588         * WebProcess/WebPage/WebPage.h:
2589
2590         * WebProcess/WebPage/WebPage.messages.in: Added a callbackID parameter to SetInitialFocus.
2591
2592 2015-03-21  Dean Jackson  <dino@apple.com>
2593
2594         Remove the prefix for CSS Transforms
2595         https://bugs.webkit.org/show_bug.cgi?id=142927
2596         <rdar://problem/11568151>
2597
2598         Reviewed by Simon Fraser.
2599
2600         Rename AnimatedPropertyWebkitTransform to AnimatedPropertyTransform.
2601
2602         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
2603         (IPC::ArgumentCoder<TextureMapperAnimation>::encode):
2604
2605 2015-03-21  Csaba Osztrogonác  <ossy@webkit.org>
2606
2607         [EFL][GTK] Make WebKit2's generate-forwarding-headers.pl less verbose
2608         https://bugs.webkit.org/show_bug.cgi?id=142908
2609
2610         Reviewed by Žan Doberšek.
2611
2612         * Scripts/generate-forwarding-headers.pl:
2613         (createForwardingHeadersForFramework):
2614
2615 2015-03-21  Commit Queue  <commit-queue@webkit.org>
2616
2617         Unreviewed, rolling out r181824.
2618         https://bugs.webkit.org/show_bug.cgi?id=142935
2619
2620         Broke Windows build (Requested by ap on #webkit).
2621
2622         Reverted changeset:
2623
2624         "Remove the prefix for CSS Transforms"
2625         https://bugs.webkit.org/show_bug.cgi?id=142927
2626         http://trac.webkit.org/changeset/181824
2627
2628 2015-03-20  Dean Jackson  <dino@apple.com>
2629
2630         Remove the prefix for CSS Transforms
2631         https://bugs.webkit.org/show_bug.cgi?id=142927
2632         <rdar://problem/11568151>
2633
2634         Reviewed by Simon Fraser.
2635
2636         Rename AnimatedPropertyWebkitTransform to AnimatedPropertyTransform.
2637
2638         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
2639         (IPC::ArgumentCoder<TextureMapperAnimation>::encode):
2640
2641 2015-03-20  Chris Dumez  <cdumez@apple.com>
2642
2643         [WK2] NetworkCache retrievals sometimes fail on browser startup
2644         https://bugs.webkit.org/show_bug.cgi?id=142925
2645         <rdar://problem/20245368>
2646
2647         Reviewed by Antti Koivisto.
2648
2649         NetworkCache retrievals sometimes fail on browser startup for resources
2650         that are actually cached. The reason is that we are using a bloom filter
2651         for performance reasons to avoid unnecessary disk I/O and this bloom
2652         filter is populated on start up in a background thread by traversing the
2653         cache files on disk. However, when restoring the tabs on start-up we
2654         sometimes query this bloom filter before it is completely populated and
2655         we thus fail to retrieve cached entries because we think they don't
2656         exist and don't check the disk.
2657
2658         This patch adds an "isPopulatingContentsFilter" flag that is turned ON
2659         on start up while we are populating the bloon filter. We then bypass
2660         the bloom filter and send queries directly to disk on start up if this
2661         flag is ON.
2662
2663         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2664         (WebKit::NetworkCache::Storage::initialize):
2665         (WebKit::NetworkCache::Storage::retrieve):
2666         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
2667         (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation):
2668         * NetworkProcess/cache/NetworkCacheStorage.h:
2669         (WebKit::NetworkCache::Storage::cacheMayContain):
2670
2671 2015-03-20  Chris Dumez  <cdumez@apple.com>
2672
2673         [WK2] Allow stale content when restoring the browser's session state
2674         https://bugs.webkit.org/show_bug.cgi?id=142916
2675         <rdar://problem/20243493>
2676
2677         Reviewed by Darin Adler.
2678
2679         Allow stale content when restoring the browser's session state
2680         (restoring all tabs from previous session), e.g.
2681         - Via History > Reopen All windows from previous session on Safari
2682         - Happens on startup for MobileSafari
2683
2684         I have verified that using "Open in tabs" on a bookmarks folder
2685         still does fresh loads (rdar://problem/8131355) as it is not using
2686         the restoreFromSessionState() code path.
2687
2688         * UIProcess/WebPageProxy.cpp:
2689         (WebKit::WebPageProxy::reattachToWebProcessForReload):
2690         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
2691         (WebKit::WebPageProxy::goForward):
2692         (WebKit::WebPageProxy::goBack):
2693         (WebKit::WebPageProxy::goToBackForwardItem):
2694         (WebKit::WebPageProxy::restoreFromSessionState):
2695         * UIProcess/WebPageProxy.h:
2696         * WebProcess/WebPage/WebPage.cpp:
2697         (WebKit::WebPage::goToBackForwardItem):
2698         * WebProcess/WebPage/WebPage.h:
2699         * WebProcess/WebPage/WebPage.messages.in:
2700
2701 2015-03-20  Beth Dakin  <bdakin@apple.com>
2702
2703         [Immediate Actions] Should re-enable immediate actions for iBooks
2704         https://bugs.webkit.org/show_bug.cgi?id=142915
2705         -and corresponding-
2706         rdar://problem/19585689
2707
2708         Reviewed by Tim Horton.
2709
2710         * UIProcess/API/mac/WKView.mm:
2711         (-[WKView initWithFrame:processPool:configuration:webView:]):
2712
2713 2015-03-20  Alex Christensen  <achristensen@webkit.org>
2714
2715         Progress towards CMake on Mac.
2716         https://bugs.webkit.org/show_bug.cgi?id=136003
2717
2718         Reviewed by Chris Dumez.
2719
2720         * PlatformMac.cmake:
2721         Add include directories and forwarding headers.
2722         * Shared/API/APIObject.h:
2723         (API::ObjectImpl::operator new):
2724         * UIProcess/DrawingAreaProxy.h:
2725         (WebKit::DrawingAreaProxy::intrinsicContentSizeDidChange):
2726         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
2727         Fix some unused parameter warnings.
2728
2729 2015-03-20  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2730
2731         [CMake] Remove duplicated cmake function calls in WebKit2/CMakeLists.txt
2732         https://bugs.webkit.org/show_bug.cgi?id=142901
2733
2734         Reviewed by Csaba Osztrogonác.
2735
2736         add_depencencies(), install() can support multiple targets or location.
2737         We don't need to call it twice.
2738
2739         * CMakeLists.txt: Additionaly move -DBUILDING_WEBKIT to PlatformGTK.cmake,
2740         because it is only used by GTK port.
2741
2742 2015-03-20  Zan Dobersek  <zdobersek@igalia.com>
2743
2744         [GTK] Disable accelerated compositing on Wayland
2745         https://bugs.webkit.org/show_bug.cgi?id=142877
2746
2747         Reviewed by Carlos Garcia Campos.
2748
2749         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2750         (webkitWebViewBaseCreateWebPage): As was done in the past, we should disable
2751         accelerated compositing on Wayland until the proper support for it lands.
2752
2753 2015-03-19  Andy Estes  <aestes@apple.com>
2754
2755         [Content Filtering] Add tests for unblock requests
2756         https://bugs.webkit.org/show_bug.cgi?id=142900
2757
2758         Reviewed by Andreas Kling.
2759
2760         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2761         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Called WebFrameProxy::contentFilterDidBlockLoad.
2762         * UIProcess/WebFrameProxy.cpp:
2763         (WebKit::WebFrameProxy::didStartProvisionalLoad): Assigned a default-constructed ContentFilterUnblockHandler instead of calling clear().
2764         (WebKit::WebFrameProxy::didHandleContentFilterUnblockNavigation): Renamed from contentFilterDidHandleNavigationAction.
2765         Updated to use ContentFilterUnblockHandler's new API.
2766         (WebKit::WebFrameProxy::contentFilterDidHandleNavigationAction): Deleted.
2767         * UIProcess/WebFrameProxy.h:
2768         (WebKit::WebFrameProxy::contentFilterDidBlockLoad): Renamed from setContentFilterUnblockHandler.
2769         (WebKit::WebFrameProxy::setContentFilterUnblockHandler): Deleted.
2770         * UIProcess/WebPageProxy.cpp:
2771         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Called WebFrameProxy::didHandleContentFilterUnblockNavigation.
2772         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2773         (WebKit::WebFrameLoaderClient::contentFilterDidBlockLoad): If the unblock handler needs the UI process,
2774         send WebPageProxy::ContentFilterDidBlockLoadForFrame. Oterwise, call PolicyChecker::setContentFilterUnblockHandler.
2775
2776 2015-03-20  Zan Dobersek  <zdobersek@igalia.com>
2777
2778         [GTK] Properly guard X11-specific code in BackingStore::createBackend()
2779         https://bugs.webkit.org/show_bug.cgi?id=142875
2780
2781         Reviewed by Martin Robinson.
2782
2783         * UIProcess/cairo/BackingStoreCairo.cpp:
2784         (WebKit::BackingStore::createBackend): Guard the GTK- and X11-specific
2785         bit of code with PLATFORM(GTK) and PLATFORM(X11). Testing GDK_WINDOWING_X11
2786         ensures that the GTK+ dependency has X11 support, but does not ensure
2787         that WebKitGTK+ has been configured to build for X11 environments (which
2788         is what PLATFORM(X11) ensures).
2789
2790 2015-03-19  Chris Dumez  <cdumez@apple.com>
2791
2792         [WK2] We should allow stale content when restoring a killed / crashed WebProcess
2793         https://bugs.webkit.org/show_bug.cgi?id=142893
2794         <rdar://problem/19633737>
2795         <rdar://problem/19869257>
2796
2797         Reviewed by Antti Koivisto.
2798
2799         Allow stale content when restoring a killed / crashed WebProcess
2800         (similarly to a history navigation). This is actually what was intended
2801         as we call WebPage::goToBackForwardItem() in this case, which uses
2802         IndexedBackForward load type. However, this value was then ignored in
2803         FrameLoader::loadDifferentDocumentItem().
2804
2805         This patch gets rid of the special casing in
2806         FrameLoader::loadDifferentDocumentItem() and makes it clear at call
2807         sites when calling goToBackForwardItem() if we should allow stale
2808         content or not. If goToBackForwardItem() is called with the
2809         allowStaleContent flag off, we'll keep using the IndexedBackForward
2810         frame load type. However, if the flag is on, we'll use the Standard
2811         frame load type and do a fresh load.
2812
2813         * UIProcess/WebPageProxy.cpp:
2814         (WebKit::WebPageProxy::reattachToWebProcessForReload):
2815         Set allowStaleContent flag to true as we want to allow stale content
2816         when reloading a WebProcess after it crashed or was killed (behavior
2817         change).
2818
2819         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
2820         Add allowStaleContent parameter so that call sites can decide which
2821         policy to use.
2822
2823         (WebKit::WebPageProxy::goForward):
2824         (WebKit::WebPageProxy::goBack):
2825         Set allowStaleContent flag to true as this is our policy for history
2826         navigations.
2827
2828         (WebKit::WebPageProxy::goToBackForwardItem):
2829         Add allowStaleContent parameter so that the call site can let us know
2830         what to do. This is useful as this is called not only for indexed
2831         back / forward navigations (allowing stale content) but also for
2832         restoring session state (forbidding state content:
2833         <rdar://problem/8131355>).
2834
2835         (WebKit::WebPageProxy::restoreFromSessionState):
2836         Call goToBackForwardItem() with allowStaleContent flag set to false
2837         as users expect fresh contents in this case. This method is called
2838         when:
2839         - Tabs are restored on Safari / MobileSafari startup
2840         - Tabs are restored via "History > Reopen All windows from last session"
2841
2842         * UIProcess/WebPageProxy.h:
2843         * WebProcess/WebPage/WebPage.cpp:
2844         (WebKit::WebPage::goToBackForwardItem):
2845         Add allowStaleContent parameter and use "Standard" frame load type
2846         instead of "IndexedBackForward" if it is false. This is needed as
2847         "IndexedBackForward" frame load type allows using stale content.
2848
2849         * WebProcess/WebPage/WebPage.h:
2850         * WebProcess/WebPage/WebPage.messages.in:
2851         Add allowStaleContent flag to GoToBackForwardItem message.
2852
2853 2015-03-19  Eric Carlson  <eric.carlson@apple.com>
2854
2855         [Mac] Move MediaPlaybackTargetPicker
2856         https://bugs.webkit.org/show_bug.cgi?id=142889
2857
2858         Move WebMediaPlaybackTargetPickerProxy to WebCore so it can be used by
2859         both WK2 and WK1.
2860
2861         Reviewed by Tim Horton.
2862
2863         * UIProcess/PageClient.h:
2864         * UIProcess/WebMediaPlaybackTargetPickerProxy.cpp: Removed.
2865         * UIProcess/WebMediaPlaybackTargetPickerProxy.h: Removed.
2866         * UIProcess/WebPageProxy.cpp:
2867         (WebKit::WebPageProxy::devicePickerProxy):
2868         * UIProcess/WebPageProxy.h:
2869         * UIProcess/mac/PageClientImpl.h:
2870         * UIProcess/mac/PageClientImpl.mm:
2871         (WebKit::PageClientImpl::createPlaybackTargetPicker):
2872         * UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h: Removed.
2873         * UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm: Removed.
2874         * WebKit2.xcodeproj/project.pbxproj:
2875
2876 2015-03-19  Jessie Berlin  <jberlin@webkit.org>
2877
2878         32-bit build fix after r181770.
2879
2880         * UIProcess/mac/WKFullScreenWindowController.mm:
2881         (-[WKFullScreenWindowController initWithWindow:webView:]):
2882
2883 2015-03-19  Anders Carlsson  <andersca@apple.com>
2884
2885         Add support for deleting individual cache entries
2886         https://bugs.webkit.org/show_bug.cgi?id=142886
2887
2888         Reviewed by Antti Koivisto.
2889
2890         * NetworkProcess/NetworkProcess.cpp:
2891         (WebKit::fetchDiskCacheEntries):
2892         Remove an unnecessary call to cfURLCacheOrigins().
2893
2894         (WebKit::clearDiskCacheEntries):
2895         Helper function for clearing disk cache entries. This handles both the old and new cache implementations.
2896
2897         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
2898         Call clearDiskCacheEntries if needed.
2899
2900 2015-03-19  Jer Noble  <jer.noble@apple.com>
2901
2902         [WK2][Mac] Fullscreen animations with mismatched aspect ratios are "squished".
2903         https://bugs.webkit.org/show_bug.cgi?id=142132
2904
2905         Reviewed by Tim Horton.
2906
2907         Use CALayer animations for the transition into and out of fullscreen.
2908
2909         The fullscreen transition consists of three separate animations:
2910         1. An opacity animation for the black backdrop behind the fullscreen content
2911         2. A scale/translation animation from fullscreen element's initial screen to its final one.
2912         3. A clip animation from the fullscreen element's initial aspect ratio to its final one.
2913
2914         The opacity animation will apply to the fullscreen window's content view's layer's
2915         background color. To separately animate the transform and mask of the web view's content, a
2916         layer-backed subview is added to the content view, and the scale/translation & clip
2917         animations are applied to its transform property and mask layer respectively.
2918
2919         Utility methods to create each animation have been added, and each includes a parameter for
2920         the direction of the animation, so that the same methods can be used for entering and
2921         exiting fullscreen transitions.
2922
2923         The user-visible changes to this new transition are when the aspect ratios of the initial
2924         and final screen locations are different: previously the transition would use a scale
2925         transform to "squish" the fullscreen content into the initial aspect ratio. The new
2926         transition instead "clips" the fullscreen content to the initial aspect ratio. For common
2927         operations such a <video> element with a different aspect ratio than the screen, this makes
2928         the black letterbox "grow" during the transition, and makes the transition overall much
2929         smoother.
2930
2931         * UIProcess/mac/WKFullScreenWindowController.h:
2932         * UIProcess/mac/WKFullScreenWindowController.mm:
2933         (-[WKFullScreenWindowController initWithWindow:webView:]): Create and initialze the clipping view.
2934         (-[WKFullScreenWindowController applicationDidChangeScreenParameters:]): _backgroundWindow was removed.
2935         (-[WKFullScreenWindowController enterFullScreen:]): Add the webView to the _clipView, not the contentView.
2936         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): _backgroundWindow,
2937                 _fadeAnimation, and _scaleAnimation are all removed.
2938         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Ditto.
2939         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Ditto.  Hide the contentView's
2940                 layer. Pause visibility updates.
2941         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]): Resume visibility updates.
2942         (-[WKFullScreenWindowController close]): _fadeAnimation and _scaleAnimation are removed.
2943         (-[WKFullScreenWindowController customWindowsToEnterFullScreenForWindow:]): Return only the fullscreen
2944                 window.
2945         (-[WKFullScreenWindowController customWindowsToExitFullScreenForWindow:]): Ditto.
2946         (zoomAnimation): Added.
2947         (maskAnimation): Added.
2948         (fadeAnimation): Added.
2949         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]): Use the utility
2950                 methods above to set up the animation.
2951         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]): Ditto.
2952         (createBackgroundFullscreenWindow): Deleted.
2953         (windowFrameFromApparentFrames): Deleted.
2954
2955 2015-03-19  Enrica Casucci  <enrica@apple.com>
2956
2957         <attachment> should put URLs on the pasteboard so that Finder can accept drops.
2958         https://bugs.webkit.org/show_bug.cgi?id=142801
2959         rdar://problem/19982527
2960
2961         Reviewed by Tim Horton.
2962
2963         This patch adds all the necessary support to write attachment elements into
2964         the pasteboard, including the promised type in WK2.
2965
2966         * UIProcess/API/mac/WKView.mm:
2967         (-[WKView _setPromisedDataForImage:withFileName:withExtension:withTitle:withURL:withVisibleURL:withArchive:forPasteboard:]):
2968         (-[WKView _setPromisedDataForAttachment:withExtension:withTitle:withURL:withVisibleURL:forPasteboard:]):
2969         (-[WKView namesOfPromisedFilesDroppedAtDestination:]):
2970         (-[WKView _setPromisedData:withFileName:withExtension:withTitle:withURL:withVisibleURL:withArchive:forPasteboard:]): Deleted.
2971         * UIProcess/API/mac/WKViewInternal.h:
2972         * UIProcess/PageClient.h:
2973         * UIProcess/WebPageProxy.h:
2974         * UIProcess/WebPageProxy.messages.in:
2975         * UIProcess/mac/PageClientImpl.h:
2976         * UIProcess/mac/PageClientImpl.mm:
2977         (WebKit::PageClientImpl::setPromisedDataForImage):
2978         (WebKit::PageClientImpl::setPromisedDataForAttachment):
2979         (WebKit::PageClientImpl::setPromisedData): Deleted.
2980         * UIProcess/mac/WebPageProxyMac.mm:
2981         (WebKit::WebPageProxy::setPromisedDataForImage):
2982         (WebKit::WebPageProxy::setPromisedDataForAttachment):
2983         (WebKit::WebPageProxy::setPromisedData): Deleted.
2984         * WebProcess/WebCoreSupport/WebDragClient.h:
2985         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2986         (WebKit::WebDragClient::declareAndWriteAttachment):
2987         (WebKit::WebDragClient::declareAndWriteDragImage):
2988
2989 2015-03-19  Anders Carlsson  <andersca@apple.com>
2990
2991         Cache::remove should take a Key instead of an entry
2992         https://bugs.webkit.org/show_bug.cgi?id=142878
2993
2994         Reviewed by Antti Koivisto.
2995
2996         * NetworkProcess/cache/NetworkCache.cpp:
2997         (WebKit::NetworkCache::Cache::remove):
2998         * NetworkProcess/cache/NetworkCache.h:
2999
3000 2015-03-19  Chris Dumez  <cdumez@apple.com>
3001
3002         Clean up DOMTimer related settings
3003         https://bugs.webkit.org/show_bug.cgi?id=142837
3004
3005         Reviewed by Darin Adler.
3006
3007         Stop setting the DOMTimers' default minimum interval to 4ms as this
3008         is now the default.
3009
3010         * WebProcess/WebPage/WebPage.cpp:
3011         (WebKit::WebPage::WebPage):
3012
3013 2015-03-19  Chris Dumez  <cdumez@apple.com>
3014
3015         The network cache should ignore "cache-control: no-cache, must-revalidate" on history navigation
3016         https://bugs.webkit.org/show_bug.cgi?id=142831
3017         <rdar://problem/20209957>
3018
3019         Reviewed by Antti Koivisto.
3020
3021         The network cache should ignore "no-cache" and "must-revalidate" as
3022         Cache-Control policy for history navigations to avoid unnecessary
3023         revalidation in this case. Our memory cache already behaves this way.
3024
3025         On history navigation, our disk cache implementation currently
3026         revalidates unconditionally resources if "cache-control: no-cache" is
3027         used. It also revalidates expired resources if "cache-control:
3028         must-revalidate" is used. This is sub-optimal.
3029
3030         RFC 7234 does not require us to do so [1]:
3031         """
3032           User agents often have history mechanisms, such as "Back" buttons and
3033           history lists, that can be used to redisplay a representation
3034           retrieved earlier in a session.
3035
3036           The freshness model (Section 4.2) does not necessarily apply to
3037           history mechanisms.  That is, a history mechanism can display a
3038           previous representation even if it has expired.
3039         """
3040
3041         Chrome and IE9+ [2] already ignore "cache-control: must-revalidate" on history navigation.
3042
3043         [1] https://tools.ietf.org/html/rfc7234#page-32
3044         [2] http://blogs.msdn.com/b/ie/archive/2010/07/14/caching-improvements-in-internet-explorer-9.aspx
3045
3046         Test: http/tests/cache/disk-cache-validation-back-navigation-policy.html
3047
3048         * NetworkProcess/cache/NetworkCache.cpp:
3049         (WebKit::NetworkCache::decodeStorageEntry):
3050
3051 2015-03-18  Simon Fraser  <simon.fraser@apple.com>
3052
3053         Don't paint PDFs on every scroll
3054         https://bugs.webkit.org/show_bug.cgi?id=142857
3055         rdar://problem/20130207
3056
3057         Reviewed by Tim Horton.
3058         
3059         Don't push a scale factor onto the PDF layer controller if it hasn't
3060         changed, since doing so causes a repaint.
3061
3062         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3063         (WebKit::PDFPlugin::updatePageAndDeviceScaleFactors):
3064
3065 2015-03-18  Anders Carlsson  <andersca@apple.com>
3066
3067         Use && instead of & when deciding if the network cache should be cleared
3068         https://bugs.webkit.org/show_bug.cgi?id=142845
3069
3070         Reviewed by Antti Koivisto.
3071
3072         * NetworkProcess/NetworkProcess.cpp:
3073         (WebKit::NetworkProcess::deleteWebsiteData):
3074
3075 2015-03-18  Anders Carlsson  <andersca@apple.com>
3076
3077         Add WKContextGetWebsiteDataStore API
3078         https://bugs.webkit.org/show_bug.cgi?id=142832
3079         rdar://problem/16544715
3080
3081         Reviewed by Sam Weinig.
3082
3083         Also add WKWebsiteDataStoreRef which is toll-free bridged to _WKWebsiteDataStore.
3084
3085         * Shared/API/c/WKBase.h:
3086         Add new declaration.
3087
3088         * UIProcess/API/APIWebsiteDataStore.cpp:
3089         (API::WebsiteDataStore::create):
3090         * UIProcess/API/APIWebsiteDataStore.h:
3091         Add a new function that takes a configuration.
3092
3093         * UIProcess/API/C/WKAPICast.h:
3094         Add cast.
3095
3096         * UIProcess/API/C/WKContext.cpp:
3097         (WKContextGetWebsiteDataStore):
3098         Return the context's website data store.
3099
3100         * UIProcess/API/C/WKContext.h:
3101         Add new declaration.
3102
3103         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: Added.
3104         * UIProcess/API/C/WKWebsiteDataStoreRef.h: Added.
3105         Add new files.
3106
3107         * UIProcess/WebKeyValueStorageManager.cpp:
3108         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
3109         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
3110         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
3111         (WebKit::WebKeyValueStorageManager::deleteAllEntries):
3112         Update now that WebProcessPool holds on to an API::WebsiteDataStore.
3113
3114         * UIProcess/WebProcessPool.cpp:
3115         (WebKit::WebProcessPool::WebProcessPool):
3116         (WebKit::WebProcessPool::createWebPage):
3117         * UIProcess/WebProcessPool.h:
3118         WebProcessPool should hold on to an API::WebsiteDataStore instead of a WebKit::WebsiteDataStore.
3119
3120         * WebKit2.xcodeproj/project.pbxproj:
3121         Add new files.
3122
3123 2015-03-18  Tim Horton  <timothy_horton@apple.com>
3124
3125         Cannot invoke action menus anymore
3126         https://bugs.webkit.org/show_bug.cgi?id=142797
3127         <rdar://problem/20032670>
3128
3129         * UIProcess/API/mac/WKView.mm:
3130         Need one more respondsToSelector check.
3131
3132 2015-03-18  Chris Dumez  <cdumez@apple.com>
3133
3134         [WK2] Log the number of network cache requests that we have never seen before
3135         https://bugs.webkit.org/show_bug.cgi?id=142828
3136         <rdar://problem/19632130>
3137
3138         Reviewed by Antti Koivisto.
3139
3140         Log the number of network cache requests that we have never seen before
3141         using diagnostic logging.
3142
3143         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
3144         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
3145         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
3146
3147 2015-03-17  Antti Koivisto  <antti@apple.com>
3148
3149         Prune least valuable cache entries first
3150         https://bugs.webkit.org/show_bug.cgi?id=142810
3151         rdar://problem/19632130
3152
3153         Reviewed by Darin Adler.
3154
3155         When pruning the cache estimate relative value of each entry using formula
3156
3157         age = current time - creation time
3158         accessAge = last access time - creation time
3159         value = accessAge / age
3160
3161         That is, we value entries that have been accessed recently and survived in the cache longest.
3162
3163         The most valuable entries don't get deleted at all while the deletion probablity ramps up for
3164         lower value entries.
3165
3166         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
3167         (WebKit::NetworkCache::fileTimes):
3168
3169             Get the creation time and access time for a file.
3170
3171         (WebKit::NetworkCache::updateFileAccessTimeIfNeeded):
3172
3173             Update access time manually if the file system doesn't do it automatically.
3174
3175         * NetworkProcess/cache/NetworkCacheIOChannel.h:
3176         (WebKit::NetworkCache::IOChannel::path):
3177         (WebKit::NetworkCache::IOChannel::type):
3178         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
3179         (WebKit::NetworkCache::IOChannel::IOChannel):
3180         (WebKit::NetworkCache::IOChannel::open):
3181
3182             Remember the file path and move most of the work to constructor.
3183
3184         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3185         (WebKit::NetworkCache::Storage::Storage):
3186         (WebKit::NetworkCache::Storage::remove):
3187         (WebKit::NetworkCache::Storage::updateFileAccessTime):
3188         (WebKit::NetworkCache::Storage::dispatchReadOperation):
3189         (WebKit::NetworkCache::deletionProbability):
3190
3191             Compute the probability based on entry age and access time.
3192
3193         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
3194         * NetworkProcess/cache/NetworkCacheStorage.h:
3195         (WebKit::NetworkCache::Storage::serialBackgroundIOQueue):
3196         (WebKit::NetworkCache::Storage::deleteQueue): Deleted.
3197
3198             More generic name.
3199
3200 2015-03-18  Chris Dumez  <cdumez@apple.com>
3201
3202         [WK2] Log total number of network cache queries using diagnostic logging
3203         https://bugs.webkit.org/show_bug.cgi?id=142803
3204         <rdar://problem/19632130>
3205
3206         Reviewed by Antti Koivisto.
3207
3208         Log total number of network cache queries using diagnostic logging.
3209
3210         * NetworkProcess/cache/NetworkCache.cpp:
3211         (WebKit::NetworkCache::Cache::retrieve):
3212         * NetworkProcess/cache/NetworkCacheStatistics.h:
3213         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
3214         (WebKit::NetworkCache::Statistics::recordCacheRetrievalRequest):
3215
3216 2015-03-18  Chris Dumez  <cdumez@apple.com>
3217
3218         [WK2] We should not even try the network cache for non-HTTP protocol requests
3219         https://bugs.webkit.org/show_bug.cgi?id=142802
3220         <rdar://problem/19632130>
3221
3222         Reviewed by Antti Koivisto.
3223
3224         We should not even try the network cache for non-HTTP protocol requests
3225         and the network cache cannot handle those.
3226
3227         * NetworkProcess/NetworkResourceLoader.cpp:
3228         (WebKit::NetworkResourceLoader::start):
3229         * NetworkProcess/cache/NetworkCache.cpp:
3230         (WebKit::NetworkCache::canRetrieve):
3231         (WebKit::NetworkCache::Cache::retrieve):
3232         * NetworkProcess/cache/NetworkCache.h:
3233         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
3234         (WebKit::NetworkCache::retrieveDecisionToDiagnosticKey):
3235
3236 2015-03-17  Conrad Shultz  <conrad_shultz@apple.com>
3237
3238         Ignore some deprecation warnings
3239         https://bugs.webkit.org/show_bug.cgi?id=142813
3240
3241         Reviewed by Mark Rowe.
3242
3243         Fixing the deprecations is tracked by: <rdar://problem/20201450>
3244
3245         * UIProcess/mac/WebPopupMenuProxyMac.mm:
3246         (WebKit::WebPopupMenuProxyMac::populate):
3247
3248 2015-03-17  Ryuan Choi  <ryuan.choi@navercorp.com>
3249
3250         [EFL] Expose JavaScript binding interface through ewk_extension
3251         https://bugs.webkit.org/show_bug.cgi?id=142033
3252
3253         Reviewed by Gyuyoung Kim.
3254
3255         * PlatformEfl.cmake:
3256         * UIProcess/API/efl/tests/extensions/extension_sample.cpp: Registered test object for new test case.
3257         * UIProcess/API/efl/tests/test_ewk2_javascript_binding.cpp: Added simple binding API test case.
3258         (EWK2ContextTestWithExtension::messageReceivedCallback):
3259         (EWK2ContextTestWithExtension::EWK2ContextTestWithExtension):
3260         (TEST_F):
3261         * WebProcess/InjectedBundle/API/efl/EWebKit_Extension.h:
3262         * WebProcess/InjectedBundle/API/efl/ewk_extension.cpp:
3263         (EwkExtension::didCreatePage):
3264         (EwkExtension::willDestroyPage):
3265         * WebProcess/InjectedBundle/API/efl/ewk_extension.h:
3266         * WebProcess/InjectedBundle/API/efl/ewk_extension_private.h:
3267         * WebProcess/InjectedBundle/API/efl/ewk_page.cpp: Added.
3268         (toEwkPage):
3269         (EwkPage::EwkPage):
3270         (EwkPage::append):
3271         (EwkPage::remove):
3272         (EwkPage::didFinishDocumentLoadForFrame):
3273         (ewk_page_js_global_context_get):
3274         (ewk_page_client_register):
3275         (ewk_page_client_unregister):
3276         * WebProcess/InjectedBundle/API/efl/ewk_page.h: Added.
3277         * WebProcess/InjectedBundle/API/efl/ewk_page_private.h: Added.
3278         (EwkPage::page):
3279         * efl/ewebkit2-extension.pc.in:
3280
3281 2015-03-17  Tim Horton  <timothy_horton@apple.com>
3282
3283         Cannot invoke action menus anymore
3284         https://bugs.webkit.org/show_bug.cgi?id=142797
3285         <rdar://problem/20032670>
3286
3287         * UIProcess/API/mac/WKView.mm:
3288         Need a respondsToSelector check.
3289
3290 2015-03-17  Tim Horton  <timothy_horton@apple.com>
3291
3292         Cannot invoke action menus anymore
3293         https://bugs.webkit.org/show_bug.cgi?id=142797
3294         <rdar://problem/20032670>
3295
3296         Reviewed by Beth Dakin.
3297
3298         * UIProcess/API/mac/WKView.mm:
3299         Don't process mouse events that would make an action menu; call super
3300         and let AppKit take care of it. We have to duplicate the macro so that
3301         we can avoid calling super for the internal-only methods.
3302         Also, otherMouseMoved is simply not a thing, so remove it.
3303
3304 2015-03-17  Beth Dakin  <bdakin@apple.com>
3305
3306         DOM mouse events have weird timing for force clickable elements in Safari 8.0.3 on 
3307         10.10.2
3308         https://bugs.webkit.org/show_bug.cgi?id=142700
3309         -and corresponding-
3310         rdar://problem/20165168
3311
3312         Reviewed by Tim Horton.
3313
3314         No need to tell the WKImmediateActionController about mouse down any more since we 
3315         are expecting it at the beginning of an immediate action interaction.
3316         * UIProcess/API/mac/WKView.mm:
3317         (-[WKView mouseDown:]):
3318
3319         Set the delaysPrimaryMouseButtonEvents to NO for the 
3320         _immediateActionGestureRecognizer. This will cause AppKit to send up the mouse 
3321         events at the expected time.
3322         (-[WKView initWithFrame:processPool:configuration:webView:]):
3323
3324         WebCore::EventHandler now needs to know if an immediate action cancelled or 
3325         completed. This plumbs that information down.
3326         * UIProcess/WebPageProxy.cpp:
3327         (WebKit::WebPageProxy::immediateActionDidCancel):
3328         (WebKit::WebPageProxy::immediateActionDidComplete):
3329         * UIProcess/WebPageProxy.h:
3330         * UIProcess/mac/WKImmediateActionController.h:
3331         * UIProcess/mac/WKImmediateActionController.mm:
3332         (-[WKImmediateActionController immediateActionRecognizerDidCancelAnimation:]):
3333         (-[WKImmediateActionController immediateActionRecognizerDidCompleteAnimation:]):
3334         (-[WKImmediateActionController wkView:willHandleMouseDown:]): Deleted.
3335         * WebProcess/WebPage/WebPage.h:
3336         * WebProcess/WebPage/WebPage.messages.in:
3337
3338         Call EventHandler::setImmediateActionStage() with the appropriate stage.
3339         * WebProcess/WebPage/mac/WebPageMac.mm:
3340         (WebKit::WebPage::performActionMenuHitTestAtLocation):
3341         (WebKit::WebPage::immediateActionDidCancel):
3342         (WebKit::WebPage::immediateActionDidComplete):
3343
3344 2015-03-17  Timothy Horton  <timothy_horton@apple.com>
3345
3346         Reproducible null deref under ScriptedAnimationController::createDisplayRefreshMonitor
3347         https://bugs.webkit.org/show_bug.cgi?id=142776
3348         <rdar://problem/18921338>
3349
3350         Reviewed by Alexey Proskuryakov.
3351
3352         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3353         (WebKit::WebChromeClient::createDisplayRefreshMonitor):
3354         * WebProcess/WebCoreSupport/WebChromeClient.h:
3355         Adjust to the new signature.
3356
3357 2015-03-17  Antti Koivisto  <antti@apple.com>
3358
3359         Disk cache should support Vary: Cookie
3360         https://bugs.webkit.org/show_bug.cgi?id=142770
3361         rdar://problem/19764945
3362
3363         Reviewed by Anders Carlsson.
3364
3365         Cookies are not part of the original request but are added by the networking layer when submitting the request.
3366         Fetch them explicitly when resolving Vary: Cookie.
3367
3368         The implementation is not perfect as it fetches the cookie for the cache entry when saving a Vary:Cookie response,
3369         not when making the request. In principle the cookie may have changed in-between. This should be enough to handle
3370         reasonable cases though. Fetching cookies for every request might be too expensive for this rarely used feature.
3371
3372         * NetworkProcess/cache/NetworkCache.cpp:
3373         (WebKit::NetworkCache::headerValueForVary):
3374         (WebKit::NetworkCache::encodeStorageEntry):
3375         (WebKit::NetworkCache::verifyVaryingRequestHeaders):
3376
3377 2015-03-17  Zan Dobersek  <zdobersek@igalia.com>
3378
3379         [WK2] Use C++ lambdas in IPC::Connection
3380         https://bugs.webkit.org/show_bug.cgi?id=138018
3381
3382         Reviewed by Anders Carlsson.
3383
3384         Replace uses of WTF::bind() in the IPC::Connection class with C++ lambdas.
3385
3386         * Platform/IPC/Connection.cpp:
3387         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
3388         (IPC::Connection::invalidate):
3389         (IPC::Connection::sendMessage):
3390         (IPC::Connection::processIncomingMessage): Simplify the error messages so we
3391         don't have to format strings on-the-fly, removing the issues of cross-thread
3392         string copying altogether.
3393         (IPC::Connection::dispatchDidReceiveInvalidMessage): The parameters are now
3394         of the StringReference type.
3395         (IPC::Connection::enqueueIncomingMessage):
3396         * Platform/IPC/Connection.h:
3397         * Platform/IPC/mac/ConnectionMac.mm:
3398         (IPC::Connection::receiveSourceEventHandler):
3399         * Platform/IPC/unix/ConnectionUnix.cpp:
3400         (IPC::Connection::open):
3401
3402 2015-03-17  Zan Dobersek  <zdobersek@igalia.com>
3403
3404         [CMake] Use a forwarding header for ANGLE's ShaderLang.h to avoid picking up ANGLE's EGL headers
3405         https://bugs.webkit.org/show_bug.cgi?id=142530
3406
3407         Reviewed by Darin Adler.
3408
3409         * CMakeLists.txt: Replace the Source/ThirdParty/ANGLE/include/GLSLANG entry
3410         in the list of inclusion directories for WebKit2 with Source/ThirdParty/ANGLE,
3411         possible due to the new forwarding header for ANGLE's ShaderLang.h.
3412
3413 2015-03-17  Gwang Yoon Hwang  <yoon@igalia.com>
3414
3415         REGRESSION(r180924): Unable to build WebKitGTK+ with threaded compositor
3416
3417         Unreviewed build fix.
3418
3419         * WebProcess/WebPage/LayerTreeHost.h:
3420         Remove duplicated declaration of setNativeSurfaceHandleForCompositing.
3421
3422 2015-03-16  Ryosuke Niwa  <rniwa@webkit.org>
3423
3424         Enable ES6 classes by default
3425         https://bugs.webkit.org/show_bug.cgi?id=142774
3426
3427         Reviewed by Gavin Barraclough.
3428
3429         * Configurations/FeatureDefines.xcconfig:
3430
3431 2015-03-16  Conrad Shultz  <conrad_shultz@apple.com>
3432
3433         Don't pass nil as a fireDate for NSTimer
3434         https://bugs.webkit.org/show_bug.cgi?id=142765
3435
3436         Reviewed by Dan Bernstein.
3437
3438         While we're here, switch to a selector that conforms to documented NSTimer API.
3439
3440         * UIProcess/mac/WKFullScreenWindowController.mm:
3441         (-[WKFullScreenWindowController cancelOperation:]):
3442         Set the timer's fireDate as the future date matching the former interval; update the selector.
3443         (-[WKFullScreenWindowController _watchdogTimerFired:]):
3444         Timer callback; wrap -exitFullScreen.
3445
3446 2015-03-16  Alex Christensen  <achristensen@webkit.org>
3447
3448         Progress towards CMake on Mac
3449         https://bugs.webkit.org/show_bug.cgi?id=142747
3450
3451         Reviewed by Chris Dumez.
3452
3453         * PlatformMac.cmake:
3454         Started adding Mac-specific directories and headers.
3455
3456 2015-03-16  Alexey Proskuryakov  <ap@apple.com>
3457
3458         ASSERT(m_plugin) on plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image.html
3459         https://bugs.webkit.org/show_bug.cgi?id=142637
3460
3461         Reviewed by Dean Jackson.
3462
3463         * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::pluginSnapshotTimerFired):
3464         m_plugin can be legitimately null.
3465
3466 2015-03-16  Csaba Osztrogonác  <ossy@webkit.org>
3467
3468         One more URTBF after r181578.
3469
3470         * WebProcess/WebPage/WebPage.cpp:
3471         (WebKit::WebPage::updatePreferences):
3472
3473 2015-03-16  Csaba Osztrogonác  <ossy@webkit.org>
3474
3475         URTBF after r181578.
3476
3477         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3478         (WebKit::InjectedBundle::setCSSAnimationTriggersEnabled): Copy/paste error fixed.
3479
3480 2015-03-16  Dean Jackson  <dino@apple.com>
3481
3482         Expose WK2 preference for Animation Triggers runtime flag
3483         https://bugs.webkit.org/show_bug.cgi?id=142744
3484
3485         Reviewed by Anders Carlsson.
3486
3487         Expose CSSAnimationTriggersEnabled, linking it to the runtime enabled
3488         feature flag.
3489
3490         * Shared/WebPreferencesDefinitions.h:
3491         * UIProcess/API/C/WKPreferences.cpp:
3492         (WKPreferencesSetCSSAnimationTriggersEnabled):
3493         (WKPreferencesGetCSSAnimationTriggersEnabled):
3494         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3495         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3496         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3497         (WebKit::InjectedBundle::setCSSAnimationTriggersEnabled):
3498         * WebProcess/InjectedBundle/InjectedBundle.h:
3499         * WebProcess/WebPage/WebPage.cpp:
3500         (WebKit::WebPage::updatePreferences):
3501
3502 2015-03-16  Conrad Shultz  <conrad_shultz@apple.com>
3503
3504         Allow clients to selectively disable plug-ins
3505         https://bugs.webkit.org/show_bug.cgi?id=142506
3506
3507         Reviewed by Anders Carlsson.
3508
3509         Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
3510         from the page). As part of this:
3511
3512         1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
3513            set of plug-ins.
3514
3515         2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
3516            down the stack.
3517
3518         3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
3519            a concrete implementation thereof in WebPlatformStrategies in WebKit2.
3520
3521         4) Add messaging infrastructure to allow clients to set and clear plug-in policies.
3522
3523         While currently only used in a very limited manner, the new declarative plug-in policies are written generically
3524         so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.
3525
3526         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
3527         (WebKit::NetscapePluginModule::getPluginInfo):
3528         Set new PluginInfo members.
3529
3530         * Shared/WebCoreArgumentCoders.cpp:
3531         (IPC::ArgumentCoder<PluginInfo>::encode):
3532         Handle new PluginInfo members.
3533         (IPC::ArgumentCoder<PluginInfo>::decode):
3534         Ditto.
3535
3536         * Shared/WebProcessCreationParameters.h:
3537         Declare a member to store client plug-in policies.
3538
3539         * Shared/WebProcessCreationParameters.cpp:
3540         (WebKit::WebProcessCreationParameters::encode):
3541         Encode the policies.
3542         (WebKit::WebProcessCreationParameters::decode):
3543         Decode the policies.
3544
3545         * UIProcess/API/C/WKAPICast.h:
3546         (WebKit::toWKPluginLoadClientPolicy):
3547         Teach how to cast between WebCore and WebKit2 policy definitions.
3548         (WebKit::toPluginLoadClientPolicy):
3549         Ditto.
3550
3551         * UIProcess/API/C/WKPluginLoadPolicy.h:
3552         Declare WKPluginLoadClientPolicy, matching PluginLoadClientPolicy in WebCore.
3553
3554         * UIProcess/API/C/mac/WKContextPrivateMac.h:
3555         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
3556         (WKContextSetPluginLoadClientPolicy):
3557         New function; wrap WebProcessPool::setPluginLoadClientPolicy().
3558         (WKContextClearPluginClientPolicies):
3559         New function; wrap WebProcessPool::clearPluginClientPolicies().
3560
3561         * UIProcess/WebProcessPool.h:
3562         * UIProcess/WebProcessPool.cpp:
3563         (WebKit::WebProcessPool::createNewWebProcess):
3564         Copy any client plug-in policies to the new process' creation parameters.
3565         (WebKit::WebProcessPool::setPluginLoadClientPolicy):
3566         Send SetPluginLoadClientPolicy to all processes and stash the passed-in policy info.
3567         (WebKit::WebProcessPool::clearPluginClientPolicies):
3568         Send ClearPluginClientPolicies to all processes and clear any stashed policy info.
3569
3570         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3571         (WebKit::PDFPlugin::pluginInfo):
3572         Set new PluginInfo member.
3573
3574         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3575         (WebKit::pluginSupportsExtension):
3576         Adopt getWebVisibleMimesAndPluginIndices().
3577         (WebKit::WebFrameLoaderClient::objectContentType):
3578         Update to reflect reflect function rename.
3579
3580         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3581         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3582         (WebKit::WebPlatformStrategies::getPluginInfo):
3583         Pass the Page to populatePluginCache().
3584         (WebKit::WebPlatformStrategies::getWebVisiblePluginInfo):
3585         New member function; wrap getPluginInfo(); if appropriate, filter out plug-ins the client has asked
3586         to block on the current page.
3587         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
3588         New member function; map empty inputs to a wildcard character and insert the new policy into the nested map.
3589         (WebKit::WebPlatformStrategies::clearPluginClientPolicies):
3590         New member function; empty m_hostsToPluginIdentifierData.
3591         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost):
3592         New member function; look up the most specific policy for the given plug-in and host.
3593         (WebKit::WebPlatformStrategies::populatePluginCache):
3594         If appropriate, set the client load policy on the plug-ins; do this irrespective of whether the cache has
3595         been populated since the Page, and therefore host, may change.
3596
3597         * WebProcess/WebPage/WebPage.cpp:
3598         (WebKit::WebPage::canShowMIMEType):
3599         Update to reflect function rename.
3600
3601         * WebProcess/WebProcess.h:
3602         * WebProcess/WebProcess.cpp:
3603         (WebKit::WebProcess::initializeWebProcess):
3604         Enumerate and process the client plug-in policies in the creation parameters.
3605         (WebKit::WebProcess::setPluginLoadClientPolicy):
3606         New member function; wrap PluginStrategy::setPluginLoadClientPolicy.
3607         (WebKit::WebProcess::clearPluginClientPolicies):
3608         New member function; wrap PluginStrategy::clearPluginClientPolicies().
3609
3610         * WebProcess/WebProcess.messages.in:
3611         Add messages for setting and clearing policies.
3612
3613 2015-03-16  Carlos Garcia Campos  <cgarcia@igalia.com>
3614
3615         Unreviewed. Add new Notification classes to GTK+ API documentation.
3616
3617         Add WebKitNotification and WebKitNotificationPermissionRequest to
3618         the documentation and fix some other typos causing warnings when
3619         generating HTML documentation.
3620
3621         * UIProcess/API/gtk/WebKitUserContent.cpp:
3622         * UIProcess/API/gtk/WebKitWebView.cpp:
3623         (webkit_web_view_class_init):
3624         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
3625
3626 2015-03-16  Przemyslaw Piorkowski  <p.piorkowski@samsung.com>
3627
3628         [EFL][WK2] REGRESSION(r178526): test_ewk2_storage_manager has been failed for a long time
3629         https://bugs.webkit.org/show_bug.cgi?id=141249
3630
3631         Reviewed by Gyuyoung Kim.
3632
3633         * PlatformEfl.cmake: Enable test_ewk2_storage_manager for EFL port - it is passing now.
3634
3635 2015-03-16  David Kilzer  <ddkilzer@apple.com>
3636
3637         [iOS] REGRESSION (r181511): Most layout tests crash with a NULL deref
3638
3639         Follow-up fix for:
3640         [iOS] Presenting a modal sheet on top of a WKWebView causes it to lose focused, active state
3641         <http://webkit.org/b/142702>
3642
3643         * UIProcess/ios/PageClientImplIOS.mm:
3644         (WebKit::PageClientImpl::isViewWindowActive): Add NULL check for m_webView.
3645         (WebKit::PageClientImpl::isViewFocused): Ditto.
3646
3647 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
3648
3649         Clean up related to wheelEvent names
3650         https://bugs.webkit.org/show_bug.cgi?id=142713
3651
3652         Reviewed by Anders Carlsson.
3653
3654         Add EventNames::isWheelEventType() and use it in places that test for the
3655         two wheel event names.
3656
3657         * WebProcess/Plugins/PluginView.cpp:
3658         (WebKit::PluginView::handleEvent):
3659
3660 2015-03-15  Dan Bernstein  <mitz@apple.com>
3661
3662         [iOS] Presenting a modal sheet on top of a WKWebView causes it to lose focused, active state
3663         https://bugs.webkit.org/show_bug.cgi?id=142702
3664
3665         Reviewed by Anders Carlsson.
3666
3667         * UIProcess/API/Cocoa/WKWebView.mm:
3668         (-[WKWebView becomeFirstResponder]): Override to delegate first responder status to the
3669         WKContentView if possible.
3670         (-[WKWebView _retainActiveFocusedState]): New SPI that prevents view hierarchy changes from
3671         affecting the active and focused state of the view. Increments a counter ivar and returns a
3672         completion block (which callers must call when they’re done) that decrements it back.
3673         * UIProcess/API/Cocoa/WKWebViewInternal.h: Declared new _activeFocusedStateRetainCount ivar
3674         with @package access.
3675         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new method.
3676
3677         * UIProcess/ios/PageClientImplIOS.mm:
3678         (WebKit::PageClientImpl::isViewWindowActive): Return true if active/focused state is to be
3679         maintained despite not being visible.
3680         (WebKit::PageClientImpl::isViewFocused): Return true if active/focused state is to be
3681         maintained despite not being active.
3682
3683         * UIProcess/ios/WKContentViewInteraction.mm:
3684         (-[WKContentView resignFirstResponder]): Don’t blur the assisted node if active/focused
3685         state is to be maintained.
3686
3687 2015-03-14  Simon Fraser  <simon.fraser@apple.com>
3688
3689         Clean up use of flags in localToContainer-type functions
3690         https://bugs.webkit.org/show_bug.cgi?id=142704
3691
3692         Reviewed by Alexey Proskuryakov.
3693         
3694         Pass UseTransforms explicitly to localToContainerPoint()
3695
3696         * WebProcess/WebPage/ios/WebPageIOS.mm:
3697         (WebKit::WebPage::getAssistedNodeInformation):
3698
3699 2015-03-14  Brent Fulgham  <bfulgham@apple.com>
3700
3701         [iOS] scroll snap points are animating to the wrong positions.
3702         https://bugs.webkit.org/show_bug.cgi?id=142705
3703         <rdar://problem/20136946>
3704
3705         Reviewed by Simon Fraser.
3706
3707         Scroll snapping was landing in the wrong place on iOS because of two problems:
3708         (1) It was searching for the closest snap offset point using unscaled 'screen' pixels,
3709         which caused it to always choose one of the earliest snap point options.
3710         (2) It was then selecting a scaled snap point coordinate and passing it back to UIKit
3711         to animate the snap. This caused it to select a target point beyond the 'screen' pixel
3712         we want to hit.
3713         
3714         The solution to both problems are to scale the scroll destination UIKit suggests so that
3715         we search among the scaled points with a valid value. Then, we need to scale the returned
3716         value back to screen units before handing it back to UIKit to process.
3717
3718         * UIProcess/API/Cocoa/WKWebView.mm:
3719         (-[WKWebView scrollViewWillBeginDragging:]): Drive-by fix. Get rid of extra ';' at
3720         the end of the line.
3721         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3722         (WebKit::RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling):
3723
3724 2015-03-14  Dean Jackson  <dino@apple.com>
3725
3726         Feature flag for Animations Level 2
3727         https://bugs.webkit.org/show_bug.cgi?id=142699
3728         <rdar://problem/20165097>
3729
3730         Reviewed by Brent Fulgham.
3731
3732         Add ENABLE_CSS_ANIMATIONS_LEVEL_2 and a runtime flag animationTriggersEnabled.
3733
3734         * Configurations/FeatureDefines.xcconfig:
3735
3736 2015-03-14  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
3737
3738         [GStreamer] share GL context in pipeline
3739         https://bugs.webkit.org/show_bug.cgi?id=142693
3740
3741         Reviewed by Philippe Normand.
3742
3743         * WebProcess/gtk/WebProcessMainGtk.cpp: Enable XInitThreads() if
3744         GSTREAMER_GL is used, since GstGL elements use another thread for
3745         queuing GL operations.
3746
3747 2015-03-13  Alex Christensen  <achristensen@webkit.org>
3748
3749         Progress towards CMake on Mac.
3750         https://bugs.webkit.org/show_bug.cgi?id=142680
3751
3752         Reviewed by Gyuyoung Kim.
3753
3754         * PlatformMac.cmake: Added.
3755
3756 2015-03-13  Commit Queue  <commit-queue@webkit.org>
3757
3758         Unreviewed, rolling out r181483.
3759         https://bugs.webkit.org/show_bug.cgi?id=142688
3760
3761         Caused use-after-free on many tests (Requested by ap on
3762         #webkit).
3763
3764         Reverted changeset:
3765
3766         "Allow clients to selectively disable plug-ins"
3767         https://bugs.webkit.org/show_bug.cgi?id=142506
3768         http://trac.webkit.org/changeset/181483
3769
3770 2015-03-13  Eric Carlson  <eric.carlson@apple.com>
3771
3772         [Mac] Enable WIRELESS_PLAYBACK_TARGET
3773         https://bugs.webkit.org/show_bug.cgi?id=142635
3774
3775         Reviewed by Darin Adler.
3776
3777         * Configurations/FeatureDefines.xcconfig:
3778
3779 2015-03-13  Timothy Horton  <timothy_horton@apple.com>
3780
3781         Sites that use a device-width viewport but don't have enough height to fill the view are scaled up
3782         https://bugs.webkit.org/show_bug.cgi?id=142664
3783         <rdar://problem/18859470>
3784
3785         Reviewed by Benjamin Poulain.
3786
3787         * UIProcess/ios/WKScrollView.mm:
3788         (-[WKScrollView _rubberBandOffsetForOffset:maxOffset:minOffset:range:outside:]):
3789         Now that the WKContentView can (without pinching) be smaller than the unobscured
3790         region of the WKWebView, we need to take that into account when deciding where
3791         to retarget scrolling.
3792
3793 2015-03-13  Mark Lam  <mark.lam@apple.com>
3794
3795         Replace TCSpinLock with a new WTF::SpinLock based on WTF::Atomic.
3796         <https://webkit.org/b/142674>
3797
3798         Reviewed by Filip Pizlo.
3799
3800         * WebProcess/WebPage/EventDispatcher.cpp:
3801         (WebKit::EventDispatcher::EventDispatcher):
3802         * WebProcess/WebPage/EventDispatcher.h:
3803         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
3804         (WebKit::ViewUpdateDispatcher::ViewUpdateDispatcher):
3805         * WebProcess/WebPage/ViewUpdateDispatcher.h:
3806
3807 2015-03-10  Conrad Shultz  <conrad_shultz@apple.com>
3808
3809         Allow clients to selectively disable plug-ins
3810         https://bugs.webkit.org/show_bug.cgi?id=142506
3811
3812         Reviewed by Anders Carlsson.
3813
3814         Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
3815         from the page). As part of this:
3816
3817         1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
3818            set of plug-ins.
3819
3820         2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
3821            down the stack.
3822
3823         3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
3824            a concrete implementation thereof in WebPlatformStrategies in WebKit2.
3825
3826         4) Add messaging infrastructure to allow clients to set and clear plug-in policies.
3827
3828         While currently only used in a very limited manner, the new declarative plug-in policies are written generically
3829         so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.
3830
3831         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
3832         (WebKit::NetscapePluginModule::getPluginInfo):
3833         Set new PluginInfo members.
3834
3835         * Shared/WebCoreArgumentCoders.cpp:
3836         (IPC::ArgumentCoder<PluginInfo>::encode):
3837         Handle new PluginInfo members.
3838         (IPC::ArgumentCoder<PluginInfo>::decode):
3839         Ditto.
3840
3841         * Shared/WebProcessCreationParameters.h:
3842         Declare a member to store client plug-in policies.
3843
3844         * Shared/WebProcessCreationParameters.cpp:
3845         (WebKit::WebProcessCreationParameters::encode):
3846         Encode the policies.
3847         (WebKit::WebProcessCreationParameters::decode):
3848         Decode the policies.
3849
3850         * UIProcess/API/C/WKAPICast.h:
3851         (WebKit::toWKPluginLoadClientPolicy):
3852         Teach how to cast between WebCore and WebKit2 policy definitions.
3853         (WebKit::toPluginLoadClientPolicy):
3854         Ditto.
3855
3856         * UIProcess/API/C/WKPluginLoadPolicy.h:
3857         Declare WKPluginLoadClientPolicy, matching PluginLoadClientPolicy in WebCore.
3858
3859         * UIProcess/API/C/mac/WKContextPrivateMac.h:
3860         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
3861         (WKContextSetPluginLoadClientPolicy):
3862         New function; wrap WebProcessPool::setPluginLoadClientPolicy().
3863         (WKContextClearPluginClientPolicies):
3864         New function; wrap WebProcessPool::clearPluginClientPolicies().
3865
3866         * UIProcess/WebProcessPool.h:
3867         * UIProcess/WebProcessPool.cpp:
3868         (WebKit::WebProcessPool::createNewWebProcess):
3869         Copy any client plug-in policies to the new process' creation parameters.
3870         (WebKit::WebProcessPool::setPluginLoadClientPolicy):
3871         Send SetPluginLoadClientPolicy to all processes and stash the passed-in policy info.
3872         (WebKit::WebProcessPool::clearPluginClientPolicies):
3873         Send ClearPluginClientPolicies to all processes and clear any stashed policy info.
3874
3875         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3876         (WebKit::PDFPlugin::pluginInfo):
3877         Set new PluginInfo member.
3878
3879         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3880         (WebKit::pluginSupportsExtension):
3881         Adopt getWebVisibleMimesAndPluginIndices().
3882         (WebKit::WebFrameLoaderClient::objectContentType):
3883         Update to reflect reflect function rename.
3884
3885         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3886         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3887         (WebKit::WebPlatformStrategies::getPluginInfo):
3888         Pass the Page to populatePluginCache().
3889         (WebKit::WebPlatformStrategies::getWebVisiblePluginInfo):
3890         New member function; wrap getPluginInfo(); if appropriate, filter out plug-ins the client has asked
3891         to block on the current page.
3892         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
3893         New member function; map empty inputs to a wildcard character and insert the new policy into the nested map.
3894         (WebKit::WebPlatformStrategies::clearPluginClientPolicies):
3895         New member function; empty m_hostsToPluginIdentifierData.
3896         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost):
3897         New member function; look up the most specific policy for the given plug-in and host.
3898         (WebKit::WebPlatformStrategies::populatePluginCache):
3899         If appropriate, set the client load policy on the plug-ins; do this irrespective of whether the cache has
3900         been populated since the Page, and therefore host, may change.
3901
3902         * WebProcess/WebPage/WebPage.cpp:
3903         (WebKit::WebPage::canShowMIMEType):
3904         Update to reflect function rename.
3905
3906         * WebProcess/WebProcess.h:
3907         * WebProcess/WebProcess.cpp:
3908         (WebKit::WebProcess::initializeWebProcess):
3909         Enumerate and process the client plug-in policies in the creation parameters.
3910         (WebKit::WebProcess::setPluginLoadClientPolicy):
3911         New member function; wrap PluginStrategy::setPluginLoadClientPolicy.
3912         (WebKit::WebProcess::clearPluginClientPolicies):
3913         New member function; wrap PluginStrategy::clearPluginClientPolicies().
3914
3915         * WebProcess/WebProcess.messages.in:
3916         Add messages for setting and clearing policies.
3917
3918 2015-03-12  Jon Honeycutt  <jhoneycutt@apple.com>
3919
3920         Use UIDocumentMenuViewController to allow selection of files from
3921         iCloud Drive in WKFileUploadPanel
3922
3923         Part of <https://bugs.webkit.org/show_bug.cgi?id=142596> WebKit on
3924         iOS should support file upload from iCloud Drive
3925         <rdar://problem/12178991>
3926
3927         Reviewed by Andy Estes.
3928
3929         * Platform/spi/ios/UIKitSPI.h:
3930         Include UIDocumentMenuViewController_Private.h if it exists. If not,
3931         declare this new SPI.
3932
3933         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3934         (fallbackIconForFile):
3935         Create a UIDocumentInteractionController for the file, and return a
3936         thumbnail image from its smallest icon.
3937
3938         (iconForImageFile):
3939         If we can get a UIImage from the file, create a thumbnail from it.
3940         Otherwise, call fallbackIconForFile().
3941
3942         (iconForVideoFile):
3943         Code moved from -[_WKVideoFileUploadItem displayImage].
3944
3945         (iconForFile):
3946         Get the file's extension, and get the extension's preferred UTI. If the
3947         UTI is an image type, call iconForImageFile(). If it's a video type,
3948         call iconForVideoFile(). Otherwise, return the fallback icon.
3949
3950         (-[_WKFileUploadItem initWithFileURL:]):
3951         Added an initializer that takes a file URL.
3952
3953         (-[_WKFileUploadItem fileURL]):
3954         (-[_WKImageFileUploadItem initWithFileURL:originalImage:]):
3955         (-[_WKVideoFileUploadItem displayImage]):
3956         (WKFileUploadPanel):
3957         Inherit from UIDocumentPickerDelegate and UIDocumentMenuDelegate. Add
3958         an ivar for the document menu controller.
3959
3960         (-[WKFileUploadPanel dealloc]):
3961         (-[WKFileUploadPanel presentWithParameters:resultListener:]):
3962         If instances of UIDocumentMenuViewController respond to
3963         -_setIgnoreApplicationEntitlementForImport:, meaning we can disable the
3964         assertion that the current app has the iCloud Documents entitlement,
3965         then show the document picker menu. Otherwise, show the current source
3966         selection UI. The runtime check will be removed when a newer UIKit is
3967         available.
3968
3969         (UTIsForMIMETypes):
3970         Return the UTIs for the <input> element's "accept" attribute's MIME
3971         type list.
3972
3973         (-[WKFileUploadPanel _mediaTypesForPickerSourceType:]):
3974         Call UTIsForMIMETypes(). Fall back to available source types for this
3975         picker type.
3976
3977         (-[WKFileUploadPanel _documentPickerMenuMediaTypes]):
3978         Call UTIsForMIMETypes(). Fall back to the all-encompassing
3979         "public.item" UTI.
3980
3981         (-[WKFileUploadPanel _photoLibraryButtonLabel]):
3982         (-[WKFileUploadPanel _cameraButtonLabel]):
3983         Factored out of -_showMediaSourceSelectionSheet. Return the
3984         appropriate label for the camera button, based on whether it can take a
3985         photo or video, or return nil if the camera is not available.
3986
3987         (-[WKFileUploadPanel _showMediaSourceSelectionSheet]):
3988         Changed to use -_cameraButtonLabel and
3989         -_presentForCurrentInterfaceIdiom:.
3990
3991         (-[WKFileUploadPanel _showDocumentPickerMenu]):
3992         Create a UIDocumentMenuViewController, and populate it with options to
3993         open the photo library or take a picture or video. If iCloud Drive or
3994         other document sources are available, they will be added automatically.
3995
3996         (-[WKFileUploadPanel _presentForCurrentInterfaceIdiom:]):
3997         (-[WKFileUploadPanel documentMenu:didPickDocumentPicker:]):
3998         (-[WKFileUploadPanel documentMenuWasCancelled:]):
3999         (-[WKFileUploadPanel documentPicker:didPickDocumentAtURL:]):
4000         (-[WKFileUploadPanel documentPickerWasCancelled:]):
4001         (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
4002
4003         (-[_WKImageFileUploadItem initWithFilePath:originalImage:]): Deleted.
4004         (-[_WKImageFileUploadItem fileURL]): Deleted.
4005         (-[_WKVideoFileUploadItem initWithFilePath:mediaURL:]): Deleted.
4006         (-[_WKVideoFileUploadItem fileURL]): Deleted.
4007
4008 2015-03-11  Enrica Casucci  <enrica@apple.com>
4009
4010         Adopt new API for keyboard event handling.
4011         https://bugs.webkit.org/show_bug.cgi?id=142602
4012         rdar://problem/19966087
4013
4014         Reviewed by Sam Weinig.
4015
4016         Adopts the new API.
4017
4018         * UIProcess/ios/WKContentViewInteraction.mm:
4019         (-[WKContentView _didHandleKeyEvent:]):
4020
4021 2015-03-12  Alexey Proskuryakov  <ap@apple.com>
4022
4023         testRunner.setAlwaysAcceptCookies does not work with NetworkProcess
4024         https://bugs.webkit.org/show_bug.cgi?id=138687
4025
4026         Reviewed by Carlos Garcia Campos.
4027
4028         * UIProcess/WebCookieManagerProxy.cpp:
4029         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy): Don't change system-wide
4030         cookie accept policy when in testing mode. Also, update the policy in WebProcesses too,
4031         as we still do some networking there.
4032
4033         * UIProcess/WebProcessPool.h:
4034         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
4035         (WKBundleSetAlwaysAcceptCookies): Deleted.
4036         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
4037         * WebProcess/InjectedBundle/InjectedBundle.cpp:
4038         (WebKit::InjectedBundle::setAlwaysAcceptCookies): Deleted.
4039         * WebProcess/InjectedBundle/InjectedBundle.h:
4040         Remove WKBundleSetAlwaysAcceptCookies SPI, as WKTR now uses an API in UI process.
4041
4042 2015-03-12  Anders Carlsson  <andersca@apple.com>
4043
4044         WKErrorDomain should be declared nonnull
4045         https://bugs.webkit.org/show_bug.cgi?id=142628
4046
4047         Reviewed by Antti Koivisto.
4048
4049         Add WK_ASSUME_NONNULL_BEGIN and WK_ASSUME_NONNULL_END so everything will be implicitly nonnull.
4050
4051         * UIProcess/API/Cocoa/WKError.h:
4052
4053 2015-03-12  Ian Henderson  <ian@ianhenderson.org>
4054
4055         PDFs don't snapshot properly in iOS Safari
4056         https://bugs.webkit.org/show_bug.cgi?id=142623
4057
4058         Reviewed by Tim Horton.
4059
4060         * UIProcess/API/Cocoa/WKWebView.mm:
4061         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
4062         If we have a _customContentView, use UIView snapshotting instead of
4063         trying to snapshot the web page.
4064
4065 2015-03-12  Eric Carlson  <eric.carlson@apple.com>
4066
4067         [Mac] Update AirPlay handling
4068         https://bugs.webkit.org/show_bug.cgi?id=142541
4069
4070         Unreviewed, respond to post-review comments and add previously reviewed changes
4071         missed by a bungled merge.
4072
4073         * Shared/mac/WebCoreArgumentCodersMac.mm:
4074         * UIProcess/WebMediaPlaybackTargetPickerProxy.cpp:
4075         (WebKit::WebMediaPlaybackTargetPickerProxy::~WebMediaPlaybackTargetPickerProxy):
4076         * UIProcess/mac/PageClientImpl.h:
4077         * UIProcess/mac/PageClientImpl.mm:
4078         (WebKit::PageClientImpl::createPlaybackTargetPicker):
4079         * UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h: Added.
4080         * UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm: Added.
4081         * WebKit2.xcodeproj/project.pbxproj:
4082         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
4083         * WebProcess/WebCoreSupport/WebChromeClient.h:
4084         * WebProcess/WebPage/WebPage.h:
4085         * WebProcess/WebPage/WebPage.messages.in:
4086         * WebProcess/WebPage/mac/WebPageMac.mm:
4087         * WebProcess/com.apple.WebProcess.sb.in:
4088
4089 2015-03-11  Antti Koivisto  <antti@apple.com>
4090
4091         Cache traversal missing large entries
4092         https://bugs.webkit.org/show_bug.cgi?id=142601
4093
4094         Reviewed by Andreas Kling.
4095
4096         When traversing cache entries we only read the header data from disk. This didn't work
4097    &n