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