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