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