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