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