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