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