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