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