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