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