Source/WebCore:
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-03-24  Dan Bernstein  <mitz@apple.com>
2
3         WebKit2 part of <rdar://problem/20282863> Transforms are flattened in snapshots of on-screen WKWebViews
4         https://bugs.webkit.org/show_bug.cgi?id=143023
5
6         Reviewed by Tim Horton.
7
8         * UIProcess/API/Cocoa/WKWebView.mm:
9         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): If the view is in a
10         window, use CARenderServerRenderLayerWithTransform to synchronously capture a snapshot of
11         its layer tree into an IOSurfcae, then call the completion handler with an image created
12         from the IOSurface.
13
14 2015-03-24  Beth Dakin  <bdakin@apple.com>
15
16         Add events related to force click gesture
17         https://bugs.webkit.org/show_bug.cgi?id=142836
18         -and corresponding-
19         rdar://problem/20210239
20
21         Reviewed by Dean Jackson.
22
23         ActionMenuHitTestResult has a new bool indicating whether to not the HitTestResult 
24         will prevent default. 
25         * Shared/mac/ActionMenuHitTestResult.h:
26         * Shared/mac/ActionMenuHitTestResult.mm:
27         (WebKit::ActionMenuHitTestResult::encode):
28         (WebKit::ActionMenuHitTestResult::decode):
29
30         Send immediateActionDidUpdate and the normalized force over the the WebProcess.
31         * UIProcess/WebPageProxy.cpp:
32         (WebKit::WebPageProxy::immediateActionDidUpdate):
33         * UIProcess/WebPageProxy.h:
34
35         We need a dummy animation controller when web content is overriding the default 
36         behavior.
37         * UIProcess/mac/WKImmediateActionController.mm:
38
39         Send along the update information.
40         (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
41
42         Use the dummy animation controller if default has been prevented.
43         (-[WKImmediateActionController _defaultAnimationController]):
44         (-[WKImmediateActionController _updateImmediateActionItem]):
45
46         Keep track of whether m_lastActionMenuHitTes prevented the default immediate 
47         action behavior.
48         * WebProcess/WebPage/WebPage.cpp:
49         (WebKit::WebPage::WebPage):
50         * WebProcess/WebPage/WebPage.h:
51         * WebProcess/WebPage/WebPage.messages.in:
52
53         Call dispatchMouseForceMayBegin() at hit test time.
54         * WebProcess/WebPage/mac/WebPageMac.mm:
55         (WebKit::WebPage::performActionMenuHitTestAtLocation):
56
57         Call dispatchMouseForceChanged() if appropriate.
58         (WebKit::WebPage::immediateActionDidUpdate):
59
60         Call dispatchMouseForceCancelled() if appropriate.
61         (WebKit::WebPage::immediateActionDidCancel):
62
63         Call dispatchMouseForceDown() if appropriate.
64         (WebKit::WebPage::immediateActionDidComplete):
65
66 2015-03-24  Anders Carlsson  <andersca@apple.com>
67
68         Fix designated initializer violations
69         https://bugs.webkit.org/show_bug.cgi?id=143016
70         rdar://problem/20268858
71
72         Reviewed by Dan Bernstein.
73
74         Move -[WKProcessPool _initWithConfiguration:] to a class extension so we can make it the designated initializer.
75
76         * UIProcess/API/Cocoa/WKProcessPool.mm:
77         (-[WKProcessPool _initWithConfiguration:]):
78         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
79
80 2015-03-24  Chris Dumez  <cdumez@apple.com>
81
82         [WK2] Responses with 404 HTTP Status Code should be cacheable by default
83         https://bugs.webkit.org/show_bug.cgi?id=143014
84         <rdar://problem/20280310>
85
86         Reviewed by Antti Koivisto.
87
88         Make responses with 404 HTTP Status Code cacheable by default, as
89         per RFC 7231:
90         http://tools.ietf.org/html/rfc7231#section-6.5.4
91
92         Test: http/tests/cache/disk-cache/disk-cache-404-status-code.html
93
94         * NetworkProcess/cache/NetworkCache.cpp:
95         (WebKit::NetworkCache::canStore):
96
97 2015-03-24  Chris Dumez  <cdumez@apple.com>
98
99         [WK2] Remove NetworkCache FIXME comment about caching responses to OPTIONS requests
100         https://bugs.webkit.org/show_bug.cgi?id=143009
101
102         Reviewed by Andreas Kling.
103
104         Remove NetworkCache FIXME comment about caching responses to OPTIONS
105         method as RFC 7234 says "Responses to the OPTIONS method are not
106         cacheable" [1].
107
108         [1] http://tools.ietf.org/html/rfc7231#page-31
109
110         * NetworkProcess/cache/NetworkCache.cpp:
111         (WebKit::NetworkCache::canRetrieve):
112
113 2015-03-24  Chris Dumez  <cdumez@apple.com>
114
115         [WK2] NetworkCache retrievals fail for entries with no body
116         https://bugs.webkit.org/show_bug.cgi?id=142979
117         <rdar://problem/20264100>
118
119         Reviewed by Antti Koivisto.
120
121         NetworkCache retrievals were failing for entries with no body because
122         decodeEntry() doesn't correctly handle this case. In particular, the
123         following check fails:
124         "metaData.bodyOffset + metaData.bodySize == fileData.size()".
125         This is because bodyOffset is pageSize-aligned.
126
127         As a result, the following resource on apple.com is stored in the cache
128         but we fail to reuse it and reload it from the network every time:
129         http://images.apple.com/home/styles/promos.css
130
131         This patch updates decodeEntry() to create a null Data object for the
132         body if bodySize is 0.
133
134         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
135         (WebKit::NetworkCache::Data::data):
136         Do not attempt to initialize m_data if m_dispatchData is null as the
137         call to dispatch_data_create_map() would then crash. We now return
138         null in this case. This is needed as decodeStorageEntry() in
139         NetworkCache.cpp constructs a SharedBuffer from
140         storageEntry.body.data() and the body may be null.
141
142         * NetworkProcess/cache/NetworkCacheStorage.cpp:
143         (WebKit::NetworkCache::decodeEntry):
144
145 2015-03-24  Chris Dumez  <cdumez@apple.com>
146
147         [WK2] The WebKit network cache does not cache responses with "Content-Disposition: attachment" header
148         https://bugs.webkit.org/show_bug.cgi?id=142989
149         <rdar://problem/20265992>
150
151         Reviewed by Antti Koivisto.
152
153         Update our WebKit network cache policy to cache responses with
154         "Content-Disposition: attachment" header. There is no reason we cannot
155         cache these and our memory cache already does.
156
157         This was causing a decent amount of cache misses in the wild. I have
158         noticed for example that when loading disney.com, we fail to cache the
159         following resources because of this policy:
160         http://pagead2.googlesyndication.com/pagead/osd.js
161         http://pagead2.googlesyndication.com/pagead/show_companion_ad.js
162
163         Those resources have Cache-Control headers that indicate they are meant
164         to be cacheable.
165
166         Test: http/tests/cache/disk-cache-validation-attachment.html
167
168         * NetworkProcess/cache/NetworkCache.cpp:
169         (WebKit::NetworkCache::canStore):
170
171 2015-03-23  Joseph Pecoraro  <pecoraro@apple.com>
172
173         Unreviewed, another attempt to fix 32-bit build after r181881.
174
175         * UIProcess/WebInspectorProxy.h:
176
177 2015-03-23  Joseph Pecoraro  <pecoraro@apple.com>
178
179         Unreviewed, attempt to fix 32-bit build after r181881.
180
181         * UIProcess/API/Cocoa/WKViewPrivate.h:
182         * UIProcess/API/mac/WKView.mm:
183
184 2015-03-19  Timothy Hatcher  <timothy@apple.com>
185
186         Web Inspector: Support attaching to another view other than the WKView
187         https://bugs.webkit.org/show_bug.cgi?id=142892
188
189         Reviewed by Tim Horton.
190
191         * UIProcess/API/C/WKInspector.cpp:
192         (WKInspectorAttach): Drive by fix so it used the last attachment side.
193
194         * UIProcess/API/Cocoa/WKViewPrivate.h:
195         * UIProcess/API/mac/WKView.mm:
196         (-[WKView _inspectorAttachmentView]): Added.
197         (-[WKView _setInspectorAttachmentView:]): Added.
198
199         * UIProcess/WebInspectorProxy.cpp:
200         (WebKit::WebInspectorProxy::createInspectorPage):
201         (WebKit::WebInspectorProxy::attachAvailabilityChanged):
202         Use platformCanAttach as a final check incase there is a different
203         attachment view that the platform knows about.
204
205         * UIProcess/WebInspectorProxy.h:
206         (WebKit::WebInspectorProxy::attachmentSide): Added.
207         (WebKit::WebInspectorProxy::platformCanAttach): Added.
208
209         * UIProcess/mac/WebInspectorProxyMac.mm:
210         (WebKit::WebInspectorProxy::attachmentViewDidChange): Added.
211         (WebKit::WebInspectorProxy::closeTimerFired):
212         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
213         (WebKit::WebInspectorProxy::platformCanAttach):
214         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
215         (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
216         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
217         (WebKit::WebInspectorProxy::platformAttach):
218         (WebKit::WebInspectorProxy::platformDetach):
219         Use the _inspectorAttachmentView and change how the frame change notification
220         is observed and follow the attachment view as it changes.
221
222 2015-03-23  Tim Horton  <timothy_horton@apple.com>
223
224         Images shared to photos via action menu are padded with zeroes at the end
225         https://bugs.webkit.org/show_bug.cgi?id=142985
226
227         Reviewed by Anders Carlsson.
228
229         * Shared/mac/ActionMenuHitTestResult.h:
230         * Shared/mac/ActionMenuHitTestResult.mm:
231         (WebKit::ActionMenuHitTestResult::encode):
232         (WebKit::ActionMenuHitTestResult::decode):
233         * WebProcess/WebPage/mac/WebPageMac.mm:
234         (WebKit::WebPage::performActionMenuHitTestAtLocation):
235         Send the size of the image separately from the SharedMemory.
236         The SharedMemory's size can be rounded up, so we need to keep the original
237         size around in order to write the data to disk.
238
239         * UIProcess/mac/WKActionMenuController.mm:
240         (-[WKActionMenuController _hitTestResultImage]):
241         (-[WKActionMenuController _addImageToPhotos:]):
242         Use the image size instead of the SharedMemory size.
243
244 2015-03-23  Enrica Casucci  <enrica@apple.com>
245
246         [iOS] WebContent crash attempting to select text with a gesture at RenderObject::absoluteBoundingBoxRect.
247         https://bugs.webkit.org/show_bug.cgi?id=142913
248         rdar://problem/16400033
249
250         Reviewed by Sam Weinig.
251
252         When looking for the best candidate range at the given position,
253         we should skip nodes that don't have a renderer.
254         This is a speculative fix.
255
256         * WebProcess/WebPage/ios/WebPageIOS.mm:
257         (WebKit::WebPage::rangeForWebSelectionAtPosition):
258
259 2015-03-23  Alexey Proskuryakov  <ap@apple.com>
260
261         REGRESSION (Yosemite): WKView visibility notifications are messed up
262         https://bugs.webkit.org/show_bug.cgi?id=142945
263
264         Reviewed by Tim Horton.
265
266         As these notifications cannot be used by NSView subclasses, create a separate
267         object for observing them.
268
269         * UIProcess/API/mac/WKView.mm:
270         (-[WKWindowVisibilityObserver initWithView:]):
271         (-[WKWindowVisibilityObserver startObserving:]):
272         (-[WKWindowVisibilityObserver stopObserving:]):
273         (-[WKWindowVisibilityObserver _windowDidOrderOnScreen:]):
274         (-[WKWindowVisibilityObserver _windowDidOrderOffScreen:]):
275         (-[WKView addWindowObserversForWindow:]):
276         (-[WKView removeWindowObservers]): Also, don't try to remove NSWindowWillOrderOffScreenNotification,
277         which we never start to observe.
278         (-[WKView initWithFrame:processPool:configuration:webView:]):
279         * UIProcess/API/mac/WKViewInternal.h:
280
281 2015-03-23  Anders Carlsson  <andersca@apple.com>
282
283         Make platform/mac-wk2/plugins/destroy-during-async-npp-new.html work again.
284         https://bugs.webkit.org/show_bug.cgi?id=133692
285         rdar://problem/17255947
286
287         Reviewed by Alexey Proskuryakov.
288
289         Add plug-in destruction protectors around message receiver code that can call out to NPObjects or JavaScript
290         where we need the plug-in to stay around after the call.
291
292         * Shared/Plugins/NPObjectMessageReceiver.cpp:
293         (WebKit::NPObjectMessageReceiver::invoke):
294         (WebKit::NPObjectMessageReceiver::invokeDefault):
295         (WebKit::NPObjectMessageReceiver::getProperty):
296         (WebKit::NPObjectMessageReceiver::setProperty):
297         (WebKit::NPObjectMessageReceiver::construct):
298
299 2015-03-23  Anders Carlsson  <andersca@apple.com>
300
301         Put the WK_NULLABLE_SPECIFIER in the right place for block parameters
302         https://bugs.webkit.org/show_bug.cgi?id=142975
303         rdar://problem/19863930
304
305         Reviewed by Dan Bernstein.
306
307         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
308         * UIProcess/API/Cocoa/WKUIDelegate.h:
309         * UIProcess/API/Cocoa/WKWebView.h:
310
311 2015-03-23  Tim Horton  <timothy_horton@apple.com>
312
313         Add a share item to the link action menu
314         https://bugs.webkit.org/show_bug.cgi?id=142961
315         <rdar://problem/19198374>
316
317         Reviewed by Beth Dakin.
318
319         * UIProcess/mac/WKActionMenuController.mm:
320         (-[WKActionMenuController _hitLinkURL]):
321         Factor out _hitLinkURL from various places.
322
323         (-[WKActionMenuController _openURLFromActionMenu:]):
324         (-[WKActionMenuController _addToReadingListFromActionMenu:]):
325         (-[WKActionMenuController _defaultMenuItemsForVideo]):
326         (-[WKActionMenuController _defaultMenuItemsForImage]):
327         (-[WKActionMenuController _createActionMenuItemForTag:]):
328         (-[WKActionMenuController _createShareActionMenuItemForTag:withItems:]):
329         Adopt -[NSMenuItem standardShareMenuItemWithItems].
330         All of the null-checking is unnecessary as it's impossible to enter
331         these functions with a null image/etc.
332
333         (-[WKActionMenuController _defaultMenuItemsForLink]):
334         * Shared/API/c/WKActionMenuItemTypes.h:
335         Add a 'Share' item to the link menu.
336
337 2015-03-23  Zan Dobersek  <zdobersek@igalia.com>
338
339         [GTK] Use std::abs() in ClickCounter::currentClickCountForGdkButtonEvent()
340         https://bugs.webkit.org/show_bug.cgi?id=142964
341
342         Reviewed by Carlos Garcia Campos.
343
344         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
345         (ClickCounter::currentClickCountForGdkButtonEvent): Use the STL's std::abs()
346         instead of C's abs(). The templated nature of std::abs() ensures the proper
347         computation that matches the types of the passed-in values, and shuts down
348         a warning when compiling with Clang.
349
350 2015-03-23  Zan Dobersek  <zdobersek@igalia.com>
351
352         [GTK][WK2] webkitBackForwardListChanged() should operate on a Vector reference
353         https://bugs.webkit.org/show_bug.cgi?id=142963
354
355         Reviewed by Carlos Garcia Campos.
356
357         * UIProcess/API/gtk/WebKitBackForwardList.cpp:
358         (webkitBackForwardListChanged): This function only reads from the passed-in
359         Vector of removed items, so only a const lvalue reference to the Vector
360         is needed.
361         * UIProcess/API/gtk/WebKitBackForwardListPrivate.h:
362
363 2015-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
364
365         [GTK] Add a configure option to build without Redirected XComposite Window
366         https://bugs.webkit.org/show_bug.cgi?id=142865
367
368         Reviewed by Žan Doberšek.
369
370         Use USE(REDIRECTED_XCOMPOSITE_WINDOW) instead of
371         USE(TEXTURE_MAPPER_GL) && PLATFORM(X11).
372
373         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
374         (webkitWebViewBaseRealize): Use the XID of the WebKitWebView
375         window as native surface handle when REDIRECTED_XCOMPOSITE_WINDOW
376         is disabled.
377         (webkitWebViewRenderAcceleratedCompositingResults):
378         (resizeWebKitWebViewBaseFromAllocation):
379         (webkitWebViewBaseEnterAcceleratedCompositingMode):
380         (webkitWebViewBaseExitAcceleratedCompositingMode):
381         * UIProcess/gtk/RedirectedXCompositeWindow.cpp:
382         * UIProcess/gtk/RedirectedXCompositeWindow.h:
383
384 2015-03-22  Eric Carlson  <eric.carlson@apple.com>
385
386         [Mac] Enable WIRELESS_PLAYBACK_TARGET for WK1
387         https://bugs.webkit.org/show_bug.cgi?id=142940
388
389         Reviewed by Sam Weinig.
390
391         * WebProcess/WebPage/mac/WebPageMac.mm:
392         (WebKit::WebPage::playbackTargetSelected): Argument to didChoosePlaybackTarget is now const.
393
394 2015-03-22  Anders Carlsson  <andersca@apple.com>
395
396         _WKWebsiteDataStore should clear WebSQL databases
397         https://bugs.webkit.org/show_bug.cgi?id=142947
398         rdar://problem/20242174
399
400         Reviewed by Sam Weinig.
401
402         * Shared/WebsiteData/WebsiteDataTypes.h:
403         Add WebsiteDataTypeWebSQLDatabases.
404
405         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
406         (API::WebsiteDataStore::defaultDataStoreConfiguration):
407         Initialize configuration.webSQLDatabaseDirectory.
408
409         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
410         Add WKWebsiteDataTypeWebSQLDatabases.
411
412         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm:
413         (dataTypesToString):
414         Handle WKWebsiteDataTypeWebSQLDatabases.
415
416         * UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h:
417         (WebKit::toWebsiteDataTypes):
418         (WebKit::toWKWebsiteDataTypes):
419         Handle WKWebsiteDataTypeWebSQLDatabases and WebsiteDataTypes::WebsiteDataTypeWebSQLDatabases.
420
421         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
422         (WebKit::WebsiteDataStore::WebsiteDataStore):
423         Initialize m_webSQLDatabaseDirectory and add a queue member variable.
424
425         (WebKit::WebsiteDataStore::fetchData):
426         Fetch database origins.
427     
428         (WebKit::WebsiteDataStore::removeData):
429         Remove databases.
430
431         * UIProcess/WebsiteData/WebsiteDataStore.h:
432         Add new members.
433
434 2015-03-22  Dan Bernstein  <mitz@apple.com>
435
436         [iOS] Expose WebPageProxy::setInitialFocus as SPI
437         https://bugs.webkit.org/show_bug.cgi?id=142951
438
439         Reviewed by Anders Carlsson.
440
441         * UIProcess/API/Cocoa/WKWebView.mm:
442         (-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): New SPI.
443         Just calls through to WKWebContentView, but allows a nil completion handler.
444         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
445
446         * UIProcess/API/mac/WKView.mm:
447         (-[WKView becomeFirstResponder]): Pass an empty lambda for the new callback parameter to
448         WebPageProxy::setInitialFocus.
449
450         * UIProcess/WebPageProxy.cpp:
451         (WebKit::WebPageProxy::setInitialFocus): Added a void callback parameter and made sure to
452         call it.
453         * UIProcess/WebPageProxy.h:
454
455         * UIProcess/ios/WKContentViewInteraction.h:
456         * UIProcess/ios/WKContentViewInteraction.mm:
457         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
458         Added. Calls WebPageProxy::setInitialFocus, and once that completes, checks if anything was
459         focused and if so, becomes first responder, then calls the completion handler.
460
461         * WebProcess/WebPage/WebPage.cpp:
462         (WebKit::WebPage::setInitialFocus): Added a callbackID parameter, and made sure to send the
463         callback message. Added a temporary change of m_userIsInteracting to true, so that the UI
464         process won’t ignore any StartAssistingNode message resulting from the focus change.
465         * WebProcess/WebPage/WebPage.h:
466
467         * WebProcess/WebPage/WebPage.messages.in: Added a callbackID parameter to SetInitialFocus.
468
469 2015-03-21  Dean Jackson  <dino@apple.com>
470
471         Remove the prefix for CSS Transforms
472         https://bugs.webkit.org/show_bug.cgi?id=142927
473         <rdar://problem/11568151>
474
475         Reviewed by Simon Fraser.
476
477         Rename AnimatedPropertyWebkitTransform to AnimatedPropertyTransform.
478
479         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
480         (IPC::ArgumentCoder<TextureMapperAnimation>::encode):
481
482 2015-03-21  Csaba Osztrogonác  <ossy@webkit.org>
483
484         [EFL][GTK] Make WebKit2's generate-forwarding-headers.pl less verbose
485         https://bugs.webkit.org/show_bug.cgi?id=142908
486
487         Reviewed by Žan Doberšek.
488
489         * Scripts/generate-forwarding-headers.pl:
490         (createForwardingHeadersForFramework):
491
492 2015-03-21  Commit Queue  <commit-queue@webkit.org>
493
494         Unreviewed, rolling out r181824.
495         https://bugs.webkit.org/show_bug.cgi?id=142935
496
497         Broke Windows build (Requested by ap on #webkit).
498
499         Reverted changeset:
500
501         "Remove the prefix for CSS Transforms"
502         https://bugs.webkit.org/show_bug.cgi?id=142927
503         http://trac.webkit.org/changeset/181824
504
505 2015-03-20  Dean Jackson  <dino@apple.com>
506
507         Remove the prefix for CSS Transforms
508         https://bugs.webkit.org/show_bug.cgi?id=142927
509         <rdar://problem/11568151>
510
511         Reviewed by Simon Fraser.
512
513         Rename AnimatedPropertyWebkitTransform to AnimatedPropertyTransform.
514
515         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
516         (IPC::ArgumentCoder<TextureMapperAnimation>::encode):
517
518 2015-03-20  Chris Dumez  <cdumez@apple.com>
519
520         [WK2] NetworkCache retrievals sometimes fail on browser startup
521         https://bugs.webkit.org/show_bug.cgi?id=142925
522         <rdar://problem/20245368>
523
524         Reviewed by Antti Koivisto.
525
526         NetworkCache retrievals sometimes fail on browser startup for resources
527         that are actually cached. The reason is that we are using a bloom filter
528         for performance reasons to avoid unnecessary disk I/O and this bloom
529         filter is populated on start up in a background thread by traversing the
530         cache files on disk. However, when restoring the tabs on start-up we
531         sometimes query this bloom filter before it is completely populated and
532         we thus fail to retrieve cached entries because we think they don't
533         exist and don't check the disk.
534
535         This patch adds an "isPopulatingContentsFilter" flag that is turned ON
536         on start up while we are populating the bloon filter. We then bypass
537         the bloom filter and send queries directly to disk on start up if this
538         flag is ON.
539
540         * NetworkProcess/cache/NetworkCacheStorage.cpp:
541         (WebKit::NetworkCache::Storage::initialize):
542         (WebKit::NetworkCache::Storage::retrieve):
543         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
544         (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation):
545         * NetworkProcess/cache/NetworkCacheStorage.h:
546         (WebKit::NetworkCache::Storage::cacheMayContain):
547
548 2015-03-20  Chris Dumez  <cdumez@apple.com>
549
550         [WK2] Allow stale content when restoring the browser's session state
551         https://bugs.webkit.org/show_bug.cgi?id=142916
552         <rdar://problem/20243493>
553
554         Reviewed by Darin Adler.
555
556         Allow stale content when restoring the browser's session state
557         (restoring all tabs from previous session), e.g.
558         - Via History > Reopen All windows from previous session on Safari
559         - Happens on startup for MobileSafari
560
561         I have verified that using "Open in tabs" on a bookmarks folder
562         still does fresh loads (rdar://problem/8131355) as it is not using
563         the restoreFromSessionState() code path.
564
565         * UIProcess/WebPageProxy.cpp:
566         (WebKit::WebPageProxy::reattachToWebProcessForReload):
567         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
568         (WebKit::WebPageProxy::goForward):
569         (WebKit::WebPageProxy::goBack):
570         (WebKit::WebPageProxy::goToBackForwardItem):
571         (WebKit::WebPageProxy::restoreFromSessionState):
572         * UIProcess/WebPageProxy.h:
573         * WebProcess/WebPage/WebPage.cpp:
574         (WebKit::WebPage::goToBackForwardItem):
575         * WebProcess/WebPage/WebPage.h:
576         * WebProcess/WebPage/WebPage.messages.in:
577
578 2015-03-20  Beth Dakin  <bdakin@apple.com>
579
580         [Immediate Actions] Should re-enable immediate actions for iBooks
581         https://bugs.webkit.org/show_bug.cgi?id=142915
582         -and corresponding-
583         rdar://problem/19585689
584
585         Reviewed by Tim Horton.
586
587         * UIProcess/API/mac/WKView.mm:
588         (-[WKView initWithFrame:processPool:configuration:webView:]):
589
590 2015-03-20  Alex Christensen  <achristensen@webkit.org>
591
592         Progress towards CMake on Mac.
593         https://bugs.webkit.org/show_bug.cgi?id=136003
594
595         Reviewed by Chris Dumez.
596
597         * PlatformMac.cmake:
598         Add include directories and forwarding headers.
599         * Shared/API/APIObject.h:
600         (API::ObjectImpl::operator new):
601         * UIProcess/DrawingAreaProxy.h:
602         (WebKit::DrawingAreaProxy::intrinsicContentSizeDidChange):
603         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
604         Fix some unused parameter warnings.
605
606 2015-03-20  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
607
608         [CMake] Remove duplicated cmake function calls in WebKit2/CMakeLists.txt
609         https://bugs.webkit.org/show_bug.cgi?id=142901
610
611         Reviewed by Csaba Osztrogonác.
612
613         add_depencencies(), install() can support multiple targets or location.
614         We don't need to call it twice.
615
616         * CMakeLists.txt: Additionaly move -DBUILDING_WEBKIT to PlatformGTK.cmake,
617         because it is only used by GTK port.
618
619 2015-03-20  Zan Dobersek  <zdobersek@igalia.com>
620
621         [GTK] Disable accelerated compositing on Wayland
622         https://bugs.webkit.org/show_bug.cgi?id=142877
623
624         Reviewed by Carlos Garcia Campos.
625
626         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
627         (webkitWebViewBaseCreateWebPage): As was done in the past, we should disable
628         accelerated compositing on Wayland until the proper support for it lands.
629
630 2015-03-19  Andy Estes  <aestes@apple.com>
631
632         [Content Filtering] Add tests for unblock requests
633         https://bugs.webkit.org/show_bug.cgi?id=142900
634
635         Reviewed by Andreas Kling.
636
637         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
638         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Called WebFrameProxy::contentFilterDidBlockLoad.
639         * UIProcess/WebFrameProxy.cpp:
640         (WebKit::WebFrameProxy::didStartProvisionalLoad): Assigned a default-constructed ContentFilterUnblockHandler instead of calling clear().
641         (WebKit::WebFrameProxy::didHandleContentFilterUnblockNavigation): Renamed from contentFilterDidHandleNavigationAction.
642         Updated to use ContentFilterUnblockHandler's new API.
643         (WebKit::WebFrameProxy::contentFilterDidHandleNavigationAction): Deleted.
644         * UIProcess/WebFrameProxy.h:
645         (WebKit::WebFrameProxy::contentFilterDidBlockLoad): Renamed from setContentFilterUnblockHandler.
646         (WebKit::WebFrameProxy::setContentFilterUnblockHandler): Deleted.
647         * UIProcess/WebPageProxy.cpp:
648         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Called WebFrameProxy::didHandleContentFilterUnblockNavigation.
649         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
650         (WebKit::WebFrameLoaderClient::contentFilterDidBlockLoad): If the unblock handler needs the UI process,
651         send WebPageProxy::ContentFilterDidBlockLoadForFrame. Oterwise, call PolicyChecker::setContentFilterUnblockHandler.
652
653 2015-03-20  Zan Dobersek  <zdobersek@igalia.com>
654
655         [GTK] Properly guard X11-specific code in BackingStore::createBackend()
656         https://bugs.webkit.org/show_bug.cgi?id=142875
657
658         Reviewed by Martin Robinson.
659
660         * UIProcess/cairo/BackingStoreCairo.cpp:
661         (WebKit::BackingStore::createBackend): Guard the GTK- and X11-specific
662         bit of code with PLATFORM(GTK) and PLATFORM(X11). Testing GDK_WINDOWING_X11
663         ensures that the GTK+ dependency has X11 support, but does not ensure
664         that WebKitGTK+ has been configured to build for X11 environments (which
665         is what PLATFORM(X11) ensures).
666
667 2015-03-19  Chris Dumez  <cdumez@apple.com>
668
669         [WK2] We should allow stale content when restoring a killed / crashed WebProcess
670         https://bugs.webkit.org/show_bug.cgi?id=142893
671         <rdar://problem/19633737>
672         <rdar://problem/19869257>
673
674         Reviewed by Antti Koivisto.
675
676         Allow stale content when restoring a killed / crashed WebProcess
677         (similarly to a history navigation). This is actually what was intended
678         as we call WebPage::goToBackForwardItem() in this case, which uses
679         IndexedBackForward load type. However, this value was then ignored in
680         FrameLoader::loadDifferentDocumentItem().
681
682         This patch gets rid of the special casing in
683         FrameLoader::loadDifferentDocumentItem() and makes it clear at call
684         sites when calling goToBackForwardItem() if we should allow stale
685         content or not. If goToBackForwardItem() is called with the
686         allowStaleContent flag off, we'll keep using the IndexedBackForward
687         frame load type. However, if the flag is on, we'll use the Standard
688         frame load type and do a fresh load.
689
690         * UIProcess/WebPageProxy.cpp:
691         (WebKit::WebPageProxy::reattachToWebProcessForReload):
692         Set allowStaleContent flag to true as we want to allow stale content
693         when reloading a WebProcess after it crashed or was killed (behavior
694         change).
695
696         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
697         Add allowStaleContent parameter so that call sites can decide which
698         policy to use.
699
700         (WebKit::WebPageProxy::goForward):
701         (WebKit::WebPageProxy::goBack):
702         Set allowStaleContent flag to true as this is our policy for history
703         navigations.
704
705         (WebKit::WebPageProxy::goToBackForwardItem):
706         Add allowStaleContent parameter so that the call site can let us know
707         what to do. This is useful as this is called not only for indexed
708         back / forward navigations (allowing stale content) but also for
709         restoring session state (forbidding state content:
710         <rdar://problem/8131355>).
711
712         (WebKit::WebPageProxy::restoreFromSessionState):
713         Call goToBackForwardItem() with allowStaleContent flag set to false
714         as users expect fresh contents in this case. This method is called
715         when:
716         - Tabs are restored on Safari / MobileSafari startup
717         - Tabs are restored via "History > Reopen All windows from last session"
718
719         * UIProcess/WebPageProxy.h:
720         * WebProcess/WebPage/WebPage.cpp:
721         (WebKit::WebPage::goToBackForwardItem):
722         Add allowStaleContent parameter and use "Standard" frame load type
723         instead of "IndexedBackForward" if it is false. This is needed as
724         "IndexedBackForward" frame load type allows using stale content.
725
726         * WebProcess/WebPage/WebPage.h:
727         * WebProcess/WebPage/WebPage.messages.in:
728         Add allowStaleContent flag to GoToBackForwardItem message.
729
730 2015-03-19  Eric Carlson  <eric.carlson@apple.com>
731
732         [Mac] Move MediaPlaybackTargetPicker
733         https://bugs.webkit.org/show_bug.cgi?id=142889
734
735         Move WebMediaPlaybackTargetPickerProxy to WebCore so it can be used by
736         both WK2 and WK1.
737
738         Reviewed by Tim Horton.
739
740         * UIProcess/PageClient.h:
741         * UIProcess/WebMediaPlaybackTargetPickerProxy.cpp: Removed.
742         * UIProcess/WebMediaPlaybackTargetPickerProxy.h: Removed.
743         * UIProcess/WebPageProxy.cpp:
744         (WebKit::WebPageProxy::devicePickerProxy):
745         * UIProcess/WebPageProxy.h:
746         * UIProcess/mac/PageClientImpl.h:
747         * UIProcess/mac/PageClientImpl.mm:
748         (WebKit::PageClientImpl::createPlaybackTargetPicker):
749         * UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h: Removed.
750         * UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm: Removed.
751         * WebKit2.xcodeproj/project.pbxproj:
752
753 2015-03-19  Jessie Berlin  <jberlin@webkit.org>
754
755         32-bit build fix after r181770.
756
757         * UIProcess/mac/WKFullScreenWindowController.mm:
758         (-[WKFullScreenWindowController initWithWindow:webView:]):
759
760 2015-03-19  Anders Carlsson  <andersca@apple.com>
761
762         Add support for deleting individual cache entries
763         https://bugs.webkit.org/show_bug.cgi?id=142886
764
765         Reviewed by Antti Koivisto.
766
767         * NetworkProcess/NetworkProcess.cpp:
768         (WebKit::fetchDiskCacheEntries):
769         Remove an unnecessary call to cfURLCacheOrigins().
770
771         (WebKit::clearDiskCacheEntries):
772         Helper function for clearing disk cache entries. This handles both the old and new cache implementations.
773
774         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
775         Call clearDiskCacheEntries if needed.
776
777 2015-03-19  Jer Noble  <jer.noble@apple.com>
778
779         [WK2][Mac] Fullscreen animations with mismatched aspect ratios are "squished".
780         https://bugs.webkit.org/show_bug.cgi?id=142132
781
782         Reviewed by Tim Horton.
783
784         Use CALayer animations for the transition into and out of fullscreen.
785
786         The fullscreen transition consists of three separate animations:
787         1. An opacity animation for the black backdrop behind the fullscreen content
788         2. A scale/translation animation from fullscreen element's initial screen to its final one.
789         3. A clip animation from the fullscreen element's initial aspect ratio to its final one.
790
791         The opacity animation will apply to the fullscreen window's content view's layer's
792         background color. To separately animate the transform and mask of the web view's content, a
793         layer-backed subview is added to the content view, and the scale/translation & clip
794         animations are applied to its transform property and mask layer respectively.
795
796         Utility methods to create each animation have been added, and each includes a parameter for
797         the direction of the animation, so that the same methods can be used for entering and
798         exiting fullscreen transitions.
799
800         The user-visible changes to this new transition are when the aspect ratios of the initial
801         and final screen locations are different: previously the transition would use a scale
802         transform to "squish" the fullscreen content into the initial aspect ratio. The new
803         transition instead "clips" the fullscreen content to the initial aspect ratio. For common
804         operations such a <video> element with a different aspect ratio than the screen, this makes
805         the black letterbox "grow" during the transition, and makes the transition overall much
806         smoother.
807
808         * UIProcess/mac/WKFullScreenWindowController.h:
809         * UIProcess/mac/WKFullScreenWindowController.mm:
810         (-[WKFullScreenWindowController initWithWindow:webView:]): Create and initialze the clipping view.
811         (-[WKFullScreenWindowController applicationDidChangeScreenParameters:]): _backgroundWindow was removed.
812         (-[WKFullScreenWindowController enterFullScreen:]): Add the webView to the _clipView, not the contentView.
813         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): _backgroundWindow,
814                 _fadeAnimation, and _scaleAnimation are all removed.
815         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Ditto.
816         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Ditto.  Hide the contentView's
817                 layer. Pause visibility updates.
818         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]): Resume visibility updates.
819         (-[WKFullScreenWindowController close]): _fadeAnimation and _scaleAnimation are removed.
820         (-[WKFullScreenWindowController customWindowsToEnterFullScreenForWindow:]): Return only the fullscreen
821                 window.
822         (-[WKFullScreenWindowController customWindowsToExitFullScreenForWindow:]): Ditto.
823         (zoomAnimation): Added.
824         (maskAnimation): Added.
825         (fadeAnimation): Added.
826         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]): Use the utility
827                 methods above to set up the animation.
828         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]): Ditto.
829         (createBackgroundFullscreenWindow): Deleted.
830         (windowFrameFromApparentFrames): Deleted.
831
832 2015-03-19  Enrica Casucci  <enrica@apple.com>
833
834         <attachment> should put URLs on the pasteboard so that Finder can accept drops.
835         https://bugs.webkit.org/show_bug.cgi?id=142801
836         rdar://problem/19982527
837
838         Reviewed by Tim Horton.
839
840         This patch adds all the necessary support to write attachment elements into
841         the pasteboard, including the promised type in WK2.
842
843         * UIProcess/API/mac/WKView.mm:
844         (-[WKView _setPromisedDataForImage:withFileName:withExtension:withTitle:withURL:withVisibleURL:withArchive:forPasteboard:]):
845         (-[WKView _setPromisedDataForAttachment:withExtension:withTitle:withURL:withVisibleURL:forPasteboard:]):
846         (-[WKView namesOfPromisedFilesDroppedAtDestination:]):
847         (-[WKView _setPromisedData:withFileName:withExtension:withTitle:withURL:withVisibleURL:withArchive:forPasteboard:]): Deleted.
848         * UIProcess/API/mac/WKViewInternal.h:
849         * UIProcess/PageClient.h:
850         * UIProcess/WebPageProxy.h:
851         * UIProcess/WebPageProxy.messages.in:
852         * UIProcess/mac/PageClientImpl.h:
853         * UIProcess/mac/PageClientImpl.mm:
854         (WebKit::PageClientImpl::setPromisedDataForImage):
855         (WebKit::PageClientImpl::setPromisedDataForAttachment):
856         (WebKit::PageClientImpl::setPromisedData): Deleted.
857         * UIProcess/mac/WebPageProxyMac.mm:
858         (WebKit::WebPageProxy::setPromisedDataForImage):
859         (WebKit::WebPageProxy::setPromisedDataForAttachment):
860         (WebKit::WebPageProxy::setPromisedData): Deleted.
861         * WebProcess/WebCoreSupport/WebDragClient.h:
862         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
863         (WebKit::WebDragClient::declareAndWriteAttachment):
864         (WebKit::WebDragClient::declareAndWriteDragImage):
865
866 2015-03-19  Anders Carlsson  <andersca@apple.com>
867
868         Cache::remove should take a Key instead of an entry
869         https://bugs.webkit.org/show_bug.cgi?id=142878
870
871         Reviewed by Antti Koivisto.
872
873         * NetworkProcess/cache/NetworkCache.cpp:
874         (WebKit::NetworkCache::Cache::remove):
875         * NetworkProcess/cache/NetworkCache.h:
876
877 2015-03-19  Chris Dumez  <cdumez@apple.com>
878
879         Clean up DOMTimer related settings
880         https://bugs.webkit.org/show_bug.cgi?id=142837
881
882         Reviewed by Darin Adler.
883
884         Stop setting the DOMTimers' default minimum interval to 4ms as this
885         is now the default.
886
887         * WebProcess/WebPage/WebPage.cpp:
888         (WebKit::WebPage::WebPage):
889
890 2015-03-19  Chris Dumez  <cdumez@apple.com>
891
892         The network cache should ignore "cache-control: no-cache, must-revalidate" on history navigation
893         https://bugs.webkit.org/show_bug.cgi?id=142831
894         <rdar://problem/20209957>
895
896         Reviewed by Antti Koivisto.
897
898         The network cache should ignore "no-cache" and "must-revalidate" as
899         Cache-Control policy for history navigations to avoid unnecessary
900         revalidation in this case. Our memory cache already behaves this way.
901
902         On history navigation, our disk cache implementation currently
903         revalidates unconditionally resources if "cache-control: no-cache" is
904         used. It also revalidates expired resources if "cache-control:
905         must-revalidate" is used. This is sub-optimal.
906
907         RFC 7234 does not require us to do so [1]:
908         """
909           User agents often have history mechanisms, such as "Back" buttons and
910           history lists, that can be used to redisplay a representation
911           retrieved earlier in a session.
912
913           The freshness model (Section 4.2) does not necessarily apply to
914           history mechanisms.  That is, a history mechanism can display a
915           previous representation even if it has expired.
916         """
917
918         Chrome and IE9+ [2] already ignore "cache-control: must-revalidate" on history navigation.
919
920         [1] https://tools.ietf.org/html/rfc7234#page-32
921         [2] http://blogs.msdn.com/b/ie/archive/2010/07/14/caching-improvements-in-internet-explorer-9.aspx
922
923         Test: http/tests/cache/disk-cache-validation-back-navigation-policy.html
924
925         * NetworkProcess/cache/NetworkCache.cpp:
926         (WebKit::NetworkCache::decodeStorageEntry):
927
928 2015-03-18  Simon Fraser  <simon.fraser@apple.com>
929
930         Don't paint PDFs on every scroll
931         https://bugs.webkit.org/show_bug.cgi?id=142857
932         rdar://problem/20130207
933
934         Reviewed by Tim Horton.
935         
936         Don't push a scale factor onto the PDF layer controller if it hasn't
937         changed, since doing so causes a repaint.
938
939         * WebProcess/Plugins/PDF/PDFPlugin.mm:
940         (WebKit::PDFPlugin::updatePageAndDeviceScaleFactors):
941
942 2015-03-18  Anders Carlsson  <andersca@apple.com>
943
944         Use && instead of & when deciding if the network cache should be cleared
945         https://bugs.webkit.org/show_bug.cgi?id=142845
946
947         Reviewed by Antti Koivisto.
948
949         * NetworkProcess/NetworkProcess.cpp:
950         (WebKit::NetworkProcess::deleteWebsiteData):
951
952 2015-03-18  Anders Carlsson  <andersca@apple.com>
953
954         Add WKContextGetWebsiteDataStore API
955         https://bugs.webkit.org/show_bug.cgi?id=142832
956         rdar://problem/16544715
957
958         Reviewed by Sam Weinig.
959
960         Also add WKWebsiteDataStoreRef which is toll-free bridged to _WKWebsiteDataStore.
961
962         * Shared/API/c/WKBase.h:
963         Add new declaration.
964
965         * UIProcess/API/APIWebsiteDataStore.cpp:
966         (API::WebsiteDataStore::create):
967         * UIProcess/API/APIWebsiteDataStore.h:
968         Add a new function that takes a configuration.
969
970         * UIProcess/API/C/WKAPICast.h:
971         Add cast.
972
973         * UIProcess/API/C/WKContext.cpp:
974         (WKContextGetWebsiteDataStore):
975         Return the context's website data store.
976
977         * UIProcess/API/C/WKContext.h:
978         Add new declaration.
979
980         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: Added.
981         * UIProcess/API/C/WKWebsiteDataStoreRef.h: Added.
982         Add new files.
983
984         * UIProcess/WebKeyValueStorageManager.cpp:
985         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
986         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
987         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
988         (WebKit::WebKeyValueStorageManager::deleteAllEntries):
989         Update now that WebProcessPool holds on to an API::WebsiteDataStore.
990
991         * UIProcess/WebProcessPool.cpp:
992         (WebKit::WebProcessPool::WebProcessPool):
993         (WebKit::WebProcessPool::createWebPage):
994         * UIProcess/WebProcessPool.h:
995         WebProcessPool should hold on to an API::WebsiteDataStore instead of a WebKit::WebsiteDataStore.
996
997         * WebKit2.xcodeproj/project.pbxproj:
998         Add new files.
999
1000 2015-03-18  Tim Horton  <timothy_horton@apple.com>
1001
1002         Cannot invoke action menus anymore
1003         https://bugs.webkit.org/show_bug.cgi?id=142797
1004         <rdar://problem/20032670>
1005
1006         * UIProcess/API/mac/WKView.mm:
1007         Need one more respondsToSelector check.
1008
1009 2015-03-18  Chris Dumez  <cdumez@apple.com>
1010
1011         [WK2] Log the number of network cache requests that we have never seen before
1012         https://bugs.webkit.org/show_bug.cgi?id=142828
1013         <rdar://problem/19632130>
1014
1015         Reviewed by Antti Koivisto.
1016
1017         Log the number of network cache requests that we have never seen before
1018         using diagnostic logging.
1019
1020         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
1021         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
1022         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
1023
1024 2015-03-17  Antti Koivisto  <antti@apple.com>
1025
1026         Prune least valuable cache entries first
1027         https://bugs.webkit.org/show_bug.cgi?id=142810
1028         rdar://problem/19632130
1029
1030         Reviewed by Darin Adler.
1031
1032         When pruning the cache estimate relative value of each entry using formula
1033
1034         age = current time - creation time
1035         accessAge = last access time - creation time
1036         value = accessAge / age
1037
1038         That is, we value entries that have been accessed recently and survived in the cache longest.
1039
1040         The most valuable entries don't get deleted at all while the deletion probablity ramps up for
1041         lower value entries.
1042
1043         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
1044         (WebKit::NetworkCache::fileTimes):
1045
1046             Get the creation time and access time for a file.
1047
1048         (WebKit::NetworkCache::updateFileAccessTimeIfNeeded):
1049
1050             Update access time manually if the file system doesn't do it automatically.
1051
1052         * NetworkProcess/cache/NetworkCacheIOChannel.h:
1053         (WebKit::NetworkCache::IOChannel::path):
1054         (WebKit::NetworkCache::IOChannel::type):
1055         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1056         (WebKit::NetworkCache::IOChannel::IOChannel):
1057         (WebKit::NetworkCache::IOChannel::open):
1058
1059             Remember the file path and move most of the work to constructor.
1060
1061         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1062         (WebKit::NetworkCache::Storage::Storage):
1063         (WebKit::NetworkCache::Storage::remove):
1064         (WebKit::NetworkCache::Storage::updateFileAccessTime):
1065         (WebKit::NetworkCache::Storage::dispatchReadOperation):
1066         (WebKit::NetworkCache::deletionProbability):
1067
1068             Compute the probability based on entry age and access time.
1069
1070         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
1071         * NetworkProcess/cache/NetworkCacheStorage.h:
1072         (WebKit::NetworkCache::Storage::serialBackgroundIOQueue):
1073         (WebKit::NetworkCache::Storage::deleteQueue): Deleted.
1074
1075             More generic name.
1076
1077 2015-03-18  Chris Dumez  <cdumez@apple.com>
1078
1079         [WK2] Log total number of network cache queries using diagnostic logging
1080         https://bugs.webkit.org/show_bug.cgi?id=142803
1081         <rdar://problem/19632130>
1082
1083         Reviewed by Antti Koivisto.
1084
1085         Log total number of network cache queries using diagnostic logging.
1086
1087         * NetworkProcess/cache/NetworkCache.cpp:
1088         (WebKit::NetworkCache::Cache::retrieve):
1089         * NetworkProcess/cache/NetworkCacheStatistics.h:
1090         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
1091         (WebKit::NetworkCache::Statistics::recordCacheRetrievalRequest):
1092
1093 2015-03-18  Chris Dumez  <cdumez@apple.com>
1094
1095         [WK2] We should not even try the network cache for non-HTTP protocol requests
1096         https://bugs.webkit.org/show_bug.cgi?id=142802
1097         <rdar://problem/19632130>
1098
1099         Reviewed by Antti Koivisto.
1100
1101         We should not even try the network cache for non-HTTP protocol requests
1102         and the network cache cannot handle those.
1103
1104         * NetworkProcess/NetworkResourceLoader.cpp:
1105         (WebKit::NetworkResourceLoader::start):
1106         * NetworkProcess/cache/NetworkCache.cpp:
1107         (WebKit::NetworkCache::canRetrieve):
1108         (WebKit::NetworkCache::Cache::retrieve):
1109         * NetworkProcess/cache/NetworkCache.h:
1110         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
1111         (WebKit::NetworkCache::retrieveDecisionToDiagnosticKey):
1112
1113 2015-03-17  Conrad Shultz  <conrad_shultz@apple.com>
1114
1115         Ignore some deprecation warnings
1116         https://bugs.webkit.org/show_bug.cgi?id=142813
1117
1118         Reviewed by Mark Rowe.
1119
1120         Fixing the deprecations is tracked by: <rdar://problem/20201450>
1121
1122         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1123         (WebKit::WebPopupMenuProxyMac::populate):
1124
1125 2015-03-17  Ryuan Choi  <ryuan.choi@navercorp.com>
1126
1127         [EFL] Expose JavaScript binding interface through ewk_extension
1128         https://bugs.webkit.org/show_bug.cgi?id=142033
1129
1130         Reviewed by Gyuyoung Kim.
1131
1132         * PlatformEfl.cmake:
1133         * UIProcess/API/efl/tests/extensions/extension_sample.cpp: Registered test object for new test case.
1134         * UIProcess/API/efl/tests/test_ewk2_javascript_binding.cpp: Added simple binding API test case.
1135         (EWK2ContextTestWithExtension::messageReceivedCallback):
1136         (EWK2ContextTestWithExtension::EWK2ContextTestWithExtension):
1137         (TEST_F):
1138         * WebProcess/InjectedBundle/API/efl/EWebKit_Extension.h:
1139         * WebProcess/InjectedBundle/API/efl/ewk_extension.cpp:
1140         (EwkExtension::didCreatePage):
1141         (EwkExtension::willDestroyPage):
1142         * WebProcess/InjectedBundle/API/efl/ewk_extension.h:
1143         * WebProcess/InjectedBundle/API/efl/ewk_extension_private.h:
1144         * WebProcess/InjectedBundle/API/efl/ewk_page.cpp: Added.
1145         (toEwkPage):
1146         (EwkPage::EwkPage):
1147         (EwkPage::append):
1148         (EwkPage::remove):
1149         (EwkPage::didFinishDocumentLoadForFrame):
1150         (ewk_page_js_global_context_get):
1151         (ewk_page_client_register):
1152         (ewk_page_client_unregister):
1153         * WebProcess/InjectedBundle/API/efl/ewk_page.h: Added.
1154         * WebProcess/InjectedBundle/API/efl/ewk_page_private.h: Added.
1155         (EwkPage::page):
1156         * efl/ewebkit2-extension.pc.in:
1157
1158 2015-03-17  Tim Horton  <timothy_horton@apple.com>
1159
1160         Cannot invoke action menus anymore
1161         https://bugs.webkit.org/show_bug.cgi?id=142797
1162         <rdar://problem/20032670>
1163
1164         * UIProcess/API/mac/WKView.mm:
1165         Need a respondsToSelector check.
1166
1167 2015-03-17  Tim Horton  <timothy_horton@apple.com>
1168
1169         Cannot invoke action menus anymore
1170         https://bugs.webkit.org/show_bug.cgi?id=142797
1171         <rdar://problem/20032670>
1172
1173         Reviewed by Beth Dakin.
1174
1175         * UIProcess/API/mac/WKView.mm:
1176         Don't process mouse events that would make an action menu; call super
1177         and let AppKit take care of it. We have to duplicate the macro so that
1178         we can avoid calling super for the internal-only methods.
1179         Also, otherMouseMoved is simply not a thing, so remove it.
1180
1181 2015-03-17  Beth Dakin  <bdakin@apple.com>
1182
1183         DOM mouse events have weird timing for force clickable elements in Safari 8.0.3 on 
1184         10.10.2
1185         https://bugs.webkit.org/show_bug.cgi?id=142700
1186         -and corresponding-
1187         rdar://problem/20165168
1188
1189         Reviewed by Tim Horton.
1190
1191         No need to tell the WKImmediateActionController about mouse down any more since we 
1192         are expecting it at the beginning of an immediate action interaction.
1193         * UIProcess/API/mac/WKView.mm:
1194         (-[WKView mouseDown:]):
1195
1196         Set the delaysPrimaryMouseButtonEvents to NO for the 
1197         _immediateActionGestureRecognizer. This will cause AppKit to send up the mouse 
1198         events at the expected time.
1199         (-[WKView initWithFrame:processPool:configuration:webView:]):
1200
1201         WebCore::EventHandler now needs to know if an immediate action cancelled or 
1202         completed. This plumbs that information down.
1203         * UIProcess/WebPageProxy.cpp:
1204         (WebKit::WebPageProxy::immediateActionDidCancel):
1205         (WebKit::WebPageProxy::immediateActionDidComplete):
1206         * UIProcess/WebPageProxy.h:
1207         * UIProcess/mac/WKImmediateActionController.h:
1208         * UIProcess/mac/WKImmediateActionController.mm:
1209         (-[WKImmediateActionController immediateActionRecognizerDidCancelAnimation:]):
1210         (-[WKImmediateActionController immediateActionRecognizerDidCompleteAnimation:]):
1211         (-[WKImmediateActionController wkView:willHandleMouseDown:]): Deleted.
1212         * WebProcess/WebPage/WebPage.h:
1213         * WebProcess/WebPage/WebPage.messages.in:
1214
1215         Call EventHandler::setImmediateActionStage() with the appropriate stage.
1216         * WebProcess/WebPage/mac/WebPageMac.mm:
1217         (WebKit::WebPage::performActionMenuHitTestAtLocation):
1218         (WebKit::WebPage::immediateActionDidCancel):
1219         (WebKit::WebPage::immediateActionDidComplete):
1220
1221 2015-03-17  Timothy Horton  <timothy_horton@apple.com>
1222
1223         Reproducible null deref under ScriptedAnimationController::createDisplayRefreshMonitor
1224         https://bugs.webkit.org/show_bug.cgi?id=142776
1225         <rdar://problem/18921338>
1226
1227         Reviewed by Alexey Proskuryakov.
1228
1229         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1230         (WebKit::WebChromeClient::createDisplayRefreshMonitor):
1231         * WebProcess/WebCoreSupport/WebChromeClient.h:
1232         Adjust to the new signature.
1233
1234 2015-03-17  Antti Koivisto  <antti@apple.com>
1235
1236         Disk cache should support Vary: Cookie
1237         https://bugs.webkit.org/show_bug.cgi?id=142770
1238         rdar://problem/19764945
1239
1240         Reviewed by Anders Carlsson.
1241
1242         Cookies are not part of the original request but are added by the networking layer when submitting the request.
1243         Fetch them explicitly when resolving Vary: Cookie.
1244
1245         The implementation is not perfect as it fetches the cookie for the cache entry when saving a Vary:Cookie response,
1246         not when making the request. In principle the cookie may have changed in-between. This should be enough to handle
1247         reasonable cases though. Fetching cookies for every request might be too expensive for this rarely used feature.
1248
1249         * NetworkProcess/cache/NetworkCache.cpp:
1250         (WebKit::NetworkCache::headerValueForVary):
1251         (WebKit::NetworkCache::encodeStorageEntry):
1252         (WebKit::NetworkCache::verifyVaryingRequestHeaders):
1253
1254 2015-03-17  Zan Dobersek  <zdobersek@igalia.com>
1255
1256         [WK2] Use C++ lambdas in IPC::Connection
1257         https://bugs.webkit.org/show_bug.cgi?id=138018
1258
1259         Reviewed by Anders Carlsson.
1260
1261         Replace uses of WTF::bind() in the IPC::Connection class with C++ lambdas.
1262
1263         * Platform/IPC/Connection.cpp:
1264         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
1265         (IPC::Connection::invalidate):
1266         (IPC::Connection::sendMessage):
1267         (IPC::Connection::processIncomingMessage): Simplify the error messages so we
1268         don't have to format strings on-the-fly, removing the issues of cross-thread
1269         string copying altogether.
1270         (IPC::Connection::dispatchDidReceiveInvalidMessage): The parameters are now
1271         of the StringReference type.
1272         (IPC::Connection::enqueueIncomingMessage):
1273         * Platform/IPC/Connection.h:
1274         * Platform/IPC/mac/ConnectionMac.mm:
1275         (IPC::Connection::receiveSourceEventHandler):
1276         * Platform/IPC/unix/ConnectionUnix.cpp:
1277         (IPC::Connection::open):
1278
1279 2015-03-17  Zan Dobersek  <zdobersek@igalia.com>
1280
1281         [CMake] Use a forwarding header for ANGLE's ShaderLang.h to avoid picking up ANGLE's EGL headers
1282         https://bugs.webkit.org/show_bug.cgi?id=142530
1283
1284         Reviewed by Darin Adler.
1285
1286         * CMakeLists.txt: Replace the Source/ThirdParty/ANGLE/include/GLSLANG entry
1287         in the list of inclusion directories for WebKit2 with Source/ThirdParty/ANGLE,
1288         possible due to the new forwarding header for ANGLE's ShaderLang.h.
1289
1290 2015-03-17  Gwang Yoon Hwang  <yoon@igalia.com>
1291
1292         REGRESSION(r180924): Unable to build WebKitGTK+ with threaded compositor
1293
1294         Unreviewed build fix.
1295
1296         * WebProcess/WebPage/LayerTreeHost.h:
1297         Remove duplicated declaration of setNativeSurfaceHandleForCompositing.
1298
1299 2015-03-16  Ryosuke Niwa  <rniwa@webkit.org>
1300
1301         Enable ES6 classes by default
1302         https://bugs.webkit.org/show_bug.cgi?id=142774
1303
1304         Reviewed by Gavin Barraclough.
1305
1306         * Configurations/FeatureDefines.xcconfig:
1307
1308 2015-03-16  Conrad Shultz  <conrad_shultz@apple.com>
1309
1310         Don't pass nil as a fireDate for NSTimer
1311         https://bugs.webkit.org/show_bug.cgi?id=142765
1312
1313         Reviewed by Dan Bernstein.
1314
1315         While we're here, switch to a selector that conforms to documented NSTimer API.
1316
1317         * UIProcess/mac/WKFullScreenWindowController.mm:
1318         (-[WKFullScreenWindowController cancelOperation:]):
1319         Set the timer's fireDate as the future date matching the former interval; update the selector.
1320         (-[WKFullScreenWindowController _watchdogTimerFired:]):
1321         Timer callback; wrap -exitFullScreen.
1322
1323 2015-03-16  Alex Christensen  <achristensen@webkit.org>
1324
1325         Progress towards CMake on Mac
1326         https://bugs.webkit.org/show_bug.cgi?id=142747
1327
1328         Reviewed by Chris Dumez.
1329
1330         * PlatformMac.cmake:
1331         Started adding Mac-specific directories and headers.
1332
1333 2015-03-16  Alexey Proskuryakov  <ap@apple.com>
1334
1335         ASSERT(m_plugin) on plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image.html
1336         https://bugs.webkit.org/show_bug.cgi?id=142637
1337
1338         Reviewed by Dean Jackson.
1339
1340         * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::pluginSnapshotTimerFired):
1341         m_plugin can be legitimately null.
1342
1343 2015-03-16  Csaba Osztrogonác  <ossy@webkit.org>
1344
1345         One more URTBF after r181578.
1346
1347         * WebProcess/WebPage/WebPage.cpp:
1348         (WebKit::WebPage::updatePreferences):
1349
1350 2015-03-16  Csaba Osztrogonác  <ossy@webkit.org>
1351
1352         URTBF after r181578.
1353
1354         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1355         (WebKit::InjectedBundle::setCSSAnimationTriggersEnabled): Copy/paste error fixed.
1356
1357 2015-03-16  Dean Jackson  <dino@apple.com>
1358
1359         Expose WK2 preference for Animation Triggers runtime flag
1360         https://bugs.webkit.org/show_bug.cgi?id=142744
1361
1362         Reviewed by Anders Carlsson.
1363
1364         Expose CSSAnimationTriggersEnabled, linking it to the runtime enabled
1365         feature flag.
1366
1367         * Shared/WebPreferencesDefinitions.h:
1368         * UIProcess/API/C/WKPreferences.cpp:
1369         (WKPreferencesSetCSSAnimationTriggersEnabled):
1370         (WKPreferencesGetCSSAnimationTriggersEnabled):
1371         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1372         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1373         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1374         (WebKit::InjectedBundle::setCSSAnimationTriggersEnabled):
1375         * WebProcess/InjectedBundle/InjectedBundle.h:
1376         * WebProcess/WebPage/WebPage.cpp:
1377         (WebKit::WebPage::updatePreferences):
1378
1379 2015-03-16  Conrad Shultz  <conrad_shultz@apple.com>
1380
1381         Allow clients to selectively disable plug-ins
1382         https://bugs.webkit.org/show_bug.cgi?id=142506
1383
1384         Reviewed by Anders Carlsson.
1385
1386         Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
1387         from the page). As part of this:
1388
1389         1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
1390            set of plug-ins.
1391
1392         2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
1393            down the stack.
1394
1395         3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
1396            a concrete implementation thereof in WebPlatformStrategies in WebKit2.
1397
1398         4) Add messaging infrastructure to allow clients to set and clear plug-in policies.
1399
1400         While currently only used in a very limited manner, the new declarative plug-in policies are written generically
1401         so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.
1402
1403         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
1404         (WebKit::NetscapePluginModule::getPluginInfo):
1405         Set new PluginInfo members.
1406
1407         * Shared/WebCoreArgumentCoders.cpp:
1408         (IPC::ArgumentCoder<PluginInfo>::encode):
1409         Handle new PluginInfo members.
1410         (IPC::ArgumentCoder<PluginInfo>::decode):
1411         Ditto.
1412
1413         * Shared/WebProcessCreationParameters.h:
1414         Declare a member to store client plug-in policies.
1415
1416         * Shared/WebProcessCreationParameters.cpp:
1417         (WebKit::WebProcessCreationParameters::encode):
1418         Encode the policies.
1419         (WebKit::WebProcessCreationParameters::decode):
1420         Decode the policies.
1421
1422         * UIProcess/API/C/WKAPICast.h:
1423         (WebKit::toWKPluginLoadClientPolicy):
1424         Teach how to cast between WebCore and WebKit2 policy definitions.
1425         (WebKit::toPluginLoadClientPolicy):
1426         Ditto.
1427
1428         * UIProcess/API/C/WKPluginLoadPolicy.h:
1429         Declare WKPluginLoadClientPolicy, matching PluginLoadClientPolicy in WebCore.
1430
1431         * UIProcess/API/C/mac/WKContextPrivateMac.h:
1432         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
1433         (WKContextSetPluginLoadClientPolicy):
1434         New function; wrap WebProcessPool::setPluginLoadClientPolicy().
1435         (WKContextClearPluginClientPolicies):
1436         New function; wrap WebProcessPool::clearPluginClientPolicies().
1437
1438         * UIProcess/WebProcessPool.h:
1439         * UIProcess/WebProcessPool.cpp:
1440         (WebKit::WebProcessPool::createNewWebProcess):
1441         Copy any client plug-in policies to the new process' creation parameters.
1442         (WebKit::WebProcessPool::setPluginLoadClientPolicy):
1443         Send SetPluginLoadClientPolicy to all processes and stash the passed-in policy info.
1444         (WebKit::WebProcessPool::clearPluginClientPolicies):
1445         Send ClearPluginClientPolicies to all processes and clear any stashed policy info.
1446
1447         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1448         (WebKit::PDFPlugin::pluginInfo):
1449         Set new PluginInfo member.
1450
1451         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1452         (WebKit::pluginSupportsExtension):
1453         Adopt getWebVisibleMimesAndPluginIndices().
1454         (WebKit::WebFrameLoaderClient::objectContentType):
1455         Update to reflect reflect function rename.
1456
1457         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1458         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1459         (WebKit::WebPlatformStrategies::getPluginInfo):
1460         Pass the Page to populatePluginCache().
1461         (WebKit::WebPlatformStrategies::getWebVisiblePluginInfo):
1462         New member function; wrap getPluginInfo(); if appropriate, filter out plug-ins the client has asked
1463         to block on the current page.
1464         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
1465         New member function; map empty inputs to a wildcard character and insert the new policy into the nested map.
1466         (WebKit::WebPlatformStrategies::clearPluginClientPolicies):
1467         New member function; empty m_hostsToPluginIdentifierData.
1468         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost):
1469         New member function; look up the most specific policy for the given plug-in and host.
1470         (WebKit::WebPlatformStrategies::populatePluginCache):
1471         If appropriate, set the client load policy on the plug-ins; do this irrespective of whether the cache has
1472         been populated since the Page, and therefore host, may change.
1473
1474         * WebProcess/WebPage/WebPage.cpp:
1475         (WebKit::WebPage::canShowMIMEType):
1476         Update to reflect function rename.
1477
1478         * WebProcess/WebProcess.h:
1479         * WebProcess/WebProcess.cpp:
1480         (WebKit::WebProcess::initializeWebProcess):
1481         Enumerate and process the client plug-in policies in the creation parameters.
1482         (WebKit::WebProcess::setPluginLoadClientPolicy):
1483         New member function; wrap PluginStrategy::setPluginLoadClientPolicy.
1484         (WebKit::WebProcess::clearPluginClientPolicies):
1485         New member function; wrap PluginStrategy::clearPluginClientPolicies().
1486
1487         * WebProcess/WebProcess.messages.in:
1488         Add messages for setting and clearing policies.
1489
1490 2015-03-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1491
1492         Unreviewed. Add new Notification classes to GTK+ API documentation.
1493
1494         Add WebKitNotification and WebKitNotificationPermissionRequest to
1495         the documentation and fix some other typos causing warnings when
1496         generating HTML documentation.
1497
1498         * UIProcess/API/gtk/WebKitUserContent.cpp:
1499         * UIProcess/API/gtk/WebKitWebView.cpp:
1500         (webkit_web_view_class_init):
1501         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
1502
1503 2015-03-16  Przemyslaw Piorkowski  <p.piorkowski@samsung.com>
1504
1505         [EFL][WK2] REGRESSION(r178526): test_ewk2_storage_manager has been failed for a long time
1506         https://bugs.webkit.org/show_bug.cgi?id=141249
1507
1508         Reviewed by Gyuyoung Kim.
1509
1510         * PlatformEfl.cmake: Enable test_ewk2_storage_manager for EFL port - it is passing now.
1511
1512 2015-03-16  David Kilzer  <ddkilzer@apple.com>
1513
1514         [iOS] REGRESSION (r181511): Most layout tests crash with a NULL deref
1515
1516         Follow-up fix for:
1517         [iOS] Presenting a modal sheet on top of a WKWebView causes it to lose focused, active state
1518         <http://webkit.org/b/142702>
1519
1520         * UIProcess/ios/PageClientImplIOS.mm:
1521         (WebKit::PageClientImpl::isViewWindowActive): Add NULL check for m_webView.
1522         (WebKit::PageClientImpl::isViewFocused): Ditto.
1523
1524 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
1525
1526         Clean up related to wheelEvent names
1527         https://bugs.webkit.org/show_bug.cgi?id=142713
1528
1529         Reviewed by Anders Carlsson.
1530
1531         Add EventNames::isWheelEventType() and use it in places that test for the
1532         two wheel event names.
1533
1534         * WebProcess/Plugins/PluginView.cpp:
1535         (WebKit::PluginView::handleEvent):
1536
1537 2015-03-15  Dan Bernstein  <mitz@apple.com>
1538
1539         [iOS] Presenting a modal sheet on top of a WKWebView causes it to lose focused, active state
1540         https://bugs.webkit.org/show_bug.cgi?id=142702
1541
1542         Reviewed by Anders Carlsson.
1543
1544         * UIProcess/API/Cocoa/WKWebView.mm:
1545         (-[WKWebView becomeFirstResponder]): Override to delegate first responder status to the
1546         WKContentView if possible.
1547         (-[WKWebView _retainActiveFocusedState]): New SPI that prevents view hierarchy changes from
1548         affecting the active and focused state of the view. Increments a counter ivar and returns a
1549         completion block (which callers must call when they’re done) that decrements it back.
1550         * UIProcess/API/Cocoa/WKWebViewInternal.h: Declared new _activeFocusedStateRetainCount ivar
1551         with @package access.
1552         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new method.
1553
1554         * UIProcess/ios/PageClientImplIOS.mm:
1555         (WebKit::PageClientImpl::isViewWindowActive): Return true if active/focused state is to be
1556         maintained despite not being visible.
1557         (WebKit::PageClientImpl::isViewFocused): Return true if active/focused state is to be
1558         maintained despite not being active.
1559
1560         * UIProcess/ios/WKContentViewInteraction.mm:
1561         (-[WKContentView resignFirstResponder]): Don’t blur the assisted node if active/focused
1562         state is to be maintained.
1563
1564 2015-03-14  Simon Fraser  <simon.fraser@apple.com>
1565
1566         Clean up use of flags in localToContainer-type functions
1567         https://bugs.webkit.org/show_bug.cgi?id=142704
1568
1569         Reviewed by Alexey Proskuryakov.
1570         
1571         Pass UseTransforms explicitly to localToContainerPoint()
1572
1573         * WebProcess/WebPage/ios/WebPageIOS.mm:
1574         (WebKit::WebPage::getAssistedNodeInformation):
1575
1576 2015-03-14  Brent Fulgham  <bfulgham@apple.com>
1577
1578         [iOS] scroll snap points are animating to the wrong positions.
1579         https://bugs.webkit.org/show_bug.cgi?id=142705
1580         <rdar://problem/20136946>
1581
1582         Reviewed by Simon Fraser.
1583
1584         Scroll snapping was landing in the wrong place on iOS because of two problems:
1585         (1) It was searching for the closest snap offset point using unscaled 'screen' pixels,
1586         which caused it to always choose one of the earliest snap point options.
1587         (2) It was then selecting a scaled snap point coordinate and passing it back to UIKit
1588         to animate the snap. This caused it to select a target point beyond the 'screen' pixel
1589         we want to hit.
1590         
1591         The solution to both problems are to scale the scroll destination UIKit suggests so that
1592         we search among the scaled points with a valid value. Then, we need to scale the returned
1593         value back to screen units before handing it back to UIKit to process.
1594
1595         * UIProcess/API/Cocoa/WKWebView.mm:
1596         (-[WKWebView scrollViewWillBeginDragging:]): Drive-by fix. Get rid of extra ';' at
1597         the end of the line.
1598         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1599         (WebKit::RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling):
1600
1601 2015-03-14  Dean Jackson  <dino@apple.com>
1602
1603         Feature flag for Animations Level 2
1604         https://bugs.webkit.org/show_bug.cgi?id=142699
1605         <rdar://problem/20165097>
1606
1607         Reviewed by Brent Fulgham.
1608
1609         Add ENABLE_CSS_ANIMATIONS_LEVEL_2 and a runtime flag animationTriggersEnabled.
1610
1611         * Configurations/FeatureDefines.xcconfig:
1612
1613 2015-03-14  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
1614
1615         [GStreamer] share GL context in pipeline
1616         https://bugs.webkit.org/show_bug.cgi?id=142693
1617
1618         Reviewed by Philippe Normand.
1619
1620         * WebProcess/gtk/WebProcessMainGtk.cpp: Enable XInitThreads() if
1621         GSTREAMER_GL is used, since GstGL elements use another thread for
1622         queuing GL operations.
1623
1624 2015-03-13  Alex Christensen  <achristensen@webkit.org>
1625
1626         Progress towards CMake on Mac.
1627         https://bugs.webkit.org/show_bug.cgi?id=142680
1628
1629         Reviewed by Gyuyoung Kim.
1630
1631         * PlatformMac.cmake: Added.
1632
1633 2015-03-13  Commit Queue  <commit-queue@webkit.org>
1634
1635         Unreviewed, rolling out r181483.
1636         https://bugs.webkit.org/show_bug.cgi?id=142688
1637
1638         Caused use-after-free on many tests (Requested by ap on
1639         #webkit).
1640
1641         Reverted changeset:
1642
1643         "Allow clients to selectively disable plug-ins"
1644         https://bugs.webkit.org/show_bug.cgi?id=142506
1645         http://trac.webkit.org/changeset/181483
1646
1647 2015-03-13  Eric Carlson  <eric.carlson@apple.com>
1648
1649         [Mac] Enable WIRELESS_PLAYBACK_TARGET
1650         https://bugs.webkit.org/show_bug.cgi?id=142635
1651
1652         Reviewed by Darin Adler.
1653
1654         * Configurations/FeatureDefines.xcconfig:
1655
1656 2015-03-13  Timothy Horton  <timothy_horton@apple.com>
1657
1658         Sites that use a device-width viewport but don't have enough height to fill the view are scaled up
1659         https://bugs.webkit.org/show_bug.cgi?id=142664
1660         <rdar://problem/18859470>
1661
1662         Reviewed by Benjamin Poulain.
1663
1664         * UIProcess/ios/WKScrollView.mm:
1665         (-[WKScrollView _rubberBandOffsetForOffset:maxOffset:minOffset:range:outside:]):
1666         Now that the WKContentView can (without pinching) be smaller than the unobscured
1667         region of the WKWebView, we need to take that into account when deciding where
1668         to retarget scrolling.
1669
1670 2015-03-13  Mark Lam  <mark.lam@apple.com>
1671
1672         Replace TCSpinLock with a new WTF::SpinLock based on WTF::Atomic.
1673         <https://webkit.org/b/142674>
1674
1675         Reviewed by Filip Pizlo.
1676
1677         * WebProcess/WebPage/EventDispatcher.cpp:
1678         (WebKit::EventDispatcher::EventDispatcher):
1679         * WebProcess/WebPage/EventDispatcher.h:
1680         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
1681         (WebKit::ViewUpdateDispatcher::ViewUpdateDispatcher):
1682         * WebProcess/WebPage/ViewUpdateDispatcher.h:
1683
1684 2015-03-10  Conrad Shultz  <conrad_shultz@apple.com>
1685
1686         Allow clients to selectively disable plug-ins
1687         https://bugs.webkit.org/show_bug.cgi?id=142506
1688
1689         Reviewed by Anders Carlsson.
1690
1691         Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
1692         from the page). As part of this:
1693
1694         1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
1695            set of plug-ins.
1696
1697         2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
1698            down the stack.
1699
1700         3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
1701            a concrete implementation thereof in WebPlatformStrategies in WebKit2.
1702
1703         4) Add messaging infrastructure to allow clients to set and clear plug-in policies.
1704
1705         While currently only used in a very limited manner, the new declarative plug-in policies are written generically
1706         so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.
1707
1708         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
1709         (WebKit::NetscapePluginModule::getPluginInfo):
1710         Set new PluginInfo members.
1711
1712         * Shared/WebCoreArgumentCoders.cpp:
1713         (IPC::ArgumentCoder<PluginInfo>::encode):
1714         Handle new PluginInfo members.
1715         (IPC::ArgumentCoder<PluginInfo>::decode):
1716         Ditto.
1717
1718         * Shared/WebProcessCreationParameters.h:
1719         Declare a member to store client plug-in policies.
1720
1721         * Shared/WebProcessCreationParameters.cpp:
1722         (WebKit::WebProcessCreationParameters::encode):
1723         Encode the policies.
1724         (WebKit::WebProcessCreationParameters::decode):
1725         Decode the policies.
1726
1727         * UIProcess/API/C/WKAPICast.h:
1728         (WebKit::toWKPluginLoadClientPolicy):
1729         Teach how to cast between WebCore and WebKit2 policy definitions.
1730         (WebKit::toPluginLoadClientPolicy):
1731         Ditto.
1732
1733         * UIProcess/API/C/WKPluginLoadPolicy.h:
1734         Declare WKPluginLoadClientPolicy, matching PluginLoadClientPolicy in WebCore.
1735
1736         * UIProcess/API/C/mac/WKContextPrivateMac.h:
1737         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
1738         (WKContextSetPluginLoadClientPolicy):
1739         New function; wrap WebProcessPool::setPluginLoadClientPolicy().
1740         (WKContextClearPluginClientPolicies):
1741         New function; wrap WebProcessPool::clearPluginClientPolicies().
1742
1743         * UIProcess/WebProcessPool.h:
1744         * UIProcess/WebProcessPool.cpp:
1745         (WebKit::WebProcessPool::createNewWebProcess):
1746         Copy any client plug-in policies to the new process' creation parameters.
1747         (WebKit::WebProcessPool::setPluginLoadClientPolicy):
1748         Send SetPluginLoadClientPolicy to all processes and stash the passed-in policy info.
1749         (WebKit::WebProcessPool::clearPluginClientPolicies):
1750         Send ClearPluginClientPolicies to all processes and clear any stashed policy info.
1751
1752         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1753         (WebKit::PDFPlugin::pluginInfo):
1754         Set new PluginInfo member.
1755
1756         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1757         (WebKit::pluginSupportsExtension):
1758         Adopt getWebVisibleMimesAndPluginIndices().
1759         (WebKit::WebFrameLoaderClient::objectContentType):
1760         Update to reflect reflect function rename.
1761
1762         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1763         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1764         (WebKit::WebPlatformStrategies::getPluginInfo):
1765         Pass the Page to populatePluginCache().
1766         (WebKit::WebPlatformStrategies::getWebVisiblePluginInfo):
1767         New member function; wrap getPluginInfo(); if appropriate, filter out plug-ins the client has asked
1768         to block on the current page.
1769         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
1770         New member function; map empty inputs to a wildcard character and insert the new policy into the nested map.
1771         (WebKit::WebPlatformStrategies::clearPluginClientPolicies):
1772         New member function; empty m_hostsToPluginIdentifierData.
1773         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost):
1774         New member function; look up the most specific policy for the given plug-in and host.
1775         (WebKit::WebPlatformStrategies::populatePluginCache):
1776         If appropriate, set the client load policy on the plug-ins; do this irrespective of whether the cache has
1777         been populated since the Page, and therefore host, may change.
1778
1779         * WebProcess/WebPage/WebPage.cpp:
1780         (WebKit::WebPage::canShowMIMEType):
1781         Update to reflect function rename.
1782
1783         * WebProcess/WebProcess.h:
1784         * WebProcess/WebProcess.cpp:
1785         (WebKit::WebProcess::initializeWebProcess):
1786         Enumerate and process the client plug-in policies in the creation parameters.
1787         (WebKit::WebProcess::setPluginLoadClientPolicy):
1788         New member function; wrap PluginStrategy::setPluginLoadClientPolicy.
1789         (WebKit::WebProcess::clearPluginClientPolicies):
1790         New member function; wrap PluginStrategy::clearPluginClientPolicies().
1791
1792         * WebProcess/WebProcess.messages.in:
1793         Add messages for setting and clearing policies.
1794
1795 2015-03-12  Jon Honeycutt  <jhoneycutt@apple.com>
1796
1797         Use UIDocumentMenuViewController to allow selection of files from
1798         iCloud Drive in WKFileUploadPanel
1799
1800         Part of <https://bugs.webkit.org/show_bug.cgi?id=142596> WebKit on
1801         iOS should support file upload from iCloud Drive
1802         <rdar://problem/12178991>
1803
1804         Reviewed by Andy Estes.
1805
1806         * Platform/spi/ios/UIKitSPI.h:
1807         Include UIDocumentMenuViewController_Private.h if it exists. If not,
1808         declare this new SPI.
1809
1810         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1811         (fallbackIconForFile):
1812         Create a UIDocumentInteractionController for the file, and return a
1813         thumbnail image from its smallest icon.
1814
1815         (iconForImageFile):
1816         If we can get a UIImage from the file, create a thumbnail from it.
1817         Otherwise, call fallbackIconForFile().
1818
1819         (iconForVideoFile):
1820         Code moved from -[_WKVideoFileUploadItem displayImage].
1821
1822         (iconForFile):
1823         Get the file's extension, and get the extension's preferred UTI. If the
1824         UTI is an image type, call iconForImageFile(). If it's a video type,
1825         call iconForVideoFile(). Otherwise, return the fallback icon.
1826
1827         (-[_WKFileUploadItem initWithFileURL:]):
1828         Added an initializer that takes a file URL.
1829
1830         (-[_WKFileUploadItem fileURL]):
1831         (-[_WKImageFileUploadItem initWithFileURL:originalImage:]):
1832         (-[_WKVideoFileUploadItem displayImage]):
1833         (WKFileUploadPanel):
1834         Inherit from UIDocumentPickerDelegate and UIDocumentMenuDelegate. Add
1835         an ivar for the document menu controller.
1836
1837         (-[WKFileUploadPanel dealloc]):
1838         (-[WKFileUploadPanel presentWithParameters:resultListener:]):
1839         If instances of UIDocumentMenuViewController respond to
1840         -_setIgnoreApplicationEntitlementForImport:, meaning we can disable the
1841         assertion that the current app has the iCloud Documents entitlement,
1842         then show the document picker menu. Otherwise, show the current source
1843         selection UI. The runtime check will be removed when a newer UIKit is
1844         available.
1845
1846         (UTIsForMIMETypes):
1847         Return the UTIs for the <input> element's "accept" attribute's MIME
1848         type list.
1849
1850         (-[WKFileUploadPanel _mediaTypesForPickerSourceType:]):
1851         Call UTIsForMIMETypes(). Fall back to available source types for this
1852         picker type.
1853
1854         (-[WKFileUploadPanel _documentPickerMenuMediaTypes]):
1855         Call UTIsForMIMETypes(). Fall back to the all-encompassing
1856         "public.item" UTI.
1857
1858         (-[WKFileUploadPanel _photoLibraryButtonLabel]):
1859         (-[WKFileUploadPanel _cameraButtonLabel]):
1860         Factored out of -_showMediaSourceSelectionSheet. Return the
1861         appropriate label for the camera button, based on whether it can take a
1862         photo or video, or return nil if the camera is not available.
1863
1864         (-[WKFileUploadPanel _showMediaSourceSelectionSheet]):
1865         Changed to use -_cameraButtonLabel and
1866         -_presentForCurrentInterfaceIdiom:.
1867
1868         (-[WKFileUploadPanel _showDocumentPickerMenu]):
1869         Create a UIDocumentMenuViewController, and populate it with options to
1870         open the photo library or take a picture or video. If iCloud Drive or
1871         other document sources are available, they will be added automatically.
1872
1873         (-[WKFileUploadPanel _presentForCurrentInterfaceIdiom:]):
1874         (-[WKFileUploadPanel documentMenu:didPickDocumentPicker:]):
1875         (-[WKFileUploadPanel documentMenuWasCancelled:]):
1876         (-[WKFileUploadPanel documentPicker:didPickDocumentAtURL:]):
1877         (-[WKFileUploadPanel documentPickerWasCancelled:]):
1878         (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
1879
1880         (-[_WKImageFileUploadItem initWithFilePath:originalImage:]): Deleted.
1881         (-[_WKImageFileUploadItem fileURL]): Deleted.
1882         (-[_WKVideoFileUploadItem initWithFilePath:mediaURL:]): Deleted.
1883         (-[_WKVideoFileUploadItem fileURL]): Deleted.
1884
1885 2015-03-11  Enrica Casucci  <enrica@apple.com>
1886
1887         Adopt new API for keyboard event handling.
1888         https://bugs.webkit.org/show_bug.cgi?id=142602
1889         rdar://problem/19966087
1890
1891         Reviewed by Sam Weinig.
1892
1893         Adopts the new API.
1894
1895         * UIProcess/ios/WKContentViewInteraction.mm:
1896         (-[WKContentView _didHandleKeyEvent:]):
1897
1898 2015-03-12  Alexey Proskuryakov  <ap@apple.com>
1899
1900         testRunner.setAlwaysAcceptCookies does not work with NetworkProcess
1901         https://bugs.webkit.org/show_bug.cgi?id=138687
1902
1903         Reviewed by Carlos Garcia Campos.
1904
1905         * UIProcess/WebCookieManagerProxy.cpp:
1906         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy): Don't change system-wide
1907         cookie accept policy when in testing mode. Also, update the policy in WebProcesses too,
1908         as we still do some networking there.
1909
1910         * UIProcess/WebProcessPool.h:
1911         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1912         (WKBundleSetAlwaysAcceptCookies): Deleted.
1913         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1914         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1915         (WebKit::InjectedBundle::setAlwaysAcceptCookies): Deleted.
1916         * WebProcess/InjectedBundle/InjectedBundle.h:
1917         Remove WKBundleSetAlwaysAcceptCookies SPI, as WKTR now uses an API in UI process.
1918
1919 2015-03-12  Anders Carlsson  <andersca@apple.com>
1920
1921         WKErrorDomain should be declared nonnull
1922         https://bugs.webkit.org/show_bug.cgi?id=142628
1923
1924         Reviewed by Antti Koivisto.
1925
1926         Add WK_ASSUME_NONNULL_BEGIN and WK_ASSUME_NONNULL_END so everything will be implicitly nonnull.
1927
1928         * UIProcess/API/Cocoa/WKError.h:
1929
1930 2015-03-12  Ian Henderson  <ian@ianhenderson.org>
1931
1932         PDFs don't snapshot properly in iOS Safari
1933         https://bugs.webkit.org/show_bug.cgi?id=142623
1934
1935         Reviewed by Tim Horton.
1936
1937         * UIProcess/API/Cocoa/WKWebView.mm:
1938         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
1939         If we have a _customContentView, use UIView snapshotting instead of
1940         trying to snapshot the web page.
1941
1942 2015-03-12  Eric Carlson  <eric.carlson@apple.com>
1943
1944         [Mac] Update AirPlay handling
1945         https://bugs.webkit.org/show_bug.cgi?id=142541
1946
1947         Unreviewed, respond to post-review comments and add previously reviewed changes
1948         missed by a bungled merge.
1949
1950         * Shared/mac/WebCoreArgumentCodersMac.mm:
1951         * UIProcess/WebMediaPlaybackTargetPickerProxy.cpp:
1952         (WebKit::WebMediaPlaybackTargetPickerProxy::~WebMediaPlaybackTargetPickerProxy):
1953         * UIProcess/mac/PageClientImpl.h:
1954         * UIProcess/mac/PageClientImpl.mm:
1955         (WebKit::PageClientImpl::createPlaybackTargetPicker):
1956         * UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h: Added.
1957         * UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm: Added.
1958         * WebKit2.xcodeproj/project.pbxproj:
1959         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1960         * WebProcess/WebCoreSupport/WebChromeClient.h:
1961         * WebProcess/WebPage/WebPage.h:
1962         * WebProcess/WebPage/WebPage.messages.in:
1963         * WebProcess/WebPage/mac/WebPageMac.mm:
1964         * WebProcess/com.apple.WebProcess.sb.in:
1965
1966 2015-03-11  Antti Koivisto  <antti@apple.com>
1967
1968         Cache traversal missing large entries
1969         https://bugs.webkit.org/show_bug.cgi?id=142601
1970
1971         Reviewed by Andreas Kling.
1972
1973         When traversing cache entries we only read the header data from disk. This didn't work
1974         correctly for entries larger than the read size.
1975
1976         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1977         (WebKit::NetworkCache::IOChannel::read):
1978
1979             Partial reads only receive one callback with 'done' set to true.
1980             Ensure we actually return data in this case.
1981
1982         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1983         (WebKit::NetworkCache::decodeEntryHeader):
1984
1985             Add some logging.
1986
1987 2015-03-11  Eric Carlson  <eric.carlson@apple.com>
1988
1989         [Mac] Update AirPlay handling
1990         https://bugs.webkit.org/show_bug.cgi?id=142541
1991
1992         Reviewed by Sam Weinig.
1993
1994         * Shared/WebCoreArgumentCoders.h:
1995         * Shared/mac/WebCoreArgumentCodersMac.mm:
1996         (IPC::ArgumentCoder<AVPlaybackTarget>::encode):
1997         (IPC::ArgumentCoder<AVPlaybackTarget>::decode):
1998         * UIProcess/PageClient.h:
1999         * UIProcess/WebAVPlaybackTargetPickerProxy.cpp: Added.
2000         (WebKit::WebAVPlaybackTargetPickerProxy::WebAVPlaybackTargetPickerProxy):
2001         (WebKit::WebAVPlaybackTargetPickerProxy::~WebAVPlaybackTargetPickerProxy):
2002         (WebKit::WebAVPlaybackTargetPickerProxy::showPlaybackTargetPicker):
2003         (WebKit::WebAVPlaybackTargetPickerProxy::startingMonitoringPlaybackTargets):
2004         (WebKit::WebAVPlaybackTargetPickerProxy::stopMonitoringPlaybackTargets):
2005         * UIProcess/WebAVPlaybackTargetPickerProxy.h: Added.
2006         (WebKit::WebAVPlaybackTargetPickerProxy::Client::~Client):
2007         * UIProcess/WebPageProxy.cpp:
2008         (WebKit::WebPageProxy::devicePickerProxy):
2009         (WebKit::WebPageProxy::showPlaybackTargetPicker):
2010         (WebKit::WebPageProxy::startingMonitoringPlaybackTargets):
2011         (WebKit::WebPageProxy::stopMonitoringPlaybackTargets):
2012         (WebKit::WebPageProxy::didChoosePlaybackTarget):
2013         (WebKit::WebPageProxy::externalOutputDeviceAvailableDidChange):
2014         * UIProcess/WebPageProxy.h:
2015         * UIProcess/WebPageProxy.messages.in:
2016         * UIProcess/mac/PageClientImpl.h:
2017         * UIProcess/mac/PageClientImpl.mm:
2018         (WebKit::PageClientImpl::createPlaybackTargetPicker):
2019         * UIProcess/mac/WebAVPlaybackTargetPickerProxyMac.h: Added.
2020         * UIProcess/mac/WebAVPlaybackTargetPickerProxyMac.mm: Added.
2021         (WebKit::WebAVPlaybackTargetPickerProxyMac::create):
2022         (WebKit::WebAVPlaybackTargetPickerProxyMac::WebAVPlaybackTargetPickerProxyMac):
2023         (WebKit::WebAVPlaybackTargetPickerProxyMac::~WebAVPlaybackTargetPickerProxyMac):
2024         (WebKit::WebAVPlaybackTargetPickerProxyMac::outputeDeviceAvailabilityChangedTimerFired):
2025         (WebKit::WebAVPlaybackTargetPickerProxyMac::availableDevicesDidChange):
2026         (WebKit::WebAVPlaybackTargetPickerProxyMac::devicePicker):
2027         (WebKit::WebAVPlaybackTargetPickerProxyMac::showPlaybackTargetPicker):
2028         (WebKit::WebAVPlaybackTargetPickerProxyMac::currentDeviceDidChange):
2029         (WebKit::WebAVPlaybackTargetPickerProxyMac::startingMonitoringPlaybackTargets):
2030         (WebKit::WebAVPlaybackTargetPickerProxyMac::stopMonitoringPlaybackTargets):
2031         (-[WebAVOutputDevicePickerMenuControllerHelper initWithCallback:]):
2032         (-[WebAVOutputDevicePickerMenuControllerHelper clearCallback]):
2033         (-[WebAVOutputDevicePickerMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]):
2034         * WebKit2.xcodeproj/project.pbxproj:
2035         * WebProcess/WebCoreSupport/WebAVPlaybackTargetPicker.cpp: Added.
2036         (WebKit::WebAVPlaybackTargetPicker::WebAVPlaybackTargetPicker):
2037         (WebKit::WebAVPlaybackTargetPicker::showPlaybackDevicePicker):
2038         (WebKit::WebAVPlaybackTargetPicker::configureWireLessTargetMonitoring):
2039         (WebKit::WebAVPlaybackTargetPicker::addClient):
2040         (WebKit::WebAVPlaybackTargetPicker::removeClient):
2041         (WebKit::WebAVPlaybackTargetPicker::didChoosePlaybackTarget):
2042         (WebKit::WebAVPlaybackTargetPicker::playbackTargetAvailabilityDidChange):
2043         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2044         (WebKit::WebChromeClient::showPlaybackTargetPicker):
2045         (WebKit::WebChromeClient::startingMonitoringPlaybackTargets):
2046         (WebKit::WebChromeClient::stopMonitoringPlaybackTargets):
2047         * WebProcess/WebCoreSupport/WebChromeClient.h:
2048         * WebProcess/WebPage/WebPage.h:
2049         * WebProcess/WebPage/WebPage.messages.in:
2050         * WebProcess/WebPage/mac/WebPageMac.mm:
2051         (WebKit::WebPage::playbackTargetSelected):
2052         (WebKit::WebPage::playbackTargetAvailabilityDidChange):
2053         * WebProcess/com.apple.WebProcess.sb.in:
2054
2055 2015-03-11  Myles C. Maxfield  <mmaxfield@apple.com>
2056
2057         Fix the build
2058
2059         Unreviewed.
2060
2061         * Shared/Downloads/mac/DownloadMac.mm:
2062         (WebKit::Download::start):
2063         (WebKit::Download::resume):
2064
2065 2015-03-10  Sam Weinig  <sam@webkit.org>
2066
2067         Allow adding a button in input elements for auto fill related functionality
2068         <rdar://problem/19782066>
2069         https://bugs.webkit.org/show_bug.cgi?id=142564
2070
2071         Reviewed by Anders Carlsson.
2072
2073         - Adds new SPI to respond to clicks on the AutoFill button (both bundle and UIProcess).
2074         - Adds new SPI to enable/disable the display of the AutoFill button on an element.
2075         - Adds new SPI to get the bounds of the AutoFill button.
2076         - Updates spelling of AutoFill to be consistent.
2077
2078         * UIProcess/API/APIUIClient.h:
2079         (API::UIClient::didClickAutoFillButton):
2080         * UIProcess/API/C/WKPage.cpp:
2081         (WKPageSetPageUIClient):
2082         * UIProcess/API/C/WKPageUIClient.h:
2083         * UIProcess/WebPageProxy.cpp:
2084         (WebKit::WebPageProxy::handleAutoFillButtonClick):
2085         * UIProcess/WebPageProxy.h:
2086         * UIProcess/WebPageProxy.messages.in:
2087         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
2088         (API::InjectedBundle::PageUIClient::didClickAutoFillButton):
2089         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
2090         (WebKit::InjectedBundlePageUIClient::didClickAutoFillButton):
2091         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
2092         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2093         (WebKit::WebChromeClient::handleAutoFillButtonClick):
2094         * WebProcess/WebCoreSupport/WebChromeClient.h:
2095         * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h:
2096         Pipe the didClickAutoFillButton to the SPI layer.
2097
2098         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
2099         (-[WKWebProcessPlugInNodeHandle HTMLInputElementIsAutoFilled]):
2100         (-[WKWebProcessPlugInNodeHandle setHTMLInputElementIsAutoFilled:]):
2101         Update for new spelling of AutoFill.
2102
2103         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
2104         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
2105         (WKBundleNodeHandleGetHTMLInputElementAutoFilled):
2106         (WKBundleNodeHandleSetHTMLInputElementAutoFilled):
2107         Added. Replaces WKBundleNodeHandleGetHTMLInputElementAutofilled/WKBundleNodeHandleSetHTMLInputElementAutofilled
2108         which are now deprecated due to inconsistent spelling of AutoFill.
2109
2110         (WKBundleNodeHandleGetHTMLInputElementAutoFillButtonEnabled):
2111         (WKBundleNodeHandleSetHTMLInputElementAutoFillButtonEnabled):
2112         (WKBundleNodeHandleGetHTMLInputElementAutoFillButtonBounds):
2113         Added.
2114
2115         (WKBundleNodeHandleGetHTMLInputElementAutofilled):
2116         (WKBundleNodeHandleSetHTMLInputElementAutofilled):
2117         Deprecated.
2118
2119         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
2120         (WebKit::InjectedBundleNodeHandle::getOrCreate):
2121         (WebKit::InjectedBundleNodeHandle::create):
2122         (WebKit::InjectedBundleNodeHandle::InjectedBundleNodeHandle):
2123         (WebKit::InjectedBundleNodeHandle::~InjectedBundleNodeHandle):
2124         (WebKit::InjectedBundleNodeHandle::coreNode):
2125         (WebKit::InjectedBundleNodeHandle::document):
2126         (WebKit::InjectedBundleNodeHandle::elementBounds):
2127         (WebKit::InjectedBundleNodeHandle::renderRect):
2128         (WebKit::InjectedBundleNodeHandle::renderedImage):
2129         (WebKit::InjectedBundleNodeHandle::visibleRange):
2130         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementValueForUser):
2131         (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFilled):
2132         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFilled):
2133         (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFillButtonEnabled):
2134         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFillButtonEnabled):
2135         (WebKit::InjectedBundleNodeHandle::htmlInputElementAutoFillButtonBounds):
2136         (WebKit::InjectedBundleNodeHandle::htmlInputElementLastChangeWasUserEdit):
2137         (WebKit::InjectedBundleNodeHandle::htmlTextAreaElementLastChangeWasUserEdit):
2138         (WebKit::InjectedBundleNodeHandle::isTextField):
2139         (WebKit::InjectedBundleNodeHandle::htmlTableCellElementCellAbove):
2140         (WebKit::InjectedBundleNodeHandle::documentFrame):
2141         (WebKit::InjectedBundleNodeHandle::htmlFrameElementContentFrame):
2142         (WebKit::InjectedBundleNodeHandle::htmlIFrameElementContentFrame):
2143         (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutofilled): Deleted.
2144         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutofilled): Deleted.
2145         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
2146         Fix-up InjectedBundleNodeHandle to store its underlying Node in a Ref, rather than a RefPtr.
2147         Add helpers to implement the new SPI for WKBundleNodeHandleRef.
2148
2149 2015-03-11  Timothy Horton  <timothy_horton@apple.com>
2150
2151         Make it possible to zoom on pages that claim to lay out to device size and then fail to do so
2152         https://bugs.webkit.org/show_bug.cgi?id=142549
2153
2154         Reviewed by Simon Fraser.
2155
2156         * Shared/WebPreferencesDefinitions.h:
2157         * WebProcess/WebPage/WebPage.cpp:
2158         (WebKit::WebPage::updatePreferences):
2159         Flip the pref on by default.
2160
2161 2015-03-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2162
2163         [GTK] Do not look for child processes in the UI process binary path
2164         https://bugs.webkit.org/show_bug.cgi?id=135752
2165
2166         Reviewed by Gustavo Noronha Silva.
2167
2168         It's only useful for internal tools and tests, but never when
2169         installed, since we don't install the processes in the bin dir but
2170         in the libexec dir.
2171
2172         * Shared/gtk/ProcessExecutablePathGtk.cpp:
2173         (WebKit::findWebKitProcess): Only look or the executables in the
2174         UI process binary path or WEBKIT_EXEC_PATH for development builds.
2175         * UIProcess/API/gtk/WebKitWebContext.cpp:
2176         (injectedBundleDirectory): Only check
2177         WEBKIT_INJECTED_BUNDLE_PATH env var for development builds.
2178
2179 2015-03-10  Antti Koivisto  <antti@apple.com>
2180
2181         Add interface to delete disk cache entries
2182         https://bugs.webkit.org/show_bug.cgi?id=142546
2183
2184         Reviewed by Anders Carlsson.
2185
2186         * NetworkProcess/cache/NetworkCache.cpp:
2187         (WebKit::NetworkCache::Cache::remove):
2188         * NetworkProcess/cache/NetworkCache.h:
2189         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2190         (WebKit::NetworkCache::Storage::Storage):
2191         (WebKit::NetworkCache::Storage::remove):
2192
2193             Move deletion to a serial queue so we can't create large number of threads.
2194
2195         (WebKit::NetworkCache::Storage::dispatchReadOperation):
2196         (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation):
2197         (WebKit::NetworkCache::Storage::removeEntry): Deleted.
2198         * NetworkProcess/cache/NetworkCacheStorage.h:
2199         (WebKit::NetworkCache::Storage::deleteQueue):
2200
2201 2015-03-10  Chris Dumez  <cdumez@apple.com>
2202
2203         5 tests fail on Apple Mac WK2 performance bots
2204         https://bugs.webkit.org/show_bug.cgi?id=142485
2205
2206         Reviewed by Andreas Kling.
2207
2208         Only log errors in debug builds if SandboxExtension::createHandle() fails
2209         so that performance tests don't fail because of it. Such error is not
2210         fatal and is expected under certain circumstances. In particular,
2211         SandboxExtension::createHandle() is sometimes called for non-existing
2212         files (e.g. from NetworkResourceLoadParameters::encode()).
2213
2214         * Shared/mac/SandboxExtensionMac.mm:
2215         (WebKit::SandboxExtension::createHandle):
2216
2217 2015-03-10  Timothy Horton  <timothy_horton@apple.com>
2218
2219         Fix the build
2220
2221         * Shared/Downloads/ios/DownloadIOS.mm:
2222         (WebKit::Download::startWithHandle):
2223         * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
2224         (-[WKCustomProtocolLoader initWithCustomProtocolManagerProxy:customProtocolID:request:connection:]):
2225
2226 2015-03-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2227
2228         [GTK] Contents not shown when entering AC mode unless the window is resized
2229         https://bugs.webkit.org/show_bug.cgi?id=142347
2230
2231         Reviewed by Žan Doberšek.
2232
2233         The problem is once again that we are now creating the redirected
2234         X window in realize method. When entering AC mode we resize the
2235         redirected window to the drawing area size. Since the size hasn't
2236         changed from the drawing area point of view, the web process is
2237         not notified. The WebProcess always uses the window size, instead
2238         of the root layer size, to make sure it's in sync, see the comment
2239         in LayerTreeHostGtk::compositeLayersToContext(). So, we need to
2240         enforce a resize when we change the size of the redirected window
2241         when entering AC mode.
2242
2243         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2244         (webkitWebViewBaseEnterAcceleratedCompositingMode):
2245         * UIProcess/DrawingAreaProxyImpl.h:
2246         (WebKit::DrawingAreaProxyImpl::forceResize):
2247
2248 2015-03-10  Csaba Osztrogonác  <ossy@webkit.org>
2249
2250         [cmake] Handle unused parameter warnings as build errors except in WebKit2
2251         https://bugs.webkit.org/show_bug.cgi?id=142338
2252
2253         Reviewed by Gyuyoung Kim.
2254
2255         * CMakeLists.txt:
2256
2257 2015-03-10  Dan Bernstein  <mitz@apple.com>
2258
2259         WebKit2 part of <rdar://problem/20086546> [Cocoa] Add an option to treat certificate chains with SHA1-signed certificates as insecure
2260         https://bugs.webkit.org/show_bug.cgi?id=142461
2261
2262         Reviewed by Sam Weinig.
2263
2264         * UIProcess/API/Cocoa/WKWebView.mm:
2265         (-[WKWebView initWithFrame:configuration:]): Initialize
2266         webPageConfiguration.treatsSHA1SignedCertificatesAsInsecure from the WKWebViewConfiguration.
2267
2268         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2269         Added _treatsSHA1SignedCertificatesAsInsecure ivar.
2270         (-[WKWebViewConfiguration copyWithZone:]): Copy _treatsSHA1SignedCertificatesAsInsecure.
2271         (-[WKWebViewConfiguration _treatsSHA1SignedCertificatesAsInsecure]): Added this getter.
2272         (-[WKWebViewConfiguration _setTreatsSHA1SignedCertificatesAsInsecure:]): Added this setter.
2273
2274         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: Declared new
2275         _treatsSHA1SignedCertificatesAsInsecure property.
2276
2277         * UIProcess/PageLoadState.cpp:
2278         (WebKit::PageLoadState::didCommitLoad): Use new hasInsecureContent parameter to initialize
2279         hasInsecureContent parameter in the uncommitted state.
2280         * UIProcess/PageLoadState.h:
2281
2282         * UIProcess/WebPageProxy.cpp:
2283         (WebKit::WebPageProxy::WebPageProxy): Initialize new m_treatsSHA1CertificatesAsInsecure
2284         member variable from the WebPageConfiguration.
2285         (WebKit::WebPageProxy::didCommitLoadForFrame): Pass true for the new hasInsecureContent to
2286         PageLoadState::didCommitLoad if we are treating SHA1-signed certificates as insecure and
2287         the certificate info contains a non-root SHA1-signed certificate.
2288         * UIProcess/WebPageProxy.h: Added m_treatsSHA1CertificatesAsInsecure member variable.
2289
2290 2015-03-09  Geoffrey Garen  <ggaren@apple.com>
2291
2292         bmalloc: tryFastMalloc shouldn't crash
2293         https://bugs.webkit.org/show_bug.cgi?id=142443
2294
2295         Reviewed by Anders Carlsson.
2296
2297         Part 1: Stop using tryFastRealloc.
2298
2299         * Shared/ShareableBitmap.cpp:
2300         (WebKit::ShareableBitmap::resize): Deleted.
2301         * Shared/ShareableBitmap.h: Removed the resize function because it has
2302         no clients.
2303
2304         * WebProcess/Plugins/PluginProxy.cpp:
2305         (WebKit::PluginProxy::updateBackingStore): Changed to allocate a new
2306         backing store instead of resizing the old one. This has three advantages:
2307
2308         (1) Might be more memory-efficient, since you don't have to keep the old
2309         one around while allocating the new one.
2310
2311         (2) Avoids the overhead of realloc() copying the contents of the old
2312         backing store even though we only want uninitialized memory.
2313
2314         (3) Makes resize failure consistent with initial allocation failure.
2315         Previously, while initial allocation failure would set the backing store
2316         to null, resize failure would keep the old wrong backing store and then
2317         tell it not to paint. Now, resize failure also sets the backing store to
2318         null.
2319
2320 2015-03-09  Martin Robinson  <mrobinson@igalia.com>
2321
2322         [EFL] Move DispatchQueue to WTF
2323         https://bugs.webkit.org/show_bug.cgi?id=142493
2324
2325         Reviewed by Csaba Osztrogonác.
2326
2327         * PlatformEfl.cmake: Remove DispatchQueue from the source list.
2328
2329 2015-03-08  Dean Jackson  <dino@apple.com>
2330
2331         [iOS Media] Video buffer progress missing on iPhones
2332         https://bugs.webkit.org/show_bug.cgi?id=142462
2333
2334         Reviewed by Eric Carlson.
2335
2336         Coordinate the SetBufferedTime message between the Web and UI
2337         processes.
2338
2339         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: New message SetBufferedTime.
2340         * WebProcess/ios/WebVideoFullscreenManager.h:
2341         * WebProcess/ios/WebVideoFullscreenManager.mm:
2342         (WebKit::WebVideoFullscreenManager::setBufferedTime):
2343
2344 2015-03-08  Sam Weinig  <sam@webkit.org>
2345
2346         [Content Extensions] Add scaffolding for the WKUserContentExtensionStore
2347         https://bugs.webkit.org/show_bug.cgi?id=142464
2348
2349         Reviewed by Dan Bernstein.
2350
2351         * Shared/API/APIObject.h:
2352         Add a UserContentExtensionStore type and move the UserContentExtension type into the correct section (UIProcess).
2353
2354         * Shared/API/c/WKBase.h:
2355         Add the WKUserContentExtensionStoreRef C-SPI type.
2356
2357         * Shared/Cocoa/APIObject.mm:
2358         (API::Object::newObject):
2359         Add allocation support for UserContentExtensionStore (and UserContentExtension while we are there, it will be
2360         needed shortly).
2361
2362         * UIProcess/API/APIUserContentExtensionStore.cpp: Added.
2363         (API::UserContentExtensionStore::UserContentExtensionStore):
2364         (API::UserContentExtensionStore::~UserContentExtensionStore):
2365         * UIProcess/API/APIUserContentExtensionStore.h: Added.
2366         Stub out the UserContentExtensionStore.
2367
2368         * UIProcess/API/C/WKAPICast.h:
2369         Add casting for the UserContentExtensionStore.
2370
2371         * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp: Added.
2372         (WKUserContentExtensionStoreGetTypeID):
2373         * UIProcess/API/C/WKUserContentExtensionStoreRef.h: Added.
2374         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h: Added.
2375         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm: Added.
2376         (-[_WKUserContentExtensionStore init]):
2377         (-[_WKUserContentExtensionStore dealloc]):
2378         (-[_WKUserContentExtensionStore _apiObject]):
2379         * UIProcess/API/Cocoa/_WKUserContentExtensionStoreInternal.h: Added.
2380         (WebKit::wrapper):
2381         Stub out SPI for the UserContentExtensionStore.
2382
2383         * WebKit2.xcodeproj/project.pbxproj:
2384         * CMakeLists.txt:
2385         Add new files.
2386
2387 2015-03-08  Sam Weinig  <sam@webkit.org>
2388
2389         AX: Expose a frame's accessible name through WK2 C SPI
2390         <rdar://problem/19653068>
2391         https://bugs.webkit.org/show_bug.cgi?id=142468
2392
2393         Reviewed by Dan Bernstein.
2394
2395         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
2396         (WKBundleFrameSetAccessibleName):
2397         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
2398         * WebProcess/WebPage/WebFrame.cpp:
2399         (WebKit::WebFrame::setAccessibleName):
2400         * WebProcess/WebPage/WebFrame.h:
2401         Add SPI to set a frame's accessible name. This matches the Legacy WebKit SPI -[WebFrame setAccessibleName:]. 
2402
2403 2015-03-08  Sam Weinig  <sam@webkit.org>
2404
2405         [Content Extensions] Pass compiled content extensions as read-only shared memory rather than copying them
2406         https://bugs.webkit.org/show_bug.cgi?id=142458
2407
2408         Reviewed by Dan Bernstein.
2409
2410         * Shared/WebCompiledContentExtensionData.cpp:
2411         (WebKit::WebCompiledContentExtensionData::encode):
2412         (WebKit::WebCompiledContentExtensionData::decode):
2413         * Shared/WebCompiledContentExtensionData.h:
2414         (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
2415         Store the compiled data as a SharedMemory block with offset/size pairs for the
2416         bytecode and actions. While the bytecode offset is currently always 0, this won't
2417         be the case when we map these in from files due to metadata that will be placed
2418         at the top of the files.
2419
2420         * Shared/WebCompiledContentExtension.h:
2421         * Shared/WebCompiledContentExtension.cpp:
2422         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
2423         Temporary creation helper. In subsequent patches, this will be removed and replaced
2424         by always passing in shared/mapped data.
2425
2426         (WebKit::WebCompiledContentExtension::create):
2427         (WebKit::WebCompiledContentExtension::WebCompiledContentExtension):
2428         (WebKit::WebCompiledContentExtension::bytecode):
2429         (WebKit::WebCompiledContentExtension::bytecodeLength):
2430         (WebKit::WebCompiledContentExtension::actions):
2431         (WebKit::WebCompiledContentExtension::actionsLength):
2432         Convert to work with the new WebCompiledContentExtension format.
2433         
2434         * UIProcess/API/C/WKUserContentFilterRef.cpp:
2435         (WKUserContentFilterCreate):
2436         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
2437         (-[_WKUserContentFilter initWithName:serializedRules:]):
2438         Switch to using WebCompiledContentExtension::createFromCompiledContentExtensionData().
2439
2440         * WebProcess/UserContent/WebUserContentController.cpp:
2441         (WebKit::WebUserContentController::addUserContentExtensions):
2442         * WebProcess/WebPage/WebPageGroupProxy.cpp:
2443         (WebKit::WebPageGroupProxy::addUserContentExtension):
2444         Update to pass the WebCompiledContentExtensionData directly to the WebCompiledContentExtension.
2445
2446 2015-03-08  Carlos Garcia Campos  <cgarcia@igalia.com>
2447
2448         Remove willDestroyFrame in WKBundlePageLoaderClient
2449         https://bugs.webkit.org/show_bug.cgi?id=142389
2450
2451         Reviewed by Anders Carlsson.
2452
2453         I added willDestroyFrame in r154540 but I realized recently that
2454         it has never actually worked. Adding the callback to
2455         WKBundlePageLoaderClient was the first mistake, since frames are
2456         handled by WebProcess and DidDestroyFrame message is indeed a
2457         WebProcessProxy not a WebPageProxy one. Second mistake was calling
2458         the callback from WebFrameLoaderClient::frameLoaderDestroyed(),
2459         since at that point the frame has already been detached from the
2460         page and so WebFrame::page() always returns nullptr. So, this in
2461         fact dead code and since r180211 nobody is using it.
2462
2463         * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
2464         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
2465         (webkitWebPageCreate): Use verion 6 instead of version 7 of loader client.
2466         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2467         (WebKit::InjectedBundlePageLoaderClient::willDestroyFrame): Deleted.
2468         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2469         (WebKit::WebFrameLoaderClient::frameLoaderDestroyed):
2470
2471 2015-03-06  Sam Weinig  <sam@webkit.org>
2472
2473         [Content Extensions] Move compiling of content extensions to the UIProcess
2474         https://bugs.webkit.org/show_bug.cgi?id=142402
2475
2476         Reviewed by Benjamin Poulain.
2477
2478         * Shared/API/APIObject.h:
2479         Rename UserContentFilter type to UserContentExtension to match new unified naming.
2480
2481         * Shared/WebCompiledContentExtension.cpp: Added.
2482         (WebKit::WebCompiledContentExtension::create):
2483         (WebKit::WebCompiledContentExtension::WebCompiledContentExtension):
2484         (WebKit::WebCompiledContentExtension::~WebCompiledContentExtension):
2485         (WebKit::WebCompiledContentExtension::bytecode):
2486         (WebKit::WebCompiledContentExtension::bytecodeLength):
2487         (WebKit::WebCompiledContentExtension::actions):
2488         (WebKit::WebCompiledContentExtension::actionsLength):
2489         * Shared/WebCompiledContentExtension.h: Added.
2490         Add new WebKit2 implementation of CompiledContentExtension. Right now it is the same as the old
2491         WebCore based CompiledContentExtension, but in subsequent patches, it will use shared/file backed
2492         memory.
2493
2494         * Shared/WebCompiledContentExtensionData.cpp: Added.
2495         (WebKit::WebCompiledContentExtensionData::encode):
2496         (WebKit::WebCompiledContentExtensionData::decode):
2497         * Shared/WebCompiledContentExtensionData.h: Added.
2498         Add encodable/decodable holder for the compiled content extension data for use in IPC. Right
2499         now it is doing the naive thing and always copying the data, but in subsequent patches, it will
2500         use shared/file backed memory.
2501
2502         * Shared/WebPageGroupData.cpp:
2503         (WebKit::WebPageGroupData::encode):
2504         (WebKit::WebPageGroupData::decode):
2505         * Shared/WebPageGroupData.h:
2506         Rename member to match new unification on the name userContentExtension. Change the value from
2507         the serialized JSON (as a String) to WebCompiledContentExtensionData.
2508
2509         * UIProcess/API/APIUserContentExtension.cpp: Copied from Source/WebKit2/UIProcess/API/APIUserContentFilter.cpp.
2510         (API::UserContentExtension::UserContentExtension):
2511         (API::UserContentExtension::~UserContentExtension):
2512         (API::UserContentFilter::UserContentFilter): Deleted.
2513         (API::UserContentFilter::~UserContentFilter): Deleted.
2514         * UIProcess/API/APIUserContentExtension.h: Copied from Source/WebKit2/UIProcess/API/APIUserContentFilter.h.
2515         * UIProcess/API/APIUserContentFilter.cpp: Removed.
2516         * UIProcess/API/APIUserContentFilter.h: Removed.
2517         Renamed UserContentFilter to APIUserContentExtension. Updated to store the compiled extension (as a WebCompiledContentExtension)
2518         rather than the serialized JSON.
2519
2520         * UIProcess/API/C/WKAPICast.h:
2521         * UIProcess/API/C/WKPageGroup.cpp:
2522         (WKPageGroupAddUserContentFilter):
2523         (WKPageGroupRemoveUserContentFilter):
2524         (WKPageGroupRemoveAllUserContentFilters):
2525         * UIProcess/API/C/WKUserContentControllerRef.cpp:
2526         (WKUserContentControllerAddUserContentFilter):
2527         (WKUserContentControllerRemoveAllUserContentFilters):
2528         * UIProcess/API/Cocoa/WKUserContentController.mm:
2529         (-[WKUserContentController _addUserContentFilter:]):
2530         (-[WKUserContentController _removeUserContentFilter:]):
2531         (-[WKUserContentController _removeAllUserContentFilters]):
2532         Update for rename of APIUserContentFilter -> UserContentExtension.
2533
2534         * UIProcess/API/C/WKUserContentFilterRef.cpp:
2535         (WKUserContentFilterGetTypeID):
2536         (WKUserContentFilterCreate):
2537         Update for rename of APIUserContentFilter -> UserContentExtension. Also make WKUserContentFilterCreate eagerly
2538         compile rule list to a WebCompiledContentExtensionData.
2539
2540         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
2541         (-[_WKUserContentFilter initWithName:serializedRules:]):
2542         (-[_WKUserContentFilter dealloc]):
2543         (-[_WKUserContentFilter _apiObject]):
2544         Update for rename of APIUserContentFilter -> UserContentExtension. Also make initWithName:serializedRules: eagerly
2545         compile rule list to a WebCompiledContentExtensionData.
2546
2547         * UIProcess/API/Cocoa/_WKUserContentFilterInternal.h:
2548         (WebKit::wrapper):
2549         Update for rename of APIUserContentFilter -> UserContentExtension.
2550
2551         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2552         (WebKit::WebUserContentControllerProxy::addProcess):
2553         (WebKit::WebUserContentControllerProxy::addUserContentExtension):
2554         (WebKit::WebUserContentControllerProxy::removeUserContentExtension):
2555         (WebKit::WebUserContentControllerProxy::removeAllUserContentExtensions):
2556         (WebKit::WebUserContentControllerProxy::addUserContentFilter): Deleted.
2557         (WebKit::WebUserContentControllerProxy::removeUserContentFilter): Deleted.
2558         (WebKit::WebUserContentControllerProxy::removeAllUserContentFilters): Deleted.
2559         * UIProcess/UserContent/WebUserContentControllerProxy.h:
2560         * UIProcess/WebPageGroup.cpp:
2561         (WebKit::WebPageGroup::addUserContentExtension):
2562         (WebKit::WebPageGroup::removeUserContentExtension):
2563         (WebKit::WebPageGroup::removeAllUserContentExtensions):
2564         (WebKit::WebPageGroup::addUserContentFilter): Deleted.
2565         (WebKit::WebPageGroup::removeUserContentFilter): Deleted.
2566         (WebKit::WebPageGroup::removeAllUserContentFilters): Deleted.
2567         * UIProcess/WebPageGroup.h:
2568         * WebKit2.xcodeproj/project.pbxproj:
2569         * WebProcess/UserContent/WebUserContentController.cpp:
2570         (WebKit::WebUserContentController::addUserContentExtensions):
2571         (WebKit::WebUserContentController::removeUserContentExtension):
2572         (WebKit::WebUserContentController::removeAllUserContentExtensions):
2573         (WebKit::WebUserContentController::addUserContentFilters): Deleted.
2574         (WebKit::WebUserContentController::removeUserContentFilter): Deleted.
2575         (WebKit::WebUserContentController::removeAllUserContentFilters): Deleted.
2576         * WebProcess/UserContent/WebUserContentController.h:
2577         * WebProcess/UserContent/WebUserContentController.messages.in:
2578         * WebProcess/WebPage/WebPageGroupProxy.cpp:
2579         (WebKit::WebPageGroupProxy::WebPageGroupProxy):
2580         (WebKit::WebPageGroupProxy::addUserContentExtension):
2581         (WebKit::WebPageGroupProxy::removeUserContentExtension):
2582         (WebKit::WebPageGroupProxy::removeAllUserContentExtensions):
2583         (WebKit::WebPageGroupProxy::addUserContentFilter): Deleted.
2584         (WebKit::WebPageGroupProxy::removeUserContentFilter): Deleted.
2585         (WebKit::WebPageGroupProxy::removeAllUserContentFilters): Deleted.
2586         * WebProcess/WebPage/WebPageGroupProxy.h:
2587         * WebProcess/WebPage/WebPageGroupProxy.messages.in:
2588         Pipe the compiled extension from the UIProcess to the WebProcess.
2589
2590 2015-03-06  Dean Jackson  <dino@apple.com>
2591
2592         Support "plus-lighter" in mix-blend mode
2593         https://bugs.webkit.org/show_bug.cgi?id=142416
2594         <rdar://problem/19993979>
2595
2596         Reviewed by Darin Adler and Sam Weinig.
2597
2598         Output the appropriate blending type when logging.
2599
2600         * Shared/mac/RemoteLayerTreeTransaction.mm:
2601         (WebKit::RemoteLayerTreeTextStream::operator<<):
2602
2603 2015-03-06  Beth Dakin  <bdakin@apple.com>
2604
2605         REGRESSION (r180782): Data Detector popovers are not dismissed on scroll or zoom
2606         https://bugs.webkit.org/show_bug.cgi?id=142371
2607         -and corresponding-
2608         rdar://problem/20059224
2609
2610         Reviewed by Tim Horton.
2611
2612         This patch has the WKImmediateActionController keep track of whether or not it has 
2613         an active immediate action. Then we only call into Lookup and DD if the window is 
2614         key OR if the WKView’s immediateActionController has an active action.
2615         * UIProcess/API/mac/WKView.mm:
2616         (-[WKView _dismissContentRelativeChildWindows]):
2617         * UIProcess/mac/WKImmediateActionController.h:
2618         * UIProcess/mac/WKImmediateActionController.mm:
2619         (-[WKImmediateActionController initWithPage:view:recognizer:]):
2620         (-[WKImmediateActionController willDestroyView:]):
2621         (-[WKImmediateActionController _clearImmediateActionState]):
2622         (-[WKImmediateActionController hasActiveImmediateAction]):
2623         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
2624
2625 2015-03-06  Jeremy Jones  <jeremyj@apple.com>
2626
2627         Scroll to make the video element visible when exiting fullscreen.
2628         https://bugs.webkit.org/show_bug.cgi?id=141439
2629
2630         Reviewed by Simon Fraser.
2631
2632         This patch will restore interface state when exiting fullscreen.
2633         Adds preparedToReturnToInline to continue exiting once the interface is updated.
2634
2635         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
2636         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
2637         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2638         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
2639         (WebKit::WebVideoFullscreenManagerProxy::fullscreenMayReturnToInline):
2640         (WebKit::WebVideoFullscreenManagerProxy::preparedToReturnToInline): added.
2641         * WebProcess/ios/WebVideoFullscreenManager.h:
2642         * WebProcess/ios/WebVideoFullscreenManager.messages.in:
2643         * WebProcess/ios/WebVideoFullscreenManager.mm:
2644         (WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline):
2645
2646 2015-03-06  Antti Koivisto  <antti@apple.com>
2647
2648         Rename NetworkCacheStorageCocoa.mm to NetworkCacheStorage.cpp
2649         https://bugs.webkit.org/show_bug.cgi?id=142401
2650
2651         Rubber-stamped by Anders Carlsson.
2652
2653         It is now fully cross-platform.
2654
2655         * NetworkProcess/cache/NetworkCacheStorage.cpp: Copied from Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm.
2656         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
2657         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm: Removed.
2658         * WebKit2.xcodeproj/project.pbxproj:
2659
2660 2015-03-06  Antti Koivisto  <antti@apple.com>
2661
2662         Don't use dispatch_semaphore in NetworkCacheStorage
2663         https://bugs.webkit.org/show_bug.cgi?id=142395
2664
2665         Reviewed by Anders Carlsson.
2666
2667         * NetworkProcess/cache/NetworkCacheIOChannel.h:
2668         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
2669         (WebKit::NetworkCache::IOChannel::read):
2670         (WebKit::NetworkCache::IOChannel::readSync):
2671
2672             Add readSync to encapsulate the semaphore.
2673
2674         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2675         (WebKit::NetworkCache::Storage::traverse):
2676
2677 2015-03-06  Antti Koivisto  <antti@apple.com>
2678
2679         Move dispatch_data use behind NetworkCache::Data abstraction
2680         https://bugs.webkit.org/show_bug.cgi?id=142392
2681
2682         Reviewed by Anders Carlsson.
2683
2684         * NetworkProcess/cache/NetworkCacheData.h:
2685         (WebKit::NetworkCache::DispatchPtr::DispatchPtr):
2686         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
2687         (WebKit::NetworkCache::Data::Data):
2688         (WebKit::NetworkCache::Data::apply):
2689         (WebKit::NetworkCache::Data::subrange):
2690         (WebKit::NetworkCache::concatenate):
2691         (WebKit::NetworkCache::mapFile):
2692         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
2693         (WebKit::NetworkCache::IOChannel::read):
2694         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2695         (WebKit::NetworkCache::hashData):
2696         (WebKit::NetworkCache::decodeEntryMetaData):
2697         (WebKit::NetworkCache::decodeEntryHeader):
2698         (WebKit::NetworkCache::decodeEntry):
2699         (WebKit::NetworkCache::encodeEntryMetaData):
2700         (WebKit::NetworkCache::encodeEntryHeader):
2701         (WebKit::NetworkCache::Storage::dispatchFullWriteOperation):
2702         (WebKit::NetworkCache::mapFile): Deleted.
2703
2704 2015-03-06  Antti Koivisto  <antti@apple.com>
2705
2706         Use WTF abstraction for page size in NetworkCacheStorage
2707         https://bugs.webkit.org/show_bug.cgi?id=142396
2708
2709         Reviewed by Darin Adler.
2710
2711         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2712         (WebKit::NetworkCache::decodeEntryMetaData):
2713         (WebKit::NetworkCache::Storage::dispatchFullWriteOperation):
2714
2715 2015-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
2716
2717         [iOS] SVG fonts are garbled
2718         https://bugs.webkit.org/show_bug.cgi?id=142377
2719
2720         Reviewed by Simon Fraser.
2721
2722         * Configurations/FeatureDefines.xcconfig:
2723
2724 2015-03-06  Zan Dobersek  <zdobersek@igalia.com>
2725
2726         Unguarded GTK-specific member and method usage in DrawingAreaImpl
2727         https://bugs.webkit.org/show_bug.cgi?id=142391
2728
2729         Reviewed by Carlos Garcia Campos.
2730
2731         r180924 introduced unguarded use of m_nativeSurfaceHandleForCompositing
2732         and LayerTreeHost::setNativeSurfaceHandleForCompositing() in DrawingAreaImpl.
2733         Definitions for both of these are guarded with USE(TEXTURE_MAPPER_GL) and PLATFORM(GTK),
2734         so their use should be as well.
2735
2736         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2737         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
2738
2739 2015-03-06  David Kilzer  <ddkilzer@apple.com>
2740
2741         REGRESSION (r181140): WebKit2 fails to build on Mavericks buildbot
2742
2743         Work around Xcode dependency tracking issues by making changes
2744         to source files that need to be recompiled.
2745
2746         * NetworkProcess/NetworkProcess.cpp: Update copyright.  Include
2747         NetworkCache.h since it didn't appear to be included by
2748         NetworkCacheCoders.h.
2749         * NetworkProcess/cocoa/NetworkProcessCocoa.mm: Update copyright.
2750
2751 2015-03-05  Antti Koivisto  <antti@apple.com>
2752
2753         Move disk cache classes to namespace
2754         https://bugs.webkit.org/show_bug.cgi?id=142339
2755
2756         Reviewed by Anders Carlsson.
2757
2758         Move everything to NetworkCache namespace. 
2759
2760 2015-03-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2761
2762         REGRESSION(r180924): ASSERTION FAILED: !from.isEmpty() in WebCore::TransformationMatrix::rectToRect
2763         https://bugs.webkit.org/show_bug.cgi?id=142345
2764
2765         Reviewed by Martin Robinson.
2766
2767         This was caused by r180924 that postpones the creation of the
2768         TextureMapper, which could cause that a layer has not yet a size
2769         when TextureMapper::paint() is called. This patch moves the
2770         creation of the TextureMapper to
2771         LayerTreeHostGtk::setNativeSurfaceHandleForCompositing(), so that
2772         it's created as soon as it's possible to create. This method is
2773         called by the drawing area right after creating the
2774         LayerTreeHostGtk if it already have a handler, or when the handle
2775         is received from the UI process.
2776
2777         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
2778         (WebKit::LayerTreeHostGtk::initialize): Remove the
2779         nsureTextureMapper call because at this point the layer context ID
2780         is always 0, so it's impossible to create the TextureMapper.
2781         (WebKit::LayerTreeHostGtk::compositeLayersToContext): Remove the
2782         ensureTextureMapper call from here too, since at this point, if we
2783         have a context, we should also have a TextureMapper. Add an ASSERT
2784         right before using the TextureMapper.
2785         (WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing):
2786         Create the TextureMapper here.
2787         (WebKit::LayerTreeHostGtk::ensureTextureMapper): Deleted.
2788         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
2789
2790 2015-03-05  Anders Carlsson  <andersca@apple.com>
2791
2792         WKWebView Encoder for remote object communication does not implement encodeInt32:forKey:
2793         https://bugs.webkit.org/show_bug.cgi?id=142356
2794         rdar://problem/20058952
2795
2796         Reviewed by Tim Horton.
2797
2798         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
2799         (-[WKRemoteObjectEncoder encodeInt32:forKey:]):
2800         (-[WKRemoteObjectDecoder decodeInt32ForKey:]):
2801
2802 2015-03-05  Chris Dumez  <cdumez@apple.com>
2803
2804         NetworkCache efficacy logging is using too much CPU
2805         https://bugs.webkit.org/show_bug.cgi?id=142186
2806         <rdar://problem/19632080>
2807
2808         Reviewed by Antti Koivisto.
2809
2810         NetworkCache efficacy logging was using too much CPU mostly due to
2811         database writes. Logging was using ~11.3% of the NetworkProcess'
2812         CPU usage (~9.2% for writes / ~1.3% for reads).
2813
2814         This patch buffers writes requests in memory and only writes them
2815         to disk every 10 seconds. We are thus writing to this less frequently
2816         and writing more at once, in a single SQL transaction. After this
2817         change, efficacy logging only accounts for ~3.5% of the NetworkProcess'
2818         CPU activity (1.5% for writes / 1.2% for reads).
2819
2820         Now that CPU usage is more acceptable, this patch re-enables the
2821         network cache efficicy logging.
2822
2823         * NetworkProcess/cache/NetworkCacheStatistics.h:
2824
2825         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
2826         (WebKit::executeSQLCommand):
2827         (WebKit::executeSQLStatement):
2828         Call step() instead of executeCommand() because:
2829         - The input statement is already prepared.
2830         - step() does not finalize() the statement and thus we caller can
2831           reuse it after calling reset().
2832
2833         (WebKit::NetworkCacheStatistics::NetworkCacheStatistics):
2834         (WebKit::NetworkCacheStatistics::initialize):
2835         (WebKit::NetworkCacheStatistics::bootstrapFromNetworkCache):
2836         (WebKit::NetworkCacheStatistics::recordNotCachingResponse):
2837         (WebKit::NetworkCacheStatistics::recordNotUsingCacheForRequest):
2838         (WebKit::NetworkCacheStatistics::recordRetrievalFailure):
2839         (WebKit::NetworkCacheStatistics::markAsRequested):
2840         (WebKit::NetworkCacheStatistics::writeTimerFired):
2841         (WebKit::NetworkCacheStatistics::queryWasEverRequested):
2842         (WebKit::NetworkCacheStatistics::addHashesToDatabase):
2843         (WebKit::NetworkCacheStatistics::addStoreDecisionsToDatabase):
2844         (WebKit::NetworkCacheStatistics::addHashToDatabase): Deleted.
2845
2846         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2847         (WebKit::registerUserDefaultsIfNeeded):
2848         Re-enable the network cache efficacy logging.
2849
2850 2015-03-05  Antti Koivisto  <antti@apple.com>
2851
2852         Switch NetworkCacheStorage to WorkQueue abstraction
2853         https://bugs.webkit.org/show_bug.cgi?id=142337
2854
2855         Reviewed by Anders Carlsson.
2856
2857         Don't use dispatch_async directly.
2858
2859         * NetworkProcess/cache/NetworkCacheStorage.h:
2860         (WebKit::NetworkCacheStorage::ioQueue):
2861         (WebKit::NetworkCacheStorage::backgroundIOQueue):
2862         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2863         (WebKit::NetworkCacheStorage::NetworkCacheStorage):
2864         (WebKit::NetworkCacheStorage::initialize):
2865         (WebKit::NetworkCacheStorage::removeEntry):
2866         (WebKit::NetworkCacheStorage::dispatchReadOperation):
2867         (WebKit::retrieveFromMemory):
2868         (WebKit::NetworkCacheStorage::traverse):
2869         (WebKit::NetworkCacheStorage::dispatchFullWriteOperation):
2870         (WebKit::NetworkCacheStorage::dispatchHeaderWriteOperation):
2871         (WebKit::NetworkCacheStorage::clear):
2872         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
2873         (WebKit::NetworkCacheStorage::deleteOldVersions):
2874
2875 2015-03-05  Lukasz Bialek  <l.bialek@samsung.com>
2876
2877         [EFL][WK2] Crash when "Download Linked File" from MiniBrowser context menu is clicked
2878         https://bugs.webkit.org/show_bug.cgi?id=131162
2879
2880         Reviewed by Gyuyoung Kim.
2881
2882         "Download Linked File" crashes because of null-pointer exception of Download Job.
2883         Due to architectural difficulties, easy fix is not possible (EwkView is needed in
2884         DownloadManager to create DownloadJobs and it is only used to notify the client 
2885         about download (finished, error, cancel) via smart callback using EwkView (Evas_Object).
2886
2887         Propose a new callbacks which are view independent and detach EFL's DownloadManager
2888         from EwkView. It makes DownloadManagerEFL consistent with WKContextDownload.
2889         Fix the crash and restore download functionality.
2890
2891         * PlatformEfl.cmake:
2892         Enable newly reimplemented tests
2893         * UIProcess/API/efl/EwkViewCallbacks.h:
2894         Remove old callback mechanism
2895         * UIProcess/API/efl/ewk_context.cpp:
2896         (ewk_context_download_callbacks_set):
2897         * UIProcess/API/efl/ewk_context.h:
2898         Declare new callback functions and registration functions
2899         * UIProcess/API/efl/ewk_download_job.cpp:
2900         (EwkDownloadJob::EwkDownloadJob):
2901         (EwkDownloadJob::view): Deleted.
2902         * UIProcess/API/efl/ewk_download_job.h:
2903         * UIProcess/API/efl/ewk_download_job_private.h:
2904         (EwkDownloadJob::create):
2905         Remove EwkView dependency
2906         * UIProcess/API/efl/ewk_view.h:
2907         * UIProcess/API/efl/tests/test_ewk2_download_job.cpp:
2908         Alter tests to new callback mechanism
2909         * UIProcess/efl/DownloadManagerEfl.cpp:
2910         (WebKit::DownloadManagerEfl::decideDestinationWithSuggestedFilename):
2911         (WebKit::DownloadManagerEfl::didStart):
2912         (WebKit::DownloadManagerEfl::didFail):
2913         (WebKit::DownloadManagerEfl::didCancel):
2914         (WebKit::DownloadManagerEfl::didFinish):
2915         (WebKit::DownloadManagerEfl::DownloadManagerEfl):
2916         (WebKit::DownloadManagerEfl::registerDownloadJob):
2917         (WebKit::DownloadManagerEfl::setCallbacks):
2918         * UIProcess/efl/DownloadManagerEfl.h:
2919         * UIProcess/efl/WebViewEfl.cpp:
2920         (WebKit::WebViewEfl::handleDownloadRequest):
2921         Add support of new callback mechanism
2922
2923 2015-03-05  Michael Catanzaro  <mcatanzaro@igalia.com>
2924
2925         [SOUP] Disable RC4
2926         https://bugs.webkit.org/show_bug.cgi?id=140014
2927
2928         Reviewed by Carlos Garcia Campos.
2929
2930         Disallow RC4-based ciphersuites when performing TLS negotiation,
2931         because it is no longer considered secure.
2932
2933         * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
2934         (main):
2935         * WebProcess/EntryPoint/unix/WebProcessMain.cpp:
2936         (main):
2937
2938 2015-03-04  Yusuke Suzuki  <utatane.tea@gmail.com>
2939
2940         Hide Promise with runtime flags under Cocoa JSContext API
2941         https://bugs.webkit.org/show_bug.cgi?id=141965
2942
2943         Reviewed by Filip Pizlo.
2944
2945         Add new JSC runtime flag, PromiseDisabled.
2946
2947         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2948         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2949
2950 2015-03-04  Beth Dakin  <bdakin@apple.com>
2951
2952         Attempted build fix.
2953
2954         * UIProcess/API/Cocoa/WKViewPrivate.h:
2955
2956 2015-03-04  Beth Dakin  <bdakin@apple.com>
2957
2958         Message UI process when contentSize changes
2959         https://bugs.webkit.org/show_bug.cgi?id=142294
2960         -and corresponding-
2961         rdar://problem/19963165
2962
2963         Reviewed by Andreas Kling.
2964
2965         This patch un-ifdefs the didChangeContentSize message so that we can use it on Mac 
2966         as well. 
2967
2968         New private method that subclasses can override when they need to do something 
2969         with contentSize changes.
2970         * UIProcess/API/Cocoa/WKViewPrivate.h:
2971         * UIProcess/API/mac/WKView.mm:
2972         (-[WKView _didChangeContentSize:]):
2973         * UIProcess/PageClient.h:
2974
2975         Un-ifdef.
2976         * UIProcess/WebPageProxy.cpp:
2977         (WebKit::WebPageProxy::didChangeContentSize):
2978         * UIProcess/WebPageProxy.h:
2979         * UIProcess/WebPageProxy.messages.in:
2980         * UIProcess/mac/PageClientImpl.h:
2981         * UIProcess/mac/PageClientImpl.mm:
2982         (WebKit::PageClientImpl::didChangeContentSize):
2983         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2984         (WebKit::WebChromeClient::contentsSizeChanged):
2985
2986         Stubs for other platforms now that the pure-virtual is un-masked.
2987         * UIProcess/ios/PageClientImplIOS.h:
2988         * UIProcess/ios/PageClientImplIOS.mm:
2989         (WebKit::PageClientImpl::didChangeContentSize):
2990         * UIProcess/API/gtk/PageClientImpl.h:
2991
2992 2015-03-04  Antti Koivisto  <antti@apple.com>
2993
2994         Factor platform I/O out from NetworkCacheStorage
2995         https://bugs.webkit.org/show_bug.cgi?id=142279
2996
2997         Reviewed by Chris Dumez.
2998
2999         * NetworkProcess/cache/NetworkCacheData.h: Added.
3000         * NetworkProcess/cache/NetworkCacheDataCocoa.mm: Added.
3001
3002             NetworkCacheStorage::Data -> NetworkCacheData
3003             Move to files of its own.
3004
3005         * NetworkProcess/cache/NetworkCacheIOChannel.h: Added.
3006         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm: Added.
3007
3008             Add abstraction for dispatch IO channels.
3009
3010 2015-03-04  Joseph Pecoraro  <pecoraro@apple.com>
3011
3012         Remove WK_AVAILABLE and related macros when we cannot determine iOS/Mac version
3013         https://bugs.webkit.org/show_bug.cgi?id=142252
3014         rdar://problem/19983833
3015
3016         Reviewed by David Kilzer.
3017
3018         When mac / ios version was unable to be determined strip the WK_AVAILABLE
3019         and WK_DEPRECATED macros to avoid outputing a broken macro.
3020
3021         * mac/postprocess-framework-headers.sh:
3022
3023 2015-03-04  Debarshi Ray  <debarshir@gnome.org>
3024
3025         [GTK] WebView should hold a reference on WebContext because non-default contexts are a reality
3026         https://bugs.webkit.org/show_bug.cgi?id=142225
3027
3028         Reviewed by Carlos Garcia Campos.
3029
3030         * UIProcess/API/gtk/WebKitWebView.cpp:
3031         (webkitWebViewRequestFavicon):
3032         (webkitWebViewWatchForChangesInFavicon):
3033         (webkitWebViewDisconnectFaviconDatabaseSignalHandlers):
3034         (webkitWebViewConstructed):
3035         (webkitWebViewGetProperty):
3036         (webkitWebViewDispose):
3037         (webkitWebViewLoadChanged):
3038         (webkitWebViewLoadFailedWithTLSErrors):
3039         (webkit_web_view_get_context):
3040         (webkit_web_view_download_uri):
3041
3042 2015-03-03  Shivakumar JM  <shiva.jm@samsung.com>
3043
3044         Fix build warning in WebKit2/Shared module.
3045         https://bugs.webkit.org/show_bug.cgi?id=142213
3046
3047         Reviewed by Simon Fraser.
3048
3049         Fix build warning by removing argument name from function.
3050
3051         * Shared/WebCoreArgumentCoders.cpp:
3052         (IPC::pathPointCountApplierFunction):
3053
3054 2015-03-03  Andy Estes  <aestes@apple.com>
3055
3056         [Content Filtering] Separate unblock handling into its own class
3057         https://bugs.webkit.org/show_bug.cgi?id=142251
3058
3059         Reviewed by Andreas Kling.
3060
3061         Adopted ContentFilterUnblockHandler.
3062
3063         * Shared/WebCoreArgumentCoders.h:
3064         * Shared/mac/WebCoreArgumentCodersMac.mm:
3065         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode):
3066         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode):
3067         (IPC::ArgumentCoder<ContentFilter>::encode): Deleted.
3068         (IPC::ArgumentCoder<ContentFilter>::decode): Deleted.
3069         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
3070         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame):
3071         * UIProcess/WebFrameProxy.cpp:
3072         (WebKit::WebFrameProxy::didStartProvisionalLoad):
3073         (WebKit::WebFrameProxy::contentFilterDidHandleNavigationAction):
3074         * UIProcess/WebFrameProxy.h:
3075         (WebKit::WebFrameProxy::setContentFilterUnblockHandler):
3076         (WebKit::WebFrameProxy::setContentFilterForBlockedLoad): Deleted.
3077         * UIProcess/WebPageProxy.h:
3078         * UIProcess/WebPageProxy.messages.in:
3079         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3080         (WebKit::WebFrameLoaderClient::contentFilterDidBlockLoad):
3081         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3082
3083 2015-03-03  Chris Dumez  <cdumez@apple.com>
3084
3085         [WK2] Fix memory leak in _getCookieHeadersForTask
3086         https://bugs.webkit.org/show_bug.cgi?id=142245
3087
3088         Reviewed by Alexey Proskuryakov.
3089
3090         Fix memory leak in _getCookieHeadersForTask. We are leaking the CFDictionary
3091         returned by webKitCookieStorageCopyRequestHeaderFieldsForURL().
3092
3093         This patch addresses the issue by storing the return CFDictionary in a
3094         RetainPtr<CFDictionaryRef>.
3095
3096         * Shared/mac/CookieStorageShim.mm:
3097         (-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]):
3098
3099 2015-03-03  Enrica Casucci  <enrica@apple.com>
3100
3101         Incomplete dictation results in text fields in a web page.
3102         https://bugs.webkit.org/show_bug.cgi?id=142240
3103         rdar://problem/19953432
3104
3105         Reviewed by Tim Horton.
3106
3107         The empty stub for insertDictationResult:withCorrectionIdentifier
3108         must be removed. This way UIKit will call insertText and do the right thing.
3109
3110         * UIProcess/ios/WKContentViewInteraction.mm:
3111         (-[WKContentView insertDictationResult:withCorrectionIdentifier:]): Deleted.
3112
3113 2015-03-03  Dean Jackson  <dino@apple.com>
3114
3115         Controls panel should have system blurry background
3116         https://bugs.webkit.org/show_bug.cgi?id=142154
3117         <rdar://problem/20000964>
3118
3119         Reviewed by Simon Fraser.
3120
3121         In order to replicate the system style of media controls
3122         on OS X and iOS, we need to expose a special -webkit-appearance.
3123         This patch adds the new property value, and implements
3124         the iOS part of the appearance, which is a blurry shaded
3125         background.
3126
3127         * Shared/mac/RemoteLayerBackingStore.mm:
3128         (WebKit::RemoteLayerBackingStore::drawInContext): Add entries for
3129         the new layer types, even though they are not correct yet.
3130
3131         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
3132         (WebKit::updateCustomAppearance):
3133         (WebKit::RemoteLayerTreePropertyApplier::applyProperties): UIBackdropViews
3134         have a defined hierarchy that we don't create. We need to make sure we add our
3135         children to the right subview.
3136         * Shared/mac/RemoteLayerTreeTransaction.mm:
3137         (WebKit::RemoteLayerTreeTransaction::description): Logging.
3138
3139         * UIProcess/ios/RemoteLayerTreeHostIOS.mm: Rename existing WKBackdropView
3140         to WKSimpleBackdropView, and add a new WKBackdropView that inherits
3141         from UIBackdropView.
3142         (-[WKBackdropView hitTest:withEvent:]):
3143         (-[WKBackdropView description]):
3144         (WebKit::RemoteLayerTreeHost::createLayer): Handle the new LayerTypes.
3145         * UIProcess/mac/RemoteLayerTreeHost.mm:
3146         (WebKit::RemoteLayerTreeHost::createLayer):
3147
3148 2015-03-03  Chris Dumez  <cdumez@apple.com>
3149
3150         Access ApplicationCacheStorage global instance via singleton() static member function
3151         https://bugs.webkit.org/show_bug.cgi?id=142239
3152
3153         Reviewed by Anders Carlsson.
3154
3155         Access ApplicationCacheStorage global instance via singleton() static
3156         member function as per WebKit coding style.
3157
3158 2015-03-03  Joseph Pecoraro  <pecoraro@apple.com>
3159
3160         Build Fix: Add fall back handling in postprocess script for missing/unknown platform name.
3161
3162         Rubber-stamped by David Kilzer.
3163
3164         * mac/postprocess-framework-headers.sh:
3165
3166 2015-03-03  Enrica Casucci  <enrica@apple.com>
3167
3168         Build fix for iOS.
3169
3170         Unreviewed.
3171
3172         * UIProcess/ios/WKContentViewInteraction.mm: Adding forward declaration.
3173
3174 2015-03-03  Antti Koivisto  <antti@apple.com>
3175
3176         Include key to NetworkCacheStorage::Entry
3177         https://bugs.webkit.org/show_bug.cgi?id=142215
3178
3179         Reviewed by Chris Dumez.
3180
3181         This simplified code. The key is saved as part of the entry so it makes logical sense too.
3182
3183         * NetworkProcess/cache/NetworkCache.cpp:
3184         (WebKit::makeCacheKey):
3185         (WebKit::encodeStorageEntry):
3186         (WebKit::NetworkCache::retrieve):
3187         (WebKit::NetworkCache::store):
3188         (WebKit::NetworkCache::update):
3189         (WebKit::NetworkCache::traverse):
3190         (WebKit::entryAsJSON):
3191         (WebKit::NetworkCache::dumpContentsToFile):
3192         * NetworkProcess/cache/NetworkCacheKey.cpp:
3193         (WebKit::NetworkCacheKey::operator=):
3194         * NetworkProcess/cache/NetworkCacheKey.h:
3195         (WebKit::NetworkCacheKey::isNull):
3196         * NetworkProcess/cache/NetworkCacheStorage.h:
3197         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
3198         (WebKit::decodeEntry):
3199         (WebKit::encodeEntryHeader):
3200         (WebKit::retrieveFromMemory):
3201         (WebKit::NetworkCacheStorage::retrieve):
3202         (WebKit::NetworkCacheStorage::store):
3203         (WebKit::NetworkCacheStorage::update):
3204         (WebKit::NetworkCacheStorage::traverse):
3205         (WebKit::NetworkCacheStorage::dispatchPendingWriteOperations):
3206         (WebKit::NetworkCacheStorage::dispatchFullWriteOperation):
3207         (WebKit::NetworkCacheStorage::dispatchHeaderWriteOperation):
3208
3209 2015-03-03  Antti Koivisto  <antti@apple.com>
3210
3211         Cache shrink leaves behind empty partition directories
3212         https://bugs.webkit.org/show_bug.cgi?id=142217
3213
3214         Reviewed by Andreas Kling.
3215
3216         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
3217         (WebKit::traverseCacheFiles):
3218
3219             No need for std::function.
3220
3221         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
3222         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
3223
3224             After shrink traverse through the partition directories and try to delete them.
3225             System knows if they are actually empty.
3226
3227 2015-03-03  Anders Carlsson  <andersca@apple.com>
3228
3229         Use the correct display name for website data for local files
3230         https://bugs.webkit.org/show_bug.cgi?id=142228
3231
3232         Reviewed by Dan Bernstein.
3233
3234         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
3235         (displayNameForLocalFiles):
3236         Add new helper function.
3237
3238         (WebKit::WebsiteDataRecord::displayNameForCookieHostName):
3239         Check if the hostname is kCFHTTPCookieLocalFileDomain.
3240
3241         (WebKit::WebsiteDataRecord::displayNameForOrigin):
3242         Handle file URLs as well.
3243
3244 2015-03-03  Enrica Casucci  <enrica@apple.com>
3245
3246         Fixed typo in platform guard in http://trac.webkit.org/changeset/180939.
3247
3248         Unreviewed.
3249
3250         * UIProcess/ios/WKContentViewInteraction.mm:
3251
3252 2015-03-03  Enrica Casucci  <enrica@apple.com>
3253
3254         Adopt new API for keyboard interaction.
3255         https://bugs.webkit.org/show_bug.cgi?id=142201
3256         rdar://problem/19924949
3257
3258         Reviewed by Joseph Pecoraro.
3259
3260         * UIProcess/ios/WKContentViewInteraction.mm:
3261         (-[WKContentView inputAssistantItem]):
3262         (-[WKContentView _inputAssistantItem]):
3263
3264 2015-03-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3265
3266         REGRESSION(r177075): WebProcess crashes when entering accelerating compositing mode before the WebView is realized
3267         https://bugs.webkit.org/show_bug.cgi?id=142079
3268
3269         Reviewed by Žan Doberšek.
3270
3271         The problem is that the texture mapper and native window handler
3272         are initialized when the LayerTreeHost is initialized, assuming
3273         the UI process has already sent the native window handler to the
3274         web process, but that doesn't always happen since we moved the
3275         redirected window creation to realize in r177075.
3276
3277         * WebProcess/WebPage/DrawingArea.h:
3278         (WebKit::DrawingArea::nativeSurfaceHandleForCompositing): Deleted.
3279         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3280         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode): Call
3281         LayerTreeHost::setNativeSurfaceHandleForCompositing if we
3282         already have a native window handle at this point.
3283         (WebKit::DrawingAreaImpl::setNativeSurfaceHandleForCompositing):
3284         Call LayerTreeHost::setNativeSurfaceHandleForCompositing also when
3285         not using threaded compositing.
3286         * WebProcess/WebPage/LayerTreeHost.h:
3287         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
3288         (WebKit::LayerTreeHostGtk::makeContextCurrent): Helper function to
3289         ensure a context and making it current.
3290         (WebKit::LayerTreeHostGtk::ensureTextureMapper): Ensure a texture
3291         is created for the current context.
3292         (WebKit::LayerTreeHostGtk::initialize): Use makeContextCurrent()
3293         and ensureTextureMapper(), and remove the LayerTreeContext
3294         initialization since that's is now always initialized in
3295         setNativeSurfaceHandleForCompositing().
3296         (WebKit::LayerTreeHostGtk::compositeLayersToContext): Use
3297         makeContextCurrent() helper function and also call
3298         ensureTextureMapper() just in case the texture could not be
3299         created during initialization because the native window handle was
3300         not yet available.
3301         (WebKit::LayerTreeHostGtk::flushAndRenderLayers): Use makeContextCurrent().
3302         (WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing):
3303         Initialize the LayerTreeContext.
3304         (WebKit::LayerTreeHostGtk::glContext): Deleted.
3305         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
3306
3307 2015-03-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3308
3309         [WK2] Remove unnecessary create() factory functions.
3310         https://bugs.webkit.org/show_bug.cgi?id=142161
3311
3312         Reviewed by Chris Dumez.
3313
3314         We can replace some create() factory functions with std::make_unique(). Because
3315         it just returns new instance. Even some of those functions have used std::unique_ptr<>
3316         instead of std::make_unique<>. Fixed all.
3317
3318         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.h:
3319         (WebKit::SQLiteIDBTransaction::create): Deleted.
3320         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
3321         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::establishTransaction):
3322         * Platform/efl/DispatchQueueWorkItemEfl.h:
3323         (WorkItem::dispatch):
3324         (WorkItem::create): Deleted.
3325         * UIProcess/API/gtk/PageClientImpl.h:
3326         (WebKit::PageClientImpl::create): Deleted.
3327         * UIProcess/API/gtk/WebKitTextChecker.h:
3328         (WebKitTextChecker::create): Deleted.
3329         * UIProcess/API/gtk/WebKitWebContext.cpp:
3330         (webkitWebContextConstructed):
3331         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3332         (webkitWebViewBaseConstructed):
3333
3334 2015-03-02  Brady Eidson  <beidson@apple.com>
3335
3336         Lots of: ERROR: Unhandled web process message WebPageGroupProxy:RemoveAllUserContentFilters
3337         https://bugs.webkit.org/show_bug.cgi?id=142155
3338
3339         Reviewed by Simon Fraser.
3340
3341         * WebProcess/WebProcess.cpp:
3342         (WebKit::WebProcess::didReceiveMessage): Return after handling WebPageGroupProxy messages
3343           instead of logging an error.
3344
3345 2015-03-02  Antti Koivisto  <antti@apple.com>
3346
3347         Add way to dump cache meta data to file
3348         https://bugs.webkit.org/show_bug.cgi?id=142183
3349
3350         Add a missing return so we don't try to decode a null entry.
3351
3352         * NetworkProcess/cache/NetworkCache.cpp:
3353         (WebKit::NetworkCache::dumpContentsToFile):
3354
3355 2015-03-02  Anders Carlsson  <andersca@apple.com>
3356
3357         Return disk cache entries from the new disk cache
3358         https://bugs.webkit.org/show_bug.cgi?id=142190
3359
3360         Reviewed by Antti Koivisto.
3361
3362         * NetworkProcess/NetworkProcess.cpp:
3363         (WebKit::fetchDiskCacheEntries):
3364         Call NetworkCache::traverse() to get all the cache entries, unique their origins and pass them back with the completion handler.
3365
3366         * NetworkProcess/cache/NetworkCache.cpp:
3367         (WebKit::NetworkCache::traverse):
3368         New helper function that traverses network cache entries.
3369
3370         * NetworkProcess/cache/NetworkCache.h:
3371
3372 2015-03-02  Antti Koivisto  <antti@apple.com>
3373
3374         Add way to dump cache meta data to file
3375         https://bugs.webkit.org/show_bug.cgi?id=142183
3376
3377         Reviewed by Andreas Kling.
3378
3379         Dump goes to WebKitCache/dump.json. On OSX it can be triggered with
3380
3381         notifyutil -p com.apple.WebKit.Cache.dump
3382
3383         * NetworkProcess/cache/NetworkCache.cpp:
3384         (WebKit::NetworkCache::initialize):
3385         (WebKit::NetworkCache::dumpFilePath):
3386         (WebKit::entryAsJSON):
3387         (WebKit::NetworkCache::dumpContentsToFile):
3388         (WebKit::NetworkCache::clear):
3389
3390             Also clear any dumps.
3391
3392         * NetworkProcess/cache/NetworkCache.h:
3393         * NetworkProcess/cache/NetworkCacheStorage.h:
3394         (WebKit::NetworkCacheStorage::baseDirectoryPath):
3395         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
3396         (WebKit::fileNameForKey):
3397         (WebKit::filePathForKey):
3398         (WebKit::openFile):
3399         (WebKit::openFileForKey):
3400         (WebKit::decodeEntryHeader):
3401
3402             Separate header decoding.
3403
3404         (WebKit::decodeEntry):
3405         (WebKit::NetworkCacheStorage::traverse):
3406
3407             Add asynchronous cache traversal inteface.
3408
3409 2015-03-02  Anders Carlsson  <andersca@apple.com>
3410
3411         WebsiteDataStore should handle deleting cookies
3412         https://bugs.webkit.org/show_bug.cgi?id=142185
3413
3414         Reviewed by Beth Dakin.
3415
3416         * NetworkProcess/NetworkProcess.cpp:
3417         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
3418         When asked to delete cookies, do so.
3419
3420         * NetworkProcess/NetworkProcess.h:
3421         Update the deleteWebsiteDataForOrigins signature.
3422
3423         * NetworkProcess/NetworkProcess.messages.in:
3424         Add cookieHostNames to DeleteWebsiteDataForOrigins.
3425
3426         * UIProcess/Network/NetworkProcessProxy.cpp:
3427         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
3428         * UIProcess/Network/NetworkProcessProxy.h:
3429         Update to take a vector of cookie host names.
3430
3431         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3432         (WebKit::WebsiteDataStore::removeData):
3433         Figure out if we need to ask the network process to delete data.
3434
3435 2015-03-02  Anders Carlsson  <andersca@apple.com>
3436
3437         WebsiteDataStore should support getting cookie host names
3438         https://bugs.webkit.org/show_bug.cgi?id=142178
3439
3440         Reviewed by Dan Bernstein.
3441
3442         * NetworkProcess/NetworkProcess.cpp:
3443         (WebKit::NetworkProcess::fetchWebsiteData):
3444         Assert that we're destroyed from the main thread since we end up copying the website data struct.
3445
3446         * Shared/WebsiteData/WebsiteData.cpp:
3447         (WebKit::WebsiteData::encode):
3448         (WebKit::WebsiteData::decode):
3449         * Shared/WebsiteData/WebsiteData.h:
3450         Add a hostnamesWithCookies member.
3451
3452         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
3453         (WebKit::WebsiteDataRecord::displayNameForCookieHostName):
3454         Add a new function that will return the display name for a cookie host name.
3455
3456         (WebKit::WebsiteDataRecord::addCookieHostName):
3457         * UIProcess/WebsiteData/WebsiteDataRecord.h:
3458         Add a hash set of cookie host names.
3459
3460         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3461         (WebKit::WebsiteDataStore::fetchData):
3462         Create data records for each host name with cookies.
3463
3464 2015-03-02  Jer Noble  <jer.noble@apple.com>
3465
3466         [WK2][Mac] WebPageProxy::supressVisibilityUpdates() should suppress visibility updates.
3467         https://bugs.webkit.org/show_bug.cgi?id=141907
3468
3469         Reviewed by Tim Horton.
3470
3471         At some point, the window/view/page visibility update code was refactored such that setting
3472         WebPageProxy::setSuppressVisibilityUpdate() no longer suppressed visibility updates. This causes
3473         full screen animations to become "flashy" when moving the WebView between the regular and full
3474         screen window, as a HTMLMediaElement in the full screen animation will receive a "!visible"
3475         notification and disconnect its rendering pipeline.
3476
3477         In WebPageProxy::viewStateDidChange(), respect m_suppressVisibilityUpdates and bail out early
3478         if set. In WebPageProxy::setSuppressVisibilityUpdates(), trigger an explicit update after
3479         clearing m_suppressVisibilityUpdates.
3480
3481         * UIProcess/WebPageProxy.cpp:
3482         (WebKit::WebPageProxy::setSuppressVisibilityUpdates):
3483         (WebKit::WebPageProxy::viewStateDidChange):
3484         * UIProcess/WebPageProxy.h:
3485         (WebKit::WebPageProxy::setSuppressVisibilityUpdates): Deleted.
3486
3487<