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