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