Allow testing of plug-ins that handle wheel events.
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-04-29  Simon Fraser  <simon.fraser@apple.com>
2
3         Allow testing of plug-ins that handle wheel events.
4         https://bugs.webkit.org/show_bug.cgi?id=144413
5
6         Reviewed by Tim Horton.
7         
8         Allow the Test Netscape Plug-in to pretend to handle wheel events,
9         so layout tests can use it.
10
11         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
12         (WebKit::NetscapePluginModule::determineQuirks):
13
14 2015-04-29  Filip Pizlo  <fpizlo@apple.com>
15
16         JSTypeInfo should have an inline type flag to indicate if getCallData() has been overridden
17         https://bugs.webkit.org/show_bug.cgi?id=144397
18
19         Reviewed by Andreas Kling.
20
21         If you override getCallData() and you want to be called a "function", then you need to use the
22         new TypeOfShouldCallGetCallData flag.
23
24         * WebProcess/Plugins/Netscape/JSNPObject.h:
25
26 2015-04-29  Antti Koivisto  <antti@apple.com>
27
28         ResourceLoadPriority should be enum class
29         https://bugs.webkit.org/show_bug.cgi?id=144326
30
31         Reviewed by Darin Adler.
32
33         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
34         (WebKit::NetworkConnectionToWebProcess::servePendingRequests): Deleted.
35
36             Remove this unused message.
37
38         * NetworkProcess/NetworkConnectionToWebProcess.h:
39         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
40         * NetworkProcess/cache/NetworkCache.cpp:
41         (WebKit::NetworkCache::makeStoreDecision):
42         (WebKit::NetworkCache::Cache::retrieve):
43         * NetworkProcess/mac/NetworkResourceLoadSchedulerMac.mm:
44         (WebKit::NetworkResourceLoadScheduler::platformInitializeNetworkSettings):
45         * WebProcess/Network/WebResourceLoadScheduler.cpp:
46         (WebKit::WebResourceLoadScheduler::servePendingRequests):
47         * WebProcess/Network/WebResourceLoadScheduler.h:
48
49 2015-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
50
51         [OS X] Use CTFontCreateForCSS instead of doing font search ourselves
52         https://bugs.webkit.org/show_bug.cgi?id=132159
53
54         Reviewed by Darin Adler.
55
56         Add SPI to set the font whitelist.
57
58         * Shared/WebProcessCreationParameters.cpp:
59         (WebKit::WebProcessCreationParameters::encode):
60         (WebKit::WebProcessCreationParameters::decode):
61         * Shared/WebProcessCreationParameters.h:
62         * UIProcess/API/C/WKContext.cpp:
63         (WKContextSetFontWhitelist):
64         * UIProcess/API/C/WKContextPrivate.h:
65         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
66         (WebKit::WebProcessPool::platformInitializeWebProcess):
67         * UIProcess/WebProcessPool.cpp:
68         (WebKit::WebProcessPool::setFontWhitelist):
69         * UIProcess/WebProcessPool.h:
70         * WebProcess/cocoa/WebProcessCocoa.mm:
71         (WebKit::WebProcess::platformInitializeWebProcess):
72
73 2015-04-29  Martin Robinson  <mrobinson@igalia.com>
74
75         [CMake] [GTK] Organize and clean up unused CMake variables
76         https://bugs.webkit.org/show_bug.cgi?id=144364
77
78         Reviewed by Gyuyoung Kim.
79
80         * PlatformGTK.cmake: Add variables specific to this project.
81         * webkit2gtk-web-extension.pc.in: Hardcode the GTK+ API version. It rarely changes.
82         * webkit2gtk.pc.in: Ditto.
83
84 2015-04-29  Carlos Garcia Campos  <cgarcia@igalia.com>
85
86         REGRESSION(r182573): [GTK] The default context menu contains an empty item since r182573
87         https://bugs.webkit.org/show_bug.cgi?id=144388
88
89         Reviewed by Brady Eidson.
90
91         Move the WebContextMenuClient::shareMenuItem() implementation to
92         platform files, since platforms not supporting share menu item
93         should return a null ContextMenuIem instead.
94
95         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
96         (WebKit::WebContextMenuClient::shareMenuItem): Deleted.
97         * WebProcess/WebCoreSupport/efl/WebContextMenuClientEfl.cpp:
98         (WebKit::WebContextMenuClient::shareMenuItem):
99         * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
100         (WebKit::WebContextMenuClient::shareMenuItem):
101         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
102         (WebKit::WebContextMenuClient::shareMenuItem):
103
104 2015-04-29  Carlos Garcia Campos  <cgarcia@igalia.com>
105
106         REGRESSION(r183467): [SOUP] isMainResource is no longer passed as resource load parameters to the network process
107         https://bugs.webkit.org/show_bug.cgi?id=144381
108
109         Reviewed by Darin Adler.
110
111         A requester enum value is passed now as part of the
112         ResourceRequest, but it's not encoded/decoded for soup.
113
114         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
115         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData): Encode requester.
116         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData): Decode requester.
117
118 2015-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
119
120         [SOUP] Use xattrs to get/set the creation time of disk cache files
121         https://bugs.webkit.org/show_bug.cgi?id=144251
122
123         Reviewed by Martin Robinson.
124
125         The network process disk cache uses the creation time to compute a
126         worth value used to determine the order in which cached resources
127         are deleted when the cache is shrunk. In some operating systems
128         like Linux there's no st_birthtime in struct stat, but since cache
129         files are always created and deleted by us, we could use a custom
130         xattr to store and retrieve the creation time of cached resources.
131
132         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
133         (WebKit::NetworkCache::fileTimes):
134         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
135         (WebKit::NetworkCache::IOChannel::IOChannel):
136
137 2015-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
138
139         Network Cache: Do not create a SharedBuffer for mapped resources unless explicitly requested
140         https://bugs.webkit.org/show_bug.cgi?id=144337
141
142         Reviewed by Antti Koivisto.
143
144         We send a buffer or a memory mapped handler to the web process
145         depending on whether the resource body is mapped or not, but we
146         are always creating a shared buffer even for mapped resources.
147         Split initializeBufferFromStorageRecord() moving the mapped memory
148         handler initialization to its own method.
149
150         * NetworkProcess/cache/NetworkCacheEntry.cpp:
151         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord):
152         Initialize the mapped memory handler if the body data is mapped.
153         (WebKit::NetworkCache::Entry::initializeBufferFromStorageRecord):
154         Initialize the buffer by wrapping the mapped memory if the body
155         data is mapped, or using the body data directly otherwise.
156         (WebKit::NetworkCache::Entry::shareableResourceHandle): Call
157         initializeShareableResourceHandleFromStorageRecord() if the
158         handler is null.
159         * NetworkProcess/cache/NetworkCacheEntry.h:
160
161 2015-04-28  Simon Fraser  <simon.fraser@apple.com>
162
163         Make a non-static version of FrameView::yPositionForRootContentLayer()
164         https://bugs.webkit.org/show_bug.cgi?id=144375
165
166         Reviewed by Andy Estes.
167
168         There were two calls to the static FrameView::yPositionForRootContentLayer()
169         which passed in all the arguments for the same FrameView. Make a member
170         function for convenience.
171
172         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
173         (WebKit::shadowLayerPositionForFrame):
174
175 2015-04-28  Ryuan Choi  <ryuan.choi@navercorp.com>
176
177         [CoordinatedGraphics] Merge TILED_BACKING_STORE guard with COORDINATED_GRAPHICS
178         https://bugs.webkit.org/show_bug.cgi?id=143001
179
180         Reviewed by Gyuyoung Kim.
181
182         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
183         (WebKit::CoordinatedLayerTreeHostProxy::commitCoordinatedGraphicsState):
184         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
185         (WebKit::WebChromeClient::dispatchViewportPropertiesDidChange):
186         * WebProcess/WebCoreSupport/WebChromeClient.h:
187         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
188         (WebKit::WebFrameLoaderClient::dispatchDidLayout):
189         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
190         * WebProcess/WebPage/WebPage.cpp:
191         (WebKit::WebPage::setSize):
192         (WebKit::WebPage::setUseFixedLayout):
193         (WebKit::WebPage::canHandleUserEvents):
194         * WebProcess/WebPage/WebPage.h:
195
196 2015-04-28  Timothy Horton  <timothy_horton@apple.com>
197
198         [TextIndicator] Yellow highlight takes too long to fade out on scroll
199         https://bugs.webkit.org/show_bug.cgi?id=144358
200         <rdar://problem/19451011>
201
202         Reviewed by Beth Dakin.
203
204         * UIProcess/API/Cocoa/WKViewPrivate.h:
205         * UIProcess/API/mac/WKView.mm:
206         (-[WKView renewGState]):
207         (-[WKView viewDidMoveToWindow]):
208         (-[WKView _dictionaryLookupPopoverWillClose:]):
209         (-[WKView _setTextIndicator:]):
210         (-[WKView _setTextIndicator:withLifetime:]):
211         (-[WKView _clearTextIndicatorWithAnimation:]):
212         (-[WKView magnifyWithEvent:]):
213         (-[WKView smartMagnifyWithEvent:]):
214         (-[WKView setMagnification:centeredAtPoint:]):
215         (-[WKView setMagnification:]):
216         (-[WKView _dismissContentRelativeChildWindows]):
217         (-[WKView _dismissContentRelativeChildWindowsWithAnimation:]):
218         (-[WKView _setTextIndicator:fadeOut:]): Deleted.
219         * UIProcess/API/mac/WKViewInternal.h:
220         * UIProcess/PageClient.h:
221         * UIProcess/WebPageProxy.cpp:
222         (WebKit::WebPageProxy::pageDidScroll):
223         (WebKit::WebPageProxy::setTextIndicator):
224         (WebKit::WebPageProxy::clearTextIndicator):
225         * UIProcess/WebPageProxy.h:
226         * UIProcess/WebPageProxy.messages.in:
227         * UIProcess/ios/PageClientImplIOS.h:
228         * UIProcess/ios/PageClientImplIOS.mm:
229         (WebKit::PageClientImpl::setTextIndicator):
230         (WebKit::PageClientImpl::clearTextIndicator):
231         * UIProcess/mac/PageClientImpl.h:
232         * UIProcess/mac/PageClientImpl.mm:
233         (WebKit::PageClientImpl::setTextIndicator):
234         (WebKit::PageClientImpl::clearTextIndicator):
235         (WebKit::PageClientImpl::didPerformDictionaryLookup):
236         (WebKit::PageClientImpl::dismissContentRelativeChildWindows):
237         * UIProcess/mac/WKActionMenuController.mm:
238         (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
239         * UIProcess/mac/WKImmediateActionController.mm:
240         (-[WKImmediateActionController _defaultAnimationController]):
241         (-[WKImmediateActionController _animationControllerForDataDetectedText]):
242         (-[WKImmediateActionController _animationControllerForDataDetectedLink]):
243         (-[WKImmediateActionController _animationControllerForText]):
244         * WebProcess/WebPage/FindController.cpp:
245         (WebKit::FindController::updateFindIndicator):
246         Make _setTextIndicator take a reference.
247         Add a variant of _setTextIndicator that takes a Lifetime.
248         Make _clearTextIndicatorWithAnimation take a DismissalAnimation.
249         Make dismissContentRelativeChildWindows take a parameter indicating
250         whether the dismissal should include animation or not (currently
251         only applies to TextIndicator).
252         Don't animate when dismissal occurs because of scrolling, zooming,
253         or other things in which the content will have changed significantly
254         underneath the indicator and shouldn't have a slowly-fading-out yellow highlight.
255
256 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
257
258         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
259         https://bugs.webkit.org/show_bug.cgi?id=144304
260
261         Reviewed by Geoffrey Garen.
262
263         Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default.
264
265         * Configurations/FeatureDefines.xcconfig:
266
267 2015-04-28  Commit Queue  <commit-queue@webkit.org>
268
269         Unreviewed, rolling out r183514.
270         https://bugs.webkit.org/show_bug.cgi?id=144359
271
272         It broke cloop test bots (Requested by mcatanzaro on #webkit).
273
274         Reverted changeset:
275
276         "Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT"
277         https://bugs.webkit.org/show_bug.cgi?id=144304
278         http://trac.webkit.org/changeset/183514
279
280 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
281
282         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
283         https://bugs.webkit.org/show_bug.cgi?id=144304
284
285         Reviewed by Geoffrey Garen.
286
287         Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default.
288
289         * Configurations/FeatureDefines.xcconfig:
290
291 2015-04-28  Enrica Casucci  <enrica@apple.com>
292
293         Add support for lookup on iOS.
294         https://bugs.webkit.org/show_bug.cgi?id=144342
295         rdar://problem/19994090
296
297         Reviewed by Tim Horton.
298
299         * UIProcess/WebPageProxy.h:
300         * UIProcess/ios/WKContentViewInteraction.mm:
301         (-[WKContentView _lookup:]):
302         (-[WKContentView canPerformAction:withSender:]):
303         * UIProcess/ios/WebPageProxyIOS.mm:
304         (WebKit::WebPageProxy::getLookupContextAtPoint):
305         * WebProcess/WebPage/WebPage.h:
306         * WebProcess/WebPage/WebPage.messages.in:
307         * WebProcess/WebPage/ios/WebPageIOS.mm:
308         (WebKit::WebPage::getLookupContextAtPoint):
309
310 2015-04-28  Brady Eidson  <beidson@apple.com>
311
312         Consolidate most "frame load" arguments into FrameLoadRequest.
313         https://bugs.webkit.org/show_bug.cgi?id=144276
314
315         Reviewed by Alexey Proskuryakov.
316
317         * WebProcess/Plugins/PluginView.cpp:
318         (WebKit::PluginView::loadURL):
319         
320         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
321         (WebKit::WebFrameLoaderClient::dispatchCreatePage):
322         
323         * WebProcess/WebPage/WebInspector.cpp:
324         (WebKit::WebInspector::openInNewTab):
325
326 2015-04-28  Chris Dumez  <cdumez@apple.com>
327
328         [WK2][Mac] Update WebContent process' sandbox profile for AWD
329         https://bugs.webkit.org/show_bug.cgi?id=144315
330         <rdar://problem/20719293>
331
332         Reviewed by Alexey Proskuryakov.
333
334         Update sandbox profile for AWD similarly to what was done for iOS in
335         r182278.
336
337         * WebProcess/com.apple.WebProcess.sb.in:
338
339 2015-04-28  Antti Koivisto  <antti@apple.com>
340
341         Network Cache: Disk cache getting filled by YouTube video data
342         https://bugs.webkit.org/show_bug.cgi?id=144259
343
344         Reviewed by Darin Adler.
345
346         MSE media is loaded via XHR and tends to eventually fill the cache.
347
348         YouTube serves the media chunks cacheable, however they are rarely (if ever) reused.
349         We can reduce disk writes and keep more useful resources around by not caching them
350
351         * NetworkProcess/NetworkResourceLoader.cpp:
352         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
353         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
354         * NetworkProcess/cache/NetworkCache.cpp:
355         (WebKit::NetworkCache::makeStoreDecision):
356
357             Don't store if the requester is XHR and response has video or audio content type.
358
359         * NetworkProcess/cache/NetworkCache.h:
360         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
361         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
362         * Shared/Network/NetworkResourceLoadParameters.cpp:
363         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
364         (WebKit::NetworkResourceLoadParameters::encode):
365         (WebKit::NetworkResourceLoadParameters::decode):
366         * Shared/Network/NetworkResourceLoadParameters.h:
367
368             The requester type is now part of the ResourceRequest, no need for separate parameter.
369
370         * Shared/mac/WebCoreArgumentCodersMac.mm:
371         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
372         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
373         * WebProcess/Network/WebResourceLoadScheduler.cpp:
374         (WebKit::WebResourceLoadScheduler::scheduleLoad):
375
376 2015-04-28  Zan Dobersek  <zdobersek@igalia.com>
377
378         [WK2] API::UserContentURLPattern creation functions should return Ref<>
379         https://bugs.webkit.org/show_bug.cgi?id=144225
380
381         Reviewed by Darin Adler.
382
383         Have API::UserContentURLPattern creation functions return Ref<>.
384         Call-sites are also updated, using and operating on the returned Ref<>
385         object where possible.
386
387         * Shared/API/APIUserContentURLPattern.h:
388         (API::UserContentURLPattern::create):
389         * Shared/API/c/WKUserContentURLPattern.cpp:
390         (WKUserContentURLPatternCreate):
391
392 2015-04-28  Zan Dobersek  <zdobersek@igalia.com>
393
394         [WK2] API::URLRequest, API::URLResponse creation functions should return Ref<>
395         https://bugs.webkit.org/show_bug.cgi?id=144224
396
397         Reviewed by Darin Adler.
398
399         Have API::URLRequest and API::URLResponse creation functions return Ref<>.
400         The call-sites are also updated, using and operating on the returned Ref<> object
401         where possible.
402
403         * Shared/API/APIURLRequest.h:
404         (API::URLRequest::create):
405         * Shared/API/APIURLResponse.h:
406         (API::URLResponse::create):
407         * Shared/API/c/WKURLRequest.cpp:
408         (WKURLRequestCreateWithWKURL):
409         * Shared/API/c/mac/WKURLRequestNS.mm:
410         (WKURLRequestCreateWithNSURLRequest):
411         * Shared/API/c/mac/WKURLResponseNS.mm:
412         (WKURLResponseCreateWithNSURLResponse):
413         * UIProcess/API/C/WKContext.cpp:
414         (WKContextSetDownloadClient):
415         * UIProcess/API/C/WKDownload.cpp:
416         (WKDownloadCopyRequest):
417         * UIProcess/API/C/WKNavigationDataRef.cpp:
418         (WKNavigationDataCopyOriginalRequest):
419         * UIProcess/API/C/WKPage.cpp:
420         (WKPageSetPagePolicyClient):
421         (WKPageSetPageUIClient):
422         * UIProcess/Cocoa/NavigationState.mm:
423         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
424         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp:
425         (WebKit::WebSoupCustomProtocolRequestManagerClient::startLoading):
426         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
427         (willSendRequestForFrame):
428         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp:
429         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNavigationAction):
430         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNewWindowAction):
431         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForResponse):
432
433 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
434
435         [WK2] API::Point, API::Size, API::Rect creation functions should return Ref<>
436         https://bugs.webkit.org/show_bug.cgi?id=144223
437
438         Reviewed by Darin Adler.
439
440         Have API::Point, API::Size and API::Rect creation functions return Ref<>.
441         Call-sites are also updated, using and operating on the returned Ref<> object
442         where possible.
443
444         * Shared/API/APIGeometry.h:
445         (API::Size::create):
446         (API::Point::create):
447         (API::Rect::create):
448         * Shared/API/c/WKGeometry.cpp:
449         (WKPointCreate):
450         (WKSizeCreate):
451         (WKRectCreate):
452
453 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
454
455         [WK2] API::Error creation functions should return Ref<>
456         https://bugs.webkit.org/show_bug.cgi?id=144222
457
458         Reviewed by Darin Adler.
459
460         Have API::Error creation functions return Ref<>.
461         The call-sites are also updated, using and operating
462         on the returned Ref<> object where possible.
463
464         * Shared/API/APIError.h:
465         (API::Error::create):
466         * Shared/API/c/cf/WKErrorCF.cpp:
467         (WKErrorCreateWithCFError):
468         * UIProcess/API/C/WKOriginDataManager.cpp:
469         (WKOriginDataManagerDeleteEntriesForOrigin):
470         (WKOriginDataManagerDeleteEntriesModifiedBetweenDates):
471         (WKOriginDataManagerDeleteAllEntries):
472         * UIProcess/API/C/WKPage.cpp:
473         (toGenericCallbackFunction):
474         (WKPageForceRepaint):
475         (WKPageValidateCommand):
476         (WKPageComputePagesForPrinting):
477         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
478         (WKPluginSiteDataManagerClearSiteData):
479         (WKPluginSiteDataManagerClearAllSiteData):
480         * UIProcess/GenericCallback.h:
481         (WebKit::toGenericCallbackFunction):
482         * UIProcess/WebPageProxy.cpp:
483         (WebKit::WebPageProxy::printFinishedCallback):
484
485 2015-04-27  Sungmann Cho  <sungmann.cho@navercorp.com>
486
487         [GTK] Remove unnecessary semicolon from WebKitNotificationProvider.h.
488         https://bugs.webkit.org/show_bug.cgi?id=144312
489
490         Reviewed by Martin Robinson.
491
492         No new tests, no behavior change.
493
494         * UIProcess/API/gtk/WebKitNotificationProvider.h:
495
496 2015-04-27  Brent Fulgham  <bfulgham@apple.com>
497
498         PDF action menu fixes
499         https://bugs.webkit.org/show_bug.cgi?id=144299
500         <rdar://problem/20702215>
501
502         Reviewed by Tim Horton.
503
504         Make two corrections to how PDFs are handled:
505         1. When calculating the view rect for the user's selection, make sure
506         that we get coordinates for the correct PDF page. The existing code assumed
507         that the current PDFLayerControler's current page was correct, but this will
508         not be true if you zoom the PDF out so that several pages are displayed at
509         once. Each selection keeps track of the page it is referenced against.
510         
511         2. Revise the offsets calculated for the TextIndicator to take into account
512         the font descender (as well as the ascender), and to adjust by the scaled
513         amount of margin around the selected text.
514
515         * WebProcess/Plugins/PDF/PDFPlugin.mm:
516         (WebKit::PDFPlugin::viewRectForSelection): Use correct page for calculating
517         the coordinates.
518         * WebProcess/WebPage/mac/WebPageMac.mm:
519         (WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin): Include font 'descendant'
520         and (scaled) margin when adjusting the hit target for the TextIndicator to draw.
521
522 2015-04-27  Michael Catanzaro  <mcatanzaro@igalia.com>
523
524         Rename WTF_USE_3D_GRAPHICS to ENABLE_GRAPHICS_CONTEXT_3D
525         https://bugs.webkit.org/show_bug.cgi?id=144193
526
527         Reviewed by Darin Adler.
528
529         * CMakeLists.txt:
530
531 2015-04-24  Jon Honeycutt  <jhoneycutt@apple.com>
532
533         Context menus are not reshown after an orientation change
534
535         <https://bugs.webkit.org/show_bug.cgi?id=144143>
536         <rdar://problem/20679931>
537
538         Reviewed by Darin Adler.
539
540         * UIProcess/ios/WKActionSheet.mm:
541         (-[WKActionSheet updateSheetPosition]):
542         Return early if we're still in a rotation, not if the rotation is
543         complete.
544
545 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
546
547         [WK2] API::Dictionary creation functions should return Ref<>
548         https://bugs.webkit.org/show_bug.cgi?id=144221
549
550         Reviewed by Darin Adler.
551
552         Have API::Dictionary creation functions return Ref<>.
553         The call-sites are also updated, using and operating
554         on the returned Ref<> object where possible.
555
556         * Shared/API/APIDictionary.cpp:
557         (API::Dictionary::create):
558         * Shared/API/APIDictionary.h:
559         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
560         (createEncodedObject):
561         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
562         (-[_WKRemoteObjectRegistry _sendInvocation:interface:]):
563         * Shared/API/c/WKDictionary.cpp:
564         (WKDictionaryCreate):
565         * Shared/API/c/WKMutableDictionary.cpp:
566         (WKMutableDictionaryCreate):
567         * Shared/Plugins/Netscape/PluginInformation.cpp:
568         (WebKit::createPluginInformationDictionary):
569         * Shared/Plugins/Netscape/PluginInformation.h:
570         * UIProcess/API/C/WKPage.cpp:
571         (WKPageSetPageUIClient):
572         * UIProcess/API/gtk/WebKitWebContext.cpp:
573         (webkit_web_context_prefetch_dns):
574         * UIProcess/API/gtk/WebKitWebView.cpp:
575         (webkit_web_view_get_snapshot):
576         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
577         (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy):
578         * UIProcess/Plugins/PlugInAutoStartProvider.h:
579         * UIProcess/StatisticsRequest.cpp:
580         (WebKit::createDictionaryFromHashMap):
581         (WebKit::StatisticsRequest::completedRequest):
582         * UIProcess/WebFormClient.cpp:
583         (WebKit::WebFormClient::willSubmitForm):
584         * UIProcess/WebPageProxy.cpp:
585         (WebKit::WebPageProxy::didFailToInitializePlugin):
586         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
587         (didInitiateLoadForResource):
588         (willSendRequestForFrame):
589         (didReceiveResponseForResource):
590         (didReceiveContentLengthForResource):
591         (didFinishLoadForResource):
592         (didFailLoadForResource):
593         (webkitWebPageDidReceiveMessage):
594         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
595         (WebKit::InjectedBundlePageFormClient::willSendSubmitEvent):
596         (WebKit::InjectedBundlePageFormClient::willSubmitForm):
597
598 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
599
600         [WK2] API::Data creation functions should return Ref<>
601         https://bugs.webkit.org/show_bug.cgi?id=144220
602
603         Reviewed by Darin Adler.
604
605         Have API::Data creation functions return Ref<>.
606         The call-sites are also updated, using and operating
607         on the returned Ref<> object where possible.
608
609         * Shared/API/APIData.h:
610         (API::Data::createWithoutCopying):
611         (API::Data::create):
612         * Shared/API/c/WKData.cpp:
613         (WKDataCreate):
614         * Shared/API/c/mac/WKWebArchive.cpp:
615         (WKWebArchiveCopyData):
616         * Shared/API/c/mac/WKWebArchiveResource.cpp:
617         (WKWebArchiveResourceCopyData):
618         * Shared/APIWebArchive.h:
619         * Shared/APIWebArchive.mm:
620         (API::WebArchive::data):
621         * Shared/APIWebArchiveResource.h:
622         * Shared/APIWebArchiveResource.mm:
623         (API::WebArchiveResource::data):
624         * Shared/Cocoa/APIDataCocoa.mm:
625         (API::Data::createWithoutCopying):
626         * UIProcess/API/Cocoa/WKWebView.mm:
627         (-[WKWebView loadData:MIMEType:characterEncodingName:baseURL:]):
628         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
629         (webkitURISchemeRequestReadCallback):
630         * UIProcess/API/gtk/WebKitWebView.cpp:
631         (webkit_web_view_load_bytes):
632         * UIProcess/Downloads/DownloadProxy.cpp:
633         (WebKit::createData):
634         * UIProcess/WebPageProxy.cpp:
635         (WebKit::WebPageProxy::dataCallback):
636         (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder):
637
638 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
639
640         [WK2] API::URL creation functions should return Ref<>
641         https://bugs.webkit.org/show_bug.cgi?id=144219
642
643         Reviewed by Darin Adler.
644
645         Have API::URL creation functions return Ref<>.
646         The call-sites are also updated, using and operating in the
647         returned Ref<> object, where possible.
648
649         * Shared/API/APIURL.h:
650         (API::URL::create):
651         * Shared/API/c/WKSharedAPICast.h:
652         (WebKit::toCopiedURLAPI):
653         * Shared/API/c/WKURL.cpp:
654         (WKURLCreateWithUTF8CString):
655         (WKURLCreateWithBaseURL):
656         * UIProcess/API/gtk/WebKitWebResource.cpp:
657         (webkit_web_resource_get_data):
658         * UIProcess/WebIconDatabase.cpp:
659         (WebKit::WebIconDatabase::didChangeIconForPageURL):
660         (WebKit::WebIconDatabase::notifyIconDataReadyForPageURL):
661         * WebProcess/WebPage/WebPage.cpp:
662         (WebKit::WebPage::userAgent):
663
664 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
665
666         [WK2] API::String creation functions should return Ref<>
667         https://bugs.webkit.org/show_bug.cgi?id=144218
668
669         Reviewed by Darin Adler.
670
671         Have API::String creation functions return Ref<>.
672         The call-sites are also updated, using and operating on the returned
673         Ref<> object, where possible.
674
675         * Shared/API/APIString.h:
676         * Shared/API/c/WKPluginInformation.cpp:
677         (WKPluginInformationBundleIdentifierKey):
678         (WKPluginInformationBundleVersionKey):
679         (WKPluginInformationBundleShortVersionKey):
680         (WKPluginInformationPathKey):
681         (WKPluginInformationDisplayNameKey):
682         (WKPluginInformationDefaultLoadPolicyKey):
683         (WKPluginInformationUpdatePastLastBlockedVersionIsKnownAvailableKey):
684         (WKPluginInformationHasSandboxProfileKey):
685         (WKPluginInformationFrameURLKey):
686         (WKPluginInformationMIMETypeKey):
687         (WKPluginInformationPageURLKey):
688         (WKPluginInformationPluginspageAttributeURLKey):
689         (WKPluginInformationPluginURLKey):
690         (WKPlugInInformationReplacementObscuredKey):
691         * Shared/API/c/WKSharedAPICast.h:
692         (WebKit::ProxyingRefPtr::ProxyingRefPtr):
693         (WebKit::toCopiedAPI):
694         * Shared/API/c/WKString.cpp:
695         (WKStringCreateWithUTF8CString):
696         (WKStringCreateWithJSString):
697         * UIProcess/API/C/WKDatabaseManager.cpp:
698         (WKDatabaseManagerGetOriginKey):
699         (WKDatabaseManagerGetOriginQuotaKey):
700         (WKDatabaseManagerGetOriginUsageKey):
701         (WKDatabaseManagerGetDatabaseDetailsKey):
702         (WKDatabaseManagerGetDatabaseDetailsNameKey):
703         (WKDatabaseManagerGetDatabaseDetailsDisplayNameKey):
704         (WKDatabaseManagerGetDatabaseDetailsExpectedUsageKey):
705         (WKDatabaseManagerGetDatabaseDetailsCurrentUsageKey):
706         (WKDatabaseManagerGetDatabaseDetailsCreationTimeKey):
707         (WKDatabaseManagerGetDatabaseDetailsModificationTimeKey):
708         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
709         (WKKeyValueStorageManagerGetOriginKey):
710         (WKKeyValueStorageManagerGetCreationTimeKey):
711         (WKKeyValueStorageManagerGetModificationTimeKey):
712         * UIProcess/API/C/WKPage.cpp:
713         (WKPageGetSessionHistoryURLValueType):
714         (WKPageGetSessionBackForwardListItemValueType):
715         (toGenericCallbackFunction):
716         (WKPageValidateCommand):
717         * UIProcess/WebProcessPool.cpp:
718         (WebKit::WebProcessPool::didReceiveInvalidMessage):
719
720 2015-04-27  Brady Eidson  <beidson@apple.com>
721
722         Make 'enum NavigationType' be an enum class
723         https://bugs.webkit.org/show_bug.cgi?id=144270
724
725         Reviewed by Alex Christensen.
726
727         * Shared/API/c/WKSharedAPICast.h:
728         (WebKit::toAPI):
729         
730         * Shared/NavigationActionData.cpp:
731         (WebKit::NavigationActionData::NavigationActionData):
732         
733         * UIProcess/API/Cocoa/WKNavigationAction.mm:
734         (toWKNavigationType):
735         
736         * UIProcess/API/gtk/WebKitPrivate.cpp:
737         (toWebKitNavigationType):
738         
739         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
740         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
741         
742         * WebProcess/WebPage/WebInspector.cpp:
743         (WebKit::WebInspector::openInNewTab):
744
745 2015-04-27  Brent Fulgham  <bfulgham@apple.com>
746
747         REGRESSION(r182879): Images and video can no longer be downloaded
748         https://bugs.webkit.org/show_bug.cgi?id=144267
749         <rdar://problem/20702844>
750
751         Reviewed by Simon Fraser.
752
753         * UIProcess/mac/WKActionMenuController.mm:
754         (-[WKActionMenuController _createActionMenuItemForTag:]): Check for
755         "!WebCore::protocolIs(..., "file")" for image and media downloads.
756
757 2015-04-27  Csaba Osztrogonác  <ossy@webkit.org>
758
759         [EFL] TestWebKitAPI's forwarding header generator should depend on WebKit2's generator
760         https://bugs.webkit.org/show_bug.cgi?id=143874
761
762         Reviewed by Gyuyoung Kim.
763
764         * PlatformEfl.cmake: Rename the generator to have consistent name with other generators.
765         * Scripts/generate-forwarding-headers.pl: Removed the unnecessary multiple include-path support.
766
767 2015-04-17  Carlos Garcia Campos  <cgarcia@igalia.com>
768
769         [SOUP] Add initial implementation of NetworkProcess disk cache
770         https://bugs.webkit.org/show_bug.cgi?id=143872
771
772         Reviewed by Martin Robinson.
773
774         Implement the platform specific parts of the disk cache
775         implementation for Soup. It's mainly NetworkCache::Data and
776         NetworkCache::IOChannel.
777
778         * CMakeLists.txt:
779         * NetworkProcess/cache/NetworkCache.cpp:
780         (WebKit::NetworkCache::dumpFileChanged):
781         (WebKit::NetworkCache::Cache::initialize):
782         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
783         * NetworkProcess/cache/NetworkCacheData.h:
784         (WebKit::NetworkCache::Data::soupBuffer):
785         * NetworkProcess/cache/NetworkCacheDataSoup.cpp: Added.
786         (WebKit::NetworkCache::Data::Data):
787         (WebKit::NetworkCache::Data::empty):
788         (WebKit::NetworkCache::Data::data):
789         (WebKit::NetworkCache::Data::isNull):
790         (WebKit::NetworkCache::Data::apply):
791         (WebKit::NetworkCache::Data::subrange):
792         (WebKit::NetworkCache::concatenate):
793         (WebKit::NetworkCache::MapWrapper::~MapWrapper):
794         (WebKit::NetworkCache::deleteMapWrapper):
795         (WebKit::NetworkCache::mapFile):
796         (WebKit::NetworkCache::Data::adoptMap):
797         (WebKit::NetworkCache::computeSHA1):
798         (WebKit::NetworkCache::bytesEqual):
799         * NetworkProcess/cache/NetworkCacheIOChannel.h:
800         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: Added.
801         (WebKit::NetworkCache::IOChannel::IOChannel):
802         (WebKit::NetworkCache::IOChannel::open):
803         (WebKit::NetworkCache::fillDataFromReadBuffer):
804         (WebKit::NetworkCache::inputStreamReadReadyCallback):
805         (WebKit::NetworkCache::IOChannel::read):
806         (WebKit::NetworkCache::IOChannel::readSync):
807         (WebKit::NetworkCache::outputStreamWriteReadyCallback):
808         (WebKit::NetworkCache::IOChannel::write):
809         * NetworkProcess/cache/NetworkCacheStorageSoup.cpp: Removed.
810         * NetworkProcess/gtk/NetworkProcessMainGtk.cpp:
811         * NetworkProcess/soup/NetworkProcessSoup.cpp:
812         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
813         (WebKit::NetworkProcess::platformSetCacheModel):
814         (WebKit::NetworkProcess::clearDiskCache):
815         * PlatformGTK.cmake:
816
817 2015-04-26  Yusuke Suzuki  <utatane.tea@gmail.com>
818
819         [ES6] Implement ES6 template literals
820         https://bugs.webkit.org/show_bug.cgi?id=142691
821
822         Reviewed by Darin Adler.
823
824         Add ENABLE_ES6_TEMPLATE_LITERAL_SYNTAX compile time flag.
825
826         * Configurations/FeatureDefines.xcconfig:
827
828 2015-04-26  Sungmann Cho  <sungmann.cho@navercorp.com>
829
830         Remove PluginView::renderer().
831         https://bugs.webkit.org/show_bug.cgi?id=144216
832
833         Reviewed by Darin Adler.
834
835         Nobody should have to know about the plug-in view's renderer except the plug-in view itself.
836
837         No new tests, no behavior change.
838
839         * WebProcess/Plugins/PDF/PDFPlugin.mm:
840         (WebKit::PDFPlugin::convertFromScrollbarToContainingView):
841         (WebKit::PDFPlugin::convertFromContainingViewToScrollbar):
842         * WebProcess/Plugins/PluginView.cpp:
843         (WebKit::PluginView::renderer): Deleted.
844         * WebProcess/Plugins/PluginView.h:
845
846 2015-04-26  Doug Russell  <d_russell@apple.com>
847
848         AX: richer text change notifications (142719)
849         https://bugs.webkit.org/show_bug.cgi?id=142719
850
851         Reviewed by Darin Adler.
852
853         Richer accessibility value change notifications. Introduce AXTextEditType,
854         postTextStateChangeNotification and postTextReplacementNotification to give assistive
855         tech apps more reliable context for responding to changes in web content. Also implement
856         a mechanism to post value changes in password form fields in coalesced ticks to thwart
857         analyzing the cadence of changes.
858
859         Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent,
860         and an overload of postTextReplacementNotification to give assistive tech apps more
861         reliable context for responding to changes in web content selection. Also block posting
862         selection changes on password fields.
863
864         * UIProcess/WebEditCommandProxy.cpp:
865         (WebKit::WebEditCommandProxy::nameForEditAction):
866
867 2015-04-26  Dan Bernstein  <mitz@apple.com>
868
869         <rdar://problem/20702337> REGRESSION (r182952): Plug-in service fails to load because it links against WebKit2.framework
870         https://bugs.webkit.org/show_bug.cgi?id=144233
871
872         Reviewed by Simon Fraser.
873
874         Have the plug-in service link against WebKit.framework rather than WebKit2.framework.
875
876         * Configurations/PluginService.32.xcconfig: Removed linker flags for linking against WebKit2
877         and Foundation from the definition of OTHER_LDFLAGS. Since linking is no longer conditional,
878         we can just do it in the target’s Link Binary With Libraries build phase.
879
880         * Configurations/PluginService.64.xcconfig: Ditto.
881
882         * WebKit2.xcodeproj/project.pbxproj: Have Foundation and WebKit listed in the services’ Link
883         Binariy With Libraries build phases (one service already had WebKit).
884
885 2015-04-26  Dan Bernstein  <mitz@apple.com>
886
887         Fixed the build.
888
889         * UIProcess/ios/forms/WKFileUploadPanel.mm:
890         (-[WKFileUploadPanel _showDocumentPickerMenu]): Suppressed deprecation warnings around use
891         of -[UIDocumentMenuViewController _setIgnoreApplicationEntitlementForImport:].
892
893 2015-04-25  Tim Horton  <timothy_horton@apple.com>
894
895         Further update gesture swipe shadow style
896         https://bugs.webkit.org/show_bug.cgi?id=144215
897         <rdar://problem/19295843>
898
899         Reviewed by Dan Bernstein.
900
901         * Resources/mac/SwipeShadow.png: Removed.
902         * Resources/mac/SwipeShadow@2x.png: Removed.
903         * UIProcess/mac/ViewGestureController.h:
904         * UIProcess/mac/ViewGestureControllerMac.mm:
905         (WebKit::ViewGestureController::beginSwipeGesture):
906         * WebKit2.xcodeproj/project.pbxproj:
907         Use a CAGradientLayer instead of PNGs for the swipe shadow.
908
909 2015-04-25  Dan Bernstein  <mitz@apple.com>
910
911         WebKit2 part of <rdar://problem/20697966> Avoid using TBD as an argument to NS_AVAILABLE
912         https://bugs.webkit.org/show_bug.cgi?id=144201
913
914         Reviewed by Darin Adler.
915
916         Instead of TBD, we use the high version number to which it corresponds in CFAvailability.h,
917         9876.5.
918
919         * mac/MigrateHeadersFromWebKitLegacy.make: To detect not-yet-available declarations in
920         headers, look for "9876_5" rather than "TBA".
921
922 2015-04-24  Timothy Hatcher  <timothy@apple.com>
923
924         Web Inspector: Remove native window dock controls
925         https://bugs.webkit.org/show_bug.cgi?id=144184
926
927         Reviewed by Joseph Pecoraro.
928
929         * Resources/DockBottom.pdf: Removed.
930         * Resources/DockBottomLegacy.pdf: Removed.
931         * Resources/DockRight.pdf: Removed.
932         * Resources/DockRightLegacy.pdf: Removed.
933         * UIProcess/WebInspectorProxy.h:
934         * UIProcess/mac/WebInspectorProxyMac.mm:
935         (WebKit::WebInspectorProxy::createInspectorWindow):
936         (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
937         * WebKit2.xcodeproj/project.pbxproj:
938
939 2015-04-25  Martin Robinson  <mrobinson@igalia.com>
940
941         Rename ENABLE_3D_RENDERING to ENABLE_3D_TRANSFORMS
942         https://bugs.webkit.org/show_bug.cgi?id=144182
943
944         Reviewed by Simon Fraser.
945
946         * Configurations/FeatureDefines.xcconfig: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
947
948 2015-04-24  Simon Fraser  <simon.fraser@apple.com>
949
950         Have the web inspector report accurate memory use for layers with detached backing store
951         https://bugs.webkit.org/show_bug.cgi?id=144179
952
953         Reviewed by Dean Jackson.
954         
955         Remote layers can make their backing store volatile, so the backing only contributes
956         to reported memory use when attached.
957
958         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
959
960 2015-04-24  Andreas Kling  <akling@apple.com>
961
962         theverge.com burning 100% CPU on iPad (due to window.screenX/Y)
963         <https://webkit.org/b/144175>
964         <rdar://problem/20694585>
965
966         Reviewed by Anders Carlsson.
967
968         Return an empty window rect on iOS WK2 builds. This avoids sending a synchronous
969         IPC request to the UI process that would give the same result, but spend way
970         more time and CPU cycles to do so.
971
972         With this change, theverge.com CPU usage goes from 100% to ~20% when idle.
973
974         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
975         (WebKit::WebChromeClient::windowRect):
976
977 2015-04-24  Brent Fulgham  <bfulgham@apple.com>
978
979         TextIndicator for embedded PDFs is slightly offset
980         https://bugs.webkit.org/show_bug.cgi?id=144172
981         <rdar://problem/20691304>
982
983         Reviewed by Tim Horton.
984
985         When I converted the existing DOM Range logic to work with PDFSelections, I omitted the
986         step where the font ascent was used to adjust the origin used for the TextIndicator. This
987         patch determines the correct ascent for the range of characters in the selection, and
988         adjusts the offset by the difference between the ascent and the height of the selection rect.
989         
990         Also, since the PDFSelection only supplies the bounding rect for the selection, I calculate
991         an equivalent text bounding box by insetting the rect by half the size of the ascent.
992
993         * WebProcess/Plugins/PDF/PDFPlugin.mm:
994         (WebKit::PDFPlugin::scaleFactor): Add accessor for PDF scale factor.
995         * WebProcess/Plugins/PDF/PDFPlugin.h:
996         * WebProcess/WebPage/mac/WebPageMac.mm:
997         (WebKit::WebPage::dictionaryPopupInfoForPDFSelectionInPluginView): Adjusted to take the
998         font ascent and scale factor into account.
999
1000 2015-04-24  David Kilzer  <ddkilzer@apple.com>
1001
1002         REGRESSION (r183293): Fix iOS EWS build by adding SPI declaration for +[UIPeripheralHost visiblePeripheralFrame]
1003
1004         Fixes the following build failures:
1005
1006             WebKit2/UIProcess/ios/WKPDFView.mm:740:45: error: class method '+visiblePeripheralFrame' not found (return type defaults to 'id') [-Werror,-Wobjc-method-access]
1007                 CGRect keyboardRect = [UIPeripheralHost visiblePeripheralFrame];
1008                                                         ^~~~~~~~~~~~~~~~~~~~~~
1009             WebKit2/UIProcess/ios/WKPDFView.mm:740:12: error: no viable conversion from 'id' to 'CGRect'
1010                 CGRect keyboardRect = [UIPeripheralHost visiblePeripheralFrame];
1011                        ^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1012
1013         * Platform/spi/ios/UIKitSPI.h:
1014         (+[UIPeripheralHost visiblePeripheralFrame]): Add declaration.
1015
1016 2015-04-24  Anders Carlsson  <andersca@apple.com>
1017
1018         Change _WKWebsiteDataStore to hold on to an internal WKWebsiteDataStore
1019         https://bugs.webkit.org/show_bug.cgi?id=144171
1020
1021         Reviewed by Tim Horton.
1022
1023         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1024         (-[WKWebViewConfiguration _websiteDataStore]):
1025         (-[WKWebViewConfiguration _setWebsiteDataStore:]):
1026         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
1027         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
1028         (-[_WKWebsiteDataStore initWithDataStore:]):
1029         (+[_WKWebsiteDataStore defaultDataStore]):
1030         (+[_WKWebsiteDataStore nonPersistentDataStore]):
1031         (-[_WKWebsiteDataStore isNonPersistent]):
1032         (-[_WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
1033         (-[_WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
1034         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
1035         * UIProcess/API/Cocoa/_WKWebsiteDataStoreInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.h.
1036         * WebKit2.xcodeproj/project.pbxproj:
1037
1038 2015-04-24  Tim Horton  <timothy_horton@apple.com>
1039
1040         WKPDFView does not support password-protected PDFs
1041         https://bugs.webkit.org/show_bug.cgi?id=144162
1042         <rdar://problem/18411512>
1043
1044         Reviewed by Andy Estes.
1045
1046         * Platform/spi/ios/UIKitSPI.h:
1047         Add some SPI.
1048
1049         * UIProcess/ios/WKPDFView.h:
1050         * UIProcess/ios/WKPDFView.mm:
1051         (-[WKPDFView _didLoadPDFDocument]):
1052         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
1053         Move creation of the UIPDFDocument (only possible if the CGPDFDocument is unlocked)
1054         and initial setup of the page views out into _didLoadPDFDocument.
1055
1056         If the CGPDFDocument is locked, we'll show some UI to unlock it; otherwise
1057         we'll continue on to _didLoadPDFDocument as previously.
1058
1059         (-[WKPDFView web_setMinimumSize:]):
1060         Resize the password UI instead of the PDF pages if we have it.
1061
1062         (-[WKPDFView _computePageAndDocumentFrames]):
1063         Don't bother doing any work revalidating PDF pages if the document is locked.
1064
1065         (-[WKPDFView _updatePasswordEntryField]):
1066         Make sure that the UIDocumentPassword view is always the size of the scrollview.
1067         This takes care of rotation.
1068
1069         (-[WKPDFView _keyboardDidShow:]):
1070         Make sure that we scroll the password field around, if necessary, to keep it
1071         on screen when editing begins.
1072
1073         (-[WKPDFView _showPasswordEntryField]):
1074         (-[WKPDFView _hidePasswordEntryField]):
1075         Adjust the background color (to match the UIDocumentPasswordView) and disable zooming
1076         while it's up. The UIDocumentPassword view is installed into the scroll view
1077         to match UIWebView behavior.
1078
1079         (-[WKPDFView userDidEnterPassword:forPasswordView:]):
1080         (-[WKPDFView didBeginEditingPassword:inView:]):
1081         (-[WKPDFView didEndEditingPassword:inView:]):
1082         (-[WKPDFView _didFailToUnlock]):
1083         Pop up a dialog informing the user that they entered the wrong password.
1084
1085         (-[WKPDFView _tryToUnlockWithPassword:]):
1086         Try to unlock the document. If it succeeds, hide the unlock UI and go back to
1087         _didLoadPDFDocument.
1088
1089 2015-04-24  Commit Queue  <commit-queue@webkit.org>
1090
1091         Unreviewed, rolling out r183266.
1092         https://bugs.webkit.org/show_bug.cgi?id=144164
1093
1094         Broke 32-bit build and a test. (Requested by ap on #webkit).
1095
1096         Reverted changeset:
1097
1098         "AX: richer text change notifications (142719)"
1099         https://bugs.webkit.org/show_bug.cgi?id=142719
1100         http://trac.webkit.org/changeset/183266
1101
1102 2015-04-24  Brent Fulgham  <bfulgham@apple.com>
1103
1104         REGRESSION: WebKit2.ActionMenusTest API test fails
1105         https://bugs.webkit.org/show_bug.cgi?id=144149
1106         <rdar://problem/20677770>
1107
1108         Reviewed by Tim Horton.
1109
1110         Tested by TestWebKitAPI 
1111
1112         The 'lookupTextAtLocation' method was not converting the NSEvent coordinates it
1113         was receiving from root view to the plugin view. Consequently, full page PDFs
1114         did hit testing correctly, but an <embed> PDF would not.
1115
1116         Since 'existingSelectionContainsPoint' is exposed as API, I also modified it to
1117         expect 'root view' coordinates and perform the requisite conversions, rather
1118         than expecting 'plugin view' coordinates.
1119
1120         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1121         (WebKit::PDFPlugin::existingSelectionContainsPoint): Expect 'root view' coordinates
1122         for the input.
1123         (WebKit::PDFPlugin::lookupTextAtLocation): Properly convert the passed 'root view'
1124         coordinates to the PDF's view coordinate space.
1125         * WebProcess/WebPage/mac/WebPageMac.mm:
1126         (WebKit::WebPage::performActionMenuHitTestAtLocation): Pass hit point using view coordinates,
1127         not content coordinates.
1128
1129 2015-04-24  Anders Carlsson  <andersca@apple.com>
1130
1131         Address a review comment from Joe Pecoraro.
1132
1133         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
1134
1135 2015-04-24  Anders Carlsson  <andersca@apple.com>
1136
1137         Rename -[WKWebsiteDataStore isNonPersistent] to -[WKWebsiteDataStore isPersistent]
1138         https://bugs.webkit.org/show_bug.cgi?id=144158
1139
1140         Reviewed by Beth Dakin.
1141
1142         * UIProcess/API/APIWebsiteDataStore.cpp:
1143         (API::WebsiteDataStore::isPersistent):
1144         (API::WebsiteDataStore::isNonPersistent): Deleted.
1145         * UIProcess/API/APIWebsiteDataStore.h:
1146         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
1147         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1148         (-[WKWebsiteDataStore isPersistent]):
1149         (-[WKWebsiteDataStore isNonPersistent]): Deleted.
1150         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
1151         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
1152         (-[_WKWebsiteDataStore isNonPersistent]):
1153         * UIProcess/WebsiteData/WebsiteDataStore.h:
1154
1155 2015-04-24  Brent Fulgham  <bfulgham@apple.com>
1156
1157         Immediate action not functional for embedded PDFs
1158         https://bugs.webkit.org/show_bug.cgi?id=143952
1159         <rdar://problem/19842365>        
1160
1161         Reviewed by Tim Horton.
1162
1163         Add a new method to retrieve appropriate dictionary lookup content and update the
1164         hit test result with relevant dictionary content and the bounding rect of the
1165         selection.
1166
1167         * WebProcess/Plugins/Netscape/NetscapePlugin.h: Add stub.
1168         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: Initialize plugin type.
1169         * WebProcess/Plugins/PDF/PDFPlugin.h:
1170         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1171         (WebKit::rectInWindowSpaceForRectInLayoutSpace): New helper function to
1172         convert PDF 'in page' units to the equivalent view units.
1173         (WebKit::PDFPlugin::PDFPlugin): Initialize plugin type.
1174         (WebKit::PDFPlugin::viewRectForSelection): Query a provided PDFSelection for
1175         its bounding rect and return the result in view units.
1176         * WebProcess/Plugins/Plugin.h:
1177         * WebProcess/Plugins/PluginProxy.cpp: Initialize plugin type.
1178         * WebProcess/Plugins/PluginProxy.h: Add stub.
1179         * WebProcess/Plugins/PluginView.cpp: 
1180         (WebKit::PluginView::viewRectForSelection): Added.
1181         * WebProcess/Plugins/PluginView.h:
1182         * WebProcess/WebPage/WebPage.h:
1183         * WebProcess/WebPage/mac/WebPageMac.mm:
1184         (WebKit::WebPage::dictionaryPopupInfoForPDFSelectionInPluginView): Added.
1185         (WebKit::textIndicatorTransitionForActionMenu): Added helper function.
1186         (WebKit::WebPage::performActionMenuHitTestAtLocation): Update the hit test information
1187         with relevant dictionary lookup content, and mark the result as a text node (if
1188         appropriate).
1189
1190 2015-04-24  Jer Noble  <jer.noble@apple.com>
1191
1192         [WK2] Only issue a isPlayingAudioDidChange() notification if the audio playing state actually changed.
1193         https://bugs.webkit.org/show_bug.cgi?id=144153
1194
1195         Reviewed by Alexey Proskuryakov.
1196
1197         Check the old state vs. the new state and only issue the change notification if the IsPlayingAudio state changed.
1198
1199         * UIProcess/WebPageProxy.cpp:
1200         (WebKit::WebPageProxy::isPlayingMediaDidChange):
1201
1202 2015-04-24  Antti Koivisto  <antti@apple.com>
1203
1204         CrashTracer: [USER] com.apple.WebKit.Networking at com.apple.WebKit: WebKit::NetworkResourceLoader::~NetworkResourceLoader + 14
1205         https://bugs.webkit.org/show_bug.cgi?id=144147
1206
1207         Reviewed by Chris Dumez.
1208
1209         Storage::storeBodyAsBlob copies the std::function callback for handling mapped bodies in a thread.
1210         This is thread safe only if the function copy is thread safe. It is currently not as we are capturing
1211         RefPtr<NetworkResourceLoader> and NetworkResourceLoader doesn't use thread safe refcounting.
1212
1213         Fix by avoiding copying of the callback. Use same apporach for WriteOperation as we already use for
1214         ReadOperation: count the active operations in progress and delete WriteOperation when everything is
1215         finished. This way we don't need to copy the function out from WriteOperation.
1216
1217         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1218         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation):
1219         (WebKit::NetworkCache::Storage::WriteOperation::WriteOperation):
1220
1221             Move definition here from the header.
1222
1223         (WebKit::NetworkCache::Storage::~Storage):
1224         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
1225
1226             Increment the operation count when storing a blob, call finishWriteOperation when done.
1227
1228         (WebKit::NetworkCache::Storage::dispatchReadOperation):
1229         (WebKit::NetworkCache::Storage::finishReadOperation):
1230
1231             Count active operations instead of finished operations. This makes the code clearer.
1232
1233         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
1234         (WebKit::NetworkCache::Storage::finishWriteOperation):
1235
1236             Mirror the way ReadOperations work.
1237
1238         * NetworkProcess/cache/NetworkCacheStorage.h:
1239         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation): Deleted.
1240
1241 2015-04-24  Timothy Hatcher  <timothy@apple.com>
1242
1243         REGRESSION: Web Inspector: Start Timeline Recording in Develop menu broken
1244         https://bugs.webkit.org/show_bug.cgi?id=144150
1245
1246         Reviewed by Brian Burg.
1247
1248         * WebProcess/WebPage/WebInspectorUI.cpp:
1249         (WebKit::WebInspectorUI::evaluateCommandOnLoad): Properly treat bools as literals
1250         instead of strings by not using the string version of evaluateCommandOnLoad.
1251
1252 2015-04-23  Anders Carlsson  <andersca@apple.com>
1253
1254         Add headerdocs for WKWebsiteDataRecord and WKWebsiteDataStore
1255         https://bugs.webkit.org/show_bug.cgi?id=144138
1256
1257         Reviewed by Darin Adler.
1258
1259         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
1260         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
1261         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1262         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
1263         (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
1264         (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
1265
1266 2015-04-24  Doug Russell  <d_russell@apple.com>
1267
1268         AX: richer text change notifications (142719)
1269         https://bugs.webkit.org/show_bug.cgi?id=142719
1270
1271         Reviewed by Darin Adler.
1272
1273         Richer accessibility value change notifications. Introduce AXTextEditType, postTextStateChangeNotification and postTextReplacementNotification to give assistive tech apps more reliable context for responding to changes in web content. Also implement a mechanism to post value changes in password form fields in coalesced ticks to thwart analyzing the cadence of changes.
1274
1275         Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent, and an overload of postTextReplacementNotification to give assistive tech apps more reliable context for responding to changes in web content selection. Also block posting selection changes on password fields.
1276
1277         * UIProcess/WebEditCommandProxy.cpp:
1278         (WebKit::WebEditCommandProxy::nameForEditAction):
1279
1280 2015-04-24  Darin Adler  <darin@apple.com>
1281
1282         Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
1283         https://bugs.webkit.org/show_bug.cgi?id=128007
1284
1285         Reviewed by Anders Carlsson.
1286
1287         * NetworkProcess/cache/NetworkCacheEncoder.h: Added an include now
1288         needed that was inherited from OwnPtr.h before.
1289
1290 2015-04-24  Antti Koivisto  <antti@apple.com>
1291
1292         Network Cache: Make path functions members
1293         https://bugs.webkit.org/show_bug.cgi?id=144146
1294
1295         Reviewed by Carlos Garcia Campos.
1296
1297         This simplifies the code.
1298
1299         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1300         (WebKit::NetworkCache::Storage::partitionPathForKey):
1301         (WebKit::NetworkCache::Storage::recordPathForKey):
1302         (WebKit::NetworkCache::Storage::bodyPathForKey):
1303         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
1304         (WebKit::NetworkCache::Storage::remove):
1305         (WebKit::NetworkCache::Storage::dispatchReadOperation):
1306         (WebKit::NetworkCache::Storage::finishReadOperation):
1307         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
1308         (WebKit::NetworkCache::partitionPathForKey): Deleted.
1309         (WebKit::NetworkCache::recordPathForKey): Deleted.
1310         (WebKit::NetworkCache::bodyPathForKey): Deleted.
1311         * NetworkProcess/cache/NetworkCacheStorage.h:
1312
1313 2015-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1314
1315         Unreviewed. Remove incorrect assert after r183189.
1316
1317         In this case the assert was already there, but it's incorrect
1318         because we are handling uninitialized attachments below in the
1319         same function, and also when sending messages. So, if it's ok to
1320         send uninitialized attachments, it's ok to receive them. This
1321         didn't fail before r183189, because we were only invaliding the
1322         attachments by setting the file descriptor to -1, and they were
1323         handled as null attachments. After r183189, the move operator
1324         resets the moved attachment leaving it uninitialized again.
1325
1326         * Platform/IPC/unix/ConnectionUnix.cpp:
1327         (IPC::Connection::processMessage):
1328
1329 2015-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1330
1331         [SOUP] Use a webkit subdirectory for the disk cache
1332         https://bugs.webkit.org/show_bug.cgi?id=144048
1333
1334         Reviewed by Martin Robinson.
1335
1336         Recent versions of libsoup remove any file in cache dir not
1337         referenced by the index when the cache is loaded to workaround
1338         leaked resources when load/dump is unbalanced for whatever reason,
1339         like a crash. We currently use $XDG_CACHE_HOME/app-name as default
1340         disk cache directory, but that directory could be used by apps to
1341         cache other things, and the soup cache might end up deleting other
1342         stuff. The soup cache assumes the given directory is only for the
1343         disk cache, so we should ensure that.
1344
1345         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1346         (WebKit::NetworkProcess::platformInitializeNetworkProcess): Append
1347         webkit to the given disk cache and clear the previous soup cache if it exists.
1348         * WebProcess/soup/WebProcessSoup.cpp:
1349         (WebKit::WebProcess::platformInitializeWebProcess): Ditto.
1350
1351 2015-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1352
1353         Unreviewed. Remove incorrect ASSERT added in r183176.
1354
1355         We allow to encode null attachments.
1356
1357         * Platform/unix/SharedMemoryUnix.cpp:
1358         (WebKit::SharedMemory::Handle::releaseAttachment):
1359
1360 2015-04-23  Dan Bernstein  <mitz@apple.com>
1361
1362         <rdar://problem/20680694> Framework header postprocessing isn’t removing WK_DEPRECATED macros when it should.
1363
1364         Reviewed by Andy Estes.
1365
1366         * mac/postprocess-framework-headers.sh:
1367
1368 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
1369
1370         Make it possible to detach GraphicsLayerCA backing store
1371         https://bugs.webkit.org/show_bug.cgi?id=144140
1372
1373         Reviewed by Tim Horton.
1374         
1375         This changes makes it possible to denote a GraphicsLayerCA's backing store
1376         as "attached" or not. When not attached, the backing store is made volatile
1377         and can be purged. This will be used in a future patch.
1378
1379         * Shared/mac/RemoteLayerBackingStore.mm:
1380         (WebKit::RemoteLayerBackingStore::~RemoteLayerBackingStore): Whitespace.
1381         (WebKit::RemoteLayerBackingStore::display): If backingStoreWillBeDisplayed()
1382         returns true, this indicates that the backing store was brought out of the
1383         "unreachable" list, so return true even if the backing store doesn't require
1384         painting.
1385         * Shared/mac/RemoteLayerBackingStoreCollection.h: C++11 initializer, and comments.
1386         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
1387         (WebKit::RemoteLayerBackingStoreCollection::RemoteLayerBackingStoreCollection):
1388         (WebKit::RemoteLayerBackingStoreCollection::backingStoreWillBeDisplayed): Return true
1389         if the caller will need to submit the backing store in the current transaction.
1390         (WebKit::RemoteLayerBackingStoreCollection::backingStoreBecameUnreachable): This
1391         explicit dirtying is no longer necessary given the backingStoreWillBeDisplayed() change.
1392         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
1393         (WebKit::applyPropertiesToLayer): Only set the layer's backing if we both have backing
1394         store, and it's attached.
1395         * Shared/mac/RemoteLayerTreeTransaction.h: New bit, and data member.
1396         * Shared/mac/RemoteLayerTreeTransaction.mm:
1397         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
1398         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
1399         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
1400         (WebKit::dumpChangedLayers):
1401         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1402         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction): Only call display()
1403         on the backing store if it's attached.
1404         (WebKit::PlatformCALayerRemote::setBackingStoreAttached):
1405         (WebKit::PlatformCALayerRemote::backingStoreAttached):
1406         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1407         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
1408         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
1409         (WebKit::RemoteLayerTreeContext::backingStoreWillBeDisplayed):
1410
1411 2015-04-23  Tim Horton  <timothy_horton@apple.com>
1412
1413         Quick Look preview popover is not dismissed on scroll in Mail
1414         https://bugs.webkit.org/show_bug.cgi?id=144119
1415         <rdar://problem/19752045>
1416
1417         Reviewed by Anders Carlsson.
1418
1419         * UIProcess/API/mac/WKView.mm:
1420         (-[WKView renewGState]):
1421         If we have a TextIndicator, dismiss all content relative child windows
1422         on renewGState, not just the TextIndicator itself.
1423
1424         This will fix cases like Mail, where WebKit isn't driving the scrolling,
1425         and we have no way (except renewGState) to know that scrolling is happening.
1426
1427 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
1428
1429         Changing TiledBacking velocity should schedule a tile revalidation
1430         https://bugs.webkit.org/show_bug.cgi?id=144123
1431
1432         Reviewed by Tim Horton.
1433         
1434         Drive-by fix: use the FrameView& that we have already.
1435
1436         * WebProcess/WebPage/ios/WebPageIOS.mm:
1437         (WebKit::WebPage::updateVisibleContentRects):
1438
1439 2015-04-23  Jer Noble  <jer.noble@apple.com>
1440
1441         [Mac] Disable QTKit by default on future OS X.
1442         https://bugs.webkit.org/show_bug.cgi?id=144082
1443
1444         Reviewed by Darin Adler.
1445
1446         QTKitEnabled defaults to false.
1447
1448         * Shared/WebPreferencesDefinitions.h:
1449
1450 2015-04-23  Jer Noble  <jer.noble@apple.com>
1451
1452         [WK2][Mac] Tweak the timing curve of the WebKit Fullscreen animation
1453         https://bugs.webkit.org/show_bug.cgi?id=144120
1454
1455         Reviewed by Eric Carlson.
1456
1457         Tweak the curve to ease-in faster when the fullscreen animation duration is short.
1458
1459         * UIProcess/mac/WKFullScreenWindowController.mm:
1460         (timingFunctionForDuration):
1461         (zoomAnimation):
1462         (maskAnimation):
1463         (fadeAnimation):
1464
1465 2015-04-23  Enrica Casucci  <enrica@apple.com>
1466
1467         iOS build fix after r183208.
1468
1469         Unreviewed.
1470
1471         * UIProcess/ios/WKContentViewInteraction.mm:
1472
1473 2015-04-22  Alexey Proskuryakov  <ap@apple.com>
1474
1475         [iOS] WebKit services should inherit environment variables for home
1476         https://bugs.webkit.org/show_bug.cgi?id=144078
1477         rdar://problem/20571678
1478
1479         Reviewed by Dan Bernstein.
1480
1481         Pass current environment variables as XPC bootstrap. Also while at it, made
1482         _CFBundleSetupXPCBootstrap not soft linked.
1483
1484         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
1485         (main):
1486         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1487         (WebKit::connectToService):
1488
1489 2015-04-23  Enrica Casucci  <enrica@apple.com>
1490
1491         Support share button.
1492         https://bugs.webkit.org/show_bug.cgi?id=144077
1493         rdar://problem/19772892
1494
1495         Reviewed by Darin Adler.
1496
1497         * UIProcess/ios/WKContentViewInteraction.mm:
1498         (-[WKContentView _share:]):
1499         (-[WKContentView canPerformAction:withSender:]):
1500         (-[WKContentView _define:]):
1501         (-[WKContentView accessibilityRetrieveSpeakSelectionContent]):
1502         (-[WKContentView moveByOffset:]):
1503         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
1504         (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
1505         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
1506         (-[WKContentView accessoryTab:]):
1507         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
1508         (-[WKContentView executeEditCommandWithCallback:]):
1509
1510 2015-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1511
1512         [UNIX] Do not allow copies of IPC::Attachment
1513         https://bugs.webkit.org/show_bug.cgi?id=144096
1514
1515         Reviewed by Darin Adler.
1516
1517         It ensures that the file descriptor ownership is always correctly
1518         transferred. This way we can remove the dispose() method to
1519         explicitly close the file descriptor and always close it in the
1520         Attachment destructor (unless explicitly transferred to
1521         IPC::Connection or SharedMemory). It simplifies the code and
1522         ensure we don't leak file descriptors.
1523
1524         * Platform/IPC/ArgumentDecoder.cpp:
1525         (IPC::ArgumentDecoder::~ArgumentDecoder): Remove the code to
1526         explicitly dispose attachments.
1527         (IPC::ArgumentDecoder::removeAttachment): Use WTF::move().
1528         * Platform/IPC/ArgumentEncoder.cpp:
1529         (IPC::ArgumentEncoder::~ArgumentEncoder): Remove the code to
1530         explicitly dispose attachments.
1531         (IPC::ArgumentEncoder::addAttachment): Use WTF::move().
1532         (IPC::ArgumentEncoder::releaseAttachments): Simplify by using WTF::move().
1533         * Platform/IPC/ArgumentEncoder.h:
1534         * Platform/IPC/Attachment.cpp:
1535         (IPC::Attachment::encode): Move a copy of the attachment, and
1536         reset the file descriptor, since the ownership is passed to the encoder.
1537         * Platform/IPC/Attachment.h: Make copy constructor and assignment
1538         private to not allow public copies. The only copy allowed is done
1539         by Attachment::encode(). Make m_fileDescriptor mutable so that we
1540         can reset it in Attachment::encode() after passing the ownership
1541         to the encoder.
1542         * Platform/IPC/unix/AttachmentUnix.cpp:
1543         (IPC::Attachment::~Attachment): Close the file descriptor if it
1544         hasn't been released explicitly.
1545         (IPC::Attachment::dispose): Deleted.
1546         * Platform/IPC/unix/ConnectionUnix.cpp:
1547         (IPC::Connection::processMessage): Do not use AttachmentResourceGuard.
1548         (IPC::Connection::sendOutgoingMessage): Ditto.
1549         (IPC::AttachmentResourceGuard::AttachmentResourceGuard): Deleted.
1550         (IPC::AttachmentResourceGuard::~AttachmentResourceGuard): Deleted.
1551         * Platform/unix/SharedMemoryUnix.cpp:
1552         (WebKit::SharedMemory::Handle::~Handle): Do not call clear().
1553         (WebKit::SharedMemory::Handle::clear): Reset the attachment.
1554         * UIProcess/WebInspectorProxy.cpp:
1555         (WebKit::WebInspectorProxy::createInspectorPage): Use WTF::move().
1556         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
1557         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
1558         Call releaseFileDescriptor() instead of fileDescritpro() since the
1559         ownership is passed to the connection.
1560
1561 2015-04-23  Alexey Proskuryakov  <ap@apple.com>
1562
1563         Build fix.
1564
1565         * WebProcess/cocoa/WebProcessCocoa.mm: Correct the case of an include file name.
1566
1567 2015-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1568
1569         Unreviewed. Fix debug build after r183176.
1570
1571         * Platform/unix/SharedMemoryUnix.cpp:
1572         (WebKit::SharedMemory::Handle::decode):
1573         (WebKit::SharedMemory::createHandle):
1574
1575 2015-04-23  Andreas Kling  <akling@apple.com>
1576
1577         There should only be one way to get the system memory size.
1578         <https://webkit.org/b/144081>
1579
1580         Reviewed by Antti Koivisto.
1581
1582         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1583         (WebKit::NetworkProcess::platformSetCacheModel):
1584         (WebKit::memorySize): Deleted.
1585         * WebProcess/cocoa/WebProcessCocoa.mm:
1586         (WebKit::WebProcess::platformSetCacheModel):
1587         (WebKit::memorySize): Deleted.
1588
1589 2015-04-23  Chris Dumez  <cdumez@apple.com>
1590
1591         [WK2] WebDiagnosticLoggingClient is leaking
1592         https://bugs.webkit.org/show_bug.cgi?id=144089
1593         <rdar://problem/19706214>
1594
1595         Reviewed by Darin Adler.
1596
1597         WebDiagnosticLoggingClient is leaking. It is constructed inside WebPage
1598         constructor but there is no code destroying it.
1599
1600         This patch adds a new xxxDestroyed() virtual function to
1601         DiagnosticLoggingClient and that is overriden in
1602         WebDiagnosticLoggingClient to call "delete this". This is the same
1603         pattern as for other WK2 clients (e.g. WebFrameLoaderClient,
1604         WebProgressTrackerClient).
1605
1606         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
1607         (WebKit::WebDiagnosticLoggingClient::mainFrameDestroyed):
1608         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
1609
1610 2015-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1611
1612         [UNIX] Simplify the file descriptor handling in SharedMemory
1613         https://bugs.webkit.org/show_bug.cgi?id=144046
1614
1615         Reviewed by Darin Adler.
1616
1617         Simplify the file descriptor handling and clarify its ownership by
1618         using IPC::Attachment in SharedMemory::Handle instead of fd and
1619         size members. SharedMemory::Handle::adoptFromAttachment() has been
1620         renamed as SharedMemory::Handle::adoptAttachment() and receives an
1621         IPC::Attachment. And SharedMemory::Handle::releaseToAttachment()
1622         has been renamed as SharedMemory::Handle::releaseAttachment().
1623
1624         * Platform/IPC/Attachment.h: Add move constructor and move assigned operator.
1625         * Platform/IPC/Connection.h:
1626         (IPC::Connection::identifierIsNull): A file descriptor is null
1627         when it's -1 no 0.
1628         * Platform/IPC/unix/AttachmentUnix.cpp:
1629         (IPC::Attachment::Attachment):
1630         (IPC::Attachment::operator=):
1631         (IPC::Attachment::dispose): Reset the file descriptor after
1632         closing it.
1633         * Platform/IPC/unix/ConnectionUnix.cpp:
1634         (IPC::Connection::processMessage): Use
1635         SharedMemory::Handle::adoptAttachment() that receives an
1636         IPC::Attachment now.
1637         (IPC::Connection::sendOutgoingMessage): Use
1638         SharedMemory::Handle::releaseAttachment().
1639         * Platform/SharedMemory.h:
1640         * Platform/unix/SharedMemoryUnix.cpp:
1641         (WebKit::SharedMemory::Handle::Handle): Remove initializers for
1642         file descriptor and size members.
1643         (WebKit::SharedMemory::Handle::clear): Dispose the attachment.
1644         (WebKit::SharedMemory::Handle::isNull): Handle is null if the
1645         attachment file descriptor is -1.
1646         (WebKit::SharedMemory::Handle::encode): Use releaseAttachment().
1647         (WebKit::SharedMemory::Handle::decode): Use adoptAttachment().
1648         (WebKit::SharedMemory::Handle::releaseAttachment): Implement it
1649         using move.
1650         (WebKit::SharedMemory::Handle::adoptAttachment): Ditto.
1651         (WebKit::SharedMemory::map): Use
1652         IPC::Attachment::releaseFileDescriptor() instead of manually
1653         changing the member.
1654         (WebKit::SharedMemory::createHandle): Initialize the handle
1655         attachment with the duplicated file descriptor and size.
1656
1657 2015-04-22  Darin Adler  <darin@apple.com>
1658
1659         Remove OwnPtr and PassOwnPtr use from WebKit/cf, WebKit/mac, and WebKit2
1660         https://bugs.webkit.org/show_bug.cgi?id=143943
1661
1662         Reviewed by Anders Carlsson.
1663
1664         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1665         Removed unneeded include.
1666
1667 2015-04-22  Brent Fulgham  <bfulgham@apple.com>
1668
1669         VisibleSelection should only accept Range by reference
1670         https://bugs.webkit.org/show_bug.cgi?id=144047
1671
1672         Reviewed by Tim Horton.
1673
1674         Update all uses of VisibleSelection to pass a Range reference instead
1675         of a Range pointer.
1676
1677         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1678         (WebKit::InjectedBundleRangeHandle::renderedImage):
1679         * WebProcess/WebPage/FindController.cpp:
1680         (WebKit::FindController::getImageForFindMatch):
1681         (WebKit::FindController::selectFindMatch):
1682         * WebProcess/WebPage/WebPage.cpp:
1683         (WebKit::WebPage::insertTextAsync):
1684         (WebKit::WebPage::setCompositionAsync):
1685         * WebProcess/WebPage/mac/WebPageMac.mm:
1686         (WebKit::WebPage::insertDictatedTextAsync):
1687
1688 2015-04-22  Anders Carlsson  <andersca@apple.com>
1689
1690         Add WK_ARRAY and WK_SET annotations
1691         https://bugs.webkit.org/show_bug.cgi?id=144075
1692         rdar://problem/19417770
1693
1694         Reviewed by Dan Bernstein.
1695
1696         * Shared/API/Cocoa/WKFoundation.h:
1697         * UIProcess/API/Cocoa/WKBackForwardList.h:
1698         * UIProcess/API/Cocoa/WKUserContentController.h:
1699         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
1700         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
1701         * mac/postprocess-framework-headers.sh:
1702
1703 2015-04-22  Brent Fulgham  <bfulgham@apple.com>
1704
1705         Unreviewed build fix after r183136.
1706
1707         * WebProcess/WebPage/mac/WebPageMac.mm: Correct capitalization of
1708         'HTMLPluginImageElement.h' -> 'HTMLPlugInImageElement.h'
1709
1710 2015-04-21  Brent Fulgham  <bfulgham@apple.com>
1711
1712         Extend action menus to support PDF
1713         https://bugs.webkit.org/show_bug.cgi?id=143895
1714         <rdar://problem/19003333>
1715
1716         Reviewed by Tim Horton.
1717
1718         If the mouse pointer is over a PDF, try to provide a relevant action menu for whatever
1719         content is under the mouse. For now, we only support copying text and handling URLs.
1720
1721         If no text is selected, use the dictionary lookup service to find a semantically appropriate
1722         selection underneath the mouse. This is consistent with how normal text is treated in pure HTML
1723         views. If some text is already selected, and the mouse is over the existing selection, continue
1724         using the selected text. Otherwise, discard the old selection and select the most appropriate
1725         region under the mouse pointer.
1726
1727         * Shared/API/c/WKActionMenuTypes.h: Add PDF menu option.
1728         * Shared/WebMouseEvent.cpp: Recognize mouse force events as valid mouse events.
1729         * UIProcess/mac/WKActionMenuController.mm:
1730         (-[WKActionMenuController _defaultMenuItemsForPDF]): Add simply copy text option.
1731         (-[WKActionMenuController _defaultMenuItems]): Recognize PDFs and add relevant action
1732         menu entries.
1733         * WebProcess/Plugins/Netscape/NetscapePlugin.h: Provide stub for new method.
1734         * WebProcess/Plugins/PDF/PDFLayerControllerDetails.h: Expose 'rectsForSelectionInLayerSpace',
1735         'rectsForAnnotationInLayoutSpace', 'layout', and 'currentPage'.
1736         * WebProcess/Plugins/PDF/PDFPlugin.h:
1737         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1738         (WebKit::PDFPlugin::getSelectionForWordAtPoint): Added.
1739         (WebKit::PDFPlugin::existingSelectionContainsPoint): Added.
1740         (WebKit::PDFPlugin::lookupTextAtLocation): Added.
1741         * WebProcess/Plugins/Plugin.h: Add declaration for new 'getSelectionForWordAtPoint' method.
1742         * WebProcess/Plugins/PluginProxy.h: Provide stub for new method.
1743         * WebProcess/Plugins/PluginView.cpp:
1744         (WebKit::PluginView::getSelectionForWordAtPoint): Added.
1745         (WebKit::PluginView::existingSelectionContainsPoint): Added.
1746         (WebKit::PluginView::lookupTextAtLocation): Added.
1747         * WebProcess/Plugins/PluginView.h:
1748         * WebProcess/WebPage/mac/WebPageMac.mm:
1749         (WebKit::WebPage::performActionMenuHitTestAtLocation): Update to support PDF documents and retrieve
1750         relevant content to support later action menu handling.
1751
1752 2015-04-22  Eric Carlson  <eric.carlson@apple.com>
1753
1754         Update AirPlay sandbox rules
1755         https://bugs.webkit.org/show_bug.cgi?id=144062
1756         <rdar://problem/19869448>
1757
1758         Reviewed by Alexey Proskuryakov.
1759
1760         * WebProcess/com.apple.WebProcess.sb.in: Remove obsolete rules.
1761
1762 2015-04-22  Alexey Proskuryakov  <ap@apple.com>
1763
1764         [Mac] In nightlies and local builds, WebKit services can get terminated under memory pressure
1765         https://bugs.webkit.org/show_bug.cgi?id=144052
1766         rdar://problem/19754404
1767
1768         Reviewed by Darin Adler.
1769
1770         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
1771         (main): Make XPC transaction tracking work again after a re-exec.
1772
1773 2015-04-22  Zan Dobersek  <zdobersek@igalia.com>
1774
1775         [WK2] Have API::Array creation methods return Ref<>
1776         https://bugs.webkit.org/show_bug.cgi?id=143933
1777
1778         Reviewed by Darin Adler.
1779
1780         API::Array::create() and API::Array::createStringArray() should return Ref<> objects
1781         as the return values are never null. It's up to the caller to implicitly convert the
1782         returned objects to RefPtr<> if so required. All the call-sites have been updated to
1783         reflect that.
1784
1785         * Shared/API/APIArray.cpp:
1786         (API::Array::create):
1787         (API::Array::createStringArray):
1788         (API::Array::copy):
1789         * Shared/API/APIArray.h:
1790         * Shared/API/APIDictionary.cpp:
1791         (API::Dictionary::keys):
1792         * Shared/API/APIDictionary.h:
1793         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
1794         (ensureObjectStream):
1795         * Shared/API/c/WKArray.cpp:
1796         (WKArrayCreate):
1797         (WKArrayCreateAdoptingValues):
1798         * Shared/API/c/WKContextMenuItem.cpp:
1799         (WKContextMenuCopySubmenuItems):
1800         * Shared/API/c/WKDictionary.cpp:
1801         (WKDictionaryCopyKeys):
1802         * Shared/API/c/WKMutableArray.cpp:
1803         (WKMutableArrayCreate):
1804         * Shared/Cocoa/WKNSDictionary.mm:
1805         (-[WKNSDictionary keyEnumerator]):
1806         * Shared/SecurityOriginData.cpp:
1807         (WebKit::performAPICallbackWithSecurityOriginDataVector):
1808         * Shared/WebContextMenuItem.cpp:
1809         (WebKit::WebContextMenuItem::submenuItemsAsAPIArray):
1810         * Shared/WebContextMenuItem.h:
1811         * Shared/WebOpenPanelParameters.cpp:
1812         (WebKit::WebOpenPanelParameters::acceptMIMETypes):
1813         (WebKit::WebOpenPanelParameters::selectedFileNames):
1814         * Shared/WebOpenPanelParameters.h:
1815         * UIProcess/API/C/WKBackForwardListRef.cpp:
1816         (WKBackForwardListCopyBackListWithLimit):
1817         (WKBackForwardListCopyForwardListWithLimit):
1818         * UIProcess/API/C/WKGrammarDetail.cpp:
1819         (WKGrammarDetailCopyGuesses):
1820         * UIProcess/API/C/WKOpenPanelParameters.cpp:
1821         (WKOpenPanelParametersCopyAcceptedMIMETypes):
1822         (WKOpenPanelParametersCopySelectedFileNames):
1823         * UIProcess/API/C/WKPage.cpp:
1824         (WKPageSetPageContextMenuClient):
1825         (WKPageCopyRelatedPages):
1826         * UIProcess/API/Cocoa/WKBackForwardList.mm:
1827         (-[WKBackForwardList backList]):
1828         (-[WKBackForwardList forwardList]):
1829         * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
1830         (createWKArray):
1831         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1832         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
1833         * UIProcess/API/gtk/WebKitBackForwardList.cpp:
1834         (webkit_back_forward_list_get_back_list_with_limit):
1835         (webkit_back_forward_list_get_forward_list_with_limit):
1836         * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
1837         (webkit_file_chooser_request_get_mime_types):
1838         (webkit_file_chooser_request_get_mime_types_filter):
1839         (webkit_file_chooser_request_select_files):
1840         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
1841         (WebKitNotificationProvider::notificationCloseCallback):
1842         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
1843         (WebKit::WebNotificationManagerProxy::populateCopyOfNotificationPermissions):
1844         * UIProcess/Notifications/WebNotificationProvider.cpp:
1845         (WebKit::WebNotificationProvider::clearNotifications):
1846         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
1847         (WebKit::WebPluginSiteDataManager::didGetSitesWithData):
1848         * UIProcess/StatisticsRequest.cpp:
1849         (WebKit::StatisticsRequest::completedRequest):
1850         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
1851         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
1852         * UIProcess/WebBackForwardList.cpp:
1853         (WebKit::WebBackForwardList::backList):
1854         (WebKit::WebBackForwardList::forwardList):
1855         (WebKit::WebBackForwardList::backListAsAPIArrayWithLimit):
1856         (WebKit::WebBackForwardList::forwardListAsAPIArrayWithLimit):
1857         * UIProcess/WebBackForwardList.h:
1858         * UIProcess/WebCookieManagerProxy.cpp:
1859         (WebKit::WebCookieManagerProxy::didGetHostnamesWithCookies):
1860         * UIProcess/WebDatabaseManagerProxy.cpp:
1861         (WebKit::WebDatabaseManagerProxy::didGetDatabasesByOrigin):
1862         (WebKit::WebDatabaseManagerProxy::didGetDatabaseOrigins):
1863         * UIProcess/WebGrammarDetail.cpp:
1864         (WebKit::WebGrammarDetail::guesses):
1865         * UIProcess/WebGrammarDetail.h:
1866         * UIProcess/WebKeyValueStorageManager.cpp:
1867         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
1868         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
1869         * UIProcess/WebMediaCacheManagerProxy.cpp:
1870         (WebKit::WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache):
1871         * UIProcess/WebOriginDataManagerProxy.cpp:
1872         (WebKit::WebOriginDataManagerProxy::didGetOrigins):
1873         * UIProcess/WebPageProxy.cpp:
1874         (WebKit::WebPageProxy::didFindStringMatches):
1875         * UIProcess/WebProcessPool.cpp:
1876         (WebKit::WebProcessPool::pluginInfoStoreDidLoadPlugins):
1877         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1878         (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]):
1879         (-[WKFileUploadPanel presentWithParameters:resultListener:]):
1880         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
1881         (-[WKWebProcessPlugInFrame childFrames]):
1882         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
1883         (WKBundleBackForwardListItemCopyChildren):
1884         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1885         (WKBundleFrameCopyChildFrames):
1886         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1887         (WKBundlePageCopyTrackedRepaintRects):
1888         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp:
1889         (WebKit::InjectedBundleBackForwardListItem::children):
1890         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h:
1891         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
1892         (WebKit::InjectedBundlePageContextMenuClient::getCustomMenuFromDefaultItems):
1893         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
1894         (WebKit::InjectedBundlePageFormClient::didAssociateFormControls):
1895         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
1896         (WebKit::InjectedBundlePageLoaderClient::featuresUsedInPage):
1897         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1898         (WebKit::findLargestFrameInFrameSet):
1899         * WebProcess/WebPage/WebFrame.cpp:
1900         (WebKit::WebFrame::childFrames):
1901         * WebProcess/WebPage/WebFrame.h:
1902         * WebProcess/WebPage/WebPage.cpp:
1903         (WebKit::WebPage::trackedRepaintRects):
1904         * WebProcess/WebPage/WebPage.h:
1905
1906 2015-04-21  Eric Carlson  <eric.carlson@apple.com>
1907
1908         [Mac] Use one playback target for all web processes
1909         https://bugs.webkit.org/show_bug.cgi?id=144009
1910
1911         Reviewed by Tim Horton.
1912
1913         Every WebPageProxy uses the WebMediaSessionManager singleton to talk to the playback target
1914         picker.
1915
1916         * UIProcess/PageClient.h:
1917         * UIProcess/WebPageProxy.cpp:
1918         (WebKit::WebPageProxy::WebPageProxy):
1919         (WebKit::WebPageProxy::resetState):
1920         (WebKit::WebPageProxy::isPlayingMediaDidChange):
1921         (WebKit::WebPageProxy::addPlaybackTargetPickerClient):
1922         (WebKit::WebPageProxy::removePlaybackTargetPickerClient):
1923         (WebKit::WebPageProxy::showPlaybackTargetPicker):
1924         (WebKit::WebPageProxy::playbackTargetPickerClientStateDidChange):
1925         (WebKit::WebPageProxy::setPlaybackTarget):
1926         (WebKit::WebPageProxy::externalOutputDeviceAvailableDidChange):
1927         (WebKit::WebPageProxy::setShouldPlayToPlaybackTarget):
1928         (WebKit::WebPageProxy::devicePickerProxy): Deleted.
1929         (WebKit::WebPageProxy::startingMonitoringPlaybackTargets): Deleted.
1930         (WebKit::WebPageProxy::stopMonitoringPlaybackTargets): Deleted.
1931         (WebKit::WebPageProxy::didChoosePlaybackTarget): Deleted.
1932         * UIProcess/WebPageProxy.h:
1933         (WebKit::WebPageProxy::isPlayingAudio):
1934         * UIProcess/WebPageProxy.messages.in:
1935         * UIProcess/mac/PageClientImpl.h:
1936         * UIProcess/mac/PageClientImpl.mm:
1937         (WebKit::PageClientImpl::mediaSessionManager):
1938         (WebKit::PageClientImpl::createPlaybackTargetPicker): Deleted.
1939         * UIProcess/mac/WebMediaSessionManagerMac.cpp: Added.
1940         (WebKit::WebMediaSessionManagerMac::singleton):
1941         (WebKit::WebMediaSessionManagerMac::WebMediaSessionManagerMac):
1942         (WebKit::WebMediaSessionManagerMac::~WebMediaSessionManagerMac):
1943         (WebKit::WebMediaSessionManagerMac::targetPicker):
1944         * UIProcess/mac/WebMediaSessionManagerMac.h: Added.
1945         * WebProcess/Plugins/PluginView.h:
1946         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1947         (WebKit::WebChromeClient::isPlayingMediaDidChange):
1948         (WebKit::WebChromeClient::addPlaybackTargetPickerClient):
1949         (WebKit::WebChromeClient::removePlaybackTargetPickerClient):
1950         (WebKit::WebChromeClient::showPlaybackTargetPicker):
1951         (WebKit::WebChromeClient::playbackTargetPickerClientStateDidChange):
1952         (WebKit::WebChromeClient::startingMonitoringPlaybackTargets): Deleted.
1953         (WebKit::WebChromeClient::stopMonitoringPlaybackTargets): Deleted.
1954         * WebProcess/WebCoreSupport/WebChromeClient.h:
1955         * WebProcess/WebPage/WebPage.h:
1956         * WebProcess/WebPage/WebPage.messages.in:
1957         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1958         (WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
1959         * WebProcess/WebPage/mac/WebPageMac.mm:
1960         (WebKit::WebPage::playbackTargetSelected):
1961         (WebKit::WebPage::playbackTargetAvailabilityDidChange):
1962         (WebKit::WebPage::setShouldPlayToPlaybackTarget):
1963
1964 2015-04-21  Anders Carlsson  <andersca@apple.com>
1965
1966         WKWebsiteDataStore doesn't track and remove IndexedDB databases
1967         https://bugs.webkit.org/show_bug.cgi?id=144032
1968         rdar://problem/20242856
1969
1970         Reviewed by Tim Horton.
1971
1972         * DatabaseProcess/DatabaseProcess.cpp:
1973         (WebKit::DatabaseProcess::fetchWebsiteData):
1974         (WebKit::DatabaseProcess::deleteWebsiteData):
1975         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
1976         * DatabaseProcess/DatabaseProcess.h:
1977         * DatabaseProcess/DatabaseProcess.messages.in:
1978         * Shared/WebsiteData/WebsiteDataTypes.h:
1979         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
1980         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
1981         (dataTypesToString):
1982         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
1983         (WebKit::toWebsiteDataTypes):
1984         (WebKit::toWKWebsiteDataTypes):
1985         * UIProcess/Databases/DatabaseProcessProxy.cpp:
1986         (WebKit::generateCallbackID):
1987         (WebKit::DatabaseProcessProxy::~DatabaseProcessProxy):
1988         (WebKit::DatabaseProcessProxy::fetchWebsiteData):
1989         (WebKit::DatabaseProcessProxy::deleteWebsiteData):
1990         (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins):
1991         (WebKit::DatabaseProcessProxy::didClose):
1992         (WebKit::DatabaseProcessProxy::didFetchWebsiteData):
1993         (WebKit::DatabaseProcessProxy::didDeleteWebsiteData):
1994         (WebKit::DatabaseProcessProxy::didDeleteWebsiteDataForOrigins):
1995         * UIProcess/Databases/DatabaseProcessProxy.h:
1996         * UIProcess/Databases/DatabaseProcessProxy.messages.in:
1997         * UIProcess/WebProcessPool.h:
1998         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1999         (WebKit::WebsiteDataStore::fetchData):
2000         (WebKit::WebsiteDataStore::removeData):
2001
2002 2015-04-21  Anders Carlsson  <andersca@apple.com>
2003
2004         Add module maps for WebKit
2005         https://bugs.webkit.org/show_bug.cgi?id=144026
2006         rdar://problem/19665428
2007
2008         Reviewed by Dan Bernstein.
2009
2010         * Configurations/WebKit.xcconfig:
2011         * Modules/OSX.modulemap: Added.
2012         * Modules/iOS.modulemap: Added.
2013
2014 2015-04-21  Tim Horton  <timothy_horton@apple.com>
2015
2016         Long pause under _takeViewSnapshot when screen updates are disabled
2017         https://bugs.webkit.org/show_bug.cgi?id=144017
2018         <rdar://problem/20548397>
2019
2020         Reviewed by Simon Fraser.
2021
2022         * UIProcess/API/mac/WKView.mm:
2023         (-[WKView _takeViewSnapshot]):
2024         Use CGSHWCaptureWindowList, for snapshotting that doesn't block on
2025         the next commit, and can succeed while screen updates are disabled
2026         without blocking.
2027
2028 2015-04-21  Chris Dumez  <cdumez@apple.com>
2029
2030         [WK2][NetworkCache] Better account of resource revalidations in efficacy logging
2031         https://bugs.webkit.org/show_bug.cgi?id=144014
2032
2033         Reviewed by Antti Koivisto.
2034
2035         Better account of resource revalidations in efficacy logging.
2036         Prevously, resources that were in the cache but needed revalidation
2037         were counted as retrieval successes, which is not entirely accurate.
2038
2039         We now distinguish "is in the cache and is directly usable" from
2040         "is in the cache but needs revalidation". We also log how many of these
2041         revalidations are successful.
2042
2043         * NetworkProcess/NetworkResourceLoader.cpp:
2044         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
2045         * NetworkProcess/cache/NetworkCache.cpp:
2046         (WebKit::NetworkCache::Cache::update):
2047         * NetworkProcess/cache/NetworkCache.h:
2048         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2049         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
2050         (WebKit::NetworkCache::Statistics::recordRevalidationSuccess):
2051         * NetworkProcess/cache/NetworkCacheStatistics.h:
2052
2053 2015-04-21  Dan Bernstein  <mitz@apple.com>
2054
2055         [Cocoa] Framework header postprocessing should respect additional definitions
2056         https://bugs.webkit.org/show_bug.cgi?id=144018
2057
2058         Reviewed by Anders Carlsson.
2059
2060         * mac/postprocess-framework-headers.sh: Read definitons from
2061         /usr/local/include/WebKitAdditions/Scripts/postprocess-framework-headers-definitions, and
2062         have them take precedence over OSX_VERSION and IOS_VERSION and supply additional options to
2063         sed.
2064
2065 2015-04-21  Anders Carlsson  <andersca@apple.com>
2066
2067         Fix block signatures
2068         https://bugs.webkit.org/show_bug.cgi?id=144002
2069
2070         Reviewed by Andreas Kling.
2071
2072         * UIProcess/API/Cocoa/WKUIDelegate.h:
2073         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
2074         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2075         (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
2076         (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
2077         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
2078         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
2079         (-[_WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
2080         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
2081         * UIProcess/ios/WKPDFView.mm:
2082         (-[WKPDFView _highlightLinkAnnotation:forDuration:completionHandler:]):
2083         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2084         (-[WKFileUploadPanel _processMediaInfoDictionaries:successBlock:failureBlock:]):
2085         (-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:processedImageCount:processedVideoCount:successBlock:failureBlock:]):
2086         (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
2087
2088 2015-04-21  Timothy Horton  <timothy_horton@apple.com>
2089
2090         PDFs still don't snapshot properly in iOS Safari
2091         https://bugs.webkit.org/show_bug.cgi?id=143976
2092         <rdar://problem/18283459>
2093
2094         Reviewed by Anders Carlsson.
2095
2096         * UIProcess/WebPageProxy.cpp:
2097         (WebKit::WebPageProxy::didLayoutForCustomContentProvider):
2098         * UIProcess/WebPageProxy.h:
2099         * UIProcess/API/Cocoa/WKWebView.mm:
2100         (-[WKWebView _didFinishLoadingDataForCustomContentProviderWithSuggestedFilename:data:]):
2101         Inform the client that we've passed all reasonable layout milestones
2102         as soon as the custom content provider has been handed its data.
2103         WKPDFView, the only custom content provider, synchronously lays out
2104         its subviews upon initial receipt of data, so this works fine for it.
2105         This ensures that clients that normally depend on layout milestones firing
2106         won't break when a custom content view is installed.
2107
2108         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2109         Fall back to renderInContext: if the custom content view is not parented
2110         when a snapshot is requested.
2111
2112 2015-04-21  Dan Bernstein  <mitz@apple.com>
2113
2114         Merged WKBackForwardListItem’s Internal category into the class extension in WKBackForwardListItemInternal.h.
2115
2116         Reviewed by Anders Carlsson.
2117
2118         * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
2119         (-[WKBackForwardListItem _item]):
2120         (-[WKBackForwardListItem _apiObject]):
2121         * UIProcess/API/Cocoa/WKBackForwardListItemInternal.h:
2122
2123 2015-04-21  Chris Dumez  <cdumez@apple.com>
2124
2125         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&) constructor explicit
2126         https://bugs.webkit.org/show_bug.cgi?id=143970
2127
2128         Reviewed by Darin Adler.
2129
2130         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&)
2131         constructor explicit as it copies the vector and it is easy to call it
2132         by mistake.
2133
2134         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
2135         (WebKit::WebIDBServerConnection::setIndexKeys):
2136         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
2137
2138 2015-04-20  Dan Bernstein  <mitz@apple.com>
2139
2140         Expose more bundle form client functions as WKWebProcessPlugInFormDelegatePrivate methods
2141         https://bugs.webkit.org/show_bug.cgi?id=143973
2142
2143         Reviewed by Anders Carlsson.
2144
2145         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Declared new
2146         delegate methods.
2147
2148         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h: Declared new frame
2149         property.
2150         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
2151         (-[WKWebProcessPlugInNodeHandle frame]): Added. Returns the node’s document’s frame. This is
2152         useful to delegates getting an array of nodes via the new method.
2153
2154         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2155         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Added overrides of
2156         shouldNotifyOnFormChanges and didAssociateFormControls, which call the new delegate methods.
2157
2158 2015-04-20  Joseph Pecoraro  <pecoraro@apple.com>
2159
2160         Cleanup some StringBuilder use
2161         https://bugs.webkit.org/show_bug.cgi?id=143550
2162
2163         Reviewed by Darin Adler.
2164
2165         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
2166         (WebKit::buildObjectStoreStatement):
2167         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
2168         (WebKit::v2RecordsTableSchema):
2169         * Shared/Databases/IndexedDB/IDBUtilities.cpp:
2170         (WebKit::uniqueDatabaseIdentifier):
2171         * UIProcess/API/APIUserScript.cpp:
2172         (API::UserScript::generateUniqueURL):
2173         * UIProcess/WebProcessPool.cpp:
2174         (WebKit::WebProcessPool::didReceiveInvalidMessage):
2175         * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp:
2176         (WebKit::combinedSecurityOriginIdentifier):
2177
2178 2015-04-20  Anders Carlsson  <andersca@apple.com>
2179
2180         Modify the WKWebsiteDataStore API to take a NSSet of types instead of a bitmask
2181         https://bugs.webkit.org/show_bug.cgi?id=143966
2182
2183         Reviewed by Dan Bernstein.
2184
2185         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
2186         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
2187         (dataTypesToString):
2188         (-[WKWebsiteDataRecord dataTypes]):
2189         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
2190         (WebKit::toWebsiteDataTypes):
2191         (WebKit::toWKWebsiteDataTypes):
2192         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
2193         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2194         (+[WKWebsiteDataStore allWebsiteDataTypes]):
2195         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
2196         (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
2197         (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
2198         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
2199         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
2200         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
2201         (toWKWebsiteDataTypes):
2202         (-[_WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
2203         (-[_WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
2204         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
2205
2206 2015-04-20  Beth Dakin  <bdakin@apple.com>
2207
2208         Should remove mouseForceClick and mouseForceCancelled from DOM force events
2209         https://bugs.webkit.org/show_bug.cgi?id=143904
2210         -and corresponding-
2211         rdar://problem/20578842
2212
2213         Reviewed by Dan Bernstein.
2214
2215         * WebProcess/WebPage/mac/WebPageMac.mm:
2216         (WebKit::WebPage::immediateActionDidCancel):
2217
2218 2015-04-20  Tim Horton  <timothy_horton@apple.com>
2219
2220         Implement immediate action support for tel: and mailto: URLs
2221         https://bugs.webkit.org/show_bug.cgi?id=143916
2222         <rdar://problem/19721711>
2223
2224         Reviewed by Darin Adler.
2225
2226         * Shared/API/c/WKImmediateActionTypes.h:
2227         * UIProcess/mac/WKImmediateActionController.mm:
2228         (-[WKImmediateActionController _defaultAnimationController]):
2229         (-[WKImmediateActionController _animationControllerForDataDetectedText]):
2230         (-[WKImmediateActionController _animationControllerForDataDetectedLink]):
2231         (-[WKImmediateActionController _menuItemForDataDetectedText]): Deleted.
2232         Add _animationControllerForDataDetectedLink and use it when
2233         building immediate actions for tel: and mailto: links.
2234
2235 2015-04-20  Alex Christensen  <achristensen@webkit.org>
2236
2237         Properly report errors from _WKUserContentExtensionStore.
2238         https://bugs.webkit.org/show_bug.cgi?id=143808
2239
2240         Reviewed by Darin Adler.
2241
2242         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
2243         (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
2244         (-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
2245         (-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
2246
2247 2015-04-18  Simon Fraser  <simon.fraser@apple.com>
2248
2249         REGRESSION (r181656): Animated tiled layers are missing content
2250         https://bugs.webkit.org/show_bug.cgi?id=143911
2251         rdar://problem/20596328
2252
2253         Reviewed by Darin Adler.
2254         
2255         After r181656, all requestAnimationFrame was falling back to timers, and not
2256         using the platform's DisplayRefreshMonitor, because of a Nullopt vs nullptr
2257         fumble.
2258         
2259         Replace this confusing Optional<> code with simpler code that just forces the
2260         clients to make a DisplayRefreshMonitor if they can, first asking
2261         ChromeClient, and then falling back to createDefaultDisplayRefreshMonitor().
2262         
2263         Make lots of things into references, and use C++11 initialization in some places.
2264
2265         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2266         (WebKit::WebChromeClient::createDisplayRefreshMonitor):
2267         * WebProcess/WebCoreSupport/WebChromeClient.h:
2268
2269 2015-04-18  Dan Bernstein  <mitz@apple.com>
2270
2271         SwipeShadow images are installed on iOS
2272         https://bugs.webkit.org/show_bug.cgi?id=143915
2273
2274         Reviewed by Tim Horton.
2275
2276         * Configurations/WebKit.xcconfig: Added Resources/Mac/* to
2277         EXCLUDED_SOURCE_FILE_NAMES[sdk=iphone*]. We could move more resources there and remove
2278         individual patterns.
2279         * Resources/SwipeShadow.png: Moved to mac.
2280         * Resources/SwipeShadow@2x.png: Moved to mac.
2281         * Resources/mac: Added.
2282         * Resources/mac/SwipeShadow.png: Moved from Source/WebKit2/Resources/SwipeShadow.png.
2283         * Resources/mac/SwipeShadow@2x.png: Moved from Source/WebKit2/Resources/SwipeShadow@2x.png.
2284         * WebKit2.xcodeproj/project.pbxproj: Created mac group in the Resources group and moved
2285         SwipeShadow*.png into it. Updated for file moves.
2286
2287 2015-04-18  Chris Dumez  <cdumez@apple.com>
2288
2289         Fix NetworkCache Statistics database bootstrapping after r182803
2290         https://bugs.webkit.org/show_bug.cgi?id=143890
2291
2292         Reviewed by Darin Adler.
2293
2294         Update the NetworkCache Statistics database bootstrapping code to use
2295         the records path instead of the version path. Also check that the
2296         filenames in the folder are valid hashes to discard the *-body files.
2297
2298         * NetworkProcess/cache/NetworkCache.cpp:
2299         (WebKit::NetworkCache::Cache::recordsPath):
2300         (WebKit::NetworkCache::Cache::storagePath): Deleted.
2301         * NetworkProcess/cache/NetworkCache.h:
2302         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2303         (WebKit::NetworkCache::Statistics::initialize):
2304         (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
2305         (WebKit::NetworkCache::Statistics::shrinkIfNeeded):
2306
2307 2015-04-17  Tim Horton  <timothy_horton@apple.com>
2308
2309         Clients sometimes block for 500ms in waitForPossibleGeometryUpdates
2310         https://bugs.webkit.org/show_bug.cgi?id=143901
2311         <rdar://problem/20488655>
2312
2313         Reviewed by Anders Carlsson.
2314
2315         * Platform/IPC/Connection.cpp:
2316         (IPC::Connection::waitForMessage):
2317         InterruptWaitingIfSyncMessageArrives already cancels waitForMessage if
2318         a sync message arrives while waiting, but it should also avoid waiting
2319         if there's a sync message already in the queue when the waiting starts,
2320         as that will have the same nasty effect.
2321
2322         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2323         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForPossibleGeometryUpdate):
2324         If a synchronous message comes in from the Web process while we're waiting,
2325         cancel our synchronous wait for DidUpdateGeometry. This will cause the size
2326         change to not synchronize with the Web process' painting, but that is better
2327         than pointlessly blocking for 500ms.
2328
2329 2015-04-17  Chris Dumez  <cdumez@apple.com>
2330
2331         Possible null pointer dereference in WebDiagnosticLoggingClient::logDiagnosticMessageWithValue()
2332         https://bugs.webkit.org/show_bug.cgi?id=143899
2333         <rdar://problem/20584215>
2334
2335         Reviewed by Anders Carlsson.
2336
2337         WebDiagnosticLoggingClient::logDiagnosticMessage*() methods failed to
2338         check that m_page.corePage() was non-null before dereferencing, thus
2339         causing crashes when it is null.
2340
2341         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
2342         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage):
2343         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult):
2344         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue):
2345
2346 2015-04-17  Yongjun Zhang  <yongjun_zhang@apple.com>
2347
2348         WebKit client should be able to add view controller for link preview.
2349         https://bugs.webkit.org/show_bug.cgi?id=143686
2350
2351         Add delegate methods to WKUIDelegatePrivate so that a WebKit client can prepare a view controller
2352         for link preview and react to the dismissal of this view controller. Also connect WKContentView to
2353         preview gesture recognizer and forwards the delegate callbacks to corresponding delegate methods
2354         in WKUIDelegatePrivate.
2355
2356         Reviewed by Beth Dakin.
2357
2358         * Platform/spi/ios/UIKitSPI.h:
2359         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2360         * UIProcess/ios/WKContentView.mm:
2361         (-[WKContentView willMoveToWindow:]):
2362         * UIProcess/ios/WKContentViewInteraction.h:
2363         * UIProcess/ios/WKContentViewInteraction.mm:
2364         (-[WKContentView cleanupInteraction]):
2365         (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):
2366         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
2367         (-[WKContentView gestureRecognizerShouldBegin:]):
2368         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
2369         (-[WKContentView commitPreviewViewController:]):
2370         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]):
2371         (-[WKContentView didDismissPreviewViewController:committing:]):
2372
2373 2015-04-17  Beth Dakin  <bdakin@apple.com>
2374
2375         Force mouse events should go through normal mouse event handling code paths
2376         https://bugs.webkit.org/show_bug.cgi?id=143749
2377         -and corresponding-
2378         rdar://problem/20472895
2379
2380         Reviewed by Dean Jackson.
2381
2382         This patch makes pressureChangeWithEvent create NativeWebMouseEvents with the 
2383         NSEventTypePressures that is gets and sends those down to the web process.
2384
2385         Re-name pressureEvent to lastPressureEvent. Now that event can sometimes be an 
2386         NSEventTypePressure, the new name makes it clear how the second parameter differs 
2387         from the first.
2388         * Shared/NativeWebMouseEvent.h:
2389
2390         New event types for the new types of events.
2391         * Shared/WebEvent.h:
2392         * Shared/WebEventConversion.cpp:
2393         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
2394         * Shared/mac/NativeWebMouseEventMac.mm:
2395         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
2396         * Shared/mac/WebEventFactory.h:
2397
2398         All of the square-peg, round-hole problems of massaging the NSEventTypePressures 
2399         events into WebMouseEvents is taken care of here.
2400         * Shared/mac/WebEventFactory.mm:
2401         (WebKit::mouseButtonForEvent):
2402         (WebKit::globalPointForEvent):
2403         (WebKit::pointForEvent):
2404         (WebKit::WebEventFactory::createWebMouseEvent):
2405
2406         Instead of calling the old inputDeviceForceDidChange, create a NativeWebMouseEvent 
2407         and handle it.
2408         * UIProcess/API/mac/WKView.mm:
2409         (-[WKView pressureChangeWithEvent:]):
2410
2411         Handle the new types.
2412         * UIProcess/WebPageProxy.cpp:
2413         (WebKit::WebPageProxy::didReceiveEvent):
2414
2415         Can delete inputDeviceForceDidChange since it’s no longer used.
2416         (WebKit::WebPageProxy::inputDeviceForceDidChange): Deleted.
2417         * UIProcess/WebPageProxy.h:
2418
2419         Handle the new types of mouse events properly.
2420         * WebProcess/WebPage/WebPage.cpp:
2421         (WebKit::handleMouseEvent):
2422
2423         Delete inputDeviceForceDidChange() and m_lastForceStage.
2424         * WebProcess/WebPage/WebPage.h:
2425         * WebProcess/WebPage/WebPage.messages.in:
2426         * WebProcess/WebPage/mac/WebPageMac.mm:
2427         (WebKit::WebPage::inputDeviceForceDidChange): Deleted.
2428
2429         Handle new WebEvent types.
2430         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
2431
2432 2015-04-17  Commit Queue  <commit-queue@webkit.org>
2433
2434         Unreviewed, rolling out r182912 and r182920.
2435         https://bugs.webkit.org/show_bug.cgi?id=143881
2436
2437         Build breakage in some configurations (Requested by ap on
2438         #webkit).
2439
2440         Reverted changesets:
2441
2442         "Force mouse events should go through normal mouse event
2443         handling code paths"
2444         https://bugs.webkit.org/show_bug.cgi?id=143749
2445         http://trac.webkit.org/changeset/182912
2446
2447         http://trac.webkit.org/changeset/182920
2448
2449 2015-04-17  Antti Koivisto  <antti@apple.com>
2450
2451         Network Cache: Read resource record and body in parallel
2452         https://bugs.webkit.org/show_bug.cgi?id=143879
2453
2454         Reviewed by Chris Dumez.
2455
2456         We currently first fetch the record file and then fetch the body blob if needed.
2457         We can do both operations in parallel to reduce latency.
2458
2459         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
2460         (WebKit::NetworkCache::traverseCacheFiles):
2461
2462             Do all validation in the client.
2463
2464         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2465         (WebKit::NetworkCache::Storage::synchronize):
2466
2467             Maintain a bloom filter that contains the body blobs to avoid unnecessary IO attempts.
2468             Delete any unknown file in cache directory.
2469
2470         (WebKit::NetworkCache::Storage::addToRecordFilter):
2471
2472             More informative name for record filter.
2473
2474         (WebKit::NetworkCache::Storage::mayContain):
2475         (WebKit::NetworkCache::Storage::readRecord):
2476         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
2477         (WebKit::NetworkCache::Storage::dispatchReadOperation):
2478
2479             Start record read IO and body blob read IO in parallel.
2480
2481         (WebKit::NetworkCache::Storage::finishReadOperation):
2482
2483             The read is finished when we have both the record and the blob.
2484
2485         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
2486         (WebKit::NetworkCache::Storage::retrieve):
2487         (WebKit::NetworkCache::Storage::store):
2488         (WebKit::NetworkCache::Storage::traverse):
2489         (WebKit::NetworkCache::Storage::clear):
2490         (WebKit::NetworkCache::Storage::shrink):
2491         (WebKit::NetworkCache::Storage::addToContentsFilter): Deleted.
2492         (WebKit::NetworkCache::Storage::decodeRecord): Deleted.
2493         * NetworkProcess/cache/NetworkCacheStorage.h:
2494         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation):
2495
2496             ReadOperation is now mutable and gathers the read result.
2497
2498 2015-04-16  Anders Carlsson  <andersca@apple.com>
2499
2500         Stop installing WebKit2.framework
2501         https://bugs.webkit.org/show_bug.cgi?id=143860
2502         rdar://problem/18298491
2503
2504         Reviewed by Dan Bernstein.
2505
2506         * Configurations/WebKit2.xcconfig:
2507         Set SKIP_INSTALL=YES for all SDKs except 10.9 where we still need it.
2508
2509 2015-04-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2510
2511         Unreviewed. Fix the build with ENABLE(NETWORK_CACHE) and !ENABLE(SHAREABLE_RESOURCE).
2512
2513         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2514         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
2515         (WebKit::NetworkCache::fileTimes): There's no st_birthtime in Linux.
2516
2517 2015-04-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2518
2519         [SOUP] ResourceRequest cache policy is not encoded/decoded in IPC messages
2520         https://bugs.webkit.org/show_bug.cgi?id=143867
2521
2522         Reviewed by Sergio Villar Senin.
2523
2524         Encode/Decode the ResourceRequest cache policy.
2525
2526         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
2527         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
2528         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
2529
2530 2015-04-16  Sungmann Cho  <sungmann.cho@navercorp.com>
2531
2532         Use UNUSED_PARAM instead of the void casting to suppress unused parameter warnings.
2533         https://bugs.webkit.org/show_bug.cgi?id=143750
2534
2535         Reviewed by Darin Adler.
2536
2537         No new tests, no behavior change.
2538
2539         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
2540         (WebKit::NotificationPermissionRequestManager::NotificationPermissionRequestManager):
2541
2542 2015-04-16  Brady Eidson  <beidson@apple.com>
2543
2544         Compiling a content extension fails when user's home directory is on a different volume from /var/tmp.
2545         https://bugs.webkit.org/show_bug.cgi?id=143834
2546
2547         Reviewed by Anders Carlsson.
2548
2549         * UIProcess/API/APIUserContentExtensionStore.cpp:
2550         (API::compiledToFile): Use moveFile() instead of renameFile()
2551
2552 2015-04-16  Anders Carlsson  <andersca@apple.com>
2553
2554         Deprecate _WKWebsiteDataStore in favor of WKWebsiteDataStore
2555         https://bugs.webkit.org/show_bug.cgi?id=143844
2556
2557         Reviewed by Dan Bernstein.
2558
2559         * Shared/API/Cocoa/WKFoundation.h:
2560         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2561         (-[WKWebViewConfiguration _validate]):
2562         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2563         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
2564         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
2565         * mac/postprocess-framework-headers.sh:
2566
2567 2015-04-16  Alex Christensen  <achristensen@webkit.org>
2568
2569         Removed unused WKUserContentFilterRef.
2570         https://bugs.webkit.org/show_bug.cgi?id=143852
2571
2572         Reviewed by Sam Weinig.
2573
2574         * Shared/WebCompiledContentExtension.cpp:
2575         (WebKit::LegacyContentExtensionCompilationClient::LegacyContentExtensionCompilationClient): Deleted.
2576         (WebKit::LegacyContentExtensionCompilationClient::writeBytecode): Deleted.
2577         (WebKit::LegacyContentExtensionCompilationClient::writeActions): Deleted.
2578         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData): Deleted.
2579         * Shared/WebCompiledContentExtension.h:
2580         * UIProcess/API/C/WKUserContentFilterRef.cpp: Removed.
2581         * UIProcess/API/C/WKUserContentFilterRef.h: Removed.
2582         * UIProcess/API/C/WebKit2_C.h:
2583         * UIProcess/API/Cocoa/_WKUserContentFilter.h:
2584         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
2585         (-[_WKUserContentFilter initWithName:serializedRules:]): Deleted.
2586         * WebKit2.xcodeproj/project.pbxproj:
2587
2588 2015-04-16  Beth Dakin  <bdakin@apple.com>
2589
2590         Rubber-stamped by Tim Horton.
2591
2592         Fixing a small mistake in http://trac.webkit.org/changeset/182912 which should 
2593         make sure to use the most up-to-date pressure information when setting the force 
2594         on a WebMouseEvent.
2595
2596         * Shared/mac/WebEventFactory.mm:
2597         (WebKit::WebEventFactory::createWebMouseEvent):
2598
2599 2015-04-13  Jer Noble  <jer.noble@apple.com>
2600
2601         [iOS] When simultaneously exiting-and-entering fullscreen, WebVideoFullscreenManager/Proxy becomes confused about what video element it represents.
2602         https://bugs.webkit.org/show_bug.cgi?id=143680
2603
2604         Reviewed by Simon Fraser.
2605
2606         The original assumption of WebVideoFullscreenManager and -Proxy was that the two classes would represent a
2607         single video element and its full screen state. With multiple animations in and out of fullscreen combined with
2608         multiple fullscreen modes, this assumption no longer holds true.
2609
2610         Rather than having a WebVideoFullscreenManager which /isa/ WebVideoFullscreenModelVideoElement, the manager now
2611         /hasa/ WebVideoFullscreenModelVideoElement (or has many such models). Ditto for WebVideoFullscreenManager and
2612         WebVideoFullscreenInterfaceAVKit. The WebVideoFullscreenInterfaceAVKit still needs a WebVideoFullscreenModel to
2613         communicate with, so a new wrapper class is used for that purpose, WebVideoFullscreenModelContext. Ditto for
2614         WebVideoFullscreenModelVideoElement and the new class WebVideoFullscreenInterfaceContext. These context classes
2615         are paired and share a contextId, allowing the manager and its proxy to route messages between the UIProcess's
2616         WebVideoFullscreenInterfaceAVKit to-and-from the WebProcess's WebVideoFullscreenModelVideoElement.
2617
2618         Both the WebVideoFullscreenModelContext and the WebVideoFullscreenInterfaceContext take a back-pointer to their
2619         manager or manager proxy, and each method on the context simply calls the matching method on the manager and
2620         passes its contextId as a parameter.
2621
2622         Both the WebVideoFullscreenManager and the WebVideoFullscreenManagerProxy pass that contextId in each of their
2623         cross-process messages.
2624
2625         On the other side, the manager and proxy also have a map between contextIds and their matching
2626         WebVideoFullscreenModelVideoElement (in the case of WebVideoFullscreenManager) or
2627         WebVideoFullscreenInterfaceAVKit (in the case of WebVideoFullscreenManagerProxy).
2628
2629         While this change is large by LoC, it is almost entirely boilerplate.  The new and interesting pieces are these:
2630
2631         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2632         (WebKit::WebVideoFullscreenManagerProxy::WebVideoFullscreenManagerProxy): No longer a WebVideoFullscreenInterfaceAVKit.
2633         (WebKit::WebVideoFullscreenManagerProxy::invalidate): Walk through the models and interfaces, invalidating each.
2634         (WebKit::WebVideoFullscreenManagerProxy::createModelAndInterface): Added. Return a new model and interface tuple.
2635         (WebKit::WebVideoFullscreenManagerProxy::ensureModelAndInterface): Added. Lazily create, and add to the m_contextMap
2636             a new model and interface object.
2637         (WebKit::WebVideoFullscreenManagerProxy::ensureModel): Return the model half of ensureModelAndInterface().
2638         (WebKit::WebVideoFullscreenManagerProxy::ensureInterface): Return the interface half of ensureModelAndInterface().
2639         (WebKit::WebVideoFullscreenManagerProxy::enterFullscreen): Walk through the outstanding interface objects, and if 
2640             any have a fullscreen mode which matches the about-to-be-fullscreen interface, request that that other interface
2641             exit fullscreen.
2642         * WebProcess/ios/WebVideoFullscreenManager.mm:
2643         (WebKit::nextContextId): Static, incrementing counter used as a contextId source.
2644         (WebKit::WebVideoFullscreenManager::WebVideoFullscreenManager): No longer a WebVideoFullscreenModelVideoElement.
2645         (WebKit::WebVideoFullscreenManager::~WebVideoFullscreenManager): Walk through the models and interfaces, invalidating each.
2646         (WebKit::WebVideoFullscreenManager::ensureModelAndInterface): Added. Return a new model and interface tuple.
2647         (WebKit::WebVideoFullscreenManager::ensureModelAndInterface):  Added. Lazily create, and add to the m_contextMap
2648             a new model and interface object.
2649         (WebKit::WebVideoFullscreenManager::ensureModel): Return the model half of ensureModelAndInterface().
2650         (WebKit::WebVideoFullscreenManager::ensureInterface): Return the interface half of ensureModelAndInterface().
2651
2652         New classes and methods which just forward on to their owning objects:
2653
2654         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
2655         (WebKit::WebVideoFullscreenModelContext::create):
2656         (WebKit::WebVideoFullscreenModelContext::~WebVideoFullscreenModelContext):
2657         (WebKit::WebVideoFullscreenModelContext::invalidate):
2658         (WebKit::WebVideoFullscreenModelContext::layerHost):
2659         (WebKit::WebVideoFullscreenModelContext::setLayerHost):
2660         (WebKit::WebVideoFullscreenModelContext::setInitialVideoLayerFrame):
2661         (WebKit::WebVideoFullscreenModelContext::WebVideoFullscreenModelContext):
2662         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2663         (WebKit::WebVideoFullscreenModelContext::play):
2664         (WebKit::WebVideoFullscreenModelContext::pause):
2665         (WebKit::WebVideoFullscreenModelContext::togglePlayState):
2666         (WebKit::WebVideoFullscreenModelContext::beginScrubbing):
2667         (WebKit::WebVideoFullscreenModelContext::endScrubbing):
2668         (WebKit::WebVideoFullscreenModelContext::seekToTime):
2669         (WebKit::WebVideoFullscreenModelContext::fastSeek):
2670         (WebKit::WebVideoFullscreenModelContext::beginScanningForward):
2671         (WebKit::WebVideoFullscreenModelContext::beginScanningBackward):
2672         (WebKit::WebVideoFullscreenModelContext::endScanning):
2673         (WebKit::WebVideoFullscreenModelContext::requestExitFullscreen):
2674         (WebKit::WebVideoFullscreenModelContext::setVideoLayerFrame):
2675         (WebKit::WebVideoFullscreenModelContext::videoLayerFrame):
2676         (WebKit::WebVideoFullscreenModelContext::setVideoLayerGravity):
2677         (WebKit::WebVideoFullscreenModelContext::videoLayerGravity):
2678         (WebKit::WebVideoFullscreenModelContext::selectAudioMediaOption):
2679         (WebKit::WebVideoFullscreenModelContext::selectLegibleMediaOption):
2680         (WebKit::WebVideoFullscreenModelContext::fullscreenModeChanged):
2681         (WebKit::WebVideoFullscreenModelContext::didSetupFullscreen):
2682         (WebKit::WebVideoFullscreenModelContext::didEnterFullscreen):
2683         (WebKit::WebVideoFullscreenModelContext::didExitFullscreen):
2684         (WebKit::WebVideoFullscreenModelContext::didCleanupFullscreen):
2685         (WebKit::WebVideoFullscreenModelContext::fullscreenMayReturnToInline):
2686         * WebProcess/ios/WebVideoFullscreenManager.h:
2687         (WebKit::WebVideoFullscreenInterfaceContext::create):
2688         (WebKit::WebVideoFullscreenInterfaceContext::invalidate):
2689         (WebKit::WebVideoFullscreenInterfaceContext::layerHostingContext):
2690         (WebKit::WebVideoFullscreenInterfaceContext::isAnimating):
2691         (WebKit::WebVideoFullscreenInterfaceContext::setIsAnimating):
2692         (WebKit::WebVideoFullscreenInterfaceContext::targetIsFullscreen):
2693         (WebKit::WebVideoFullscreenInterfaceContext::setTargetIsFullscreen):
2694         (WebKit::WebVideoFullscreenInterfaceContext::fullscreenMode):
2695         (WebKit::WebVideoFullscreenInterfaceContext::setFullscreenMode):
2696         (WebKit::WebVideoFullscreenInterfaceContext::isFullscreen):
2697         (WebKit::WebVideoFullscreenInterfaceContext::setIsFullscreen):
2698         * WebProcess/ios/WebVideoFullscreenManager.mm:
2699         (WebKit::WebVideoFullscreenInterfaceContext::WebVideoFullscreenInterfaceContext):
2700         (WebKit::WebVideoFullscreenInterfaceContext::~WebVideoFullscreenInterfaceContext):
2701         (WebKit::WebVideoFullscreenInterfaceContext::setLayerHostingContext):
2702         (WebKit::WebVideoFullscreenInterfaceContext::resetMediaState):
2703         (WebKit::WebVideoFullscreenInterfaceContext::setDuration):
2704         (WebKit::WebVideoFullscreenInterfaceContext::setCurrentTime):
2705         (WebKit::WebVideoFullscreenInterfaceContext::setBufferedTime):
2706         (WebKit::WebVideoFullscreenInterfaceContext::setRate):
2707         (WebKit::WebVideoFullscreenInterfaceContext::setVideoDimensions):
2708         (WebKit::WebVideoFullscreenInterfaceContext::setSeekableRanges):
2709         (WebKit::WebVideoFullscreenInterfaceContext::setCanPlayFastReverse):
2710         (WebKit::WebVideoFullscreenInterfaceContext::setAudioMediaSelectionOptions):
2711         (WebKit::WebVideoFullscreenInterfaceContext::setLegibleMediaSelectionOptions):
2712         (WebKit::WebVideoFullscreenInterfaceContext::setExternalPlayback):
2713
2714         Cross-process methods which now take a contextId parameter:
2715
2716         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
2717         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2718         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
2719         (WebKit::WebVideoFullscreenManagerProxy::resetMediaState):
2720         (WebKit::WebVideoFullscreenManagerProxy::setCurrentTime):
2721         (WebKit::WebVideoFullscreenManagerProxy::setBufferedTime):
2722         (WebKit::WebVideoFullscreenManagerProxy::setVideoDimensions):
2723         (WebKit::WebVideoFullscreenManagerProxy::setSeekableRangesVector):
2724         (WebKit::WebVideoFullscreenManagerProxy::setCanPlayFastReverse):
2725         (WebKit::WebVideoFullscreenManagerProxy::setAudioMediaSelectionOptions):
2726         (WebKit::WebVideoFullscreenManagerProxy::setLegibleMediaSelectionOptions):
2727         (WebKit::WebVideoFullscreenManagerProxy::setExternalPlaybackProperties):
2728         (WebKit::WebVideoFullscreenManagerProxy::setDuration):
2729         (WebKit::WebVideoFullscreenManagerProxy::setRate):
2730         (WebKit::WebVideoFullscreenManagerProxy::exitFullscreen):
2731         (WebKit::WebVideoFullscreenManagerProxy::cleanupFullscreen):
2732         (WebKit::WebVideoFullscreenManagerProxy::preparedToReturnToInline):
2733         (WebKit::WebVideoFullscreenManagerProxy::play):
2734         (WebKit::WebVideoFullscreenManagerProxy::pause):
2735         (WebKit::WebVideoFullscreenManagerProxy::togglePlayState):
2736         (WebKit::WebVideoFullscreenManagerProxy::beginScrubbing):
2737         (WebKit::WebVideoFullscreenManagerProxy::endScrubbing):
2738         (WebKit::WebVideoFullscreenManagerProxy::seekToTime):
2739         (WebKit::WebVideoFullscreenManagerProxy::fastSeek):
2740         (WebKit::WebVideoFullscreenManagerProxy::beginScanningForward):
2741         (WebKit::WebVideoFullscreenManagerProxy::beginScanningBackward):
2742         (WebKit::WebVideoFullscreenManagerProxy::endScanning):
2743         (WebKit::WebVideoFullscreenManagerProxy::requestExitFullscreen):
2744         (WebKit::WebVideoFullscreenManagerProxy::didSetupFullscreen):
2745         (WebKit::WebVideoFullscreenManagerProxy::didExitFullscreen):
2746         (WebKit::WebVideoFullscreenManagerProxy::didEnterFullscreen):
2747         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen):
2748         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
2749         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerGravity):
2750         (WebKit::WebVideoFullscreenManagerProxy::selectAudioMediaOption):
2751         (WebKit::WebVideoFullscreenManagerProxy::selectLegibleMediaOption):
2752         (WebKit::WebVideoFullscreenManagerProxy::fullscreenModeChanged):
2753         (WebKit::WebVideoFullscreenManagerProxy::fullscreenMayReturnToInline):
2754         (WebKit::WebVideoFullscreenManagerProxy::videoLayerFrame): Deleted.
2755         (WebKit::WebVideoFullscreenManagerProxy::videoLayerGravity): Deleted.
2756         * WebProcess/ios/WebVideoFullscreenManager.messages.in:
2757         * WebProcess/ios/WebVideoFullscreenManager.mm:
2758         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
2759         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement):
2760         (WebKit::WebVideoFullscreenManager::resetMediaState):
2761         (WebKit::WebVideoFullscreenManager::setDuration):
2762         (WebKit::WebVideoFullscreenManager::setCurrentTime):
2763         (WebKit::WebVideoFullscreenManager::setBufferedTime):
2764         (WebKit::WebVideoFullscreenManager::setRate):
2765         (WebKit::WebVideoFullscreenManager::setVideoDimensions):
2766         (WebKit::WebVideoFullscreenManager::setSeekableRanges):
2767         (WebKit::WebVideoFullscreenManager::setCanPlayFastReverse):
2768         (WebKit::WebVideoFullscreenManager::setAudioMediaSelectionOptions):
2769         (WebKit::WebVideoFullscreenManager::setLegibleMediaSelectionOptions):
2770         (WebKit::WebVideoFullscreenManager::setExternalPlayback):
2771         (WebKit::WebVideoFullscreenManager::play):
2772         (WebKit::WebVideoFullscreenManager::pause):
2773         (WebKit::WebVideoFullscreenManager::togglePlayState):
2774         (WebKit::WebVideoFullscreenManager::beginScrubbing):
2775         (WebKit::WebVideoFullscreenManager::endScrubbing):
2776         (WebKit::WebVideoFullscreenManager::seekToTime):
2777         (WebKit::WebVideoFullscreenManager::fastSeek):
2778         (WebKit::WebVideoFullscreenManager::beginScanningForward):
2779         (WebKit::WebVideoFullscreenManager::beginScanningBackward):
2780         (WebKit::WebVideoFullscreenManager::endScanning):
2781         (WebKit::WebVideoFullscreenManager::requestExitFullscreen):
2782         (WebKit::WebVideoFullscreenManager::selectAudioMediaOption):
2783         (WebKit::WebVideoFullscreenManager::selectLegibleMediaOption):
2784         (WebKit::WebVideoFullscreenManager::fullscreenModeChanged):
2785         (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
2786         (WebKit::WebVideoFullscreenManager::didEnterFullscreen):
2787         (WebKit::WebVideoFullscreenManager::didExitFullscreen):
2788         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
2789         (WebKit::WebVideoFullscreenManager::setVideoLayerGravityEnum):
2790         (WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline):
2791         (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced):
2792         (WebKit::WebVideoFullscreenManager::exitVideoFullscreen): Deleted.
2793
2794 2015-04-16  Beth Dakin  <bdakin@apple.com>
2795
2796         Force mouse events should go through normal mouse event handling code paths
2797         https://bugs.webkit.org/show_bug.cgi?id=143749
2798         -and corresponding-
2799         rdar://problem/20472895
2800
2801         Reviewed by Dean Jackson.
2802
2803         This patch makes pressureChangeWithEvent create NativeWebMouseEvents with the 
2804         NSEventTypePressures that is gets and sends those down to the web process.
2805
2806         Re-name pressureEvent to lastPressureEvent. Now that event can sometimes be an 
2807         NSEventTypePressure, the new name makes it clear how the second parameter differs 
2808         from the first.
2809         * Shared/NativeWebMouseEvent.h:
2810
2811         New event types for the new types of events.
2812         * Shared/WebEvent.h:
2813         * Shared/WebEventConversion.cpp:
2814         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
2815         * Shared/mac/NativeWebMouseEventMac.mm:
2816         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
2817         * Shared/mac/WebEventFactory.h:
2818
2819         All of the square-peg, round-hole problems of massaging the NSEventTypePressures 
2820         events into WebMouseEvents is taken care of here.
2821         * Shared/mac/WebEventFactory.mm:
2822         (WebKit::mouseButtonForEvent):
2823         (WebKit::globalPointForEvent):
2824         (WebKit::pointForEvent):
2825         (WebKit::WebEventFactory::createWebMouseEvent):
2826
2827         Instead of calling the old inputDeviceForceDidChange, create a NativeWebMouseEvent 
2828         and handle it.
2829         * UIProcess/API/mac/WKView.mm:
2830         (-[WKView pressureChangeWithEvent:]):
2831
2832         Handle the new types.
2833         * UIProcess/WebPageProxy.cpp:
2834         (WebKit::WebPageProxy::didReceiveEvent):
2835
2836         Can delete inputDeviceForceDidChange since it’s no longer used.
2837         (WebKit::WebPageProxy::inputDeviceForceDidChange): Deleted.
2838         * UIProcess/WebPageProxy.h:
2839
2840         Handle the new types of mouse events properly.
2841         * WebProcess/WebPage/WebPage.cpp:
2842         (WebKit::handleMouseEvent):
2843
2844         Delete inputDeviceForceDidChange() and m_lastForceStage.
2845         * WebProcess/WebPage/WebPage.h:
2846         * WebProcess/WebPage/WebPage.messages.in:
2847         * WebProcess/WebPage/mac/WebPageMac.mm:
2848         (WebKit::WebPage::inputDeviceForceDidChange): Deleted.
2849
2850         Handle new WebEvent types.
2851         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
2852
2853 2015-04-16  Dan Bernstein  <mitz@apple.com>
2854
2855         <rdar://problem/20575744> Also include a definition of __NSd_{current deployment target} in WKFoundation.h.
2856
2857         Reviewed by Tim Horton.
2858
2859         * WebKit2.xcodeproj/project.pbxproj:
2860
2861 2015-04-16  Timothy Horton  <timothy_horton@apple.com>
2862
2863         Provide a mechanism through the legacy SPI to know when swipe gestures begin and end
2864         https://bugs.webkit.org/show_bug.cgi?id=143740
2865         <rdar://problem/20468540>
2866
2867         Reviewed by Dan Bernstein.
2868
2869         In the C SPI, add three WKPageLoaderClient callbacks for the three
2870         navigation gesture events (did begin, will end, did end).
2871
2872         * UIProcess/API/C/WKPageLoaderClient.h:
2873         Add the callbacks.
2874
2875         * UIProcess/API/APILoaderClient.h:
2876         (API::LoaderClient::navigationGestureDidBegin):
2877         (API::LoaderClient::navigationGestureWillEnd):
2878         (API::LoaderClient::navigationGestureDidEnd):
2879         * UIProcess/WebPageProxy.cpp:
2880         (WebKit::WebPageProxy::navigationGestureDidBegin):
2881         (WebKit::WebPageProxy::navigationGestureWillEnd):
2882         (WebKit::WebPageProxy::navigationGestureDidEnd):
2883         Dispatch navigation gesture events to the loader client as well as
2884         (after a bounce through the PageClient) the navigation delegate.
2885
2886         * UIProcess/API/C/WKPage.cpp:
2887         (WKPageSetPageLoaderClient):
2888         Call the callbacks.
2889
2890         * UIProcess/mac/ViewGestureController.h:
2891         * UIProcess/mac/ViewGestureControllerMac.mm:
2892         (WebKit::ViewGestureController::trackSwipeGesture):
2893         (WebKit::ViewGestureController::willEndSwipeGesture):
2894         While we were already informing WebPageProxy of 'did begin' and 'did end'
2895         navigation gesture events, we were missing 'will end'. Add it.
2896
2897 2015-04-16  Tim Horton  <timothy_horton@apple.com>
2898
2899         Dispatching multiple asynchronous animated resizes in parallel causes page scale to detach from reality
2900         https://bugs.webkit.org/show_bug.cgi?id=143812
2901         <rdar://problem/19866038>
2902
2903         Reviewed by Simon Fraser.
2904
2905         * Shared/VisibleContentRectUpdateInfo.h:
2906         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
2907         No cats in transaction (more of these below, too).
2908
2909         * UIProcess/WebPageProxy.h:
2910         * UIProcess/WebPageProxy.messages.in:
2911         * UIProcess/ios/WebPageProxyIOS.mm:
2912         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
2913         (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget):
2914         * WebProcess/WebPage/WebPage.h:
2915         * WebProcess/WebPage/WebPage.messages.in:
2916         * WebProcess/WebPage/ios/WebPageIOS.mm:
2917         (WebKit::WebPage::handleTap):
2918         (WebKit::WebPage::commitPotentialTap):
2919         (WebKit::WebPage::dynamicViewportSizeUpdate):
2920         Add an incrementing ID to dynamicViewportSizeUpdates. The UI process keeps
2921         the current ID, and it is bounced through the Web process (dynamicViewportSizeUpdates)
2922         back to the UI process (dynamicViewportUpdateChangedTarget). If we have
2923         dispatched another dynamicViewportSizeUpdate in the interim, ignore
2924         the intermediate target.
2925
2926 2015-04-16  Sungmann Cho  <sungmann.cho@navercorp.com>
2927
2928         Remove PluginController::isPluginVisible().
2929         https://bugs.webkit.org/show_bug.cgi?id=143830
2930
2931         Reviewed by Darin Adler.
2932
2933         PluginController::isPluginVisible() was introduced by http://webkit.org/b/60285.
2934         This method had been used only for WebKit2 on Windows, and no one uses it now.
2935         So we can remove it.
2936
2937         No new tests, no behavior change.
2938
2939         * PluginProcess/PluginControllerProxy.cpp:
2940         (WebKit::PluginControllerProxy::isPluginVisible): Deleted.
2941         * PluginProcess/PluginControllerProxy.h:
2942         * WebProcess/Plugins/PluginController.h:
2943         * WebProcess/Plugins/PluginView.cpp:
2944         (WebKit::PluginView::isPluginVisible): Deleted.
2945         * WebProcess/Plugins/PluginView.h:
2946
2947 2015-04-16  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2948
2949         [EFL] Disable a flaky ewk_context_network_process_model() API test
2950         https://bugs.webkit.org/show_bug.cgi?id=143824
2951
2952         Reviewed by Csaba Osztrogonác.
2953
2954         ewk_context_network_process_model has been often failed. Though Bug 142967
2955         was filed to fix this issue, it is not solved yet. To maintain EFL bot, this patch
2956         disables it until fixing it.
2957
2958         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
2959         (TEST_F):
2960
2961 2015-04-16  Csaba Osztrogonác  <ossy@webkit.org>
2962
2963         [WK2] Forwarding headers generator shouldn't generate unnecessary headers
2964         https://bugs.webkit.org/show_bug.cgi?id=143820
2965
2966         Reviewed by Carlos Garcia Campos.
2967
2968         * Scripts/generate-forwarding-headers.pl:
2969         (collectNeededHeaders):
2970
2971 2015-04-16  Csaba Osztrogonác  <ossy@webkit.org>
2972
2973         [GTK] Run forwarding headers generator unconditionally
2974         https://bugs.webkit.org/show_bug.cgi?id=143819
2975
2976         Reviewed by Carlos Garcia Campos.
2977
2978         * PlatformGTK.cmake:
2979
2980 2015-04-15  Brent Fulgham  <bfulgham@apple.com>
2981
2982         [Mac] Disable "Save to Downloads" option for local files
2983         https://bugs.webkit.org/show_bug.cgi?id=143794
2984
2985         Reviewed by Tim Horton.
2986
2987         Disable the Image and Media download options if the download
2988         target is a local file. We can only download web resources;
2989         anything else is actually a no-op.
2990
2991         * UIProcess/mac/WKActionMenuController.mm:
2992         (-[WKActionMenuController _defaultMenuItemsForVideo]):
2993         (-[WKActionMenuController _defaultMenuItemsForImage]):
2994
2995 2015-04-15  Anders Carlsson  <andersca@apple.com>
2996
2997         Make websiteDataStore on WKWebViewConfiguration public
2998         https://bugs.webkit.org/show_bug.cgi?id=143810
2999
3000         Reviewed by Dan Bernstein.
3001
3002         * UIProcess/API/Cocoa/WKWebView.mm:
3003         (-[WKWebView initWithFrame:configuration:]):
3004         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
3005         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3006         (-[WKWebViewConfiguration copyWithZone:]):
3007         (-[WKWebViewConfiguration websiteDataStore]):
3008         (-[WKWebViewConfiguration setWebsiteDataStore:]):
3009         (-[WKWebViewConfiguration _websiteDataStore]):
3010         (-[WKWebViewConfiguration _setWebsiteDataStore:]):
3011
3012 2015-04-15  Anders Carlsson  <andersca@apple.com>
3013
3014         Make WKWebsiteDataStore public
3015         https://bugs.webkit.org/show_bug.cgi?id=143805
3016
3017         Reviewed by Dan Bernstein.
3018
3019         Rename the current _WKWebsiteDataStore to WKWebsiteDataStore. Make init unavailable and tighten up the
3020         types of the defaultDataStore and nonPersistentDataStore class methods.
3021         
3022         Add a new _WKWebsiteDataStore @interface and @implementation that derives from WKWebsiteDataStore
3023         and forwards the defaultDataStore and nonPersistentDataStore method calls.
3024
3025         * Shared/API/Cocoa/WebKit.h:
3026         * Shared/Cocoa/APIObject.mm:
3027         (API::Object::newObject):
3028         * UIProcess/API/Cocoa/WKWebView.mm:
3029         (-[WKWebView initWithFrame:configuration:]):
3030         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3031         (-[WKWebViewConfiguration _websiteDataStore]):
3032         * UIProcess/API/Cocoa/WKWebsiteDataStore.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.h.
3033         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.mm.
3034         (+[WKWebsiteDataStore defaultDataStore]):
3035         (+[WKWebsiteDataStore nonPersistentDataStore]):
3036         (-[WKWebsiteDataStore dealloc]):
3037         (-[WKWebsiteDataStore isNonPersistent]):
3038         (toSystemClockTime):
3039         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
3040         (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
3041         (toWebsiteDataRecords):
3042         (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
3043         (-[WKWebsiteDataStore _apiObject]):
3044         * UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStoreInternal.h.
3045         (WebKit::wrapper):
3046         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
3047         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
3048         (+[_WKWebsiteDataStore defaultDataStore]):
3049         (+[_WKWebsiteDataStore nonPersistentDataStore]):
3050         (-[_WKWebsiteDataStore dealloc]): Deleted.
3051         (-[_WKWebsiteDataStore isNonPersistent]): Deleted.
3052         (toWebsiteDataTypes): Deleted.
3053         (toSystemClockTime): Deleted.
3054         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]): Deleted.
3055         (-[_WKWebsiteDataStore _apiObject]): Deleted.
3056         * WebKit2.xcodeproj/project.pbxproj:
3057
3058 2015-04-15  Timothy Horton  <timothy_horton@apple.com>
3059
3060         Custom CSS cursors do not use -webkit-image-set on retina displays
3061         https://bugs.webkit.org/show_bug.cgi?id=120783
3062
3063         Reviewed by Beth Dakin.
3064         Patch by Evan Wallace <evan.exe@gmail.com>.
3065
3066         Serialize the cursor image scale for SetCursor messages so custom
3067         CSS cursors work with -webkit-image-set on retina displays.
3068
3069         * Shared/WebCoreArgumentCoders.cpp:
3070         (CoreIPC::ArgumentCoder<Cursor>::encode):
3071         (CoreIPC::ArgumentCoder<Cursor>::decode):
3072
3073 2015-04-15  Alex Christensen  <achristensen@webkit.org>
3074
3075         Progress towards CMake on Mac.
3076         https://bugs.webkit.org/show_bug.cgi?id=143785
3077
3078         Reviewed by Csaba Osztrogonác.
3079
3080         * CMakeLists.txt:
3081         * PlatformEfl.cmake:
3082         * PlatformGTK.cmake:
3083
3084 2015-04-15  Anders Carlsson  <andersca@apple.com>
3085
3086         Make WKWebsiteDataRecord public
3087         https://bugs.webkit.org/show_bug.cgi?id=143796
3088
3089         Reviewed by Dan Bernstein.
3090
3091         Rename _WKWebsiteDataRecord and associated files to WKWebsiteDataRecord and
3092         add a new _WKWebsiteDataRecord.h with a class @interface declaration that just
3093         inherits from WKWebsiteDataRecord. We don't need an @implementation since nobody is expected
3094         to allocate _WKWebsiteDataRecord objects.
3095
3096         * Shared/API/Cocoa/WebKit.h:
3097         * Shared/Cocoa/APIObject.mm:
3098         (API::Object::newObject):
3099         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataRecord.h.
3100         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm: Renamed from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm.
3101         (-[WKWebsiteDataRecord dealloc]):
3102         (dataTypesToString):
3103         (-[WKWebsiteDataRecord description]):
3104         (-[WKWebsiteDataRecord displayName]):
3105         (-[WKWebsiteDataRecord dataTypes]):
3106         (-[WKWebsiteDataRecord _apiObject]):
3107         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h.
3108         (WebKit::wrapper):
3109         (WebKit::toWebsiteDataTypes):
3110         (WebKit::toWKWebsiteDataTypes):
3111         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
3112         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
3113         (toWebsiteDataRecords):
3114         * WebKit2.xcodeproj/project.pbxproj:
3115
3116 2015-04-13  Jer Noble  <jer.noble@apple.com>
3117
3118         [Fullscreen] ChromeClient::exitVideoFullscreen() should take a pointer to a HTMLVideoElement.
3119         https://bugs.webkit.org/show_bug.cgi?id=143674
3120
3121         Reviewed by Darin Adler.
3122
3123         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3124         (WebKit::WebChromeClient::enterVideoFullscreenForVideoElement): Takes a reference.
3125         (WebKit::WebChromeClient::exitVideoFullscreenForVideoElement): Renamed from exitVideoFullscreen().
3126         (WebKit::WebChromeClient::exitVideoFullscreen): Deleted.
3127         * WebProcess/WebCoreSupport/WebChromeClient.h:
3128         * WebProcess/ios/WebVideoFullscreenManager.h:
3129         * WebProcess/ios/WebVideoFullscreenManager.mm:
3130         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): Ditto.
3131         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement): Renamed from exitVideoFullscreen().
3132         (WebKit::WebVideoFullscreenManager::didEnterFullscreen): Pass a reference.
3133         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): Ditto.
3134         (WebKit::WebVideoFullscreenManager::exitVideoFullscreen): Deleted.
3135
3136 2015-04-15  Antti Koivisto  <antti@apple.com>
3137
3138         Network Cache: Inline small body data to record file
3139         https://bugs.webkit.org/show_bug.cgi?id=143783
3140
3141         Reviewed by Chris Dumez.
3142
3143         We currently save all body data as separate files. We can improve space efficiency and do less reads and writes
3144         by inlining smaller resource bodies with the header.
3145
3146         * NetworkProcess/cache/NetworkCacheIOChannel.h:
3147         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
3148         (WebKit::NetworkCache::IOChannel::read):
3149         (WebKit::NetworkCache::IOChannel::readSync):
3150         (WebKit::NetworkCache::IOChannel::write):
3151
3152             Add WorkQueue argument to allow specifying which queue the result is submitted to.
3153
3154         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3155         (WebKit::NetworkCache::decodeRecordMetaData):
3156
3157             Add a boolean indicating whether the body is inlined.
3158
3159         (WebKit::NetworkCache::decodeRecordHeader):
3160         (WebKit::NetworkCache::Storage::decodeRecord):
3161         (WebKit::NetworkCache::encodeRecordMetaData):
3162         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
3163         (WebKit::NetworkCache::Storage::encodeRecord):
3164         (WebKit::NetworkCache::Storage::dispatchReadOperation):
3165
3166             Read the record first, then read the blob if needed.
3167             Submit the read operation directly from the main queue. Only thing we do is opening an IO channel
3168             and that uses O_NONBLOCK.
3169             Process the read results in the IO work queue where we now do the blob retrieval.
3170
3171         (WebKit::NetworkCache::shouldStoreBodyAsBlob):
3172
3173             The current threshold for saving a separate blob is 16KB.
3174
3175         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
3176         (WebKit::NetworkCache::Storage::traverse):
3177         (WebKit::NetworkCache::createRecord): Deleted.
3178         (WebKit::NetworkCache::encodeRecordHeader): Deleted.
3179         * NetworkProcess/cache/NetworkCacheStorage.h:
3180
3181 2015-04-15  Tim Horton  <timothy_horton@apple.com>
3182
3183         Non-local keyboards don't update scroll view parameters
3184         https://bugs.webkit.org/show_bug.cgi?id=143791
3185         <rdar://problem/18974020>
3186
3187         * Platform/spi/ios/UIKitSPI.h:
3188         Fix the build.
3189
3190 2015-04-15  Tim Horton  <timothy_horton@apple.com>
3191
3192         Non-local keyboards don't update scroll view parameters
3193         https://bugs.webkit.org/show_bug.cgi?id=143791
3194         <rdar://problem/18974020>
3195
3196         Reviewed by Enrica Casucci.
3197
3198         * UIProcess/API/Cocoa/WKWebView.mm:
3199         (-[WKWebView _shouldUpdateKeyboardWithInfo:]):
3200         (-[WKWebView _keyboardWillChangeFrame:]):
3201         (-[WKWebView _keyboardWillShow:]):
3202         Make sure that we update scroll view parameters (obscured insets, etc.)
3203         if we have a non-local keyboard, in addition to the cases where we have an assisted node.
3204
3205 2015-04-15  Dan Bernstein  <mitz@apple.com>
3206
3207         <rdar://problem/20549298> No matching __NSi_ definition for postprocessed value of WK_{MAC,IOS}_TBA
3208         https://bugs.webkit.org/show_bug.cgi?id=143786
3209
3210         Reviewed by Anders Carlsson.
3211
3212         * Shared/API/Cocoa/WKFoundation.h: Added a placeholder for the postprocessing script to
3213         insert a definition of __NSi_* for the current deployment target. Import CoreFoundation.h so
3214         that we can check if the macro is already defined.
3215         * WebKit2.xcodeproj/project.pbxproj: In the Postprocess WKFoundation.h script build phase,
3216         replace the placeholder with a definition of __NSi_{current deployment target} if not
3217         already defined.
3218
3219 2015-04-14  Anders Carlsson  <andersca@apple.com>
3220
3221         Make creating send rights from shared memory more robust
3222         https://bugs.webkit.org/show_bug.cgi?id=143730
3223         rdar://problem/16595870
3224
3225         Reviewed by Darin Adler.
3226
3227         This cleans up creation of handles and send rights and also fixes a bug where it would be impossible
3228         to send more than 128 MB of shared memory in a single object.
3229
3230         * Platform/SharedMemory.h:
3231         * Platform/mac/SharedMemoryMac.cpp:
3232         (WebKit::makeMemoryEntry):
3233         New helper function that creates a memory entry send right. This uses MAP_MEM_VM_SHARE which ensures
3234         that memory objects larger than 128 MB will be handled correctly.
3235
3236         (WebKit::SharedMemory::create):
3237         Call makeMemoryEntry.
3238
3239         (WebKit::SharedMemory::createHandle):
3240         Call createSendRight.
3241
3242         (WebKit::SharedMemory::createSendRight):
3243         Call makeMemoryEntry and add the necessary assertions.
3244
3245 2015-04-15  Eric Carlson  <eric.carlson@apple.com>
3246
3247         Generalize "isPlayingAudio" to include other media characteristics
3248         https://bugs.webkit.org/show_bug.cgi?id=143713
3249
3250         Reviewed by Jer Noble.
3251
3252         * UIProcess/API/C/WKPage.cpp:
3253         (toGenericCallbackFunction): Scope CallbackBase.
3254         (WKPageForceRepaint): Ditto.
3255         (WKPageValidateCommand): Ditto.
3256         (WKPageComputePagesForPrinting): Ditto.
3257
3258         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
3259         (-[_WKThumbnailView _requestSnapshotIfNeeded]): Ditto.
3260
3261         * UIProcess/API/mac/WKView.mm:
3262         (-[WKView becomeFirstResponder]): Ditto.
3263         (-[WKView updateFontPanelIfNeeded]): Ditto.
3264         (-[WKView validateUserInterfaceItem:]): Ditto.
3265         (-[WKView startSpeaking:]): Ditto.
3266         (-[WKView selectedRangeWithCompletionHandler:]): Ditto.
3267         (-[WKView markedRangeWithCompletionHandler:]): Ditto.
3268         (-[WKView hasMarkedTextWithCompletionHandler:]): Ditto.
3269         (-[WKView attributedSubstringForProposedRange:completionHandler:]): Ditto.
3270         (-[WKView firstRectForCharacterRange:completionHandler:]): Ditto.
3271         (-[WKView characterIndexForPoint:completionHandler:]): Ditto.
3272
3273         * UIProcess/WebPageProxy.cpp:
3274         (WebKit::WebPageProxy::isPlayingMediaDidChange): Rename from isPlayingAudioDidChange.
3275         (WebKit::WebPageProxy::isPlayingAudioDidChange): Deleted.
3276         * UIProcess/WebPageProxy.h:
3277
3278         * UIProcess/WebPageProxy.messages.in:
3279
3280         * UIProcess/mac/WKFullScreenWindowController.mm:
3281         (-[WKFullScreenWindowController dealloc]): Scope CallbackBase.
3282         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Ditto.
3283
3284         * UIProcess/mac/WKPrintingView.mm:
3285         (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): Ditto.
3286         (-[WKPrintingView _askPageToComputePageRects]): Ditto.
3287         (-[WKPrintingView _drawPreview:]): Ditto.
3288
3289         * WebProcess/Plugins/PluginView.cpp:
3290         (WebKit::PluginView::setPluginIsPlayingAudio):
3291         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3292         (WebKit::WebChromeClient::isPlayingMediaDidChange):
3293         (WebKit::WebChromeClient::isPlayingAudioDidChange): Deleted.
3294         * WebProcess/WebCoreSupport/WebChromeClient.h:
3295
3296 2015-04-15  Antti Koivisto  <antti@apple.com>
3297
3298         Network Cache: Add thread-safe accessors for storage paths
3299         https://bugs.webkit.org/show_bug.cgi?id=143668
3300
3301         Reviewed by Darin Adler.
3302
3303         Less need to use StringCapture.
3304
3305         * NetworkProcess/cache/NetworkCache.cpp:
3306         (WebKit::NetworkCache::Cache::dumpFilePath):
3307         (WebKit::NetworkCache::Cache::storagePath):
3308         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3309         (WebKit::NetworkCache::makeRecordsDirectoryPath):
3310         (WebKit::NetworkCache::Storage::Storage):
3311         (WebKit::NetworkCache::Storage::basePath):
3312         (WebKit::NetworkCache::Storage::versionPath):
3313         (WebKit::NetworkCache::Storage::recordsPath):
3314         (WebKit::NetworkCache::Storage::synchronize):
3315         (WebKit::NetworkCache::Storage::remove):
3316         (WebKit::NetworkCache::Storage::dispatchReadOperation):
3317         (WebKit::NetworkCache::Storage::finishReadOperation):
3318         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
3319         (WebKit::NetworkCache::Storage::traverse):
3320         (WebKit::NetworkCache::Storage::clear):
3321         (WebKit::NetworkCache::Storage::shrink):
3322         (WebKit::NetworkCache::Storage::deleteOldVersions):
3323         (WebKit::NetworkCache::makeRecordDirectoryPath): Deleted.
3324         * NetworkProcess/cache/NetworkCacheStorage.h:
3325         (WebKit::NetworkCache::Storage::baseDirectoryPath): Deleted.
3326         (WebKit::NetworkCache::Storage::directoryPath): Deleted.
3327
3328 2015-04-14  Tim Horton  <timothy_horton@apple.com>
3329
3330         Update gesture swipe shadow style
3331         https://bugs.webkit.org/show_bug.cgi?id=143616
3332         <rdar://problem/19295843>
3333
3334         Reviewed by Darin Adler.
3335
3336         * UIProcess/mac/ViewGestureController.h:
3337         * UIProcess/mac/ViewGestureControllerMac.mm:
3338         (WebKit::ViewGestureController::beginSwipeGesture):
3339         For the modern shadow style, use a layer stretched along the edge of the swiping content
3340         with the newly added PNGs as the layer contents.
3341
3342         Add a dimming layer over the lower layer of content which fades in/out
3343         during the swipe.
3344
3345         (WebKit::ViewGestureController::handleSwipeGesture):
3346         Fade the dimming layer in and out during the entire swipe.
3347         Fade the shadow layer out during the last few pixels of the swipe.
3348
3349         (WebKit::ViewGestureController::removeSwipeSnapshot):
3350         Unparent the new layers.
3351
3352         * WebKit2.xcodeproj/project.pbxproj:
3353         * Resources/SwipeShadow.png:
3354         * Resources/SwipeShadow@2x.png:
3355         Add the new resources.
3356
3357 2015-04-14  Brian Weinstein  <bweinstein@apple.com>
3358
3359         Add SPI to clear HSTS hosts added since a date.
3360         https://bugs.webkit.org/show_bug.cgi?id=143726
3361         and
3362         rdar://problem/16664597
3363
3364         Reviewed by Anders Carlsson.
3365
3366         * UIProcess/API/C/mac/WKContextPrivateMac.h:
3367         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
3368         (WKContextResetHSTSHostsAddedAfterDate): Call into the WebProcessPool.
3369         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3370         (WebKit::WebProcessPool::resetHSTSHostsAddedAfterDate): Call CFNetwork SPI to clear HSTS hosts added
3371         after the given date.
3372         * UIProcess/WebProcessPool.h:
3373
3374 2015-04-14  Anders Carlsson  <andersca@apple.com>
3375
3376         More work on making the SharedMemory interface more sane
3377         https://bugs.webkit.org/show_bug.cgi?id=143718
3378
3379         Reviewed by Andreas Kling.
3380
3381         Get rid of m_shouldVMDeallocateData. The idea is that shared memory created by calling
3382         SharedMemory::allocate has a non-null m_data pointer, and a null m_port. Shared memory created
3383         by calling SharedMemory::create with a pointer and a length has a non-null port but a null m_data
3384         since the data can be unmapped by the caller and we don't want to hold on to dangling pointers.
3385
3386         * Platform/SharedMemory.h:
3387         (WebKit::SharedMemory::data):
3388         * Platform/mac/SharedMemoryMac.cpp:
3389         (WebKit::SharedMemory::allocate):
3390         (WebKit::SharedMemory::create):
3391         (WebKit::SharedMemory::map):
3392         (WebKit::SharedMemory::~SharedMemory):
3393         (WebKit::SharedMemory::createHandle):
3394
3395 2015-04-14  Antti Koivisto  <antti@apple.com>
3396
3397         Network Cache: Deduplicate body data
3398         https://bugs.webkit.org/show_bug.cgi?id=143652
3399
3400         Reviewed by Darin Adler.
3401
3402         It is common to have cache entries with identical body data. This happens when the same resource is loaded from
3403         a different URL (https vs http, slash vs no-slash at end, etc.). It also happens when the same URL is
3404         referenced from different cache partitions.
3405
3406         We can improve disk space efficiency and use less memory by sharing identical body data between cache entries.
3407
3408         This patch splits the body data out from the record file. The new record file contains meta data and response
3409         headers only. Body data is stored using the new BlobStorage interface. Files are deduplicated by computing
3410         SHA1 hash over the data and looking for an existing blob with the same hash. If found the existing entry
3411         is reused by creating a hard link to it.
3412
3413         The new disk structure looks like this:
3414
3415         WebKitCache/
3416             Version 3/
3417                 Blobs/
3418                     0A3C9A970ADA27FAE9BD7BC630BAD0B929C293C0
3419                     0A6B8060BA77DF92C82A2FD7AF58F79524D8F34C
3420                     ...
3421                 Records/
3422                     apple.com/
3423                         0B8645B04E7EC78C178B7460052601C2
3424                         0B8645B04E7EC78C178B7460052601C2-body
3425                         0CB1A3638D1C5A09C5E3283A74FA040B
3426                         0CB1A3638D1C5A09C5E3283A74FA040B-body
3427                         ...
3428
3429         Each record file has an associated -body which is a hard link to a file in the Blobs directory.
3430
3431         The patch increases effective capacity by 10-20% with a typical cache. It also saves memory especially when identical
3432         resources are used in multiple tabs.
3433
3434         Currently all >0 sized resources are stored as shared blobs. In future small resources should be integrated into record
3435         files and blobs used for larger files only.
3436
3437         * NetworkProcess/cache/NetworkCache.cpp:
3438         (WebKit::NetworkCache::Cache::store):
3439         (WebKit::NetworkCache::Cache::update):
3440
3441             Adopt the new storage interface.
3442
3443         (WebKit::NetworkCache::Cache::dumpContentsToFile):
3444         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: Added.
3445         (WebKit::NetworkCache::BlobStorage::BlobStorage):
3446         (WebKit::NetworkCache::BlobStorage::synchronize):
3447
3448             Compute size and delete unused files from the Blobs directory (link count == 1).
3449
3450         (WebKit::NetworkCache::BlobStorage::blobPath):
3451         (WebKit::NetworkCache::BlobStorage::add):
3452         (WebKit::NetworkCache::BlobStorage::get):
3453
3454             Interface for storing and retrieving data blobs. Blobs are deduplicated on add.
3455
3456         (WebKit::NetworkCache::BlobStorage::remove):
3457