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