7abb9bdf75406900db7e10ecd8abb74df91dfb98
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-03-04  Yusuke Suzuki  <utatane.tea@gmail.com>
2
3         Hide Promise with runtime flags under Cocoa JSContext API
4         https://bugs.webkit.org/show_bug.cgi?id=141965
5
6         Reviewed by Filip Pizlo.
7
8         Add new JSC runtime flag, PromiseDisabled.
9
10         * UIProcess/API/C/WKPreferencesRefPrivate.h:
11         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
12
13 2015-03-04  Beth Dakin  <bdakin@apple.com>
14
15         Attempted build fix.
16
17         * UIProcess/API/Cocoa/WKViewPrivate.h:
18
19 2015-03-04  Beth Dakin  <bdakin@apple.com>
20
21         Message UI process when contentSize changes
22         https://bugs.webkit.org/show_bug.cgi?id=142294
23         -and corresponding-
24         rdar://problem/19963165
25
26         Reviewed by Andreas Kling.
27
28         This patch un-ifdefs the didChangeContentSize message so that we can use it on Mac 
29         as well. 
30
31         New private method that subclasses can override when they need to do something 
32         with contentSize changes.
33         * UIProcess/API/Cocoa/WKViewPrivate.h:
34         * UIProcess/API/mac/WKView.mm:
35         (-[WKView _didChangeContentSize:]):
36         * UIProcess/PageClient.h:
37
38         Un-ifdef.
39         * UIProcess/WebPageProxy.cpp:
40         (WebKit::WebPageProxy::didChangeContentSize):
41         * UIProcess/WebPageProxy.h:
42         * UIProcess/WebPageProxy.messages.in:
43         * UIProcess/mac/PageClientImpl.h:
44         * UIProcess/mac/PageClientImpl.mm:
45         (WebKit::PageClientImpl::didChangeContentSize):
46         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
47         (WebKit::WebChromeClient::contentsSizeChanged):
48
49         Stubs for other platforms now that the pure-virtual is un-masked.
50         * UIProcess/ios/PageClientImplIOS.h:
51         * UIProcess/ios/PageClientImplIOS.mm:
52         (WebKit::PageClientImpl::didChangeContentSize):
53         * UIProcess/API/gtk/PageClientImpl.h:
54
55 2015-03-04  Antti Koivisto  <antti@apple.com>
56
57         Factor platform I/O out from NetworkCacheStorage
58         https://bugs.webkit.org/show_bug.cgi?id=142279
59
60         Reviewed by Chris Dumez.
61
62         * NetworkProcess/cache/NetworkCacheData.h: Added.
63         * NetworkProcess/cache/NetworkCacheDataCocoa.mm: Added.
64
65             NetworkCacheStorage::Data -> NetworkCacheData
66             Move to files of its own.
67
68         * NetworkProcess/cache/NetworkCacheIOChannel.h: Added.
69         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm: Added.
70
71             Add abstraction for dispatch IO channels.
72
73 2015-03-04  Joseph Pecoraro  <pecoraro@apple.com>
74
75         Remove WK_AVAILABLE and related macros when we cannot determine iOS/Mac version
76         https://bugs.webkit.org/show_bug.cgi?id=142252
77         rdar://problem/19983833
78
79         Reviewed by David Kilzer.
80
81         When mac / ios version was unable to be determined strip the WK_AVAILABLE
82         and WK_DEPRECATED macros to avoid outputing a broken macro.
83
84         * mac/postprocess-framework-headers.sh:
85
86 2015-03-04  Debarshi Ray  <debarshir@gnome.org>
87
88         [GTK] WebView should hold a reference on WebContext because non-default contexts are a reality
89         https://bugs.webkit.org/show_bug.cgi?id=142225
90
91         Reviewed by Carlos Garcia Campos.
92
93         * UIProcess/API/gtk/WebKitWebView.cpp:
94         (webkitWebViewRequestFavicon):
95         (webkitWebViewWatchForChangesInFavicon):
96         (webkitWebViewDisconnectFaviconDatabaseSignalHandlers):
97         (webkitWebViewConstructed):
98         (webkitWebViewGetProperty):
99         (webkitWebViewDispose):
100         (webkitWebViewLoadChanged):
101         (webkitWebViewLoadFailedWithTLSErrors):
102         (webkit_web_view_get_context):
103         (webkit_web_view_download_uri):
104
105 2015-03-03  Shivakumar JM  <shiva.jm@samsung.com>
106
107         Fix build warning in WebKit2/Shared module.
108         https://bugs.webkit.org/show_bug.cgi?id=142213
109
110         Reviewed by Simon Fraser.
111
112         Fix build warning by removing argument name from function.
113
114         * Shared/WebCoreArgumentCoders.cpp:
115         (IPC::pathPointCountApplierFunction):
116
117 2015-03-03  Andy Estes  <aestes@apple.com>
118
119         [Content Filtering] Separate unblock handling into its own class
120         https://bugs.webkit.org/show_bug.cgi?id=142251
121
122         Reviewed by Andreas Kling.
123
124         Adopted ContentFilterUnblockHandler.
125
126         * Shared/WebCoreArgumentCoders.h:
127         * Shared/mac/WebCoreArgumentCodersMac.mm:
128         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode):
129         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode):
130         (IPC::ArgumentCoder<ContentFilter>::encode): Deleted.
131         (IPC::ArgumentCoder<ContentFilter>::decode): Deleted.
132         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
133         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame):
134         * UIProcess/WebFrameProxy.cpp:
135         (WebKit::WebFrameProxy::didStartProvisionalLoad):
136         (WebKit::WebFrameProxy::contentFilterDidHandleNavigationAction):
137         * UIProcess/WebFrameProxy.h:
138         (WebKit::WebFrameProxy::setContentFilterUnblockHandler):
139         (WebKit::WebFrameProxy::setContentFilterForBlockedLoad): Deleted.
140         * UIProcess/WebPageProxy.h:
141         * UIProcess/WebPageProxy.messages.in:
142         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
143         (WebKit::WebFrameLoaderClient::contentFilterDidBlockLoad):
144         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
145
146 2015-03-03  Chris Dumez  <cdumez@apple.com>
147
148         [WK2] Fix memory leak in _getCookieHeadersForTask
149         https://bugs.webkit.org/show_bug.cgi?id=142245
150
151         Reviewed by Alexey Proskuryakov.
152
153         Fix memory leak in _getCookieHeadersForTask. We are leaking the CFDictionary
154         returned by webKitCookieStorageCopyRequestHeaderFieldsForURL().
155
156         This patch addresses the issue by storing the return CFDictionary in a
157         RetainPtr<CFDictionaryRef>.
158
159         * Shared/mac/CookieStorageShim.mm:
160         (-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]):
161
162 2015-03-03  Enrica Casucci  <enrica@apple.com>
163
164         Incomplete dictation results in text fields in a web page.
165         https://bugs.webkit.org/show_bug.cgi?id=142240
166         rdar://problem/19953432
167
168         Reviewed by Tim Horton.
169
170         The empty stub for insertDictationResult:withCorrectionIdentifier
171         must be removed. This way UIKit will call insertText and do the right thing.
172
173         * UIProcess/ios/WKContentViewInteraction.mm:
174         (-[WKContentView insertDictationResult:withCorrectionIdentifier:]): Deleted.
175
176 2015-03-03  Dean Jackson  <dino@apple.com>
177
178         Controls panel should have system blurry background
179         https://bugs.webkit.org/show_bug.cgi?id=142154
180         <rdar://problem/20000964>
181
182         Reviewed by Simon Fraser.
183
184         In order to replicate the system style of media controls
185         on OS X and iOS, we need to expose a special -webkit-appearance.
186         This patch adds the new property value, and implements
187         the iOS part of the appearance, which is a blurry shaded
188         background.
189
190         * Shared/mac/RemoteLayerBackingStore.mm:
191         (WebKit::RemoteLayerBackingStore::drawInContext): Add entries for
192         the new layer types, even though they are not correct yet.
193
194         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
195         (WebKit::updateCustomAppearance):
196         (WebKit::RemoteLayerTreePropertyApplier::applyProperties): UIBackdropViews
197         have a defined hierarchy that we don't create. We need to make sure we add our
198         children to the right subview.
199         * Shared/mac/RemoteLayerTreeTransaction.mm:
200         (WebKit::RemoteLayerTreeTransaction::description): Logging.
201
202         * UIProcess/ios/RemoteLayerTreeHostIOS.mm: Rename existing WKBackdropView
203         to WKSimpleBackdropView, and add a new WKBackdropView that inherits
204         from UIBackdropView.
205         (-[WKBackdropView hitTest:withEvent:]):
206         (-[WKBackdropView description]):
207         (WebKit::RemoteLayerTreeHost::createLayer): Handle the new LayerTypes.
208         * UIProcess/mac/RemoteLayerTreeHost.mm:
209         (WebKit::RemoteLayerTreeHost::createLayer):
210
211 2015-03-03  Chris Dumez  <cdumez@apple.com>
212
213         Access ApplicationCacheStorage global instance via singleton() static member function
214         https://bugs.webkit.org/show_bug.cgi?id=142239
215
216         Reviewed by Anders Carlsson.
217
218         Access ApplicationCacheStorage global instance via singleton() static
219         member function as per WebKit coding style.
220
221 2015-03-03  Joseph Pecoraro  <pecoraro@apple.com>
222
223         Build Fix: Add fall back handling in postprocess script for missing/unknown platform name.
224
225         Rubber-stamped by David Kilzer.
226
227         * mac/postprocess-framework-headers.sh:
228
229 2015-03-03  Enrica Casucci  <enrica@apple.com>
230
231         Build fix for iOS.
232
233         Unreviewed.
234
235         * UIProcess/ios/WKContentViewInteraction.mm: Adding forward declaration.
236
237 2015-03-03  Antti Koivisto  <antti@apple.com>
238
239         Include key to NetworkCacheStorage::Entry
240         https://bugs.webkit.org/show_bug.cgi?id=142215
241
242         Reviewed by Chris Dumez.
243
244         This simplified code. The key is saved as part of the entry so it makes logical sense too.
245
246         * NetworkProcess/cache/NetworkCache.cpp:
247         (WebKit::makeCacheKey):
248         (WebKit::encodeStorageEntry):
249         (WebKit::NetworkCache::retrieve):
250         (WebKit::NetworkCache::store):
251         (WebKit::NetworkCache::update):
252         (WebKit::NetworkCache::traverse):
253         (WebKit::entryAsJSON):
254         (WebKit::NetworkCache::dumpContentsToFile):
255         * NetworkProcess/cache/NetworkCacheKey.cpp:
256         (WebKit::NetworkCacheKey::operator=):
257         * NetworkProcess/cache/NetworkCacheKey.h:
258         (WebKit::NetworkCacheKey::isNull):
259         * NetworkProcess/cache/NetworkCacheStorage.h:
260         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
261         (WebKit::decodeEntry):
262         (WebKit::encodeEntryHeader):
263         (WebKit::retrieveFromMemory):
264         (WebKit::NetworkCacheStorage::retrieve):
265         (WebKit::NetworkCacheStorage::store):
266         (WebKit::NetworkCacheStorage::update):
267         (WebKit::NetworkCacheStorage::traverse):
268         (WebKit::NetworkCacheStorage::dispatchPendingWriteOperations):
269         (WebKit::NetworkCacheStorage::dispatchFullWriteOperation):
270         (WebKit::NetworkCacheStorage::dispatchHeaderWriteOperation):
271
272 2015-03-03  Antti Koivisto  <antti@apple.com>
273
274         Cache shrink leaves behind empty partition directories
275         https://bugs.webkit.org/show_bug.cgi?id=142217
276
277         Reviewed by Andreas Kling.
278
279         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
280         (WebKit::traverseCacheFiles):
281
282             No need for std::function.
283
284         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
285         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
286
287             After shrink traverse through the partition directories and try to delete them.
288             System knows if they are actually empty.
289
290 2015-03-03  Anders Carlsson  <andersca@apple.com>
291
292         Use the correct display name for website data for local files
293         https://bugs.webkit.org/show_bug.cgi?id=142228
294
295         Reviewed by Dan Bernstein.
296
297         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
298         (displayNameForLocalFiles):
299         Add new helper function.
300
301         (WebKit::WebsiteDataRecord::displayNameForCookieHostName):
302         Check if the hostname is kCFHTTPCookieLocalFileDomain.
303
304         (WebKit::WebsiteDataRecord::displayNameForOrigin):
305         Handle file URLs as well.
306
307 2015-03-03  Enrica Casucci  <enrica@apple.com>
308
309         Fixed typo in platform guard in http://trac.webkit.org/changeset/180939.
310
311         Unreviewed.
312
313         * UIProcess/ios/WKContentViewInteraction.mm:
314
315 2015-03-03  Enrica Casucci  <enrica@apple.com>
316
317         Adopt new API for keyboard interaction.
318         https://bugs.webkit.org/show_bug.cgi?id=142201
319         rdar://problem/19924949
320
321         Reviewed by Joseph Pecoraro.
322
323         * UIProcess/ios/WKContentViewInteraction.mm:
324         (-[WKContentView inputAssistantItem]):
325         (-[WKContentView _inputAssistantItem]):
326
327 2015-03-03  Carlos Garcia Campos  <cgarcia@igalia.com>
328
329         REGRESSION(r177075): WebProcess crashes when entering accelerating compositing mode before the WebView is realized
330         https://bugs.webkit.org/show_bug.cgi?id=142079
331
332         Reviewed by Žan Doberšek.
333
334         The problem is that the texture mapper and native window handler
335         are initialized when the LayerTreeHost is initialized, assuming
336         the UI process has already sent the native window handler to the
337         web process, but that doesn't always happen since we moved the
338         redirected window creation to realize in r177075.
339
340         * WebProcess/WebPage/DrawingArea.h:
341         (WebKit::DrawingArea::nativeSurfaceHandleForCompositing): Deleted.
342         * WebProcess/WebPage/DrawingAreaImpl.cpp:
343         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode): Call
344         LayerTreeHost::setNativeSurfaceHandleForCompositing if we
345         already have a native window handle at this point.
346         (WebKit::DrawingAreaImpl::setNativeSurfaceHandleForCompositing):
347         Call LayerTreeHost::setNativeSurfaceHandleForCompositing also when
348         not using threaded compositing.
349         * WebProcess/WebPage/LayerTreeHost.h:
350         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
351         (WebKit::LayerTreeHostGtk::makeContextCurrent): Helper function to
352         ensure a context and making it current.
353         (WebKit::LayerTreeHostGtk::ensureTextureMapper): Ensure a texture
354         is created for the current context.
355         (WebKit::LayerTreeHostGtk::initialize): Use makeContextCurrent()
356         and ensureTextureMapper(), and remove the LayerTreeContext
357         initialization since that's is now always initialized in
358         setNativeSurfaceHandleForCompositing().
359         (WebKit::LayerTreeHostGtk::compositeLayersToContext): Use
360         makeContextCurrent() helper function and also call
361         ensureTextureMapper() just in case the texture could not be
362         created during initialization because the native window handle was
363         not yet available.
364         (WebKit::LayerTreeHostGtk::flushAndRenderLayers): Use makeContextCurrent().
365         (WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing):
366         Initialize the LayerTreeContext.
367         (WebKit::LayerTreeHostGtk::glContext): Deleted.
368         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
369
370 2015-03-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
371
372         [WK2] Remove unnecessary create() factory functions.
373         https://bugs.webkit.org/show_bug.cgi?id=142161
374
375         Reviewed by Chris Dumez.
376
377         We can replace some create() factory functions with std::make_unique(). Because
378         it just returns new instance. Even some of those functions have used std::unique_ptr<>
379         instead of std::make_unique<>. Fixed all.
380
381         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.h:
382         (WebKit::SQLiteIDBTransaction::create): Deleted.
383         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
384         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::establishTransaction):
385         * Platform/efl/DispatchQueueWorkItemEfl.h:
386         (WorkItem::dispatch):
387         (WorkItem::create): Deleted.
388         * UIProcess/API/gtk/PageClientImpl.h:
389         (WebKit::PageClientImpl::create): Deleted.
390         * UIProcess/API/gtk/WebKitTextChecker.h:
391         (WebKitTextChecker::create): Deleted.
392         * UIProcess/API/gtk/WebKitWebContext.cpp:
393         (webkitWebContextConstructed):
394         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
395         (webkitWebViewBaseConstructed):
396
397 2015-03-02  Brady Eidson  <beidson@apple.com>
398
399         Lots of: ERROR: Unhandled web process message WebPageGroupProxy:RemoveAllUserContentFilters
400         https://bugs.webkit.org/show_bug.cgi?id=142155
401
402         Reviewed by Simon Fraser.
403
404         * WebProcess/WebProcess.cpp:
405         (WebKit::WebProcess::didReceiveMessage): Return after handling WebPageGroupProxy messages
406           instead of logging an error.
407
408 2015-03-02  Antti Koivisto  <antti@apple.com>
409
410         Add way to dump cache meta data to file
411         https://bugs.webkit.org/show_bug.cgi?id=142183
412
413         Add a missing return so we don't try to decode a null entry.
414
415         * NetworkProcess/cache/NetworkCache.cpp:
416         (WebKit::NetworkCache::dumpContentsToFile):
417
418 2015-03-02  Anders Carlsson  <andersca@apple.com>
419
420         Return disk cache entries from the new disk cache
421         https://bugs.webkit.org/show_bug.cgi?id=142190
422
423         Reviewed by Antti Koivisto.
424
425         * NetworkProcess/NetworkProcess.cpp:
426         (WebKit::fetchDiskCacheEntries):
427         Call NetworkCache::traverse() to get all the cache entries, unique their origins and pass them back with the completion handler.
428
429         * NetworkProcess/cache/NetworkCache.cpp:
430         (WebKit::NetworkCache::traverse):
431         New helper function that traverses network cache entries.
432
433         * NetworkProcess/cache/NetworkCache.h:
434
435 2015-03-02  Antti Koivisto  <antti@apple.com>
436
437         Add way to dump cache meta data to file
438         https://bugs.webkit.org/show_bug.cgi?id=142183
439
440         Reviewed by Andreas Kling.
441
442         Dump goes to WebKitCache/dump.json. On OSX it can be triggered with
443
444         notifyutil -p com.apple.WebKit.Cache.dump
445
446         * NetworkProcess/cache/NetworkCache.cpp:
447         (WebKit::NetworkCache::initialize):
448         (WebKit::NetworkCache::dumpFilePath):
449         (WebKit::entryAsJSON):
450         (WebKit::NetworkCache::dumpContentsToFile):
451         (WebKit::NetworkCache::clear):
452
453             Also clear any dumps.
454
455         * NetworkProcess/cache/NetworkCache.h:
456         * NetworkProcess/cache/NetworkCacheStorage.h:
457         (WebKit::NetworkCacheStorage::baseDirectoryPath):
458         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
459         (WebKit::fileNameForKey):
460         (WebKit::filePathForKey):
461         (WebKit::openFile):
462         (WebKit::openFileForKey):
463         (WebKit::decodeEntryHeader):
464
465             Separate header decoding.
466
467         (WebKit::decodeEntry):
468         (WebKit::NetworkCacheStorage::traverse):
469
470             Add asynchronous cache traversal inteface.
471
472 2015-03-02  Anders Carlsson  <andersca@apple.com>
473
474         WebsiteDataStore should handle deleting cookies
475         https://bugs.webkit.org/show_bug.cgi?id=142185
476
477         Reviewed by Beth Dakin.
478
479         * NetworkProcess/NetworkProcess.cpp:
480         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
481         When asked to delete cookies, do so.
482
483         * NetworkProcess/NetworkProcess.h:
484         Update the deleteWebsiteDataForOrigins signature.
485
486         * NetworkProcess/NetworkProcess.messages.in:
487         Add cookieHostNames to DeleteWebsiteDataForOrigins.
488
489         * UIProcess/Network/NetworkProcessProxy.cpp:
490         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
491         * UIProcess/Network/NetworkProcessProxy.h:
492         Update to take a vector of cookie host names.
493
494         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
495         (WebKit::WebsiteDataStore::removeData):
496         Figure out if we need to ask the network process to delete data.
497
498 2015-03-02  Anders Carlsson  <andersca@apple.com>
499
500         WebsiteDataStore should support getting cookie host names
501         https://bugs.webkit.org/show_bug.cgi?id=142178
502
503         Reviewed by Dan Bernstein.
504
505         * NetworkProcess/NetworkProcess.cpp:
506         (WebKit::NetworkProcess::fetchWebsiteData):
507         Assert that we're destroyed from the main thread since we end up copying the website data struct.
508
509         * Shared/WebsiteData/WebsiteData.cpp:
510         (WebKit::WebsiteData::encode):
511         (WebKit::WebsiteData::decode):
512         * Shared/WebsiteData/WebsiteData.h:
513         Add a hostnamesWithCookies member.
514
515         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
516         (WebKit::WebsiteDataRecord::displayNameForCookieHostName):
517         Add a new function that will return the display name for a cookie host name.
518
519         (WebKit::WebsiteDataRecord::addCookieHostName):
520         * UIProcess/WebsiteData/WebsiteDataRecord.h:
521         Add a hash set of cookie host names.
522
523         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
524         (WebKit::WebsiteDataStore::fetchData):
525         Create data records for each host name with cookies.
526
527 2015-03-02  Jer Noble  <jer.noble@apple.com>
528
529         [WK2][Mac] WebPageProxy::supressVisibilityUpdates() should suppress visibility updates.
530         https://bugs.webkit.org/show_bug.cgi?id=141907
531
532         Reviewed by Tim Horton.
533
534         At some point, the window/view/page visibility update code was refactored such that setting
535         WebPageProxy::setSuppressVisibilityUpdate() no longer suppressed visibility updates. This causes
536         full screen animations to become "flashy" when moving the WebView between the regular and full
537         screen window, as a HTMLMediaElement in the full screen animation will receive a "!visible"
538         notification and disconnect its rendering pipeline.
539
540         In WebPageProxy::viewStateDidChange(), respect m_suppressVisibilityUpdates and bail out early
541         if set. In WebPageProxy::setSuppressVisibilityUpdates(), trigger an explicit update after
542         clearing m_suppressVisibilityUpdates.
543
544         * UIProcess/WebPageProxy.cpp:
545         (WebKit::WebPageProxy::setSuppressVisibilityUpdates):
546         (WebKit::WebPageProxy::viewStateDidChange):
547         * UIProcess/WebPageProxy.h:
548         (WebKit::WebPageProxy::setSuppressVisibilityUpdates): Deleted.
549
550 2015-03-02  Jer Noble  <jer.noble@apple.com>
551
552         [WK1][WK2][Mac] Fullscreen animation is incorrect when page is scaled.
553         https://bugs.webkit.org/show_bug.cgi?id=142121
554
555         Reviewed by Simon Fraser.
556
557         Change the order of operations when entering or exiting fullscreen. Change the page scale to
558         1 before entering, so the final screen rect takes that scale into account, and vice-versa on
559         exiting.
560
561         * UIProcess/mac/WKFullScreenWindowController.mm:
562         (-[WKFullScreenWindowController enterFullScreen:]):
563         (-[WKFullScreenWindowController exitFullScreen]):
564
565 2015-03-01  Simon Fraser  <simon.fraser@apple.com>
566
567         Make clip-path work on <video>, <canvas> etc.
568         https://bugs.webkit.org/show_bug.cgi?id=138684
569
570         Reviewed by Darin Adler.
571         
572         Support encode/decode for WebCore Path objects, which is done by traversing
573         the path.
574
575         * Shared/WebCoreArgumentCoders.cpp:
576         (IPC::pathPointCountApplierFunction):
577         (IPC::pathEncodeApplierFunction):
578         (IPC::ArgumentCoder<Path>::encode):
579         (IPC::ArgumentCoder<Path>::decode):
580         * Shared/WebCoreArgumentCoders.h:
581         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
582         (WebKit::applyPropertiesToLayer): Actually apply the path and wind rule to the shape layer.
583         * Shared/mac/RemoteLayerTreeTransaction.h: Include path and wind rule in the layer properties.
584         * Shared/mac/RemoteLayerTreeTransaction.mm:
585         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
586         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode): Encode shape and wind rule.
587         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): Decode shape and wind rule.
588         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
589         (WebKit::PlatformCALayerRemote::shapePath):
590         (WebKit::PlatformCALayerRemote::setShapePath):
591         (WebKit::PlatformCALayerRemote::shapeWindRule):
592         (WebKit::PlatformCALayerRemote::setShapeWindRule):
593         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
594
595 2015-03-01  Chris Dumez  <cdumez@apple.com>
596
597         Make NotificationCenter / Notification suspendable
598         https://bugs.webkit.org/show_bug.cgi?id=142117
599         <rdar://problem/19923085>
600
601         Reviewed by Andreas Kling.
602
603         Provide implementation for NotificationClient::hasPendingPermissionRequests().
604
605         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
606         (WebKit::NotificationPermissionRequestManager::hasPendingPermissionRequests):
607         * WebProcess/Notifications/NotificationPermissionRequestManager.h:
608         * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
609         (WebKit::WebNotificationClient::hasPendingPermissionRequests):
610         * WebProcess/WebCoreSupport/WebNotificationClient.h:
611
612 2015-03-01  Antti Koivisto  <antti@apple.com>
613
614         Enable new disk cache on iOS
615         https://bugs.webkit.org/show_bug.cgi?id=142148
616
617         Reviewed by Sam Weinig.
618
619         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
620
621             iOS build fix.
622
623         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
624         (WebKit::registerUserDefaultsIfNeeded):
625
626             Disable the efficacy logging by default for now. It has significant performance impact.
627
628         * config.h:
629
630             Enable it.
631
632 2015-02-28  Anders Carlsson  <andersca@apple.com>
633
634         WebsiteDataStore should handle fetching and deleting local storage data
635         https://bugs.webkit.org/show_bug.cgi?id=142137
636
637         Reviewed by Sam Weinig.
638
639         * UIProcess/Storage/StorageManager.cpp:
640         (WebKit::StorageManager::deleteEntriesForOrigins):
641         Add a new function that deletes entries from multiple origins.
642
643         * UIProcess/Storage/StorageManager.h:
644         Add new members.
645
646         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
647         (WebKit::WebsiteDataStore::fetchData):
648         Fetch local storage data as well.
649
650         (WebKit::WebsiteDataStore::removeData):
651         Delete local storage data as well.
652
653 2015-02-28  Anders Carlsson  <andersca@apple.com>
654
655         Fetch cache origins from the network process
656         https://bugs.webkit.org/show_bug.cgi?id=142135
657
658         Reviewed by Dan Bernstein.
659
660         * NetworkProcess/NetworkProcess.cpp:
661         (WebKit::cfURLCacheOrigins):
662         Add a new helper function that returns a vector of CFURL cache origins.
663
664         (WebKit::fetchDiskCacheOrigins):
665         Fetch the disk cache origins and pass them along to the completion handler. Currently we don't handle the new disk cache.
666
667         (WebKit::NetworkProcess::fetchWebsiteData):
668         Create a callback aggregator and fetch disk cache origins if we're asked for it.
669
670         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
671         (WebKit::computeNetworkProcessAccessTypeForDataFetch):
672         New helper function that computes if we need to launch the network process in order to fetch data.
673
674         (WebKit::WebsiteDataStore::fetchData):
675         Fetch website data from the network process as well.
676
677 2015-02-28  Anders Carlsson  <andersca@apple.com>
678
679         Simplify WebResourceCacheManagerCFNet.mm code
680         https://bugs.webkit.org/show_bug.cgi?id=142134
681
682         Reviewed by Dan Bernstein.
683
684         - ENABLE(CACHE_PARTITIONING) is always true on Mac and iOS, so remove those #ifdefs.
685         - Make cfURLCacheHostNamesWithCallback and clearCFURLCacheForHostNames public
686           so they can be used by the new WebsiteDataStore code in an upcoming patch.
687         - Change cfURLCacheHostNamesWithCallback to take an std::function instead of a block.
688
689         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
690         (WebKit::WebResourceCacheManager::getCacheOrigins):
691         * WebProcess/ResourceCache/WebResourceCacheManager.h:
692         * WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.mm:
693         (WebKit::partitionName):
694         (WebKit::WebResourceCacheManager::cfURLCacheHostNamesWithCallback):
695         (WebKit::WebResourceCacheManager::clearCFURLCacheForHostNames):
696         (WebKit::WebResourceCacheManager::cfURLCacheHostNames): Deleted.
697
698 2015-02-28  Commit Queue  <commit-queue@webkit.org>
699
700         Unreviewed, rolling out r180804.
701         https://bugs.webkit.org/show_bug.cgi?id=142131
702
703         Broke nightlies (Requested by ap on #webkit).
704
705         Reverted changeset:
706
707         "[WK2] Drop legacy WKBundlePageDiagnosticLoggingClient API"
708         https://bugs.webkit.org/show_bug.cgi?id=141176
709         http://trac.webkit.org/changeset/180804
710
711 2015-02-27  Hunseop Jeong  <hs85.jeong@samsung.com>
712
713         [EFL][GTK] Fix build break after r180790,180798 
714         https://bugs.webkit.org/show_bug.cgi?id=142127
715
716         Reviewed by Gyuyoung Kim.
717
718         * CMakeLists.txt:
719
720 2015-02-27  Chris Dumez  <cdumez@apple.com>
721
722         [WK2] Drop legacy WKBundlePageDiagnosticLoggingClient API
723         https://bugs.webkit.org/show_bug.cgi?id=141176
724
725         Reviewed by Sam Weinig.
726
727         Drop legacy WKBundlePageDiagnosticLoggingClient WK2 API as we are now
728         exposing this functionality via WKPageDiagnosticLoggingClient.h on
729         UIProcess side. The client-side has already been ported over.
730
731         * CMakeLists.txt:
732         * Shared/API/c/WKSharedAPICast.h:
733         (WebKit::toAPI): Deleted.
734         (WebKit::toDiagnosticLoggingResultType): Deleted.
735         * UIProcess/API/C/WKAPICast.h:
736         (WebKit::toAPI):
737         * UIProcess/API/C/WKDiagnosticLoggingResultType.h: Renamed from Source/WebKit2/Shared/API/c/WKDiagnosticLoggingResultType.h.
738         * WebKit2.xcodeproj/project.pbxproj:
739         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
740         (WKBundlePageSetDiagnosticLoggingClient): Deleted.
741         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
742         * WebProcess/InjectedBundle/API/c/WKBundlePageDiagnosticLoggingClient.h: Removed.
743         * WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.cpp: Removed.
744         * WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.h: Removed.
745         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
746         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage):
747         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult):
748         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue):
749         * WebProcess/WebPage/WebPage.cpp:
750         (WebKit::WebPage::WebPage):
751         (WebKit::WebPage::close):
752         (WebKit::WebPage::initializeInjectedBundleDiagnosticLoggingClient): Deleted.
753         * WebProcess/WebPage/WebPage.h:
754         (WebKit::WebPage::injectedBundleDiagnosticLoggingClient): Deleted.
755
756 2015-02-27  Anders Carlsson  <andersca@apple.com>
757
758         Rename WebResourceCacheManagerCFNet.cpp to WebResourceCacheManagerCFNet.mm
759
760         Rubber-stamped by Dan Bernstein.
761
762         This will let us use lambda to block conversion in a subsequent patch.
763
764         * WebKit2.xcodeproj/project.pbxproj:
765         * WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.mm: Renamed from Source/WebKit2/WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.cpp.
766
767 2015-02-27  Commit Queue  <commit-queue@webkit.org>
768
769         Unreviewed, rolling out r180203 and r180210.
770         https://bugs.webkit.org/show_bug.cgi?id=142116
771
772         broke process suspension and tile map (Requested by thorton on
773         #webkit).
774
775         Reverted changesets:
776
777         "Adopt CAMachPort-as-layer-contents"
778         https://bugs.webkit.org/show_bug.cgi?id=141687
779         http://trac.webkit.org/changeset/180203
780
781         "Fix the !USE(IOSURFACE) build"
782         http://trac.webkit.org/changeset/180210
783
784 2015-02-27  Sam Weinig  <sam@webkit.org>
785
786         Add WebKit2 SPI to create a DOM File object
787         https://bugs.webkit.org/show_bug.cgi?id=142109
788
789         Reviewed by Tim Horton.
790
791         Add a new handle type for exposing a DOM File object to script. Follow
792         the pattern of WKBundleNodeHandleRef and WKBundleRangeHandleRef with the
793         new class WKBundleFileHandleRef. It can be created for a specific path,
794         and then the JS wrapper can be obtained via WKBundleFrameGetJavaScriptWrapperForFileForWorld.
795
796         * Shared/API/APIObject.h:
797         * Shared/API/c/WKBase.h:
798         * WebKit2.xcodeproj/project.pbxproj:
799         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
800         * WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.cpp: Added.
801         (WKBundleFileHandleGetTypeID):
802         (WKBundleFileHandleCreateWithPath):
803         * WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.h: Added.
804         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
805         (WKBundleFrameGetJavaScriptWrapperForFileForWorld):
806         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
807         * WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.cpp: Added.
808         (WebKit::domHandleCache):
809         (WebKit::InjectedBundleFileHandle::create):
810         (WebKit::InjectedBundleFileHandle::getOrCreate):
811         (WebKit::InjectedBundleFileHandle::InjectedBundleFileHandle):
812         (WebKit::InjectedBundleFileHandle::~InjectedBundleFileHandle):
813         (WebKit::InjectedBundleFileHandle::coreFile):
814         * WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.h: Added.
815         * WebProcess/WebPage/WebFrame.cpp:
816         (WebKit::WebFrame::jsWrapperForWorld):
817         * WebProcess/WebPage/WebFrame.h:
818
819 2015-02-27  Beth Dakin  <bdakin@apple.com>
820
821         Lookup panel dismisses when pages are loading in other tabs/windows
822         https://bugs.webkit.org/show_bug.cgi?id=142104
823         -and corresponding-
824         rdar://problem/19882137
825
826         Reviewed by Tim Horton.
827
828         Until rdar://problem/13875766 is resolved, we should only call into Lookup and 
829         DataDetectors for key windows.
830         * UIProcess/API/mac/WKView.mm:
831         (-[WKView _dismissContentRelativeChildWindows]):
832
833 2015-02-27  Anders Carlsson  <andersca@apple.com>
834
835         Add infrastructure for handling website data in the network process
836         https://bugs.webkit.org/show_bug.cgi?id=142092
837
838         Reviewed by Andreas Kling.
839
840         * NetworkProcess/NetworkProcess.cpp:
841         (WebKit::NetworkProcess::fetchWebsiteData):
842         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
843         Send back "Did" messages without actually doing anything for now.
844
845         * NetworkProcess/NetworkProcess.h:
846         Add new members.
847
848         * NetworkProcess/NetworkProcess.messages.in:
849         Add FetchWebsiteData and DeleteWebsiteDataForOrigins messages.
850
851         * UIProcess/Network/NetworkProcessProxy.cpp:
852         (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
853         Assert that all maps are empty.
854
855         (WebKit::NetworkProcessProxy::fetchWebsiteData):
856         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
857         Add callbacks and send fetch and delete messages respectively.
858
859         (WebKit::NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch):
860         Make sure to invoke all callbacks.
861
862         (WebKit::NetworkProcessProxy::didFetchWebsiteData):
863         Find the callback and invoke it.
864
865         (WebKit::NetworkProcessProxy::didDeleteWebsiteDataForOrigins):
866         Ditto.
867
868         * UIProcess/Network/NetworkProcessProxy.h:
869         Add new members.
870
871         * UIProcess/Network/NetworkProcessProxy.messages.in:
872         Add DidFetchWebsiteData and DidDeleteWebsiteDataForOrigins messages.
873
874         * UIProcess/WebProcessProxy.cpp:
875         (WebKit::WebProcessProxy::connectionDidClose):
876         Just pass an empty WebsiteData object.
877
878 2015-02-26  Enrica Casucci  <enrica@apple.com>
879
880         [WK2] REGRESSION(r180465): WebKit::WebPage::editorState() triggers a layout.
881         https://bugs.webkit.org/show_bug.cgi?id=142015
882
883         Reviewed by Alexey Proskuryakov.
884
885         We no longer compute the font information at selection
886         when we update the editor state.
887         Instead, we request the font information only when the selection
888         changes and the font panel is visible.
889         I added an observer to be notified of the font panel visibility
890         changes to update NSFontManager to reflect the font at the
891         current selection.
892
893         * Shared/EditorState.cpp:
894         (WebKit::EditorState::encode):
895         (WebKit::EditorState::decode):
896         * Shared/EditorState.h:
897         (WebKit::EditorState::EditorState):
898         * UIProcess/API/mac/WKView.mm:
899         (-[WKView updateFontPanelIfNeeded]):
900         (-[WKView _selectionChanged]):
901         (-[WKView addWindowObserversForWindow:]):
902         (-[WKView removeWindowObservers]):
903         (-[WKView observeValueForKeyPath:ofObject:change:context:]):
904         * UIProcess/WebPageProxy.h:
905         * UIProcess/WebPageProxy.messages.in:
906         * UIProcess/mac/WebPageProxyMac.mm:
907         (WebKit::WebPageProxy::fontAtSelection):
908         (WebKit::WebPageProxy::fontAtSelectionCallback):
909         * WebProcess/WebPage/WebPage.h:
910         * WebProcess/WebPage/WebPage.messages.in:
911         * WebProcess/WebPage/mac/WebPageMac.mm:
912         (WebKit::WebPage::platformEditorState):
913         (WebKit::WebPage::fontAtSelection):
914
915 2015-02-27  Brady Eidson  <beidson@apple.com>
916
917         Add API to remove a single content filter.
918         <rdar://problem/19977764> and https://bugs.webkit.org/show_bug.cgi?id=142088
919
920         Reviewed by Sam Weinig.
921
922         * Shared/WebPageGroupData.h:
923
924         * UIProcess/API/C/WKPageGroup.cpp:
925         (WKPageGroupRemoveUserContentFilter):
926
927         * UIProcess/API/C/WKPageGroup.h:
928         * UIProcess/API/Cocoa/WKUserContentController.mm:
929         (-[WKUserContentController _removeUserContentFilter:]):
930
931         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
932         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
933         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
934         (WebKit::WebUserContentControllerProxy::addProcess):
935         (WebKit::WebUserContentControllerProxy::addUserContentFilter):
936         (WebKit::WebUserContentControllerProxy::removeUserContentFilter):
937         (WebKit::WebUserContentControllerProxy::removeAllUserContentFilters):
938         * UIProcess/UserContent/WebUserContentControllerProxy.h:
939
940         * UIProcess/WebPageGroup.cpp:
941         (WebKit::WebPageGroup::addUserContentFilter):
942         (WebKit::WebPageGroup::removeUserContentFilter):
943         * UIProcess/WebPageGroup.h:
944
945         * WebProcess/UserContent/WebUserContentController.cpp:
946         (WebKit::WebUserContentController::removeUserContentFilter):
947         * WebProcess/UserContent/WebUserContentController.h:
948         * WebProcess/UserContent/WebUserContentController.messages.in:
949
950         * WebProcess/WebPage/WebPageGroupProxy.cpp:
951         (WebKit::WebPageGroupProxy::WebPageGroupProxy):
952         (WebKit::WebPageGroupProxy::removeUserContentFilter):
953         * WebProcess/WebPage/WebPageGroupProxy.h:
954         * WebProcess/WebPage/WebPageGroupProxy.messages.in:
955
956 2015-02-26  Anders Carlsson  <andersca@apple.com>
957
958         Add API to remove all website data for the given data records
959         https://bugs.webkit.org/show_bug.cgi?id=142060
960
961         Reviewed by Beth Dakin.
962
963         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
964         Add new method declaration.
965
966         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
967         (toWebsiteDataRecords):
968         Add a helper function that converts an NSArray of _WKWebsiteDataRecords to a Vector of WebsiteDataRecords.
969
970         (-[_WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
971         Call through to the underlying WebsiteDataStore.
972
973         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
974         (WebKit::WebsiteDataStore::removeData):
975         Figure out which processes to call deleteWebsiteDataForOrigins for and do so. Add a callback aggregator so we can
976         call the completion handler at the right time.
977
978         * UIProcess/WebsiteData/WebsiteDataStore.h:
979         Add new members.
980
981         * WebProcess/WebProcess.cpp:
982         (WebKit::WebProcess::deleteWebsiteDataForOrigins):
983         Use the newly added MemoryCache member function to delete all resources matching the set of origins.
984
985 2015-02-26  Chris Dumez  <cdumez@apple.com>
986
987         Rename DatabaseManager::manager() to DatabaseManager::singleton()
988         https://bugs.webkit.org/show_bug.cgi?id=142054
989
990         Reviewed by Ryosuke Niwa.
991
992         Rename DatabaseManager::manager() to DatabaseManager::singleton() as
993         per coding style and use WTF::NeverDestroyed.
994
995         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
996         (WebKit::WebChromeClient::exceededDatabaseQuota):
997         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
998         (WebKit::WebDatabaseManager::initialize):
999         (WebKit::WebDatabaseManager::getDatabasesByOrigin):
1000         (WebKit::WebDatabaseManager::getDatabaseOrigins):
1001         (WebKit::WebDatabaseManager::deleteDatabaseWithNameForOrigin):
1002         (WebKit::WebDatabaseManager::deleteDatabasesForOrigin):
1003         (WebKit::WebDatabaseManager::deleteAllDatabases):
1004         (WebKit::WebDatabaseManager::setQuotaForOrigin):
1005         * WebProcess/WebPage/WebPage.cpp:
1006         (WebKit::WebPage::updatePreferences):
1007
1008 2015-02-26  Myles C. Maxfield  <mmaxfield@apple.com>
1009
1010         [Mac] [iOS] Parsing support for -apple-trailing-word
1011         https://bugs.webkit.org/show_bug.cgi?id=141939
1012
1013         Reviewed by Andreas Kling.
1014
1015         * Configurations/FeatureDefines.xcconfig:
1016
1017 2015-02-26  Brady Eidson  <beidson@apple.com>
1018
1019         Make WKPageGroupRemoveAllUserContentFilters actually remove all user content filters
1020         https://bugs.webkit.org/show_bug.cgi?id=142047
1021
1022         Reviewed by Geoff Garen.
1023
1024         * UIProcess/API/C/WKPageGroup.cpp:
1025         (WKPageGroupRemoveAllUserContentFilters): Remove all content filters instead of removing all user scripts.
1026
1027 2015-02-25  Anders Carlsson  <andersca@apple.com>
1028
1029         Add (unused for now) code to delete website data for a set of origins
1030         https://bugs.webkit.org/show_bug.cgi?id=142019
1031
1032         Reviewed by Beth Dakin.
1033
1034         * UIProcess/WebProcessProxy.cpp:
1035         (WebKit::WebProcessProxy::~WebProcessProxy):
1036         Assert that there are no pending callbacks.
1037
1038         (WebKit::WebProcessProxy::connectionDidClose):
1039         Invoke all the didDeleteWebsiteDataForOrigins callbacks.
1040
1041         (WebKit::WebProcessProxy::didDeleteWebsiteDataForOrigins):
1042         Grab the didDeleteWebsiteDataForOrigins and invoke it.
1043
1044         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
1045         Add the pending callback and send a DeleteWebsiteDataForOrigins to the web process.
1046
1047         * UIProcess/WebProcessProxy.h:
1048         Add new members.
1049
1050         * UIProcess/WebProcessProxy.messages.in:
1051         Add a DidDeleteWebsiteDataForOrigins message.
1052
1053         * WebProcess/WebProcess.cpp:
1054         (WebKit::WebProcess::deleteWebsiteDataForOrigins):
1055         For now, just send back a DidDeleteWebsiteDataForOrigins message.
1056
1057         * WebProcess/WebProcess.h:
1058         Add new members.
1059
1060         * WebProcess/WebProcess.messages.in:
1061         Add a DeleteWebsiteDataForOrigins message.
1062
1063 2015-02-25  Shivakumar JM  <shiva.jm@samsung.com>
1064
1065         Fix build warning in WebKit2/UIProcess module.
1066         https://bugs.webkit.org/show_bug.cgi?id=142014
1067
1068         Reviewed by Anders Carlsson.
1069
1070         Fix build warning by using UNUSED_PARAM macro.
1071
1072         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1073         (WebKit::computeWebProcessAccessTypeForDataFetch):
1074
1075 2015-02-24  Simon Fraser  <simon.fraser@apple.com>
1076
1077         Clarify some resizing terminology in ScrollView/FrameView
1078         https://bugs.webkit.org/show_bug.cgi?id=141996
1079
1080         Reviewed by Zalan Bujtas.
1081
1082         ScrollableArea/ScrollView/FrameView had some confusing terminology around
1083         contentsResized/visibleContentsResized/fixedLayoutSizeChanged.
1084         
1085         Clarify this by distinguishing between:
1086         1. Available size changes because of
1087             i) non-overlay scrollbar presence
1088            ii) ScrollableArea frame change
1089         2. Removing fixedLayoutSizeChanged() and just treating it like an
1090            available size change.
1091            
1092         contentsResized() is relegated to simply being a hook that allows Mac to
1093         flash overlay scrollbars.
1094         
1095         The confusingly named visibleContentsResized() is now updateContentsSize(),
1096         and is the way that a ScrollableArea tells its subclasss that it should recompute
1097         the size of the contents (i.e. do a layout).
1098
1099         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1100         (WebKit::PDFPlugin::scrollbarStyleChanged): Call the base class method,
1101         which takes care of 
1102
1103 2015-02-24  Simon Fraser  <simon.fraser@apple.com>
1104
1105         Use an enum for scrollbar style
1106         https://bugs.webkit.org/show_bug.cgi?id=141985
1107
1108         Reviewed by Beth Dakin.
1109         
1110         Switch to an enum class for the scrollbar style (normal or overlay).
1111         
1112         Sadly it still has to be passed as an int across the process boundary.
1113
1114         * UIProcess/PageClient.h:
1115         * UIProcess/WebPageProxy.cpp:
1116         (WebKit::WebPageProxy::recommendedScrollbarStyleDidChange):
1117         * UIProcess/mac/PageClientImpl.h:
1118         * UIProcess/mac/PageClientImpl.mm:
1119         (WebKit::PageClientImpl::recommendedScrollbarStyleDidChange):
1120         * WebProcess/Plugins/PDF/PDFPlugin.h:
1121         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1122         (WebKit::PDFPlugin::scrollbarStyleChanged):
1123         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1124         (WebKit::WebChromeClient::recommendedScrollbarStyleDidChange):
1125         * WebProcess/WebCoreSupport/WebChromeClient.h:
1126
1127 2015-02-24  Chris Dumez  <cdumez@apple.com>
1128
1129         [Mac][WK2] ASSERTION FAILED: m_sendPort in IPC::Connection::open()
1130         https://bugs.webkit.org/show_bug.cgi?id=141934
1131
1132         Reviewed by Darin Adler.
1133
1134         Speculative fix for "ASSERTION FAILED: m_sendPort" in
1135         IPC::Connection::open(). This assertion seems to indicate we ended
1136         up in IPC::Connection::open() with MACH_PORT_NULL as port.
1137
1138         I found that in XPCServiceInitializerDelegate::getConnectionIdentifier()
1139         we return true unconditionally, even though
1140         xpc_dictionary_copy_mach_send() can return MACH_PORT_NULL. This patch
1141         updates this method to add a check for MACH_PORT_NULL and return false
1142         in this case.
1143
1144         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
1145         (WebKit::XPCServiceInitializerDelegate::getConnectionIdentifier):
1146
1147 2015-02-24  Commit Queue  <commit-queue@webkit.org>
1148
1149         Unreviewed, rolling out r180599.
1150         https://bugs.webkit.org/show_bug.cgi?id=141998
1151
1152         Lots of new test failures (Requested by smfr on #webkit).
1153
1154         Reverted changeset:
1155
1156         "Parsing support for -webkit-trailing-word"
1157         https://bugs.webkit.org/show_bug.cgi?id=141939
1158         http://trac.webkit.org/changeset/180599
1159
1160 2015-02-24  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1161
1162         Fix build break on EFL and GTK port since r180585.
1163         https://bugs.webkit.org/show_bug.cgi?id=141994
1164
1165         Reviewed by Joseph Pecoraro.
1166
1167         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
1168         (WebKit::WebsiteDataRecord::displayNameForOrigin):
1169         * UIProcess/WebsiteData/WebsiteDataRecord.h:
1170         (WebKit::WebsiteDataRecord::WebsiteDataRecord):
1171
1172 2015-02-24  Myles C. Maxfield  <mmaxfield@apple.com>
1173
1174         [Mac] [iOS] Parsing support for -apple-trailing-word
1175         https://bugs.webkit.org/show_bug.cgi?id=141939
1176
1177         Reviewed by Andreas Kling.
1178
1179         * Configurations/FeatureDefines.xcconfig:
1180
1181 2015-02-24  Csaba Osztrogonác  <ossy@webkit.org>
1182
1183         Buildfix after r180585.
1184
1185         * CMakeLists.txt:
1186
1187 2015-02-24  Anders Carlsson  <andersca@apple.com>
1188
1189         Pass _WKWebsiteDataRecord objects to the fetchData completion handler
1190         https://bugs.webkit.org/show_bug.cgi?id=141984
1191
1192         Reviewed by Andreas Kling.
1193
1194         * Shared/Cocoa/APIObject.mm:
1195         (API::Object::newObject):
1196         Create _WKWebsiteDataRecord objects for WebsiteDataRecord API objects.
1197
1198         * UIProcess/API/APIWebsiteDataRecord.h:
1199         Add WebsiteDataRecord getter.
1200
1201         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
1202         Add displayName and dataTypes properties.
1203
1204         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm:
1205         (dataTypesToString):
1206         Helper function to convert dataTypes bit-fields to strings.
1207
1208         (-[_WKWebsiteDataRecord description]):
1209         Include the display name and data types in the description.
1210
1211         (-[_WKWebsiteDataRecord displayName]):
1212         Return the display name.
1213
1214         (-[_WKWebsiteDataRecord dataTypes]):
1215         Return the data types.
1216
1217         * UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h:
1218         (WebKit::toWebsiteDataTypes):
1219         Move this here from _WKWebsiteDataStore.mm.
1220
1221         (WebKit::toWKWebsiteDataTypes):
1222         Add new function to convert WebsiteDataTypes to WKWebsiteDataTypes.
1223
1224         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
1225         (-[_WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
1226         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
1227         Qualify toWebsiteDataTypes calls.
1228
1229         * UIProcess/WebsiteData/WebsiteDataRecord.cpp: Added.
1230         (WebKit::WebsiteDataRecord::displayNameForOrigin):
1231         New helper that returns a display name given an origin.
1232
1233         (WebKit::WebsiteDataRecord::add):
1234         Add the origin as well as the type.
1235
1236         * UIProcess/WebsiteData/WebsiteDataRecord.h:
1237         Add new members.
1238
1239         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1240         (WebKit::WebsiteDataStore::fetchData):
1241         Loop through the entries and add them to the m_websiteDataRecords hash map, which
1242         is keyed off of the display name. Pass the m_websiteDataRecords values to the completion handler.
1243
1244         * WebKit2.xcodeproj/project.pbxproj:
1245
1246 2015-02-24  Csaba Osztrogonác  <ossy@webkit.org>
1247
1248         One more buildfix after r180575.
1249
1250         * UIProcess/WebProcessProxy.cpp:
1251         (WebKit::WebProcessProxy::connectionDidClose):
1252
1253 2015-02-24  Csaba Osztrogonác  <ossy@webkit.org>
1254
1255         URTBF after 180575.
1256
1257         * CMakeLists.txt:
1258
1259 2015-02-24  Anders Carlsson  <andersca@apple.com>
1260
1261         Implement more of the data fetching API
1262         https://bugs.webkit.org/show_bug.cgi?id=141975
1263
1264         Reviewed by Andreas Kling.
1265
1266         * Shared/WebsiteData/WebsiteData.cpp: Added.
1267         (WebKit::WebsiteData::Entry::encode):
1268         (WebKit::WebsiteData::Entry::decode):
1269         (WebKit::WebsiteData::encode):
1270         (WebKit::WebsiteData::decode):
1271         * Shared/WebsiteData/WebsiteData.h: Added.
1272         Add a new WebsiteData class that will store website data. Currently it only stores
1273         origin + website data type, but in the future it is going to store more things, like 
1274         host names that have cookies associated.
1275
1276         * UIProcess/WebProcessProxy.cpp:
1277         (WebKit::WebProcessProxy::~WebProcessProxy):
1278         Assert that we don't have any pending fetch data callbacks.
1279
1280         (WebKit::WebProcessProxy::connectionDidClose):
1281         Invoke any pending fetch website data callbacks.
1282
1283         (WebKit::WebProcessProxy::didFetchWebsiteData):
1284         Grab the callback and invoke it.
1285
1286         (WebKit::WebProcessProxy::fetchWebsiteData):
1287         Set up a pending callback and send a FetchWebsiteData message to the web process.
1288
1289         * UIProcess/WebProcessProxy.h:
1290         Add new member.
1291
1292         * UIProcess/WebProcessProxy.messages.in:
1293         Add a DidFetchWebsiteData message.
1294
1295         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1296         (WebKit::computeWebProcessAccessTypeForDataFetch):
1297         Return the web process access type for the given set of data types.
1298
1299         (WebKit::WebsiteDataStore::fetchData):
1300         Set up a callback aggregator that will assemble the needed website data into a vector of website data records.
1301
1302         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
1303         (WebKit::computeWebProcessAccessTypeForDataRemoval):
1304         Rename these functions to indicate that they are about data removal.
1305
1306         (WebKit::WebsiteDataStore::removeData):
1307         Append "ForDataRemoval" to function calls.
1308
1309         * WebKit2.xcodeproj/project.pbxproj:
1310         Add new files.
1311
1312         * WebProcess/Storage/StorageAreaMap.cpp:
1313         (WebKit::StorageAreaMap::StorageAreaMap):
1314         Tighten types.
1315
1316         * WebProcess/WebProcess.cpp:
1317         (WebKit::WebProcess::fetchWebsiteData):
1318         For now, just fetch memory cache data.
1319
1320         * WebProcess/WebProcess.h:
1321         Add new members.
1322
1323         * WebProcess/WebProcess.messages.in:
1324         Add FetchWebsiteData message.
1325
1326 2015-02-24  Yusuke Suzuki  <utatane.tea@gmail.com>
1327
1328         REGRESSION(r179429): Can't type comments in Facebook
1329         https://bugs.webkit.org/show_bug.cgi?id=141859
1330
1331         Reviewed by Brent Fulgham.
1332
1333         Enable SymbolEnabled in inspector context.
1334
1335         * Shared/WebPreferencesDefinitions.h:
1336         * UIProcess/API/C/WKPreferences.cpp:
1337         (WKPreferencesSetJavaScriptRuntimeFlags):
1338         (WKPreferencesGetJavaScriptRuntimeFlags):
1339         (WKPreferencesSetJavaScriptExperimentsEnabled): Deleted.
1340         (WKPreferencesGetJavaScriptExperimentsEnabled): Deleted.
1341         * UIProcess/API/C/WKPreferencesRef.h:
1342         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1343         * UIProcess/API/Cocoa/WKPreferences.mm:
1344         (-[WKPreferences _javaScriptRuntimeFlags]):
1345         (-[WKPreferences _setJavaScriptRuntimeFlags:]):
1346         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1347         * UIProcess/efl/WebInspectorProxyEfl.cpp:
1348         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1349         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
1350         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1351         * UIProcess/mac/WebInspectorProxyMac.mm:
1352         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1353         * WebProcess/WebPage/WebPage.cpp:
1354         (WebKit::WebPage::updatePreferences):
1355         * mac/WebKit2.order:
1356
1357 2015-02-24  Anders Carlsson  <andersca@apple.com>
1358
1359         Tighten up some SecurityOrigin related code, use references where possible
1360         https://bugs.webkit.org/show_bug.cgi?id=141971
1361
1362         Reviewed by Antti Koivisto.
1363
1364         * DatabaseProcess/DatabaseProcess.cpp:
1365         (WebKit::DatabaseProcess::getIndexedDatabaseOrigins):
1366         * Shared/SecurityOriginData.cpp:
1367         (WebKit::SecurityOriginData::fromSecurityOrigin):
1368         (WebKit::SecurityOriginData::securityOrigin):
1369         * Shared/SecurityOriginData.h:
1370         * UIProcess/Storage/StorageManager.cpp:
1371         (WebKit::StorageManager::createTransientLocalStorageMap):
1372         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
1373         (WebKit::WebIDBServerConnection::WebIDBServerConnection):
1374         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
1375         (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins):
1376         * WebProcess/Storage/StorageAreaMap.cpp:
1377         (WebKit::StorageAreaMap::create):
1378         (WebKit::StorageAreaMap::StorageAreaMap):
1379         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
1380         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
1381         * WebProcess/Storage/StorageAreaMap.h:
1382         * WebProcess/Storage/StorageNamespaceImpl.cpp:
1383         (WebKit::StorageNamespaceImpl::storageArea):
1384
1385 2015-02-24  Michael Catanzaro  <mcatanzaro@igalia.com>
1386
1387         Crash loading local file with WebPageProxy::loadAlternateHTMLString
1388         https://bugs.webkit.org/show_bug.cgi?id=141867
1389
1390         Reviewed by Anders Carlsson.
1391
1392         WebPageProxy::loadAlternateHTMLString needs to assume read access to unreachableURL as well
1393         as baseURL, because unreachableURL will get added to the back/forward list, causing us to
1394         crash later on when we notice the unexpected URL received in checkURLReceivedFromWebProcess.
1395
1396         * UIProcess/WebPageProxy.cpp:
1397         (WebKit::WebPageProxy::loadAlternateHTMLString):
1398
1399 2015-02-24  Ryuan Choi  <ryuan.choi@navercorp.com>
1400
1401         [EFL] Add message APIs to communicate between ewk_context and extensions
1402         https://bugs.webkit.org/show_bug.cgi?id=137660
1403
1404         Reviewed by Gyuyoung Kim.
1405
1406         * PlatformEfl.cmake: Added dependencies for ewk2UnitTestExtensionSample
1407         * UIProcess/API/efl/ewk_context.cpp:
1408         (EwkContext::EwkContext):
1409         (EwkContext::didReceiveMessageFromInjectedBundle):
1410         (EwkContext::setMessageFromExtensionCallback):
1411         (EwkContext::processReceivedMessageFromInjectedBundle):
1412         (ewk_context_message_post_to_extensions):
1413         (ewk_context_message_from_extensions_callback_set):
1414         (EwkContext::didReceiveSynchronousMessageFromInjectedBundle):
1415         Deleted to split synchronouse message APIs from asynchronuous message APIs.
1416         ewebkit will not support this until there are requirements.
1417         (EwkContext::setMessageFromInjectedBundleCallback): Renamed to setMessageFromExtensionCallback.
1418         (ewk_context_message_post_to_injected_bundle): Renamed to ewk_context_message_post_to_extensions.
1419         (ewk_context_message_from_injected_bundle_callback_set): Renamed to ewk_context_message_from_injected_bundle_callback_set.
1420         * UIProcess/API/efl/ewk_context.h:
1421         * UIProcess/API/efl/ewk_context_private.h:
1422         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:
1423         Improved test case for ewk_context_new_with_extensions_path using the message APIs.
1424         (EWK2UnitTest::EWK2UnitTestBase::EWK2UnitTestBase):
1425         (EWK2UnitTest::EWK2UnitTestBase::SetUp):
1426         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:
1427         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp:
1428         (EWK2UnitTest::EWK2UnitTestEnvironment::extensionSample): Deleted.
1429         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.h:
1430         * UIProcess/API/efl/tests/extensions/extension_sample.cpp:
1431         Improved test case for ewk_context_new_with_extensions_path using the message APIs.
1432         * UIProcess/API/efl/tests/test_ewk2_context.cpp: Ditto.
1433         (EWK2ContextTestWithExtension::messageReceivedCallback):
1434         (EWK2ContextTestWithExtension::EWK2ContextTestWithExtension):
1435         (TEST_F):
1436         * WebProcess/InjectedBundle/API/efl/ewk_extension.cpp:
1437         (toEwkExtendion):
1438         (EwkExtension::EwkExtension):
1439         (EwkExtension::didCreatePage):
1440         (EwkExtension::willDestroyPage):
1441         (EwkExtension::didReceiveMessage):
1442         (EwkExtension::didReceiveMessageToPage):
1443         (ewk_extension_message_post): Implemented to post message to ewk_context.
1444         * WebProcess/InjectedBundle/API/efl/ewk_extension.h:
1445         * WebProcess/InjectedBundle/API/efl/ewk_extension_private.h:
1446         (EwkExtension::bundle):
1447         * WebProcess/efl/ExtensionManagerEfl.cpp:
1448         (WebKit::ExtensionManagerEfl::initialize):
1449         Fixed the bug when there are different shared objects in extension path.
1450         This is spotted while improving test case.
1451
1452 2015-02-23  Commit Queue  <commit-queue@webkit.org>
1453
1454         Unreviewed, rolling out r180547 and r180550.
1455         https://bugs.webkit.org/show_bug.cgi?id=141957
1456
1457         Broke 10 Windows tests. (Requested by bfulgham_ on #webkit).
1458
1459         Reverted changesets:
1460
1461         "REGRESSION(r179429): Can't type comments in Facebook"
1462         https://bugs.webkit.org/show_bug.cgi?id=141859
1463         http://trac.webkit.org/changeset/180547
1464
1465         "Constructor returning null should construct an object instead
1466         of null"
1467         https://bugs.webkit.org/show_bug.cgi?id=141640
1468         http://trac.webkit.org/changeset/180550
1469
1470 2015-02-23  Ryosuke Niwa  <rniwa@webkit.org>
1471
1472         Disable font loading events until our implementation gets updated to match the latest spec
1473         https://bugs.webkit.org/show_bug.cgi?id=141938
1474
1475         Reviewed by Andreas Kling.
1476
1477         * Configurations/FeatureDefines.xcconfig:
1478
1479 2015-02-23  Yusuke Suzuki  <utatane.tea@gmail.com>
1480
1481         REGRESSION(r179429): Can't type comments in Facebook
1482         https://bugs.webkit.org/show_bug.cgi?id=141859
1483
1484         Reviewed by Geoffrey Garen.
1485
1486         Enable SymbolEnabled in inspector context.
1487
1488         * Shared/WebPreferencesDefinitions.h:
1489         * UIProcess/API/C/WKPreferences.cpp:
1490         (WKPreferencesSetJavaScriptRuntimeFlags):
1491         (WKPreferencesGetJavaScriptRuntimeFlags):
1492         (WKPreferencesSetJavaScriptExperimentsEnabled): Deleted.
1493         (WKPreferencesGetJavaScriptExperimentsEnabled): Deleted.
1494         * UIProcess/API/C/WKPreferencesRef.h:
1495         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1496         * UIProcess/API/Cocoa/WKPreferences.mm:
1497         (-[WKPreferences _javaScriptRuntimeFlags]):
1498         (-[WKPreferences _setJavaScriptRuntimeFlags:]):
1499         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1500         * UIProcess/efl/WebInspectorProxyEfl.cpp:
1501         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1502         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
1503         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1504         * UIProcess/mac/WebInspectorProxyMac.mm:
1505         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1506         * WebProcess/WebPage/WebPage.cpp:
1507         (WebKit::WebPage::updatePreferences):
1508         * mac/WebKit2.order:
1509
1510 2015-02-23  Benjamin Poulain  <bpoulain@apple.com>
1511
1512         [iOS WK2] The WebProcess keep scrolling pages based on the last velocity after scrolling has been interrupted
1513         https://bugs.webkit.org/show_bug.cgi?id=141933
1514         rdar://problem/18746673
1515         rdar://problem/19711490
1516
1517         Reviewed by Simon Fraser.
1518
1519         The bug happened like this:
1520         1) The user scroll the page. WKContentView tracks the velocity and send
1521            the update rect + velocity to the WebProcess.
1522         2) The user interupts the scrolling but does not commit to either scrolling
1523            again or cancelling the scrolling.
1524            Since we were not notified of this state, the WebProcess still believed
1525            the velocity is stable.
1526         3) With any paint update, the WebProcess would account for the last velocity
1527            and try to guess the best repaint area. This would drift endlessly out
1528            of the view since the view is not really moving.
1529
1530         This patch fixes the issue by adding special handling for interrupted scrolling.
1531
1532         Kudos to Kurt Revis for providing us the required APIs.
1533
1534         * Shared/VisibleContentRectUpdateInfo.h:
1535         (WebKit::operator==):
1536         We can no longer filter VisibleContentRectUpdateInfo ignoring the velocity.
1537
1538         Typically, UIScrollView would call -scrollViewDidScroll: before being interrupted.
1539         If we filter based on the VisibleContentRectUpdateInfo, we have two identical
1540         states differing only by the velocity. If we filter the second update, the WebProcess
1541         would never know the velocity should be zero.
1542
1543         * UIProcess/API/Cocoa/WKWebView.mm:
1544         (-[WKWebView _scrollViewDidInterruptDecelerating:]):
1545         We get this callback when scrolling is interrupted. We just need to clear
1546         the velocity and re-send a new update for the current state.
1547
1548         (-[WKWebView _updateVisibleContentRects]):
1549         Do not consider an interrupted scroll as a stable state. We don't know if scrolling
1550         will resume or will stop.
1551
1552         * UIProcess/ios/WKContentView.h:
1553         * UIProcess/ios/WKContentView.mm:
1554         (-[WKContentView didInterruptScrolling]):
1555
1556 2015-02-23  Anders Carlsson  <andersca@apple.com>
1557
1558         Add API for fetching website data records to _WKWebsiteDataStore
1559         https://bugs.webkit.org/show_bug.cgi?id=141926
1560
1561         Reviewed by Beth Dakin.
1562
1563         * UIProcess/API/APIWebsiteDataRecord.cpp:
1564         (API::WebsiteDataRecord::create):
1565         (API::WebsiteDataRecord::WebsiteDataRecord):
1566         * UIProcess/API/APIWebsiteDataRecord.h:
1567         Update to take a WebsiteDataRecord parameter.
1568
1569         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
1570         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
1571         (-[_WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
1572         Call down to the WebsiteDataStore.
1573
1574         * UIProcess/WebsiteData/WebsiteDataRecord.h: Added.
1575         This will be the data-container part of WebsiteDataRecord, but it's currently empty.
1576
1577         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1578         (WebKit::WebsiteDataStore::fetchData):
1579         Just dispatch the completion handler for now.
1580
1581         * UIProcess/WebsiteData/WebsiteDataStore.h:
1582         Add new member.
1583
1584         * WebKit2.xcodeproj/project.pbxproj:
1585         Add new files.
1586
1587 2015-02-23  Chris Dumez  <cdumez@apple.com>
1588
1589         Add support for diagnostic logging messages sampling
1590         https://bugs.webkit.org/show_bug.cgi?id=141823
1591         <rdar://problem/19899030>
1592
1593         Reviewed by Andreas Kling.
1594
1595         Add support for diagnostic logging messages sampling to decrease the
1596         impact of diagnostic logging on CPU usage, while still getting useful
1597         overall results. This patch adds a ShouldSample argument to
1598         logDiagnosticMessage*() functions and logs 5% of the messages when
1599         sampling. Sampling is turned on for keys that are known to be verbose
1600         (e.g. per resource load logging).
1601
1602         On the page load test I am tracking, CPU usage caused by diagnostic
1603         logging went down to 0.3% of UIProcess from 2.8% with this change.
1604
1605         * NetworkProcess/NetworkProcess.cpp:
1606         (WebKit::NetworkProcess::logDiagnosticMessage):
1607         (WebKit::NetworkProcess::logDiagnosticMessageWithResult):
1608         (WebKit::NetworkProcess::logDiagnosticMessageWithValue):
1609         * NetworkProcess/NetworkProcess.h:
1610         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
1611         (WebKit::NetworkCacheStatistics::recordNotUsingCacheForRequest):
1612         (WebKit::NetworkCacheStatistics::recordRetrievalFailure):
1613         (WebKit::NetworkCacheStatistics::recordRetrievedCachedEntry):
1614         * UIProcess/Network/NetworkProcessProxy.cpp:
1615         (WebKit::NetworkProcessProxy::logDiagnosticMessage):
1616         (WebKit::NetworkProcessProxy::logDiagnosticMessageWithResult):
1617         (WebKit::NetworkProcessProxy::logDiagnosticMessageWithValue):
1618         * UIProcess/Network/NetworkProcessProxy.h:
1619         * UIProcess/Network/NetworkProcessProxy.messages.in:
1620         * UIProcess/WebPageProxy.cpp:
1621         (WebKit::shouldLogDiagnosticMessage):
1622         (WebKit::WebPageProxy::logDiagnosticMessage):
1623         (WebKit::WebPageProxy::logDiagnosticMessageWithResult):
1624         (WebKit::WebPageProxy::logDiagnosticMessageWithValue):
1625         * UIProcess/WebPageProxy.h:
1626         * UIProcess/WebPageProxy.messages.in:
1627         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
1628         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage):
1629         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult):
1630         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue):
1631         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
1632         * WebProcess/WebPage/ios/WebPageIOS.mm:
1633         (WebKit::WebPage::willStartUserTriggeredZooming):
1634
1635 2015-02-23  Anders Carlsson  <andersca@apple.com>
1636
1637         Add a stubbed out _WKWebsiteDataRecord class
1638         https://bugs.webkit.org/show_bug.cgi?id=141919
1639
1640         Reviewed by Beth Dakin.
1641
1642         Also add the corresponding API::WebsiteDataRecord C++ class. A website data record is going to represent
1643         a set of associated websites and the types of website data that exist for said websites.
1644
1645         * Shared/API/APIObject.h:
1646         * UIProcess/API/APIWebsiteDataRecord.cpp: Added.
1647         * UIProcess/API/APIWebsiteDataRecord.h: Added.
1648         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h: Added.
1649         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm: Added.
1650         * UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h: Added.
1651         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
1652         * WebKit2.xcodeproj/project.pbxproj:
1653
1654 2015-02-23  Timothy Horton  <timothy_horton@apple.com>
1655
1656         Reproducible crash in ViewGestureController::removeSwipeSnapshot()
1657         https://bugs.webkit.org/show_bug.cgi?id=141917
1658         <rdar://problem/19918590>
1659
1660         Reviewed by Brian Weinstein.
1661
1662         * UIProcess/mac/ViewGestureControllerMac.mm:
1663         (WebKit::ViewGestureController::removeSwipeSnapshot):
1664         If the snapshot was purged and we're showing a white snapshot, we won't
1665         be able to mark the (null) snapshot surface as volatile. Add a null check.
1666
1667 2015-02-23  Anders Carlsson  <andersca@apple.com>
1668
1669         Replace another straight-up cast with a toImpl call
1670         https://bugs.webkit.org/show_bug.cgi?id=141914
1671         rdar://problem/19913016
1672
1673         Reviewed by Andreas Kling.
1674
1675         This fixes a problem where Mail would not display message bodies.
1676
1677         * UIProcess/API/Cocoa/WKConnection.mm:
1678         (didReceiveMessage):
1679
1680 2015-02-20  Brent Fulgham  <bfulgham@apple.com>
1681
1682         Scrollbars and ScrollAnimators must always have a ScrollableArea
1683         https://bugs.webkit.org/show_bug.cgi?id=141855
1684
1685         Reviewed by Simon Fraser.
1686         
1687         Change users of the scrollAnimator() method to expect a reference instead of a pointer.
1688
1689         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1690         (WebKit::PDFPlugin::createScrollbar):
1691         (WebKit::PDFPlugin::destroyScrollbar):
1692
1693 2015-02-20  Jessie Berlin  <jberlin@webkit.org>
1694
1695         Build fix after r180465.
1696
1697         * UIProcess/mac/PageClientImpl.h:
1698
1699 2015-02-20  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1700
1701         [GTK] Unreviewed build fix after r180449.
1702
1703         * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
1704         (webkit_file_chooser_request_get_selected_files):
1705
1706 2015-02-20  Enrica Casucci  <enrica@apple.com>
1707
1708         [WK2] Add support for font panel on OS X.
1709         https://bugs.webkit.org/show_bug.cgi?id=141777
1710
1711         Reviewed by Tim Horton.
1712
1713         This patch adds the necessary hooks to WKView to support
1714         the font panel. It also includes refactoring of WebPage::editorState
1715         and WebPageProxy::editorStateChanged to separate the different platform
1716         specific tasks.
1717
1718         * Shared/EditorState.cpp:
1719         (WebKit::EditorState::encode):
1720         (WebKit::EditorState::decode):
1721         * Shared/EditorState.h:
1722         (WebKit::EditorState::EditorState):
1723         * UIProcess/API/mac/WKView.mm:
1724         (-[WKView _selectionChanged]):
1725         (-[WKView changeFont:]):
1726         * UIProcess/API/mac/WKViewInternal.h:
1727         * UIProcess/PageClient.h:
1728         * UIProcess/WebPageProxy.cpp:
1729         (WebKit::WebPageProxy::editorStateChanged): Deleted.
1730         * UIProcess/WebPageProxy.h:
1731         * UIProcess/efl/WebPageProxyEfl.cpp:
1732         (WebKit::WebPageProxy::editorStateChanged):
1733         * UIProcess/gtk/WebPageProxyGtk.cpp:
1734         (WebKit::WebPageProxy::editorStateChanged):
1735         * UIProcess/ios/WebPageProxyIOS.mm:
1736         (WebKit::WebPageProxy::editorStateChanged):
1737         * UIProcess/mac/PageClientImpl.h:
1738         * UIProcess/mac/PageClientImpl.mm:
1739         (WebKit::PageClientImpl::selectionDidChange):
1740         * UIProcess/mac/WebPageProxyMac.mm:
1741         (WebKit::WebPageProxy::setFont):
1742         (WebKit::WebPageProxy::editorStateChanged):
1743         * WebProcess/WebPage/WebPage.cpp:
1744         (WebKit::WebPage::editorState):
1745         * WebProcess/WebPage/WebPage.h:
1746         * WebProcess/WebPage/WebPage.messages.in:
1747         * WebProcess/WebPage/efl/WebPageEfl.cpp:
1748         (WebKit::WebPage::platformEditorState):
1749         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1750         (WebKit::WebPage::platformEditorState):
1751         * WebProcess/WebPage/ios/WebPageIOS.mm:
1752         (WebKit::WebPage::platformEditorState):
1753         * WebProcess/WebPage/mac/WebPageMac.mm:
1754         (WebKit::WebPage::platformEditorState):
1755         (WebKit::WebPage::setFont):
1756
1757 2015-02-20  Chris Dumez  <cdumez@apple.com>
1758
1759         [WK2] Add more detailed diagnostic logging for measuring network cache efficacy
1760         https://bugs.webkit.org/show_bug.cgi?id=141803
1761         <rdar://problem/19632080>
1762
1763         Reviewed by Antti Koivisto.
1764
1765         Add more detailed diagnostic logging for measuring network cache
1766         efficacy.
1767
1768         We want to know the reason the network cache is being by-passed, why
1769         the network cache decided not to cache a response and why it cannot
1770         reuse a cache entry.
1771
1772         This patch adds a new "UncachedReason" table to the SQLite database
1773         to store the reason the network cache is deciding not to cache a
1774         given response. This information is used later, when the resource is
1775         requested again to log the reason why the request cannot be satistied
1776         by the cache.
1777
1778         * NetworkProcess/cache/NetworkCache.cpp:
1779         (WebKit::decodeStorageEntry):
1780         (WebKit::canRetrieve):
1781         (WebKit::NetworkCache::retrieve):
1782         (WebKit::canStore):
1783         (WebKit::NetworkCache::store):
1784         * NetworkProcess/cache/NetworkCache.h:
1785         * NetworkProcess/cache/NetworkCacheStatistics.h:
1786         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
1787         (WebKit::NetworkCacheStatistics::initialize):
1788         (WebKit::NetworkCacheStatistics::recordNotCachingResponse):
1789         (WebKit::retrieveDecisionToDiagnosticKey):
1790         (WebKit::NetworkCacheStatistics::recordNotUsingCacheForRequest):
1791         (WebKit::storeDecisionToDiagnosticKey):
1792         (WebKit::NetworkCacheStatistics::recordRetrievalFailure):
1793         (WebKit::cachedEntryReuseFailureToDiagnosticKey):
1794         (WebKit::NetworkCacheStatistics::recordRetrievedCachedEntry):
1795         (WebKit::NetworkCacheStatistics::queryWasEverRequested):
1796         (WebKit::NetworkCacheStatistics::clear):
1797
1798 2015-02-20  Anders Carlsson  <andersca@apple.com>
1799
1800         API::String should just be a simple wrapper for WTF strings
1801         https://bugs.webkit.org/show_bug.cgi?id=141852
1802
1803         Reviewed by Beth Dakin.
1804
1805         Expose a StringView member function on API::String. Move all the WKString API implementations to WKString.cpp.
1806
1807         * Shared/API/APIString.h:
1808         * Shared/API/c/WKString.cpp:
1809         (WKStringIsEmpty):
1810         (WKStringGetLength):
1811         (WKStringGetCharacters):
1812         (WKStringGetMaximumUTF8CStringSize):
1813         (WKStringGetUTF8CString):
1814         (WKStringIsEqual):
1815         (WKStringIsEqualToUTF8CString):
1816         (WKStringIsEqualToUTF8CStringIgnoringCase):
1817
1818 2015-02-20  Anders Carlsson  <andersca@apple.com>
1819
1820         API::String::string() needs to return an isolated string copy
1821         https://bugs.webkit.org/show_bug.cgi?id=141846
1822
1823         Reviewed by Tim Horton.
1824
1825         Since we can expose API::String objects as NSStrings now, we need to make sure that
1826         we return copied strings so we won't mess up the StringImpl refcounts.
1827
1828         * Shared/API/APIString.h:
1829
1830 2015-02-20  Alexey Proskuryakov  <ap@apple.com>
1831
1832         Remove svn:keywords property.
1833
1834         As far as I can tell, the property had no effect on any of these files, but also,
1835         when it has effect it's likely harmful.
1836
1837         * Platform/spi/ios/DataDetectorsUISPI.h: Removed property svn:keywords.
1838         * Platform/spi/ios/ManagedConfigurationSPI.h: Removed property svn:keywords.
1839         * Platform/spi/ios/TextInputSPI.h: Removed property svn:keywords.
1840         * Scripts/webkit/LegacyMessageReceiver-expected.cpp: Removed property svn:keywords.
1841         * Scripts/webkit/LegacyMessages-expected.h: Removed property svn:keywords.
1842         * Scripts/webkit/MessageReceiver-expected.cpp: Removed property svn:keywords.
1843         * Scripts/webkit/MessageReceiverSuperclass-expected.cpp: Removed property svn:keywords.
1844         * Scripts/webkit/Messages-expected.h: Removed property svn:keywords.
1845         * Scripts/webkit/MessagesSuperclass-expected.h: Removed property svn:keywords.
1846         * UIProcess/ios/PageClientImplIOS.h: Removed property svn:keywords.
1847         * UIProcess/ios/WKActionSheet.h: Removed property svn:keywords.
1848         * UIProcess/ios/WKActionSheetAssistant.h: Removed property svn:keywords.
1849         * UIProcess/ios/WKContentView.h: Removed property svn:keywords.
1850         * UIProcess/ios/WKContentViewInteraction.h: Removed property svn:keywords.
1851         * UIProcess/ios/WKGeolocationProviderIOS.h: Removed property svn:keywords.
1852         * UIProcess/ios/WKScrollView.h: Removed property svn:keywords.
1853         * UIProcess/mac/PageClientImpl.h: Removed property svn:keywords.
1854         * UIProcess/mac/WKPrintingView.h: Removed property svn:keywords.
1855         * UIProcess/mac/WKTextInputWindowController.h: Removed property svn:keywords.
1856         * WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.h: Removed property svn:keywords.
1857
1858 2015-02-20  Csaba Osztrogonác  <ossy@webkit.org>
1859
1860         EFL URTBF
1861
1862         * Platform/efl/DispatchQueueEfl.cpp:
1863
1864 2015-02-20  Csaba Osztrogonác  <ossy@webkit.org>
1865
1866         URTBF after r180410, WorkQueue.h is in WTF now.
1867
1868         * Platform/efl/DispatchQueueWorkItemEfl.h:
1869
1870 2015-02-20  Anders Carlsson  <andersca@apple.com>
1871
1872         Use toAPI when returning the object graph as a WKTypeRef
1873         https://bugs.webkit.org/show_bug.cgi?id=141841
1874
1875         Reviewed by Sam Weinig.
1876
1877         * UIProcess/API/Cocoa/WKProcessGroup.mm:
1878         (getInjectedBundleInitializationUserData):
1879
1880 2015-02-20  Eric Carlson  <eric.carlson@apple.com>
1881
1882         [iOS] cleanup AirPlay code
1883         https://bugs.webkit.org/show_bug.cgi?id=141811
1884
1885         Reviewed by Jer Noble.
1886
1887         * Configurations/FeatureDefines.xcconfig: IOS_AIRPLAY -> WIRELESS_PLAYBACK_TARGET.
1888         * WebProcess/WebPage/WebPage.cpp:
1889         (WebKit::WebPage::updatePreferences): Ditto.
1890
1891 2015-02-20  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1892
1893         [WK2][EFL] Fix the build after r180362
1894         https://bugs.webkit.org/show_bug.cgi?id=141836
1895
1896         Reviewed by Carlos Garcia Campos.
1897
1898         As r180409, EFL port needs to add missing includes for several features,
1899         and needs to have a specific implementation of toAPI/toImple for EFL port.
1900
1901         * UIProcess/API/C/WKBatteryManager.cpp:
1902         * UIProcess/API/C/WKPage.cpp:
1903         * UIProcess/API/C/efl/WKAPICastEfl.h:
1904         (WebKit::toAPI):
1905         (WebKit::toImpl):
1906         * UIProcess/API/efl/ewk_url_scheme_request.cpp:
1907         * UIProcess/CoordinatedGraphics/WebViewClient.cpp:
1908         * UIProcess/efl/WebUIPopupMenuClient.cpp:
1909         * UIProcess/efl/WebViewEfl.cpp:
1910         * WebProcess/efl/ExtensionManagerEfl.cpp:
1911
1912 2015-02-20  Antti Koivisto  <antti@apple.com>
1913
1914         Move WorkQueue from WK2 to WTF
1915         https://bugs.webkit.org/show_bug.cgi?id=141797
1916
1917         Reviewed by Anders Carlsson.
1918
1919         * CMakeLists.txt:
1920         * DatabaseProcess/DatabaseProcess.h:
1921         * Platform/IPC/Connection.h:
1922         * Platform/WorkQueue.cpp: Removed.
1923         * Platform/WorkQueue.h: Removed.
1924         * Platform/efl/WorkQueueEfl.cpp: Removed.
1925         * Platform/gtk/WorkQueueGtk.cpp: Removed.
1926         * Platform/mac/WorkQueueMac.cpp: Removed.
1927         * PlatformEfl.cmake:
1928         * PlatformGTK.cmake:
1929         * Shared/Network/CustomProtocols/CustomProtocolManager.h:
1930         * UIProcess/Launcher/ProcessLauncher.cpp:
1931         * UIProcess/Storage/LocalStorageDatabase.cpp:
1932         * UIProcess/Storage/LocalStorageDatabase.h:
1933         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1934         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
1935         * UIProcess/Storage/StorageManager.cpp:
1936         * UIProcess/Storage/StorageManager.h:
1937         * WebKit2.xcodeproj/project.pbxproj:
1938
1939 2015-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1940
1941         [WK2][GTK] Fix the build after r180362
1942         https://bugs.webkit.org/show_bug.cgi?id=141813
1943
1944         Reviewed by Žan Doberšek.
1945
1946         Add several missing includes and a specific implementation of
1947         toAPI/toImpl for GTK+ WebView.
1948
1949         * UIProcess/API/C/gtk/WKAPICastGtk.h:
1950         (WebKit::toAPI):
1951         (WebKit::toImpl):
1952         * UIProcess/API/C/gtk/WKView.cpp:
1953         * UIProcess/API/gtk/WebKitFormClient.cpp:
1954         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp:
1955         * UIProcess/gtk/WebInspectorClientGtk.cpp:
1956
1957 2015-02-19  Shivakumar JM  <shiva.jm@samsung.com>
1958
1959         Fix build warning in WebKit2/WebProcess and UIProcess module.
1960         https://bugs.webkit.org/show_bug.cgi?id=141794.
1961
1962         Reviewed by Anders Carlsson.
1963
1964         Fix build warning by using UNUSED_PARAM macro.
1965
1966         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1967         (WebKit::computeWebProcessAccessType):
1968         * WebProcess/WebProcess.cpp:
1969         (WebKit::WebProcess::deleteWebsiteData):
1970
1971 2015-02-19  Remy Demarest  <rdemarest@apple.com>
1972
1973         Make EnvironmentVariables::appendValue() handle the case where the existing value is an empty string.
1974         https://bugs.webkit.org/show_bug.cgi?id=141818.
1975
1976         Reviewed by Dan Bernstein.
1977
1978         * UIProcess/Launcher/mac/EnvironmentVariables.cpp:
1979         (WebKit::EnvironmentVariables::appendValue): If the existing value is an empty string, replace it rather than
1980         append to it.
1981
1982 2015-02-19  Anders Carlsson  <andersca@apple.com>
1983
1984         Make C SPI objects and modern API objects toll-free bridged
1985         https://bugs.webkit.org/show_bug.cgi?id=141808
1986
1987         Reviewed by Tim Horton.
1988
1989         * Shared/API/APIObject.h:
1990         (API::Object::wrap):
1991         (API::Object::unwrap):
1992         Add default implementations of wrap and unwrap. These just cast.
1993
1994         * Shared/API/c/WKArray.cpp:
1995         (WKArrayCreate):
1996         (WKArrayCreateAdoptingValues):
1997         (WKArrayGetItemAtIndex):
1998         * Shared/API/c/WKDictionary.cpp:
1999         (WKDictionaryGetItemForKey):
2000         Add toImpl and toAPI where necessary.
2001
2002         * Shared/API/c/WKSharedAPICast.h:
2003         Add API::Object::wrap in toAPI and unwrap in toImpl.
2004
2005         * Shared/API/c/WKType.cpp:
2006         (WKGetTypeID):
2007         (WKRetain):
2008         (WKRelease):
2009         Add missing toImpl calls.
2010
2011         * Shared/Cocoa/APIObject.mm:
2012         (API::Object::wrap):
2013         Return the APIObject Objective-C wrapper.
2014
2015         (API::Object::unwrap):
2016         Return the API::Object from the Objective-C object.
2017
2018         * Shared/Cocoa/WKObject.h:
2019         Add wrap and unwrap declarations.
2020
2021         * UIProcess/API/C/WKPage.cpp:
2022         * UIProcess/API/C/WKPageConfigurationRef.cpp:
2023         * UIProcess/API/C/WKPageGroup.cpp:
2024         * UIProcess/API/C/WKUserContentControllerRef.cpp:
2025         Add missing includes; toImpl now requires a complete type.
2026
2027 2015-02-19  Timothy Horton  <timothy_horton@apple.com>
2028
2029         Remove unused forward declaration from WKWebViewInternal.h
2030         https://bugs.webkit.org/show_bug.cgi?id=141806
2031
2032         Reviewed by Anders Carlsson.
2033
2034         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2035         The use of WebCore::Highlight moved to WKContentView.
2036
2037 2015-02-19  Anders Carlsson  <andersca@apple.com>
2038
2039         Use the real implementation type in our API cast traits
2040         https://bugs.webkit.org/show_bug.cgi?id=141805
2041
2042         Reviewed by Sam Weinig.
2043
2044         * Shared/API/c/WKSharedAPICast.h:
2045         (WebKit::toURLRef):
2046         (WebKit::toAPI): Deleted.
2047         (WebKit::toImpl): Deleted.
2048         * UIProcess/GenericCallback.h:
2049
2050 2015-02-19  Anders Carlsson  <andersca@apple.com>
2051
2052         Remove the stray storage manager from WebProcessPool
2053         https://bugs.webkit.org/show_bug.cgi?id=141800
2054
2055         Reviewed by Sam Weinig.
2056
2057         * UIProcess/API/mac/WKView.mm:
2058         (-[WKView dealloc]):
2059         (-[WKView initWithFrame:processPool:configuration:webView:]):
2060         (-[WKView _applicationWillTerminate:]): Deleted.
2061         Remove code that calls applicationWillTerminate on the WebPageProxy.
2062
2063         * UIProcess/WebKeyValueStorageManager.cpp:
2064         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
2065         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
2066         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
2067         (WebKit::WebKeyValueStorageManager::deleteAllEntries):
2068         Get the storage manager from the website data store.
2069
2070         * UIProcess/WebPageProxy.cpp:
2071         (WebKit::WebPageProxy::WebPageProxy):
2072         (WebKit::WebPageProxy::close):
2073         Remove storage manager calls.
2074
2075         * UIProcess/WebProcessPool.cpp:
2076         (WebKit::WebProcessPool::WebProcessPool):
2077         (WebKit::WebProcessPool::applicationWillTerminate): Deleted.
2078         * UIProcess/WebProcessPool.h:
2079         Remove storage manager code.
2080
2081         * UIProcess/WebsiteData/WebsiteDataStore.h:
2082         (WebKit::WebsiteDataStore::storageManager):
2083         Add getter.
2084
2085 2015-02-19  Csaba Osztrogonác  <ossy@webkit.org>
2086
2087         [WK2] Unreviewed buildfix for non-Cocoa platforms.
2088
2089         * CMakeLists.txt:
2090         * UIProcess/WebsiteData/unix/WebsiteDataStoreUnix.cpp: Added.
2091         (WebKit::WebsiteDataStore::platformInitialize): Added.
2092         (WebKit::WebsiteDataStore::platformDestroy): Added.
2093
2094 2015-02-19  Anders Carlsson  <andersca@apple.com>
2095
2096         WebsiteDataStore should ensure that local storage is written before exiting
2097         https://bugs.webkit.org/show_bug.cgi?id=141798
2098
2099         Reviewed by Sam Weinig.
2100
2101         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: Added.
2102         (WebKit::dataStoresWithStorageManagers):
2103         (WebKit::WebsiteDataStore::platformInitialize):
2104         (WebKit::WebsiteDataStore::platformDestroy):
2105         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2106         (WebKit::WebsiteDataStore::WebsiteDataStore):
2107         (WebKit::WebsiteDataStore::~WebsiteDataStore):
2108         * UIProcess/WebsiteData/WebsiteDataStore.h:
2109         * WebKit2.xcodeproj/project.pbxproj:
2110
2111 2015-02-18  Chris Dumez  <cdumez@apple.com>
2112
2113         [WK2][iOS] Fix NetworkCache build
2114         https://bugs.webkit.org/show_bug.cgi?id=141778
2115
2116         Reviewed by Antti Koivisto.
2117
2118         Add missing header include to use round_page() on iOS.
2119
2120         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2121
2122 2015-02-18  Alexey Proskuryakov  <ap@apple.com>
2123
2124         Remove input and output files from "Make Frameworks Symbolic Link" step
2125         https://bugs.webkit.org/show_bug.cgi?id=141769
2126
2127         Reviewed by Dan Bernstein.
2128
2129         * WebKit2.xcodeproj/project.pbxproj:
2130
2131 2015-02-18  Timothy Horton  <timothy_horton@apple.com>
2132
2133         Adopt WebCore::IOSurface in ImageBuffer
2134         https://bugs.webkit.org/show_bug.cgi?id=141751
2135
2136         Reviewed by Simon Fraser.
2137
2138         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2139         (InitWebCoreSystemInterface):
2140         Remove old WKSI IOSurface-related functions.
2141
2142 2015-02-18  Beth Dakin  <bdakin@apple.com>
2143
2144         iBooks immediate action blacklist should not even create the gesture recognizer
2145         https://bugs.webkit.org/show_bug.cgi?id=141768
2146         -and corresponding-
2147         rdar://problem/19806770
2148
2149         Reviewed by Tim Horton.
2150
2151         Move the runtime-application check to the point where the gesture recognizer is 
2152         created so that we can avoid doing so.
2153         * UIProcess/API/mac/WKView.mm:
2154         (-[WKView initWithFrame:processPool:configuration:webView:]):
2155         * UIProcess/mac/WKImmediateActionController.mm:
2156         (-[WKImmediateActionController _updateImmediateActionItem]):
2157
2158 2015-02-18  Chris Dumez  <cdumez@apple.com>
2159
2160         Access FontCache global instance via singleton() static member function
2161         https://bugs.webkit.org/show_bug.cgi?id=141726
2162
2163         Reviewed by Daniel Bates.
2164
2165         Access FontCache global instance via singleton() static member function,
2166         as per coding style.
2167
2168 2015-02-18  Timothy Horton  <timothy_horton@apple.com>
2169
2170         Add WKContext SPI to clear all visited links
2171         https://bugs.webkit.org/show_bug.cgi?id=141752
2172         <rdar://problem/9997966>
2173
2174         Reviewed by Dan Bernstein.
2175
2176         * UIProcess/API/C/WKContext.cpp:
2177         (WKContextClearVisitedLinks):
2178         * UIProcess/API/C/WKContext.h:
2179
2180 2015-02-17  Anders Carlsson  <andersca@apple.com>
2181
2182         Add API for clearing in-memory caches to WKWebsiteDataStore
2183         https://bugs.webkit.org/show_bug.cgi?id=141724
2184
2185         Reviewed by Tim Horton.
2186
2187         * Shared/WebsiteData/WebsiteDataTypes.h:
2188         Add WebsiteDataTypeMemoryCache.
2189
2190         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
2191         Add WKWebsiteDataTypeMemoryCache.
2192
2193         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
2194         (toWebsiteDataTypes):
2195         Handle WKWebsiteDataTypeMemoryCache and convert it to WebsiteDataTypeMemoryCache.
2196
2197         * UIProcess/WebProcessProxy.cpp:
2198         (WebKit::generateCallbackID):
2199         Generate a new callback.
2200
2201         (WebKit::WebProcessProxy::~WebProcessProxy):
2202         Assert that we don't have any pending callbacks.
2203
2204         (WebKit::WebProcessProxy::connectionDidClose):
2205         Invoke pending callbacks.
2206
2207         (WebKit::WebProcessProxy::canTerminateChildProcess):
2208         Don't try to terminate if we have pending callbacks.
2209
2210         (WebKit::WebProcessProxy::didDeleteWebsiteData):
2211         Take the callback and invoke it.
2212
2213         (WebKit::WebProcessProxy::deleteWebsiteData):
2214         Send a delete message.
2215
2216         * UIProcess/WebProcessProxy.h:
2217         Add new members.
2218
2219         * UIProcess/WebProcessProxy.messages.in:
2220         Add DidDeleteWebsiteData message.
2221
2222         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2223         (WebKit::computeNetworkProcessAccessType):
2224         Spell persistent correctly.
2225
2226         (WebKit::computeWebProcessAccessType):
2227         Return a web process access type given the a data type mask.
2228
2229         (WebKit::WebsiteDataStore::removeData):
2230         Ask any associated web processes to remove website data.
2231
2232         * WebProcess/WebProcess.cpp:
2233         (WebKit::WebProcess::deleteWebsiteData):
2234         Delete the memory cache if requested.
2235
2236         * WebProcess/WebProcess.h:
2237         Add new member.
2238
2239         * WebProcess/WebProcess.messages.in:
2240         Add DeleteWebsiteData message.
2241
2242 2015-02-17  Timothy Horton  <timothy_horton@apple.com>
2243
2244         REGRESSION (r178595): Clicking on DD highlights sometimes do not work
2245         https://bugs.webkit.org/show_bug.cgi?id=141728
2246         <rdar://problem/19825372>
2247
2248         Reviewed by Beth Dakin.
2249
2250         * UIProcess/mac/WKImmediateActionController.mm:
2251         (-[WKImmediateActionController _cancelImmediateActionIfNeeded]):
2252         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
2253         The change that r178595 intended to make was purely that things that we
2254         have no immediate actions for should cancel the immediate action gesture recognizer.
2255         Moving the DataDetectors activation code as well breaks strict ordering
2256         of immediate action callbacks vs. shouldUseActionsWithContext: that they depend on.
2257
2258 2015-02-17  Anders Carlsson  <andersca@apple.com>
2259
2260         Only create the WebKit.framework symlink in PrivateFrameworks when the platform is iphoneos
2261         https://bugs.webkit.org/show_bug.cgi?id=141710
2262         <rdar://problem/19719748>
2263
2264         Reviewed by Andreas Kling.
2265
2266         Don't create the symlink when building for the simulator.
2267
2268         * WebKit2.xcodeproj/project.pbxproj:
2269
2270 2015-02-17  Chris Dumez  <cdumez@apple.com>
2271
2272         Access MemoryPressureHandler global instance via a singleton() static member function
2273         https://bugs.webkit.org/show_bug.cgi?id=141691
2274
2275         Reviewed by Andreas Kling.
2276
2277         Access MemoryPressureHandler global instance via a singleton() static
2278         member function.
2279
2280         * NetworkProcess/NetworkProcess.cpp:
2281         (WebKit::NetworkProcess::initializeNetworkProcess):
2282         (WebKit::NetworkProcess::lowMemoryHandler): Deleted.
2283         * NetworkProcess/NetworkProcess.h:
2284         * PluginProcess/PluginProcess.cpp:
2285         (WebKit::PluginProcess::initializeProcess):
2286         (WebKit::PluginProcess::lowMemoryHandler): Deleted.
2287         * PluginProcess/PluginProcess.h:
2288         * WebProcess/WebPage/ios/WebPageIOS.mm:
2289         (WebKit::WebPage::updateVisibleContentRects):
2290         * WebProcess/WebProcess.cpp:
2291         (WebKit::WebProcess::initializeWebProcess):
2292         (WebKit::WebProcess::processWillSuspend):
2293
2294 2015-02-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2295
2296         [GTK] WebKitFrame objects are never released
2297         https://bugs.webkit.org/show_bug.cgi?id=141641
2298
2299         Reviewed by Martin Robinson.
2300
2301         Use a FrameDestructionObserver derived class to wrap our
2302         WebKitFrame objects and delete them when the frame is destroyed,
2303         instead of using willDestroyFrame callback of WKBundlePageLoaderClient
2304         that has never worked.
2305
2306         * WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp:
2307         (webkitFrameGetWebFrame):
2308         * WebProcess/InjectedBundle/API/gtk/WebKitFramePrivate.h:
2309         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
2310         (webkitFrameGetOrCreate):
2311         (webkitFrameDestroy):
2312         (webkitWebPageCreate):
2313         (willDestroyFrame): Deleted.
2314
2315 2015-02-16  Tim Horton  <timothy_horton@apple.com>
2316
2317         Fix the !USE(IOSURFACE) build
2318
2319         * Shared/mac/RemoteLayerBackingStore.mm:
2320         SOFT_LINK_MAY_FAIL makes a function that will be unused if !USE(IOSURFACE).
2321
2322 2015-02-16  Tim Horton  <timothy_horton@apple.com>
2323
2324         Sometimes RemoteLayerBackingStore ends up non-volatile while the process is suspended
2325         <rdar://problem/19842957>
2326         https://bugs.webkit.org/show_bug.cgi?id=141675
2327
2328         Reviewed by Simon Fraser.
2329
2330         Previously, it was possible to get a layer tree flush in between the
2331         process suspension cleanup code making surfaces volatile and the process
2332         actually being suspended (it was racy because the suspension requires
2333         a few IPC round trips). Depending on how far through the flush we got,
2334         we could sometimes end up either making new non-volatile backing store,
2335         or switching some recently-made-volatile backing store back to non-volatile.
2336         We don't want to have any non-volatile backing store while suspended.
2337
2338         * UIProcess/ProcessThrottler.cpp:
2339         (WebKit::ProcessThrottler::updateAssertion):
2340         Inform the WebProcess when it's going from suspended to runnable state.
2341
2342         * UIProcess/WebProcessProxy.cpp:
2343         (WebKit::WebProcessProxy::sendProcessDidResume):
2344         * UIProcess/WebProcessProxy.h:
2345         Forward the message along.
2346
2347         * WebProcess/WebProcess.cpp:
2348         (WebKit::WebProcess::processWillSuspend):
2349         (WebKit::WebProcess::cancelProcessWillSuspend):
2350         (WebKit::WebProcess::setAllLayerTreeStatesFrozen):
2351         (WebKit::WebProcess::processDidResume):
2352         Freeze all of this process' pages' layer trees when we start trying to suspend,
2353         and un-freeze them when either suspension is cancelled or we resume.
2354
2355         * WebProcess/WebProcess.h:
2356         * WebProcess/WebProcess.messages.in:
2357
2358 2015-02-16  Tim Horton  <timothy_horton@apple.com>
2359
2360         Adopt CAMachPort-as-layer-contents
2361         https://bugs.webkit.org/show_bug.cgi?id=141687
2362         <rdar://problem/19393233>
2363
2364         Reviewed by Simon Fraser.
2365
2366         * Shared/mac/RemoteLayerBackingStore.h:
2367         * Shared/mac/RemoteLayerBackingStore.mm:
2368         (WebKit::RemoteLayerBackingStore::decode):
2369         If we have CAMachPort, just keep the MachSendRight around.
2370
2371         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
2372         If we have CAMachPort, make one and leak our send right into it. CAMachPort
2373         will adopt the port and destroy it when needed.
2374
2375         (WebKit::RemoteLayerBackingStore::setBufferVolatility):
2376         Tiny style fix.
2377
2378 2015-02-15  Sam Weinig  <sam@webkit.org>
2379
2380         Add experimental <attachment> element support
2381         https://bugs.webkit.org/show_bug.cgi?id=141626
2382
2383         Reviewed by Tim Horton.
2384
2385         * Configurations/FeatureDefines.xcconfig:
2386
2387 2015-02-16  Tim Horton  <timothy_horton@apple.com>
2388
2389         REGRESSION (r176459): Process suspension cleanup timer sometimes never stops
2390         https://bugs.webkit.org/show_bug.cgi?id=141669
2391
2392         Reviewed by Simon Fraser.
2393
2394         * WebProcess/WebProcess.cpp:
2395         (WebKit::WebProcess::markAllLayersVolatileIfPossible):
2396         r176459 accidentally removed the code to stop the cleanup timer
2397         in the case where we successfully finish marking layers volatile,
2398         causing the timer to continue running once the process comes back
2399         from a suspended state.
2400
2401 2015-02-16  Anders Carlsson  <andersca@apple.com>
2402
2403         Check for the assume_nonnull feature instead of noescape
2404         https://bugs.webkit.org/show_bug.cgi?id=141666
2405
2406         Reviewed by Dan Bernstein.
2407
2408         * Shared/API/Cocoa/WKFoundation.h:
2409
2410 2015-02-16  Anders Carlsson  <andersca@apple.com>
2411
2412         Add nullability qualifiers to all API headers
2413         https://bugs.webkit.org/show_bug.cgi?id=141652
2414         rdar://problem/19793630
2415
2416         Reviewed by Dan Bernstein.
2417
2418         * Shared/API/Cocoa/WKFoundation.h:
2419         Add a WK_NULLABLE_SPECIFIER macro.
2420
2421         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
2422         * UIProcess/API/Cocoa/WKFrameInfo.h:
2423         * UIProcess/API/Cocoa/WKNavigationAction.h:
2424         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
2425         * UIProcess/API/Cocoa/WKNavigationResponse.h:
2426         * UIProcess/API/Cocoa/WKScriptMessage.h:
2427         * UIProcess/API/Cocoa/WKScriptMessageHandler.h:
2428         * UIProcess/API/Cocoa/WKUIDelegate.h:
2429         * UIProcess/API/Cocoa/WKUserContentController.h:
2430         * UIProcess/API/Cocoa/WKUserScript.h:
2431         * UIProcess/API/Cocoa/WKWebView.h:
2432         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2433         * UIProcess/API/Cocoa/WKWindowFeatures.h:
2434
2435         * mac/postprocess-framework-headers.sh:
2436         Handle the WK_NULLABLE_SPECIFIER macro. Change the WK_NULLABLE sed command to replace
2437         all occurrences of WK_NULLABLE instead of just the first one.
2438
2439 2015-02-16  Dan Bernstein  <mitz@apple.com>
2440
2441         Update SPI availability annotations 
2442         https://bugs.webkit.org/show_bug.cgi?id=141588
2443
2444         Reviewed by Anders Carlsson.
2445
2446         * Shared/API/Cocoa/WKFoundation.h: Added a definition of __NSi_8_3 for when building with
2447         an older SDK.
2448         * UIProcess/API/Cocoa/WKErrorPrivate.h:
2449         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2450
2451 2015-02-16  Antti Koivisto  <antti@apple.com>
2452
2453         Remove unused InjectedBundle::setCacheModel.
2454
2455         Rubber-stamped by Anders Carlsson.
2456
2457         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2458         (WebKit::InjectedBundle::setCacheModel): Deleted.
2459         * WebProcess/InjectedBundle/InjectedBundle.h:
2460
2461 2015-02-16  Anders Carlsson  <andersca@apple.com>
2462
2463         Build fix for versions of Xcode that support nullability but don't have the Foundation #defines.
2464
2465         * Shared/API/Cocoa/WKFoundation.h:
2466
2467 2015-02-16  Antti Koivisto  <antti@apple.com>
2468
2469         Develop/Disable Caches does not properly disable disk cache
2470         https://bugs.webkit.org/show_bug.cgi?id=141636
2471
2472         Reviewed by Anders Carlsson.
2473
2474         The menu item sets the cache model to "document viewer" to disable the caches (cache size 0).
2475         However the cache model was never passed to the network process after the initialization.
2476
2477         * NetworkProcess/NetworkProcess.messages.in:
2478         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2479         (WebKit::NetworkCacheStorage::retrieve):
2480         (WebKit::NetworkCacheStorage::store):
2481         (WebKit::NetworkCacheStorage::update):
2482
2483             Don't try to store or retrieve when the maximum cache size is set to zero.
2484
2485         * UIProcess/WebProcessPool.cpp:
2486         (WebKit::WebProcessPool::setCacheModel):
2487
2488            Message the network process too.
2489
2490         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2491         (WKBundleSetCacheModel): Deleted.
2492
2493             Remove the now unused SPI.
2494
2495         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
2496
2497 2015-02-16  Antti Koivisto  <antti@apple.com>
2498
2499         Assertion in disk cache code with redirect to a non-http resource
2500         https://bugs.webkit.org/show_bug.cgi?id=141644
2501
2502         Reviewed by Anders Carlsson.
2503
2504         * NetworkProcess/NetworkResourceLoader.cpp:
2505         (WebKit::NetworkResourceLoader::didFinishLoading):
2506
2507             Check that response is HTTP before calling computeFreshnessLifetimeForHTTPFamily.
2508
2509         * NetworkProcess/cache/NetworkCache.cpp:
2510         (WebKit::canStore):
2511
2512             Deny storing non-HTTP responses to cache (though the above already covers this).
2513
2514 2015-02-13  Anders Carlsson  <andersca@apple.com>
2515
2516         Add support for nullability to the header postprocessing
2517         https://bugs.webkit.org/show_bug.cgi?id=141573
2518
2519         Reviewed by Darin Adler.
2520
2521         * Shared/API/Cocoa/WKFoundation.h:
2522         * UIProcess/API/Cocoa/WKBackForwardList.h:
2523         * mac/postprocess-framework-headers.sh:
2524
2525 2015-02-16  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
2526
2527         [EFL] Rename WebContextEfl to WebProcessPoolEfl
2528         https://bugs.webkit.org/show_bug.cgi?id=141642
2529
2530         Reviewed by Csaba Osztrogonác.
2531
2532         Although we've renamed almost everything in r177716, this is still
2533         required after r177692.
2534
2535         * UIProcess/efl/WebProcessPoolEfl.cpp: Renamed from Source/WebKit2/UIProcess/efl/WebContextEfl.cpp.
2536
2537 2015-02-14  Alexey Proskuryakov  <ap@apple.com>
2538
2539         Build fix after <http://trac.webkit.org/changeset/180122>
2540
2541         * Platform/mac/StringUtilities.mm:
2542
2543 2015-02-14  Joseph Pecoraro  <pecoraro@apple.com>
2544
2545         [Mac] Possible DDActionContext leaks, RetainPtr cleanup
2546         https://bugs.webkit.org/show_bug.cgi?id=141613
2547
2548         Reviewed by Tim Horton.
2549
2550         * UIProcess/mac/WKActionMenuController.mm:
2551         (-[WKActionMenuController _defaultMenuItemsForDataDetectableLink]):
2552         Adopt the allocated object.
2553
2554 2015-02-09  Brian J. Burg  <burg@cs.washington.edu>
2555
2556         Web Inspector: remove some unnecessary Inspector prefixes from class names in Inspector namespace
2557         https://bugs.webkit.org/show_bug.cgi?id=141372
2558
2559         Reviewed by Joseph Pecoraro.
2560
2561         * WebProcess/WebPage/WebInspector.cpp:
2562         (WebKit::WebInspector::remoteFrontendDisconnected):
2563
2564 2015-02-14  Beth Dakin  <bdakin@apple.com>
2565
2566         REGRESSION: Page opens with enlarged font after visiting PDF, navigating back, 
2567         then doing a process swap
2568         https://bugs.webkit.org/show_bug.cgi?id=141584
2569         -and corresponding-
2570         rdar://problem/18167729
2571
2572         Reviewed by Tim Horton.
2573
2574         This patch keeps the plugin zoom/scale factors separate from page zoom/scale 
2575         factors in the UI process since they are used for slightly different purposes for 
2576         plugins (i.e., PDFs) than they are for normal pages. Keeping track of the right 
2577         factor for the right type of document will ensure that we don’t use the wrong one.
2578
2579         * UIProcess/WebPageProxy.cpp:
2580         (WebKit::WebPageProxy::WebPageProxy):
2581         (WebKit::WebPageProxy::pageZoomFactor):
2582         (WebKit::WebPageProxy::pageScaleFactor):
2583         (WebKit::WebPageProxy::pluginScaleFactorDidChange):
2584         (WebKit::WebPageProxy::pluginZoomFactorDidChange):
2585         (WebKit::WebPageProxy::didCommitLoadForFrame):
2586         (WebKit::WebPageProxy::pageZoomFactorDidChange): Deleted.
2587         * UIProcess/WebPageProxy.h:
2588         (WebKit::WebPageProxy::pageZoomFactor): Deleted.
2589         (WebKit::WebPageProxy::pageScaleFactor): Deleted.
2590         * UIProcess/WebPageProxy.messages.in:
2591         * WebProcess/Plugins/PluginView.cpp:
2592         (WebKit::PluginView::setPageScaleFactor):
2593
2594 2015-02-14  Brian J. Burg  <burg@cs.washington.edu>
2595
2596         REGRESSION(r179573): Web Inspector toolbar is completely messed up on Mavericks
2597         https://bugs.webkit.org/show_bug.cgi?id=141555
2598
2599         Reviewed by Joseph Pecoraro.
2600
2601         The old WKView-based code called _setDrawsBackground:NO on the WKView for Mavericks.
2602         Simulate this old behavior by calling WebPageProxy::setDrawsBackground(false).
2603
2604         WKWebView's setOpaque:BOOL gives a flat background color instead of the intended
2605         gradient, so we can't use that method.
2606
2607         * UIProcess/mac/WebInspectorProxyMac.mm:
2608         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2609
2610 2015-02-13  Simon Fraser  <simon.fraser@apple.com>
2611
2612         Crash closing a tab when a context or popup menu is open
2613         https://bugs.webkit.org/show_bug.cgi?id=141582
2614         rdar://problem/17700475
2615
2616         Reviewed by Anders Carlsson.
2617
2618         If a context menu or a popup menu is open when a tab is programmatically closed,
2619         then we'd crash because both the WebContextMenuProxyMac/WebPopupMenuProxyMac
2620         and the WebPageProxy would be deleted while still in use, via messages
2621         handled via the nested event tracking runloop.
2622
2623         Fix by protecting those things while showing the popup. Also programmatically
2624         dismiss the popup when closing the WebPageProxy.
2625
2626         * UIProcess/WebContextMenuProxy.h:
2627         (WebKit::WebContextMenuProxy::cancelTracking):
2628         * UIProcess/WebPageProxy.cpp:
2629         (WebKit::WebPageProxy::close):
2630         (WebKit::WebPageProxy::showPopupMenu): Clean up some EFL-related confusion that we don't need.
2631         Retaining |this| will also retain m_activePopupMenu.
2632         (WebKit::WebPageProxy::hidePopupMenu):
2633         (WebKit::WebPageProxy::showContextMenu):
2634         (WebKit::WebPageProxy::resetState):
2635         * UIProcess/WebPopupMenuProxy.h:
2636         (WebKit::WebPopupMenuProxy::cancelTracking):
2637         * UIProcess/mac/WebContextMenuProxyMac.h:
2638         * UIProcess/mac/WebContextMenuProxyMac.mm:
2639         (WebKit::WebContextMenuProxyMac::showContextMenu):
2640         (WebKit::WebContextMenuProxyMac::cancelTracking):
2641         * UIProcess/mac/WebPopupMenuProxyMac.h: For popups, we need to remember if we were
2642         canceled to avoid trying to send events after closing.
2643         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2644         (WebKit::WebPopupMenuProxyMac::WebPopupMenuProxyMac):
2645         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
2646         (WebKit::WebPopupMenuProxyMac::cancelTracking):
2647
2648 2015-02-13  Timothy Horton  <timothy_horton@apple.com>
2649
2650         Fix the iOS build.
2651
2652         * UIProcess/ios/ViewGestureControllerIOS.mm:
2653         (WebKit::ViewGestureController::removeSwipeSnapshot):
2654         * UIProcess/mac/ViewGestureController.h:
2655         This code is never used on iOS.
2656
2657 2015-02-13  Timothy Horton  <timothy_horton@apple.com>
2658
2659         Make WebCore::IOSurface have single ownership instead of refcounting
2660         https://bugs.webkit.org/show_bug.cgi?id=141578
2661
2662         Reviewed by Anders Carlsson.
2663
2664         * Shared/mac/RemoteLayerBackingStore.h:
2665         * Shared/mac/RemoteLayerBackingStore.mm:
2666         (WebKit::RemoteLayerBackingStore::Buffer::discard):
2667         * UIProcess/API/mac/WKView.mm:
2668         (-[WKView _takeViewSnapshot]):
2669         * UIProcess/mac/ViewGestureController.h:
2670         * UIProcess/mac/ViewGestureControllerMac.mm:
2671         (WebKit::ViewGestureController::beginSwipeGesture):
2672         (WebKit::ViewGestureController::removeSwipeSnapshot):
2673         * UIProcess/mac/ViewSnapshotStore.h:
2674         * UIProcess/mac/ViewSnapshotStore.mm:
2675         (WebKit::ViewSnapshot::create):
2676         (WebKit::ViewSnapshot::ViewSnapshot):
2677         (WebKit::ViewSnapshot::hasImage):
2678         Adjust to the single-ownership model.
2679
2680 2015-02-13  Brent Fulgham  <bfulgham@apple.com>
2681
2682         [iOS] Unreviewed build fix after r180076.
2683
2684         * UIProcess/WebPageProxy.cpp:
2685         (WebKit::WebPageProxy::creationParameters): We do not
2686         want to do this on iOS. 
2687         * UIProcess/WebPageProxy.h: No need to expose function
2688         on iOS (only Mac).
2689
2690 2015-02-13  Brent Fulgham  <bfulgham@apple.com>
2691
2692         [Mac, iOS] Adjust pagination behavior for Mail.app printing use
2693         https://bugs.webkit.org/show_bug.cgi?id=141569
2694         <rdar://problem/14912763>
2695
2696         Reviewed by Anders Carlsson.
2697
2698         * Shared/WebPageCreationParameters.cpp:
2699         (WebKit::WebPageCreationParameters::encode): Add new flag.
2700         (WebKit::WebPageCreationParameters::decode): Ditto.
2701         * Shared/WebPageCreationParameters.h: Ditto.
2702         * UIProcess/WebPageProxy.cpp:
2703         (WebKit::WebPageProxy::creationParameters): Set new page construction flag.
2704         * UIProcess/WebPageProxy.h:
2705         * UIProcess/mac/WebPageProxyMac.mm:
2706         (WebKit::WebPageProxy::paginationQuirkEnabled): Ask for new pagination flag
2707         when running as a Mail client.
2708         * WebProcess/WebPage/WebPage.cpp:
2709         (WebKit::WebPage::WebPage): Set up pagination based on desired settings.
2710
2711 2015-02-12  Simon Fraser  <simon.fraser@apple.com>
2712
2713         determinePrimarySnapshottedPlugIn() should only traverse visible Frames
2714         https://bugs.webkit.org/show_bug.cgi?id=141547
2715         Part of rdar://problem/18445733.
2716
2717         Reviewed by Anders Carlsson.
2718         
2719         Use FrameTree::traverseNextRendered() to avoid doing things in unrendered frames
2720         which are not guaranteed to have been laid out.
2721
2722         * WebProcess/WebPage/WebPage.cpp:
2723         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
2724
2725 2015-02-13  Antti Koivisto  <antti@apple.com>
2726
2727         WorkQueue should support concurrent queues
2728         https://bugs.webkit.org/show_bug.cgi?id=141559
2729
2730         Reviewed by Anders Carlsson.
2731
2732         * DatabaseProcess/DatabaseProcess.cpp:
2733         (WebKit::DatabaseProcess::DatabaseProcess):
2734         * Platform/IPC/Connection.h:
2735         * Platform/IPC/mac/ConnectionMac.mm:
2736         (IPC::Connection::open):
2737         * Platform/WorkQueue.cpp:
2738         (WorkQueue::create):
2739
2740             Also make create return a Ref.
2741
2742         (WorkQueue::WorkQueue):
2743         * Platform/WorkQueue.h:
2744
2745             Add queue type enum.
2746
2747         * Platform/efl/WorkQueueEfl.cpp:
2748         (WorkQueue::platformInitialize):
2749         * Platform/gtk/WorkQueueGtk.cpp:
2750         (WorkQueue::platformInitialize):
2751         * Platform/mac/WorkQueueMac.cpp:
2752         (WorkQueue::platformInitialize):
2753         * Shared/mac/SecItemShim.cpp:
2754         (WebKit::SecItemShim::initializeConnection):
2755         * Shared/mac/SecItemShim.h:
2756         * UIProcess/Launcher/ProcessLauncher.cpp:
2757         (WebKit::processLauncherWorkQueue):
2758         * UIProcess/mac/SecItemShimProxy.cpp:
2759         (WebKit::SecItemShimProxy::initializeConnection):
2760         * UIProcess/mac/SecItemShimProxy.h:
2761         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
2762         (WebKit::PluginProcessConnectionManager::initializeConnection):
2763         * WebProcess/Plugins/PluginProcessConnectionManager.h:
2764         * WebProcess/WebPage/EventDispatcher.cpp:
2765         (WebKit::EventDispatcher::EventDispatcher):
2766         (WebKit::EventDispatcher::initializeConnection):
2767         * WebProcess/WebPage/EventDispatcher.h:
2768         * WebProcess/WebPage/ViewUpdateDispatcher.h:
2769
2770 2015-02-12  Anders Carlsson  <andersca@apple.com>
2771
2772         Clean up the framework postprocessing phase
2773         https://bugs.webkit.org/show_bug.cgi?id=141544
2774
2775         Reviewed by Dan Bernstein.
2776
2777         Rename WK_API_AVAILABILITY_ENABLED to WK_FRAMEWORK_HEADER_POSTPROCESSING_ENABLED to better match what
2778         it is we're doing. Also, rename the associated script. Remove a couple of now unnecessary #defines, and
2779         change everything we can to be feature-based instead of OS based.
2780
2781         * Configurations/WebKit.xcconfig:
2782         * Shared/API/Cocoa/WKFoundation.h:
2783         * WebKit2.xcodeproj/project.pbxproj:
2784         * mac/postprocess-framework-headers.sh: Renamed from Source/WebKit2/mac/rewrite-availability-macros.sh.
2785
2786 2015-02-12  Tim Horton  <timothy_horton@apple.com>
2787
2788         Crash removing RemoteLayerTreeDisplayRefreshMonitor from the drawing area's map
2789         https://bugs.webkit.org/show_bug.cgi?id=141545
2790         <rdar://problem/17712200>
2791
2792         Reviewed by Simon Fraser.
2793
2794         * WebProcess/WebPage/WebPage.cpp:
2795         (WebKit::WebPage::windowScreenDidChange):
2796         * WebProcess/WebPage/WebPage.h:
2797         * WebProcess/WebPage/WebPage.messages.in:
2798         windowScreenDidChange should take uint32_t, since that's what PlatformDisplayID is.
2799
2800         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2801         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
2802         RemoteLayerTreeDisplayRefreshMonitor is driven by the page's
2803         RemoteLayerTreeDrawingArea. Because of this, we cannot have the same
2804         sharing of DisplayRefreshMonitors that other platforms use.
2805         In order to ensure that we get a unique DisplayRefreshMonitor
2806         per-DrawingArea, give each page a unique DisplayID derived
2807         from WebPage's unique ID.
2808
2809 2015-02-12  Tim Horton  <timothy_horton@apple.com>
2810
2811         Crash under RemoteLayerTreeDrawingArea::flushLayers() when closing a tab
2812         https://bugs.webkit.org/show_bug.cgi?id=141541
2813
2814         Reviewed by Benjamin Poulain.
2815
2816         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2817         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2818         The WebPage pointer can become stale between when it is retrieved
2819         and dereferenced. Retrieve it by ID inside the dispatch_async block
2820         instead of outside of it.
2821
2822 2015-02-12  Antti Koivisto  <antti@apple.com>
2823
2824         WebKit persistent cache uses a lot of threads
2825         https://bugs.webkit.org/show_bug.cgi?id=141520
2826
2827         Reviewed by Andreas Kling.
2828
2829         Parallel retrieves are limited but stores are not. We may end up with lots of backround io
2830         dispatch queue threads if they don't complete fast enough.
2831
2832         This patch adds pending state for write operations similar to what retrieves already have
2833         and limits to number of active operations.
2834
2835         * NetworkProcess/cache/NetworkCacheStorage.h:
2836
2837             Combine StoreOperation and UpdateOperation and rename to WriteOperation.
2838             Rename RetrieveOperation to ReadOperation.
2839             The idea is to emphasize that these are disk operations.
2840
2841         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2842         (WebKit::NetworkCacheStorage::dispatchReadOperation):
2843         (WebKit::NetworkCacheStorage::dispatchPendingReadOperations):
2844         (WebKit::retrieveFromMemory):
2845         (WebKit::NetworkCacheStorage::retrieve):
2846         (WebKit::NetworkCacheStorage::store):
2847         (WebKit::NetworkCacheStorage::update):
2848         (WebKit::NetworkCacheStorage::dispatchPendingWriteOperations):
2849
2850             Only allow 3 parallel writes.
2851
2852         (WebKit::NetworkCacheStorage::dispatchFullWriteOperation):
2853         (WebKit::NetworkCacheStorage::dispatchHeaderWriteOperation):
2854
2855             More informative names.
2856
2857         (WebKit::NetworkCacheStorage::dispatchRetrieveOperation): Deleted.
2858         (WebKit::NetworkCacheStorage::dispatchPendingRetrieveOperations): Deleted.
2859         (WebKit::retrieveActive): Deleted.
2860
2861 2015-02-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2862
2863         [GTK] Add API to allow overriding the default color chooser implementation
2864         https://bugs.webkit.org/show_bug.cgi?id=98935
2865
2866         Reviewed by Gustavo Noronha Silva.
2867
2868         Add API to allow the user to override the default UI of color
2869         chooser. Similar to the file chooser API, a new run-color-chooser
2870         signal is added to WebKitWebView that passes a WebKitColorChooserRequest
2871         parameter to the signal.
2872
2873         Initial patch by Arnaud Renevier <a.renevier@sisa.samsung.com>.
2874
2875         * PlatformGTK.cmake: Add new files to compilation.
2876         * UIProcess/API/gtk/PageClientImpl.cpp:
2877         (WebKit::PageClientImpl::createColorPicker): Create a
2878         WebKitColorChooser is the view widget is a WebKitWebView or a
2879         WebColorPicker otherwise,
2880         * UIProcess/API/gtk/WebKitColorChooser.cpp: Added.
2881         (WebKit::WebKitColorChooser::create):
2882         (WebKit::WebKitColorChooser::WebKitColorChooser):
2883         (WebKit::WebKitColorChooser::~WebKitColorChooser):
2884         (WebKit::WebKitColorChooser::endPicker): Chain up to parent class
2885         when not having a request, or finish the request if we have one.
2886         (WebKit::WebKitColorChooser::colorChooserRequestFinished):
2887         (WebKit::WebKitColorChooser::colorChooserRequestRGBAChanged):
2888         (WebKit::WebKitColorChooser::showColorPicker): Create a new
2889         WebKitColorChooserRequest and emit WebKitWebView::run-color-chooser.
2890         If the signal is not handled, fallback to the default color
2891         chooser dialog implemented by the parent class.
2892         * UIProcess/API/gtk/WebKitColorChooser.h: Added.
2893         * UIProcess/API/gtk/WebKitColorChooserRequest.cpp: Added.
2894         (webkitColorChooserRequestGetProperty):
2895         (webkitColorChooserRequestSetProperty):
2896         (webkit_color_chooser_request_class_init):
2897         (webkit_color_chooser_request_set_rgba):
2898         (webkit_color_chooser_request_get_rgba):
2899         (webkit_color_chooser_request_get_element_rectangle):
2900         (webkit_color_chooser_request_finish):
2901         (webkit_color_chooser_request_cancel):
2902         (webkitColorChooserRequestCreate):
2903         * UIProcess/API/gtk/WebKitColorChooserRequest.h: Added.
2904         * UIProcess/API/gtk/WebKitColorChooserRequestPrivate.h: Added.
2905         * UIProcess/API/gtk/WebKitWebView.cpp:
2906         (webkit_web_view_class_init): Add run-color-chooser signal.
2907         (webkitWebViewEmitRunColorChooser): Emit run-color-chooser signal.
2908         * UIProcess/API/gtk/WebKitWebView.h:
2909         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
2910         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
2911         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for WebKitColorChooserRequest.
2912         * UIProcess/API/gtk/webkit2.h: Include WebKitColorChooserRequest.h
2913
2914 2015-02-11  Enrica Casucci  <enrica@apple.com>
2915
2916         iOS build fix.
2917
2918         Unreviewed.
2919
2920         * UIProcess/ios/WKContentViewInteraction.mm:
2921         (-[WKContentView inputAssistantItem]):
2922         (-[WKContentView _inputAssistantItem]):
2923
2924 2015-02-11  Chris Dumez  <cdumez@apple.com>
2925
2926         [WK2] Add logging to validate the network cache efficacy (Part 2)
2927         https://bugs.webkit.org/show_bug.cgi?id=141345
2928         <rdar://problem/19632080>
2929
2930         Reviewed by Sam Weinig.
2931
2932         Add diagnostic logging messages to validate the network cache efficacy.
2933         The following 4 messages are added:
2934         - networkCache / retrieval / success
2935         - networkCache / retrieval / unhandledRequestFailure
2936         - networkCache / retrieval / noLongerInCacheFailure
2937         - networkCache / retrieval / unusableCachedEntryFailure
2938
2939         The messages are sent via IPC from the NetworkProcess to the UIProcess,
2940         where the WebPageProxy code already handles diagnostic messages sent by
2941         the WebProcess.
2942
2943 2015-02-11  Tim Horton  <timothy_horton@apple.com>
2944
2945         REGRESSION (iOS 8): PDFs embedded in <object>/<embed> tag don't load at all
2946         https://bugs.webkit.org/show_bug.cgi?id=141457
2947         <rdar://problem/18221851>
2948
2949         Reviewed by Alexey Proskuryakov.
2950
2951         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2952         (WebKit::WebFrameLoaderClient::objectContentType):
2953         On iOS, if we don't know what to do with a PDF-in-object, treat it as an image.
2954
2955 2015-02-11  ChangSeok Oh  <changseok.oh@collabora.com>
2956
2957         Activate ReliefLogger of a memory pressure handler for linux system.
2958         https://bugs.webkit.org/show_bug.cgi?id=123611
2959
2960         Reviewed by Anders Carlsson.
2961
2962         * Shared/WebProcessCreationParameters.cpp:
2963         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
2964         Make the parameter, shouldEnableMemoryPressureReliefLogging shareable with COCOA else systems.
2965         (WebKit::WebProcessCreationParameters::encode): ditto.
2966         (WebKit::WebProcessCreationParameters::decode): ditto.
2967         * Shared/WebProcessCreationParameters.h:
2968         * UIProcess/WebProcessPool.cpp:
2969         (WebKit::WebProcessPool::createNewWebProcess): Set shouldEnableMemoryPressureReliefLogging
2970         to true for linux system.
2971         * WebProcess/WebProcess.cpp:
2972         (WebKit::WebProcess::initializeWebProcess): Pass the shouldEnableMemoryPressureReliefLogging value
2973         to MemoryPressureHandler::ReliefLogger::setLoggingEnabled().
2974
2975 2015-02-11  Yusuke Suzuki  <utatane.tea@gmail.com>
2976
2977         [GTK][EFL] Suppress a warning of unused params
2978         https://bugs.webkit.org/show_bug.cgi?id=141474
2979
2980         Reviewed by Darin Adler.
2981
2982         Drop unused argument name, `directoryName`.
2983
2984         * UIProcess/API/APIWebsiteDataStore.cpp:
2985         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
2986
2987 2015-02-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2988
2989         [GTK] Add default color chooser implementation using GtkColorChooserDialog
2990         https://bugs.webkit.org/show_bug.cgi?id=141392
2991
2992         Reviewed by Gustavo Noronha Silva.
2993
2994         * PlatformGTK.cmake: Add new files to compilation.
2995         * UIProcess/API/gtk/PageClientImpl.cpp:
2996         (WebKit::PageClientImpl::createColorPicker): Call WebColorPickerGtk::create().
2997         * UIProcess/gtk/WebColorPickerGtk.cpp: Added.
2998         (WebKit::WebColorPickerGtk::create):
2999         (WebKit::WebColorPickerGtk::WebColorPickerGtk):
3000         (WebKit::WebColorPickerGtk::~WebColorPickerGtk):
3001         (WebKit::WebColorPickerGtk::cancel): Set initial color.
3002         (WebKit::WebColorPickerGtk::endPicker): Destroy the color chooser dialog.
3003         (WebKit::WebColorPickerGtk::didChooseColor): Notify the client.
3004         (WebKit::WebColorPickerGtk::colorChooserDialogRGBAChangedCallback):
3005         Update the selected color.
3006         (WebKit::WebColorPickerGtk::colorChooserDialogResponseCallback):
3007         Cancel or finish the operation depending on the dialog response.
3008         (WebKit::WebColorPickerGtk::showColorPicker): Create a
3009         GtkColorChooserDialog to handle the color picker operation.
3010         * UIProcess/gtk/WebColorPickerGtk.h: Added.
3011         (WebKit::WebColorPickerGtk::initialColor):
3012
3013 2015-02-11  Commit Queue  <commit-queue@webkit.org>
3014
3015         Unreviewed, rolling out r179910.
3016         https://bugs.webkit.org/show_bug.cgi?id=141464
3017
3018         Caused assertions on debug bots (Requested by ap on #webkit).
3019
3020         Reverted changeset:
3021
3022         "[WK2] Add logging to validate the network cache efficacy
3023         (Part 2)"
3024         https://bugs.webkit.org/show_bug.cgi?id=141345
3025         http://trac.webkit.org/changeset/179910
3026
3027 2015-02-10  Chris Dumez  <cdumez@apple.com>
3028
3029         [WK2] Add logging to validate the network cache efficacy (Part 2)
3030         https://bugs.webkit.org/show_bug.cgi?id=141345
3031         <rdar://problem/19632080>
3032
3033         Reviewed by Antti Koivisto.
3034
3035         Add diagnostic logging messages to validate the network cache efficacy.
3036         The following 4 messages are added:
3037         - networkCache / retrieval / success
3038         - networkCache / retrieval / unhandledRequestFailure
3039         - networkCache / retrieval / noLongerInCacheFailure
3040         - networkCache / retrieval / unusableCachedEntryFailure
3041
3042         The messages are sent via IPC from the NetworkProcess to the UIProcess,
3043         where the WebPageProxy code already handles diagnostic messages sent by
3044         the WebProcess.
3045
3046 2015-02-10  Conrad Shultz  <conrad_shultz@apple.com>
3047
3048         Clients need the ability to hook into immediate action lifecycle
3049         https://bugs.webkit.org/show_bug.cgi?id=141449
3050
3051         Reviewed by Tim Horton.
3052
3053         * UIProcess/API/Cocoa/WKViewPrivate.h:
3054         Expose new methods.
3055
3056         * UIProcess/API/mac/WKView.mm:
3057         (-[WKView _prepareForImmediateActionAnimation]):
3058         (-[WKView _cancelImmediateActionAnimation]):
3059         (-[WKView _completeImmediateActionAnimation]):
3060         Stub implementations.
3061
3062         * UIProcess/mac/WKImmediateActionController.mm:
3063         (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
3064         Send -_prepareForImmediateActionAnimation.
3065         (-[WKImmediateActionController immediateActionRecognizerDidCancelAnimation:]):
3066         Send -_cancelImmediateActionAnimation.
3067         (-[WKImmediateActionController immediateActionRecognizerDidCompleteAnimation:]):
3068         Send -_completeImmediateActionAnimation.
3069
3070 2015-02-10  Dan Bernstein  <mitz@apple.com>
3071
3072         <rdar://problem/19770264> Starting a navigation gesture dismisses the keyboard
3073
3074         Reviewed by Tim Horton.
3075
3076         * UIProcess/ios/ViewGestureControllerIOS.mm:
3077         (WebKit::ViewGestureController::beginSwipeGesture): Reordered the view hierarchy changes,
3078         such that m_liveSwipeView will not momentarily move out of the window, because that causes
3079         the window’s first responder to be set to nil (if it was a descendant of m_liveSwipView).
3080
3081 2015-02-10  Enrica Casucci  <enrica@apple.com>
3082
3083         Hit testing is misplaced when selecting on wikipedia page.
3084         https://bugs.webkit.org/show_bug.cgi?id=141410
3085         rdar://problem/19768211
3086
3087         Reviewed by Simon Fraser.
3088
3089         When loading a new document into the same WebPage object, we need
3090         to clear the assisted node, since there is no guarantee that the
3091         node will be blurred. The bug was caused by the use of a stale
3092         assisted node to constrain the point where the gesture occurs.
3093         The node was still valid, since the previous page was in the cache.
3094         I've added a ASSERT to check that, when constraining the point to
3095         node rectangle, the node is in the same document as the one we
3096         are performing hit test on. When the frame is detached, we clear
3097         the assisted node if the node is part of the document is the frame
3098         being detached.
3099
3100         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3101         (WebKit::WebFrameLoaderClient::detachedFromParent2):
3102         * WebProcess/WebPage/WebPage.h:
3103         * WebProcess/WebPage/ios/WebPageIOS.mm:
3104         (WebKit::constrainPoint):
3105         (WebKit::WebPage::resetAssistedNodeForFrame):
3106
3107 2015-02-10  Joseph Pecoraro  <pecoraro@apple.com>
3108
3109         [Cocoa] NSData over retain in WKBrowsingContextController loadData
3110         https://bugs.webkit.org/show_bug.cgi?id=141437
3111
3112         Reviewed by Anders Carlsson.
3113
3114         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
3115         (-[WKBrowsingContextController loadData:MIMEType:textEncodingName:baseURL:userData:]):
3116         API::Data::createWithoutCopying will automatically do the retaining / releasing for us.
3117
3118 2015-02-10  Zhuo Li  <zachli@apple.com>
3119
3120         [WK2] Add support for registering url schemes to bypass Content Security Policy.
3121         https://bugs.webkit.org/show_bug.cgi?id=140736
3122
3123         Reviewed by Anders Carlsson.
3124
3125         * Shared/WebProcessCreationParameters.cpp:
3126         (WebKit::WebProcessCreationParameters::encode):
3127         (WebKit::WebProcessCreationParameters::decode):
3128         * Shared/WebProcessCreationParameters.h:
3129         * UIProcess/API/C/WKContext.cpp:
3130         (WKContextRegisterURLSchemeAsBypassingContentSecurityPolicy):
3131         * UIProcess/API/C/WKContextPrivate.h:
3132         * UIProcess/WebProcessPool.cpp:
3133         (WebKit::WebProcessPool::createNewWebProcess):
3134         (WebKit::WebProcessPool::registerURLSchemeAsBypassingContentSecurityPolicy):
3135         * UIProcess/WebProcessPool.h:
3136         * WebProcess/WebProcess.cpp:
3137         (WebKit::WebProcess::initializeWebProcess):
3138         (WebKit::WebProcess::registerURLSchemeAsBypassingContentSecurityPolicy):
3139         * WebProcess/WebProcess.h:
3140         * WebProcess/WebProcess.messages.in:
3141
3142 2015-02-10  Sanghyup Lee  <sh53.lee@samsung.com>
3143
3144         [EFL] Use a variable to set flicking time instead of hardcoding
3145         https://bugs.webkit.org/show_bug.cgi?id=138950
3146
3147         Reviewed by Gyuyoung Kim.
3148
3149         Currently time of flick gesture animation is hardcoded as one second.
3150         This patch added a static variable to increase readability.
3151
3152         * UIProcess/API/efl/GestureRecognizer.cpp:
3153         (WebKit::GestureHandler::GestureHandler):
3154         (WebKit::GestureHandler::flickAnimatorCallback):
3155         (WebKit::GestureHandler::handleFlick):
3156
3157 2015-02-09  Enrica Casucci  <enrica@apple.com>
3158
3159         Selection flickers when trying to change size of selection.
3160         https://bugs.webkit.org/show_bug.cgi?id=141404
3161         rdar://problem/18824863
3162
3163         Reviewed by Benjamin Poulain.
3164
3165         When looking for the contracted range from the current range,
3166         we were incorrectly choosing a selection whose rectangle is empty
3167         as a best match candidate. This was throwing off all the logic
3168         and producing a contracted range whose rectangle was bigger than the
3169         expanded range, therefore producing a shrink threshold larger than the
3170         growth one.
3171
3172         * WebProcess/WebPage/ios/WebPageIOS.mm:
3173         (WebKit::WebPage::contractedRangeFromHandle):
3174
3175 2015-02-09  Brian J. Burg  <burg@cs.washington.edu>
3176
3177         REGRESSION(r179705): 2nd-level inspector availability no longer controlled by DeveloperExtrasEnabled user default
3178         https://bugs.webkit.org/show_bug.cgi?id=141343
3179
3180         Reviewed by Timothy Hatcher.
3181
3182         The regression was caused by the switch to using WKWebViewConfiguration and
3183         its default WebPreferences object, which is used to populate the inspector page's
3184         Settings object. This WebPreferences is initialized with no identifier, so
3185         only preferences in the FOR_EACH_WEBKIT_DEBUG_*_PREFERENCE macros are populated
3186         from NSUserDefaults.
3187
3188         The simplest fix is to move DeveloperExtrasEnabled into the DEBUG group.
3189
3190         Previously, each inspector level had a unique identifier such as
3191         __WebInspectorPageGroupLevelN__, and the n+1 level inspector was enabled
3192         by toggling __WebInspectorPageGroupLevelN__.WebKit2DeveloperExrasEnabled.
3193         With the move to the DEBUG group, the preference becomes simply
3194         WebKitDeveloperExtrasEnabled, which enables any level of inspector.
3195         (This does not clash with Safari's "Show Develop Menu" preference, which uses
3196         the key "WebKitDeveloperExtrasEnabledPreferenceKey")
3197
3198         * Shared/WebPreferencesDefinitions.h:
3199
3200 2015-02-08  Antti Koivisto  <antti@apple.com>
3201
3202         Measure cache size more accurately
3203         https://bugs.webkit.org/show_bug.cgi?id=141378
3204         <rdar://problem/19760224>
3205
3206         Reviewed by Chris Dumez.
3207
3208         Estimate the cache disk space usage from the actual entry sizes instead of the item count.
3209         This prevents large cache items from making the cache grow beyond its bounds.
3210
3211         * NetworkProcess/cache/NetworkCacheStorage.h:
3212         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
3213         (WebKit::NetworkCacheStorage::initialize):
3214         (WebKit::NetworkCacheStorage::removeEntry):
3215         (WebKit::NetworkCacheStorage::store):
3216         (WebKit::NetworkCacheStorage::clear):
3217         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
3218
3219 2015-02-09  Carlos Garcia Campos  <cgarcia@igalia.com>
3220
3221         REGRESSION(r179705): [GTK] The Web Inspector doesn't work after r179705
3222         https://bugs.webkit.org/show_bug.cgi?id=141333
3223
3224         Reviewed by Žan Doberšek.
3225
3226         Create an initialize WebPreferences for the inspector page. This
3227         was moved from cross-platform code to platform specific code.
3228
3229         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3230         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3231
3232 2015-02-08  Timothy Horton  <timothy_horton@apple.com>
3233
3234         Null deref in _clearImmediateActionState when closing a view with a DataDetectors popover open
3235         https://bugs.webkit.org/show_bug.cgi?id=141377
3236         <rdar://problem/19711203>
3237
3238         Reviewed by Darin Adler.
3239
3240         * UIProcess/mac/WKImmediateActionController.mm:
3241         (-[WKImmediateActionController _clearImmediateActionState]):
3242         We can have already detached the page when DataDetectors calls us back
3243         in interactionStoppedHandler. While we have kept a strong reference to the
3244         page in the interactionStoppedHandler block, _page is nulled out.
3245         It's OK to avoid doing this work, in any case, because closing a page
3246         tears down the TextIndicator anyway.
3247
3248 2015-02-08  Chris Dumez  <cdumez@apple.com>
3249
3250         [WK2] Add logging to validate the network cache efficacy (Part 1)
3251         https://bugs.webkit.org/show_bug.cgi?id=141269
3252         <rdar://problem/19632080>
3253
3254         Reviewed by Antti Koivisto.
3255
3256         Add console logging to validate the network cache efficacy. This will
3257         tell us if how the network cache satisties requests, in particular:
3258         - Request cannot be handled by the cache
3259         - Entry was not in the cache but is no longer there (pruned)
3260         - Entry is in the cache but is not usable
3261         - Entry is in the cache and is used.
3262
3263         This patch introduces a SQLite-based network cache statistics storage
3264         that is used to store requests we have seen before, and query if we
3265         have seen a request before. The storage is lightweight as it only
3266         stores hashes in the database, in a background thread.
3267
3268         The statistics cache is initially bootstapped from the network disk
3269         cache so that we have data initially and get as accurate statistics
3270         as possible from the start.
3271
3272         To maintain an acceptable level of performance, we have a hard limit
3273         on the number of unique requests that are retained set to 100000.
3274
3275         Diagnostic logging for this will be added in a follow-up patch.
3276
3277 2015-02-07  Chris Dumez  <cdumez@apple.com>
3278
3279         Add Vector::removeFirstMatching() / removeAllMatching() methods taking lambda functions
3280         https://bugs.webkit.org/show_bug.cgi?id=141321
3281
3282         Reviewed by Darin Adler.
3283
3284         Use new Vector::removeFirstMatching() / removeAllMatching() methods.
3285
3286 2015-02-07  Tim Horton  <timothy_horton@apple.com>
3287
3288         Add API::HistoryClient and split some things out of API::NavigationClient
3289         https://bugs.webkit.org/show_bug.cgi?id=141264
3290
3291         Reviewed by Darin Adler.
3292
3293         * UIProcess/API/APIHistoryClient.h: Added.
3294         (API::HistoryClient::~HistoryClient):
3295         (API::HistoryClient::didNavigateWithNavigationData):
3296         (API::HistoryClient::didPerformClientRedirect):
3297         (API::HistoryClient::didPerformServerRedirect):
3298         (API::HistoryClient::didUpdateHistoryTitle):
3299         * UIProcess/API/APINavigationClient.h:
3300         (API::NavigationClient::didNavigateWithNavigationData): Deleted.
3301         (API::NavigationClient::didPerformClientRedirect): Deleted.
3302         (API::NavigationClient::didPerformServerRedirect): Deleted.
3303         (API::NavigationClient::didUpdateHistoryTitle): Deleted.
3304         * UIProcess/Cocoa/NavigationState.h:
3305         * UIProcess/Cocoa/NavigationState.mm:
3306         (WebKit::NavigationState::createHistoryClient):
3307         (WebKit::NavigationState::HistoryClient::HistoryClient):
3308         (WebKit::NavigationState::HistoryClient::~HistoryClient):
3309         (WebKit::NavigationState::HistoryClient::didNavigateWithNavigationData):
3310         (WebKit::NavigationState::HistoryClient::didPerformClientRedirect):
3311         (WebKit::NavigationState::HistoryClient::didPerformServerRedirect):
3312         (WebKit::NavigationState::HistoryClient::didUpdateHistoryTitle):
3313         (WebKit::NavigationState::NavigationClient::didNavigateWithNavigationData): Deleted.
3314         (WebKit::NavigationState::NavigationClient::didPerformClientRedirect): Deleted.
3315         (WebKit::NavigationState::NavigationClient::didPerformServerRedirect): Deleted.
3316         (WebKit::NavigationState::NavigationClient::didUpdateHistoryTitle): Deleted.
3317         * UIProcess/WebPageProxy.cpp:
3318         (WebKit::WebPageProxy::setHistoryClient):
3319         (WebKit::WebPageProxy::didNavigateWithNavigationData):
3320         (WebKit::WebPageProxy::didPerformClientRedirect):
3321         (WebKit::WebPageProxy::didPerformServerRedirect):
3322         (WebKit::WebPageProxy::didUpdateHistoryTitle):
3323         * UIProcess/WebPageProxy.h:
3324         Add a API::HistoryClient and move the few things that belong on it out of API::NavigationClient.
3325         Adjust accordingly in WebPageProxy and NavigationState.
3326
3327         * UIProcess/API/Cocoa/WKWebView.mm:
3328         (-[WKWebView initWithFrame:configuration:]):
3329         (-[WKWebView setNavigationDelegate:]):
3330         (-[WKWebView setUIDelegate:]):
3331         (-[WKWebView _setHistoryDelegate:]):
3332         Lazily push the NavigationState/UIDelegate clients down to WebPageProxy upon
3333         installation of a delegate, so that alternative (C SPI) delegate setters can
3334         be separately created.
3335
3336         * WebKit2.xcodeproj/project.pbxproj:
3337
3338 2015-02-07  Antti Koivisto  <antti@apple.com>
3339
3340         And as a further followup restore the 8bit test too.
3341
3342         * NetworkProcess/cache/NetworkCacheKey.cpp:
3343         (WebKit::hashString):
3344
3345 2015-02-07  Antti Koivisto  <antti@apple.com>
3346
3347         Use longer hashes for cache keys
3348         https://bugs.webkit.org/show_bug.cgi?id=141356
3349
3350         Rubber-stamped by Darin Adler.
3351
3352         Folloup and build fix.
3353
3354         * NetworkProcess/cache/NetworkCacheCoders.h:
3355         * NetworkProcess/cache/NetworkCacheKey.cpp:
3356         (WebKit::hashString):
3357
3358             Use containsOnlyASCII instead of is8Bit so both paths always compute the same hash.
3359
3360         * NetworkProcess/cache/NetworkCacheKey.h:
3361
3362 2015-02-07  Antti Koivisto  <antti@apple.com>
3363
3364         Remove a printf.
3365
3366         * NetworkProcess/cache/NetworkCache.cpp:
3367         (WebKit::NetworkCache::retrieve):
3368
3369 2015-02-07  Antti Koivisto  <antti@apple.com>
3370
3371         Use longer hashes for cache keys
3372         https://bugs.webkit.org/show_bug.cgi?id=141356
3373
3374         Reviewed by Darin Adler.
3375
3376         The current key hashes are 32bit. We should use longer hashes to eliminate collisions.
3377
3378         This patch switches us to using MD5 digests for the cache key hashes. As a result the file names for the cache
3379         entries grow from 8 to 32 character.
3380
3381         Note that we don't need a cryptographic hash (full cache keys are verified against the entries).
3382         MD5 just happens to be fast, convenient and available.
3383
3384         The patch also moves the whole cache hierarchy down to a versioned subdirectory ("WebKitCache/Version 2")
3385         and deletes any old style cache files if they exist.
3386
3387         * NetworkProcess/cache/NetworkCacheCoders.cpp:
3388         (WebKit::NetworkCacheCoder<MD5::Digest>::encode):
3389         (WebKit::NetworkCacheCoder<MD5::Digest>::decode):
3390         * NetworkProcess/cache/NetworkCacheCoders.h:
3391         * NetworkProcess/cache/NetworkCacheKey.cpp:
3392         (WebKit::NetworkCacheKey::NetworkCacheKey):
3393         (WebKit::hashString):
3394         (WebKit::NetworkCacheKey::computeHash):
3395         (WebKit::NetworkCacheKey::hashAsString):
3396         (WebKit::NetworkCacheKey::stringToHash):
3397         * NetworkProcess/cache/NetworkCacheKey.h:
3398         (WebKit::NetworkCacheKey::shortHash):
3399         (WebKit::NetworkCacheKey::toShortHash):
3400
3401             32bit hash to use in the bloom filter.
3402
3403         (WebKit::NetworkCacheKey::hashStringLength):
3404         * NetworkProcess/cache/NetworkCacheStorage.h:
3405
3406             Bump the version.
3407
3408         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
3409         (WebKit::traverseCacheFiles):
3410         (WebKit::makeVersionedDirectoryPath):
3411         (WebKit::NetworkCacheStorage::NetworkCacheStorage):
3412         (WebKit::NetworkCacheStorage::initialize):
3413         (WebKit::NetworkCacheStorage::removeEntry):
3414         (WebKit::NetworkCacheStorage::retrieve):
3415         (WebKit::NetworkCacheStorage::store):
3416         (WebKit::NetworkCacheStorage::update):
3417         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
3418         (WebKit::NetworkCacheStorage::deleteOldVersions):
3419
3420             Wipe out the version 1 cache.
3421
3422 2015-02-06  Chris Dumez  <cdumez@apple.com>
3423
3424         Have SQLiteStatement::database() return a reference
3425         https://bugs.webkit.org/show_bug.cgi?id=141348
3426
3427         Reviewed by Andreas Kling.
3428
3429         Have SQLiteStatement::database() return a reference as it can never
3430         return null.
3431
3432         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
3433         (WebKit::SQLiteIDBCursor::internalAdvanceOnce):
3434
3435 2015-02-06  Alexey Proskuryakov  <ap@apple.com>
3436
3437         Report network process crashes during layout tests
3438         https://bugs.webkit.org/show_bug.cgi?id=139646
3439
3440         Reviewed by Anders Carlsson.
3441
3442         Added a way to get network process pid, modeled after how we do this for web process.
3443
3444         * UIProcess/API/C/mac/WKContextPrivateMac.h:
3445         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
3446         (WKContextGetNetworkProcessIdentifier):
3447         * UIProcess/WebProcessPool.cpp:
3448         (WebKit::WebProcessPool::networkProcessCrashed): Don't reset m_networkProcess until
3449         after calling the client, so that the client could retrieve its pid.
3450         (WebKit::WebProcessPool::networkProcessIdentifier):
3451         * UIProcess/WebProcessPool.h:
3452
3453 2015-02-05  Timothy Hatcher  <timothy@apple.com>
3454
3455         Support overriding the deviceScaleFactor per WKWebView/WKView
3456         https://bugs.webkit.org/show_bug.cgi?id=141311
3457
3458         Reviewed by Tim Horton.
3459
3460         * UIProcess/API/Cocoa/WKViewPrivate.h:
3461         * UIProcess/API/Cocoa/WKWebView.mm:
3462         (-[WKWebView _setOverrideDeviceScaleFactor:]):
3463         (-[WKWebView _overrideDeviceScaleFactor]):
3464         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3465         * UIProcess/API/mac/WKView.mm:
3466         (-[WKView _intrinsicDeviceScaleFactor]):
3467         (-[WKView _setOverrideDeviceScaleFactor:]):
3468         (-[WKView _overrideDeviceScaleFactor]):
3469
3470 2015-02-06  Carlos Garcia Campos  <cgarcia@igalia.com>
3471
3472         [GTK] Remove WebKitWebView::close-notification signal
3473         https://bugs.webkit.org/show_bug.cgi?id=141330
3474
3475         Reviewed by Gustavo Noronha Silva.
3476
3477         In favor of a WebKitNotification::closed signal and
3478         webkit_notification_close() method that both applications and
3479         WebKit can use to close a notification. This also fixes the
3480         onclose event that was not fired when the notification was
3481         closed. It also brings back padding space in WebKitWebViewClass.
3482
3483         * UIProcess/API/gtk/WebKitNotification.cpp:
3484         (webkit_notification_class_init): Add WebKitNotification::closed signal.
3485         (webkit_notification_close): Emit WebKitNotification::closed.
3486         * UIProcess/API/gtk/WebKitNotification.h:
3487         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
3488         (WebKitNotificationProvider::notificationCloseCallback): Callback
3489         for WebKitNotification::closed signal that notifies the WebProcess
3490         and removes the notification from the map.
3491         (WebKitNotificationProvider::show): Connect to WebKitNotification::closed.
3492         (WebKitNotificationProvider::cancelNotificationByID): Call webkit_notification_close().
3493         * UIProcess/API/gtk/WebKitNotificationProvider.h:
3494         * UIProcess/API/gtk/WebKitWebView.cpp:
3495         (notifyNotificationClosed): The user closed the annotation, call
3496         webkit_notification_close().
3497         (webNotificationClosed): The WebKitNotification has been closed,
3498         close the libnotify notification if it hasn't been closed yet.
3499         (webkitWebViewShowNotification): Create the libnotifiy
3500         notification if needed and associate it to the WebKitNotification
3501         as user data. Connect to the closed signal of both, the libnotifiy
3502         notification and the WebKit notification.
3503         (webkitWebViewCloseNotification): Deleted.
3504         (webkit_web_view_class_init): Remove close-notification signal and
3505         the default hanlder.
3506         (webkitWebViewEmitCloseNotification): Deleted.
3507         * UIProcess/API/gtk/WebKitWebView.h:
3508         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
3509         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add webkit_notification_close.
3510
3511 2015-02-06  Carlos Garcia Campos  <cgarcia@igalia.com>
3512
3513         ASSERTION FAILED: !m_adoptionIsRequired in WTF::RefCountedBase::ref
3514         https://bugs.webkit.org/show_bug.cgi?id=141035
3515
3516         Reviewed by Sergio Villar Senin.
3517
3518         Rename PrinterListGtk::singleton() as PrinterListGtk::getOrCreate(), and
3519         make it return nullptr when the shared PrinterListGtk object is
3520         still being created. This can happen if the nested loop used by
3521         gtk_enumerate_printers dispatches a GSource that starts a new
3522         synchronous print operation. In that case we just ignore the
3523         second print operation, since there's already one ongoing.
3524
3525         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3526         (WebKit::WebChromeClient::print): Return early if
3527         PrinterListGtk::getOrCreate() return nullptr.
3528         * WebProcess/WebPage/gtk/PrinterListGtk.cpp:
3529         (WebKit::PrinterListGtk::getOrCreate): Return nullptr if the
3530         PrinterListGtk is still enumerating the printers.
3531         (WebKit::PrinterListGtk::PrinterListGtk): Initialize
3532         m_enumeratingPrinters to true before calling
3533         gtk_enumerate_printers, and to false once it finishes.
3534         (WebKit::PrinterListGtk::singleton): Deleted.
3535         (WebKit::PrinterListGtk::enumeratePrintersFunction): Deleted.
3536         * WebProcess/WebPage/gtk/PrinterListGtk.h:
3537         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp: Add an
3538         assertion here since PrinterListGtk::getOrCreate() should never
3539         return nullptr at this point.
3540
3541 2015-02-05  Tim Horton  <timothy_horton@apple.com>
3542
3543         Null deref in ViewGestureController::beginSwipeGesture when swiping while script is navigating
3544         https://bugs.webkit.org/show_bug.cgi?id=141308
3545         <rdar://problem/18460046>
3546
3547         Reviewed by Simon Fraser.
3548
3549         * UIProcess/mac/ViewGestureControllerMac.mm:
3550         (WebKit::ViewGestureController::trackSwipeGesture):
3551         If script navigates (history.back, probably other cases too) while in the middle of
3552         building up enough scroll events to start a swipe, it can destroy the history item
3553         that we were planning to swipe to. If this happens, bail from the swipe.
3554
3555 2015-02-05  Alexey Proskuryakov  <ap@apple.com>
3556
3557         Don't pass architecture to development plug-in XPC services
3558         https://bugs.webkit.org/show_bug.cgi?id=141309
3559
3560         Reviewed by Anders Carlsson.
3561
3562         We now have separate services for 32-bit and 64-bit.
3563
3564         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
3565         (WebKit::reexec):
3566         (WebKit::XPCServiceEventHandler):
3567         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3568         (WebKit::connectToReExecService):
3569
3570 2015-02-05  Chris Dumez  <cdumez@apple.com>
3571
3572         Use deleteEmptyDirectory() in NetworkCacheStorage::clear()
3573         https://bugs.webkit.org/show_bug.cgi?id=141314
3574
3575         Reviewed by Antti Koivisto.
3576
3577         Use deleteEmptyDirectory() in NetworkCacheStorage::clear() to simplify
3578         the code a little bit.
3579
3580         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
3581         (WebKit::NetworkCacheStorage::clear):
3582
3583 2015-02-05  Joseph Pecoraro  <pecoraro@apple.com>
3584
3585         [iOS] Remove False Positive dispatch_source Leak in WebMemoryPressureHandler singleton
3586         https://bugs.webkit.org/show_bug.cgi?id=141307
3587
3588         Reviewed by Anders Carlsson.
3589
3590         * UIProcess/ios/WebMemoryPressureHandlerIOS.h:
3591         * UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
3592         (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
3593         We want to keep the dispatch_source around, so just tie it to the
3594         singleton so that it is not reported as a leak.
3595
3596 2015-02-05  Antti Koivisto  <antti@apple.com>
3597
3598         Switch to file backed buffer when resource is cached to disk
3599         https://bugs.webkit.org/show_bug.cgi?id=141295
3600
3601         Reviewed by Chris Dumez.
3602
3603         Wire the DidCacheResource mechanism to the new disk cache.
3604
3605         * NetworkProcess/NetworkResourceLoader.cpp:
3606         (WebKit::NetworkResourceLoader::didFinishLoading):
3607
3608             Send DidCacheResource message to the web process so it can switch the resource to file backing.
3609
3610         * NetworkProcess/cache/NetworkCache.cpp:
3611         (WebKit::NetworkCache::store):
3612         (WebKit::NetworkCache::update):
3613         * NetworkProcess/cache/NetworkCache.h:
3614         * NetworkProcess/cache/NetworkCacheStorage.h:
3615         (WebKit::DispatchPtr::DispatchPtr):
3616         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
3617         (WebKit::NetworkCacheStorage::Data::Data):
3618         (WebKit::mapFile):
3619         (WebKit::decodeEntry):
3620         (WebKit::retrieveActive):
3621         (WebKit::NetworkCacheStorage::retrieve):
3622         (WebKit::NetworkCacheStorage::store):
3623
3624             Map files larger than a memory page after a successful store.
3625
3626         (WebKit::NetworkCacheStorage::update):
3627         (WebKit::encodeEntry): Deleted.
3628
3629 2015-02-05  Chris Dumez  <cdumez@apple.com>
3630
3631         [WK2] Properly check for mmap() error case
3632         https://bugs.webkit.org/show_bug.cgi?id=141304
3633
3634         Reviewed by Anders Carlsson.
3635
3636         mmap() returns MAP_FAILED, which is (void*)-1, not a null pointer in
3637         case of failure. This patch updates several wrong error checks in
3638         WebKit2.
3639
3640         * Platform/IPC/ArgumentEncoder.cpp:
3641         (IPC::allocBuffer):
3642         (IPC::ArgumentEncoder::reserve):
3643         * Platform/IPC/mac/ConnectionMac.mm:
3644         (IPC::Connection::sendOutgoingMessage):
3645
3646 2015-02-05  Brian J. Burg  <burg@cs.washington.edu>
3647
3648         Clean up WebInspectorProxy and use simpler inspector levels design
3649         https://bugs.webkit.org/show_bug.cgi?id=141135
3650
3651         Reviewed by Timothy Hatcher.
3652
3653         Inspector levels used to be managed by keeping a set of WebPageGroup
3654         instances and doing pointer comparisons to check whether the inspected
3655         view is itself a web inspector instance. This is unnecessary, as we
3656         can maintain a mapping from WebPageProxy* to its corresponding level.
3657
3658         When an inspector instance is created, it is inserted into the mapping
3659         along with its level. An inspector's level is 1 unless its inspected page
3660         is in the mapping, then it is one greater that the inspected page's level.
3661
3662         The level is provided by inspectorLevel(), rather than a member variable.
3663         WebInspectorProxy is created in the constructor of WebPageProxy. Thus, there
3664         would be no chance to add the inspector page's level to the mapping before the
3665         next level inspector tries to look it up when initializing its members.
3666
3667         This patch introduces other miscellaneous cleanups, such as naming m_page
3668         to m_inspectedPage, using Ref and using an enum class for the attachment side.
3669
3670         * UIProcess/API/C/WKInspector.cpp:
3671         (WKInspectorGetPage):
3672         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3673         (resizeWebKitWebViewBaseFromAllocation):
3674         * UIProcess/InspectorServer/efl/WebInspectorServerEfl.cpp:
3675         * UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp:
3676         * UIProcess/WebInspectorProxy.cpp:
3677         (WebKit::pageLevelMap):
3678         (WebKit::WebInspectorProxy::WebInspectorProxy):
3679         (WebKit::WebInspectorProxy::inspectorLevel):
3680         (WebKit::WebInspectorProxy::inspectorPageGroupIdentifier):
3681         (WebKit::WebInspectorProxy::inspectorPagePreferences):
3682         (WebKit::WebInspectorProxy::invalidate):
3683         (WebKit::WebInspectorProxy::isFront):
3684         (WebKit::WebInspectorProxy::connect):
3685         (WebKit::WebInspectorProxy::show):
3686         (WebKit::WebInspectorProxy::hide):
3687         (WebKit::WebInspectorProxy::close):
3688         (WebKit::WebInspectorProxy::didRelaunchInspectorPageProcess):
3689         (WebKit::WebInspectorProxy::showConsole):
3690         (WebKit::WebInspectorProxy::showResources):
3691         (WebKit::WebInspectorProxy::showMainResourceForFrame):
3692         (WebKit::WebInspectorProxy::attachBottom):
3693         (WebKit::WebInspectorProxy::attachRight):
3694         (WebKit::WebInspectorProxy::attach):
3695         (WebKit::WebInspectorProxy::detach):
3696         (WebKit::WebInspectorProxy::togglePageProfiling):
3697         (WebKit::WebInspectorProxy::isInspectorPage):
3698         (WebKit::decidePolicyForNavigationAction):
3699         (WebKit::WebInspectorProxy::remoteFrontendConnected):
3700         (WebKit::WebInspectorProxy::remoteFrontendDisconnected):
3701         (WebKit::WebInspectorProxy::dispatchMessageFromRemoteFrontend):
3702         (WebKit::WebInspectorProxy::eagerlyCreateInspectorPage):
3703         (WebKit::WebInspectorProxy::createInspectorPage):
3704         (WebKit::WebInspectorProxy::didClose):
3705         (WebKit::WebInspectorPageGroups::singleton): Deleted.
3706         (WebKit::WebInspectorPageGroups::inspectorLevel): Deleted.
3707         (WebKit::WebInspectorPageGroups::isInspectorPageGroup): Deleted.
3708         (WebKit::WebInspectorPageGroups::inspectorPageGroupLevel): Deleted.
3709         (WebKit::WebInspectorPageGroups::inspectorPageGroupForLevel): Deleted.
3710         (WebKit::WebInspectorPageGroups::createInspectorPageGroup): Deleted.
3711         (WebKit::WebInspectorProxy::~WebInspectorProxy): Deleted.
3712         (WebKit::WebInspectorProxy::inspectorPageGroup): Deleted.
3713         (WebKit::WebInspectorProxy::setAttachedWindowHeight): Deleted.
3714         (WebKit::WebInspectorProxy::enableRemoteInspection): Deleted.
3715         (WebKit::WebInspectorProxy::open): Deleted.
3716         * UIProcess/WebInspectorProxy.h:
3717         (WebKit::WebInspectorProxy::create):
3718         (WebKit::WebInspectorProxy::inspectedPage):
3719         (WebKit::WebInspectorProxy::page): Deleted.
3720         * UIProcess/efl/WebInspectorProxyEfl.cpp:
3721         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3722         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3723         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3724         (WebKit::WebInspectorProxy::dockButtonClicked):
3725         (WebKit::WebInspectorProxy::createInspectorWindow):
3726         (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
3727         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
3728         (WebKit::WebInspectorProxy::platformAttach):
3729         (WebKit::WebInspectorProxy::platformDetach):
3730         (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight):
3731         (WebKit::WebInspectorProxy::platformSetAttachedWindowWidth):
3732         * UIProcess/mac/WebInspectorProxyMac.mm:
3733         (-[WKWebInspectorProxyObjCAdapter attachRight:]):
3734         (-[WKWebInspectorProxyObjCAdapter attachBottom:]):
3735         (WebKit::WebInspectorProxy::createInspectorWindow):
3736         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3737         (WebKit::WebInspectorProxy::platformBringToFront):
3738         (WebKit::WebInspectorProxy::windowFrameDidChange):
3739         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
3740         (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
3741         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
3742         (WebKit::WebInspectorProxy::platformAttach):
3743         (WebKit::WebInspectorProxy::platformDetach):
3744         (-[WKWebInspectorProxyObjCAdapter close]): Deleted.
3745
3746 2015-02-05  Chris Dumez  <cdumez@apple.com>
3747
3748         [WK2][Cocoa] Populate m_contentsFilter bloom filter from the main dispatch queue NetworkCacheStorage::initialize()
3749         https://bugs.webkit.org/show_bug.cgi?id=141297
3750
3751         Reviewed by Antti Koivisto.
3752
3753         Populate m_contentsFilter bloom filter from the main dispatch queue
3754         NetworkCacheStorage::initialize() to avoid thread-safety issues.
3755
3756         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
3757         (WebKit::NetworkCacheStorage::initialize):
3758
3759 2015-02-05  Chris Dumez  <cdumez@apple.com>
3760
3761         Use deleteFile() in NetworkCacheStorageCocoa.mm
3762         https://bugs.webkit.org/show_bug.cgi?id=141299
3763
3764         Reviewed by Antti Koivisto.
3765
3766         Use deleteFile() in NetworkCacheStorageCocoa.mm to simplify the code
3767         a bit.
3768
3769         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
3770         (WebKit::NetworkCacheStorage::removeEntry):
3771         (WebKit::NetworkCacheStorage::clear):
3772         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
3773
3774 2015-02-04  Antti Koivisto  <antti@apple.com>
3775
3776         Avoid copying std::functions across threads in NetworkCacheStorage
3777         https://bugs.webkit.org/show_bug.cgi?id=141273
3778
3779         Reviewed by Andreas Kling.
3780
3781         The current approach is risky. There is possiblity that captured variables are
3782         deleted in an unexpected thread.
3783
3784         * NetworkProcess/cache/NetworkCache.cpp:
3785         (WebKit::NetworkCache::retrieve):
3786
3787             The capture trick here is no longer needed.
3788
3789         * NetworkProcess/cache/NetworkCacheStorage.h:
3790
3791             For each cache operation we create Retrive/Store/UpdateOperation object kept alive by the active operation map.
3792             This object captures all parameters of the operation including the lambda. When the operation completes
3793             the object is removed from the map in the main thread, ensuring safe destruction.
3794
3795         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
3796         (WebKit::NetworkCacheStorage::dispatchRetrieveOperation):
3797         (WebKit::NetworkCacheStorage::dispatchPendingRetrieveOperations):
3798         (WebKit::retrieveActive):
3799
3800             Instead of maintaining a separate write cache we just look through the active write and update maps.
3801
3802         (WebKit::NetworkCacheStorage::retrieve):
3803
3804             Use fixed sized priority array rather than a dynamic one. Vector<Deque<std::unique_ptr>> doesn't quite work.
3805
3806         (WebKit::NetworkCacheStorage::store):
3807         (WebKit::NetworkCacheStorage::update):
3808         (WebKit::NetworkCacheStorage::clear):
3809
3810 2015-02-05  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar <calvaris@igalia.com>
3811
3812         [Streams API] Implement a barebone ReadableStream interface
3813         https://bugs.webkit.org/show_bug.cgi?id=141045
3814
3815         Reviewed by Benjamin Poulain.
3816
3817         * CMakeLists.txt:
3818         * Configurations/FeatureDefines.xcconfig:
3819
3820 2015-02-04  Joseph Pecoraro  <pecoraro@apple.com>
3821
3822         [iOS] Selection callout does not follow selection when double-tap scrolling
3823         https://bugs.webkit.org/show_bug.cgi?id=141214
3824
3825         Reviewed by Benjamin Poulain.
3826
3827         Implement the delegate that gets called after UIScrollView
3828         setContentOffset animations. When scrolling to a rect, do the normal
3829         willScroll, didScroll actions to update the selection assistant.
3830
3831         * UIProcess/API/Cocoa/WKWebView.mm:
3832         (-[WKWebView _scrollToRect:origin:minimumScrollDistance:]):
3833         (-[WKWebView scrollViewDidEndScrollingAnimation:]):
3834
3835 2015-02-04  Simon Fraser  <simon.fraser@apple.com>
3836
3837         [iOS WK2] Layers that are created and destroyed in the same transaction shouldn't be encoded
3838         https://bugs.webkit.org/show_bug.cgi?id=141228
3839
3840         Reviewed by Tim Horton.
3841         
3842         With UI-side compositing, it was possible for layers to get created and
3843         destroyed in the same transaction (e.g. two layouts before a single layer
3844         tree commit). When that happened we would encode layer creation properties
3845         but not encode layer properties, since the layer would be unreachable.
3846         
3847         Fix by removing deleted layers from the created layers list, which is
3848         converted into a map for easy searching.
3849
3850         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
3851         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
3852         (WebKit::RemoteLayerTreeContext::layerWasCreated):
3853         (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed):
3854         (WebKit::RemoteLayerTreeContext::buildTransaction):
3855
3856 2015-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
3857
3858         Build with seccomp filters broken since r179409
3859         https://bugs.webkit.org/show_bug.cgi?id=141206
3860
3861         Reviewed by Darin Adler.
3862
3863         Fix build by renaming SeccompBrokerClient::shared to SeccompBrokerClient::singleton.
3864
3865         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
3866         (WebKit::SeccompBrokerClient::singleton):
3867         (WebKit::SeccompBroker::initialize):
3868         (WebKit::SeccompBrokerClient::shared):
3869         (WebKit::SeccompBroker::runLoop):
3870
3871 2015-02-04  Simon Fraser  <simon.fraser@apple.com>
3872
3873         [iOS WK2] Assert in ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren() on tab switching
3874         https://bugs.webkit.org/show_bug.cgi?id=141223
3875         rdar://problem/18458993
3876
3877         Reviewed by Tim Horton.
3878
3879         It's possible to submit a RemoteLayerTree transaction that contains data
3880         about a created layer, but doesn't have any properties for that layer. This
3881         happens when the newly created layer isn't reached during the traversal that
3882         gathers layer properties (i.e. it's not rooted). However, whether we create
3883         a scrolling layer or not requires having properties; they are missing, so we
3884         create a normal layer, but then the scrolling tree commit asserts that we
3885         should have a scrolling layer.
3886         
3887         Fix by making scrolling layers have a corresponding layer type, which is
3888         stored in layer creation properties. This required exposing layer types
3889         up through GraphicsLayer, but that allows for some nice cleanup:
3890         
3891         1. No need to have the hokey shouldUseTiledBacking() GraphicsLayerClient hack
3892            for creating the page tiled layer.
3893         2. The notion of "custom behaviors" can be removed from GraphicsLayer entirely.
3894
3895         * Shared/mac/RemoteLayerBackingStore.mm:
3896         (WebKit::RemoteLayerBackingStore::drawInContext):
3897         * Shared/mac/RemoteLayerTreeTransaction.h:
3898         * Shared/mac/RemoteLayerTreeTransaction.mm:
3899         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
3900         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
3901         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
3902         (WebKit::dumpChangedLayers):
3903         (WebKit::RemoteLayerTreeTransaction::description):
3904         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
3905         (WebKit::RemoteLayerTreeHost::createLayer):
3906         * UIProcess/mac/RemoteLayerTreeHost.mm:
3907         (WebKit::RemoteLayerTreeHost::createLayer):
3908         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
3909         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3910         (WebKit::PlatformCALayerRemote::customBehavior): Deleted.
3911         (WebKit::PlatformCALayerRemote::updateCustomBehavior): Deleted.
3912         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
3913         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
3914         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
3915         (WebKit::RemoteLayerTreeContext::createGraphicsLayer):
3916
3917 2015-02-04  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3918
3919         [EFL][WK2] Manage failing API tests
3920         https://bugs.webkit.org/show_bug.cgi?id=141250
3921
3922         Reviewed by Csaba Osztrogonác.
3923
3924         * PlatformEfl.cmake: Skip to test test_ewk2_storage_manager.
3925         * UIProcess/API/efl/tests/test_ewk2_view.cpp: Disable 2 unit test functions.
3926         (TEST_F):
3927
3928 2015-02-04  Chris Dumez  <cdumez@apple.com>
3929
3930         Add removeFirst(value) / removeAll(value) methods to WTF::Vector
3931         https://bugs.webkit.org/show_bug.cgi?id=141192
3932
3933         Reviewed by Benjamin Poulain.
3934
3935         Use new Vector::removeFirst(value) / removeAll(value) API to simplify the
3936         code a bit.
3937
3938         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp:
3939         (WebKit::WebSoupCustomProtocolRequestManager::unregisterSchemeForCustomProtocol):
3940         * UIProcess/PageLoadState.cpp:
3941         (WebKit::PageLoadState::removeObserver):
3942         * UIProcess/WebProcessPool.cpp:
3943         (WebKit::WebProcessPool::~WebProcessPool):
3944         (WebKit::WebProcessPool::disconnectProcess):
3945         * WebProcess/InjectedBundle/API/efl/ewk_extension.cpp:
3946         (EwkExtension::remove):
3947
3948 2015-02-03  Chris Dumez  <cdumez@apple.com>
3949
3950         Unreviewed attempt to fix GTK/EFL build after r179588.
3951
3952         Add new files to CMakeLists.txt.
3953
3954         * CMakeLists.txt:
3955
3956 2015-02-03  Shivakumar JM  <shiva.jm@samsung.com>
3957
3958         Fix build warning in WebKit2/Platform/IPC module.
3959         https://bugs.webkit.org/show_bug.cgi?id=141229
3960
3961         Reviewed by Chris Dumez.
3962
3963         Fix build warning by using UNUSED_PARAM macro.
3964
3965         * Platform/IPC/Connection.cpp:
3966         (IPC::Connection::sendMessage):
3967
3968 2015-02-03  Tim Horton  <timothy_horton@apple.com>
3969
3970         Add WKPageNavigationClient as C SPI around API::NavigationClient, and adopt in WKTR
3971         https://bugs.webkit.org/show_bug.cgi?id=141217
3972
3973         * UIProcess/API/C/WKPageRenderingProgressEventsInternal.h:
3974         Include, not import.
3975
3976 2015-02-03  Tim Horton  <timothy_horton@apple.com>
3977
3978         Add WKPageNavigationClient as C SPI around API::NavigationClient, and adopt in WKTR
3979         https://bugs.webkit.org/show_bug.cgi?id=141217
3980
3981         Reviewed by Sam Weinig.
3982
3983         * Shared/API/c/WKBase.h:
3984         * UIProcess/API/C/WKAPICast.h:
3985         * UIProcess/API/C/WKFrameInfoRef.cpp: Added.
3986         (WKFrameInfoGetTypeID):
3987         * UIProcess/API/C/WKFrameInfoRef.h: Added.
3988         * UIProcess/API/C/WKNavigationActionRef.cpp: Added.
3989         (WKNavigationActionGetTypeID):
3990         * UIProcess/API/C/WKNavigationActionRef.h: Added.
3991         * UIProcess/API/C/WKNavigationRef.cpp: Added.
3992         (WKNavigationGetTypeID):
3993         * UIProcess/API/C/WKNavigationRef.h: Added.
3994         * UIProcess/API/C/WKNavigationResponseRef.cpp: Added.
3995         (WKNavigationResponseGetTypeID):
3996         (WKNavigationResponseCanShowMIMEType):
3997         * UIProcess/API/C/WKNavigationResponseRef.h: Added.
3998         Add tiny C wrappers around API::{FrameInfo, NavigationAction, Navigation, NavigationResponse}.
3999
4000         * UIProcess/API/APINavigationClient.h:
4001         (API::NavigationClient::decidePolicyForPluginLoad):
4002         Add a default implementation of decidePolicyForPluginLoad.
4003
4004         * UIProcess/API/C/WKPage.cpp:
4005         (WKPageSetPageNavigationClient):
4006         * UIProcess/API/C/WKPage.h:
4007         Add WKPageSetPageNavigationClient, which connects API::NavigationClient to
4008         the new WKPageNavigationClient C SPI.
4009         
4010         * UIProcess/API/C/WKPageNavigationClient.h: Added.
4011         Add WKPageNavigationClient, which one can use in place of WKPageLoaderClient
4012         and WKPagePolicyClient and which has the same semantics as the Modern ObjC API
4013         (including things like API::Navigation as WKNavigationRef, etc.)
4014
4015         * UIProcess/API/C/WKPageLoaderClient.h:
4016         * UIProcess/API/C/WKPageRenderingProgressEvents.h: Added.
4017         * UIProcess/API/C/WKPageRenderingProgressEventsInternal.h: Added.
4018         (pageRenderingProgressEvents):
4019         * UIProcess/API/C/WKPluginLoadPolicy.h: Added.
4020         Pull some enums out into their own files (WKPageRenderingProgressEvents is
4021         duplicated from the Modern ObjC API's _WKRenderingProgressEvents, WKPluginLoadPolicy
4022         is pulled out of WKPageLoaderClient).
4023
4024         * UIProcess/WebPageProxy.cpp:
4025         (WebKit::WebPageProxy::findPlugin):
4026         Add an equivalent of pluginLoadPolicy to the NavigationClient.
4027
4028         * WebKit2.xcodeproj/project.pbxproj:
4029
4030 2015-02-03  Timothy Horton  <timothy_horton@apple.com>
4031
4032         Every PageOverlayClientImpl leaks
4033         https://bugs.webkit.org/show_bug.cgi?id=141224
4034         <rdar://problem/19652939>
4035
4036         Reviewed by Simon Fraser.
4037
4038         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
4039         (WKBundlePageOverlayCreate):
4040         * WebProcess/WebPage/WebPageOverlay.cpp:
4041         (WebKit::WebPageOverlay::create):
4042         (WebKit::WebPageOverlay::WebPageOverlay):
4043         (WebKit::WebPageOverlay::pageOverlayDestroyed):
4044         (WebKit::WebPageOverlay::willMoveToPage):
4045         (WebKit::WebPageOverlay::didMoveToPage):
4046         (WebKit::WebPageOverlay::drawRect):
4047         (WebKit::WebPageOverlay::mouseEvent):
4048         (WebKit::WebPageOverlay::didScrollFrame):
4049         (WebKit::WebPageOverlay::actionContextForResultAtPoint):
4050         (WebKit::WebPageOverlay::dataDetectorsDidPresentUI):
4051         (WebKit::WebPageOverlay::dataDetectorsDidChangeUI):
4052         (WebKit::WebPageOverlay::dataDetectorsDidHideUI):
4053         (WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
4054         (WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
4055         (WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
4056         * WebProcess/WebPage/WebPageOverlay.h:
4057         (WebKit::WebPageOverlay::client):
4058         Keep the PageOverlayClientImpl as a unique_ptr instead of a leaked reference,
4059         ensuring that it's cleaned up when the WebPageOverlay is torn down.
4060
4061 2015-02-03  Chris Dumez  <cdumez@apple.com>
4062
4063         Drop ResourceLoadPriorityUnresolved resource load priority and use Optional<> instead
4064         https://bugs.webkit.org/show_bug.cgi?id=141186
4065
4066         Reviewed by Antti Koivisto.
4067
4068         Update code now that ResourceLoadPriorityUnresolved is not longer a
4069         ResourceLoadPriority enum value.
4070
4071         * NetworkProcess/cache/NetworkCache.cpp:
4072         (WebKit::NetworkCache::retrieve):
4073         * WebProcess/Network/WebResourceLoadScheduler.cpp:
4074         (WebKit::WebResourceLoadScheduler::scheduleLoad):
4075
4076 2015-02-03  Enrica Casucci  <enrica@apple.com>
4077
4078         [iOS] Add support for deleteFromInputWithFlags.
4079         https://bugs.webkit.org/show_bug.cgi?id=141216
4080         rdar://problem/19130081
4081
4082         Reviewed by Benjamin Poulain.
4083
4084         Adopts the new method as soon as it is available.
4085         The patch also removes some obsolete code used for staging.
4086
4087         * Platform/spi/ios/UIKitSPI.h:
4088         * UIProcess/ios/WKContentViewInteraction.mm:
4089         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
4090
4091 2015-02-03  Joseph Pecoraro  <pecoraro@apple.com>
4092
4093         [iOS] Selection Callout should not immediately disappear on pages with frequent layouts
4094         https://bugs.webkit.org/show_bug.cgi?id=141210
4095
4096         Reviewed by Enrica Casucci.
4097
4098         In iOS WebKit2 in order to keep caret refreshes in sync with WebCore layouts
4099         the selection assistant is told to update whenever WebKit's layer tree
4100         commits. Unfortunately, for pages with JavaScript animation that are
4101         frequently doing a layout / layer tree update, this would trigger very
4102         frequent selection updates that would keep the caret from blinking and
4103         dismiss any selection callouts.
4104
4105         This change tracks the last selection drawing information so that we can
4106         avoid informing the assistant of a selection updates unless it has changed
4107         visually or needs to redraw (zoom).
4108
4109         * Shared/EditorState.cpp:
4110         Remove include already in header.
4111
4112         * UIProcess/ios/WKContentViewInteraction.h:
4113         * UIProcess/ios/WKContentViewInteraction.mm:
4114         (WebKit::WKSelectionDrawingInfo::WKSelectionDrawingInfo):
4115         (WebKit::operator==):
4116         (WebKit::operator!=):
4117         (-[WKContentView observeValueForKeyPath:ofObject:change:context:]):
4118         When zooming, force the selection update, even though the drawing
4119         information hasn't changed, the views will need to be updated.
4120
4121         (-[WKContentView _updateChangedSelection]):
4122         (-[WKContentView _updateChangedSelection:]):
4123         Monitor EditorState for changes in selection drawing and avoid
4124         informing the selection assistant unless necessary.
4125
4126 2015-02-03  Jeremy Jones  <jeremyj@apple.com>
4127
4128         Prevent flicker when exiting fullscreen by synchronizing transactions.
4129         https://bugs.webkit.org/show_bug.cgi?id=140897
4130
4131         Reviewed by Tim Horton.
4132
4133         Flush transactions before removing layerHost. This allows existing transactions to be completed before the hosting layer disappears.
4134
4135         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
4136         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen):
4137
4138 2015-02-03  Brian J. Burg  <burg@cs.washington.edu>
4139
4140         Convert WebInspectorProxy to use WKWebView API for the inspector view
4141         https://bugs.webkit.org/show_bug.cgi?id=141037
4142
4143         Reviewed by Timothy Hatcher.
4144
4145