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