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