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