Fix reload and programmatic scrolling in RTL documents
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-01-01  Simon Fraser  <simon.fraser@apple.com>
2
3         Fix reload and programmatic scrolling in RTL documents
4         https://bugs.webkit.org/show_bug.cgi?id=152639
5
6         Reviewed by Zalan Bujtas.
7
8         Reloading a left-scrolled RTL document would cause the content to appear
9         at an odd offset, and programmatic sideways scrolls in RTL documents also
10         jumped to the wrong location.
11         
12         Fix by resolving offset/position confusion in ScrollableArea::scrollPositionChanged()
13         and the scrolling tree.
14         
15         ScrollableArea::scrollPositionChanged() was erroneously passing a scrollPosition
16         to setScrollOffset(). 
17         
18         ScrollingTreeFrameScrollingNode* were confused about offsets and positions. It
19         turns out that the layer position is just -scrollPosition, but minimumScrollPosition()
20         and maximumScrollPosition() need fixing to return positions, not offsets.
21         
22         ScrollingTreeFrameScrollingNode::viewToContentsOffset() was also doing incorrect
23         math with scrollOrigin, which was detected by a failing test.
24         
25         Add more logging to the Scrolling channel.
26
27         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
28         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
29         (WebKit::PDFPlugin::setScrollOffset):
30
31 2016-01-01  Michael Catanzaro  <mcatanzaro@igalia.com>
32
33         [SOUP] REGRESSION(r192761): Broke resource URIs for applications that use g_resource_load in a web extension
34         https://bugs.webkit.org/show_bug.cgi?id=152634
35
36         Reviewed by Carlos Garcia Campos.
37
38         Load GResource URIs locally, not in the network process. Applications expect calling
39         g_resource_load in a web extension to make it possible to load resource URIs, but that
40         doesn't work now that the network process is in use. Loading them locally solves this.
41
42         * WebProcess/Network/WebLoaderStrategy.cpp:
43         (WebKit::WebLoaderStrategy::scheduleLoad):
44
45 2016-01-01  Jeff Miller  <jeffm@apple.com>
46
47         Update user-visible copyright strings to include 2016
48         https://bugs.webkit.org/show_bug.cgi?id=152531
49
50         Reviewed by Alexey Proskuryakov.
51
52         * DatabaseProcess/EntryPoint/mac/LegacyProcess/Info.plist:
53         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService.Development/Info.plist:
54         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist:
55         * Info.plist:
56         * NetworkProcess/EntryPoint/mac/LegacyProcess/Info.plist:
57         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info-OSX.plist:
58         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info-iOS.plist:
59         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist:
60         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist:
61         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist:
62         * PluginProcess/EntryPoint/mac/LegacyProcess/Info.plist:
63         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist:
64         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
65         * PluginProcess/EntryPoint/mac/XPCService/PluginService.Development/Info.plist:
66         * WebProcess/EntryPoint/mac/LegacyProcess/Info.plist:
67         * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-OSX.plist:
68         * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-iOS.plist:
69         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist:
70         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
71         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:
72
73 2015-12-31  Simon Fraser  <simon.fraser@apple.com>
74
75         Rename documentScrollOffsetRelativeTo* functions
76         https://bugs.webkit.org/show_bug.cgi?id=152632
77
78         Reviewed by Zalan Bujtas.
79
80         ScrollView::documentScrollOffsetRelativeTo* functions return scroll positions,
81         not offsets, so rename them and fix their return types, and fix callers. Make
82         their code more similar.
83
84         * WebProcess/WebPage/WebPage.cpp:
85         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
86         (WebKit::WebPage::plugInIntersectsSearchRect):
87
88 2015-12-31  Simon Fraser  <simon.fraser@apple.com>
89
90         [iOS WK2] Fix incorrect scrollPosition handling
91         https://bugs.webkit.org/show_bug.cgi?id=152630
92
93         Reviewed by Zalan Bujtas.
94         
95         WebPage::updateVisibleContentRects() was setting the ScrollView's scroll position
96         to a scrollOffset, which was counteracted by ScrollView::unobscuredContentRect()
97         adding the scrollOrigin to the scrollPosition, which resulted in the correct
98         rects, but an incorrect scrollPosition. Fix.
99
100         * WebProcess/WebPage/ios/WebPageIOS.mm:
101         (WebKit::WebPage::updateVisibleContentRects):
102
103 2015-12-31  Michael Catanzaro  <mcatanzaro@igalia.com>
104
105         Unreviewed, fix a log message
106
107         * WebProcess/Network/WebResourceLoader.cpp:
108         (WebKit::WebResourceLoader::didReceiveResponse):
109
110 2015-12-31  David Kilzer  <ddkilzer@apple.com>
111
112         Stop using USE(CFNETWORK) path on iOS
113         https://bugs.webkit.org/show_bug.cgi?id=142540
114
115         Step 1/2: Do everything but turn off USE(CFNETWORK) internally.
116
117         Original patch by Antti Koivisto <antti@apple.com> on 2015-03-10
118         Reviewed by Daniel Bates.
119
120         * NetworkProcess/Downloads/ios/DownloadIOS.mm: This is now the
121         USE(CFNETWORK) && !USE(NETWORK_SESSION) code path.
122         * NetworkProcess/Downloads/mac/DownloadMac.mm: This is now the
123         !USE(CFNETWORK) && !USE(NETWORK_SESSION) code path.  Make use of
124         NSURLDownloadSPI.h.  Ignore a deprecated delcaration warning now
125         that we're using actual header declarations internally.
126         * NetworkProcess/NetworkProcess.cpp:
127         (WebKit::NetworkProcess::initializeNetworkProcess): Update for
128         iOS to use NSURLConnection loader.
129
130 2015-12-31  Andy Estes  <aestes@apple.com>
131
132         Fix warnings uncovered by migrating to WTF_MOVE
133         https://bugs.webkit.org/show_bug.cgi?id=152601
134
135         Reviewed by Daniel Bates.
136
137         * UIProcess/API/APIUIClient.h:
138         (API::UIClient::actionsForElement): Moving a return value passed to the function by value is redundant, since it
139         will be implicitly moved in this case.
140         * UIProcess/Cocoa/UIDelegate.mm:
141         (WebKit::UIDelegate::UIClient::actionsForElement): Ditto.
142
143 2015-12-30  Simon Fraser  <simon.fraser@apple.com>
144
145         Add explicit conversions between scrollOffset and scrollPostion, and use them in a few places
146         https://bugs.webkit.org/show_bug.cgi?id=152594
147
148         Reviewed by Sam Weinig.
149
150         Add functions to ScrollableArea to convert between scrollPosition and scrollOffset,
151         and use them in places where code did the math with scrollOrigin.
152
153         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
154         (WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
155         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
156         (WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
157
158 2015-12-30  Zan Dobersek  <zdobersek@igalia.com>
159
160         [TexMap] Clean up TextureMapperAnimation, TextureMapperAnimations
161         https://bugs.webkit.org/show_bug.cgi?id=152112
162
163         Reviewed by Darin Adler.
164
165         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
166         (IPC::ArgumentCoder<TextureMapperAnimation>::decode):
167
168 2015-12-29  Simon Fraser  <simon.fraser@apple.com>
169
170         Remove ScrollView::scrollOffset() in preparation for scrollOffset vs. scrollPosition clarification
171         https://bugs.webkit.org/show_bug.cgi?id=152589
172
173         Reviewed by Sam Weinig.
174
175         Current code uses scrollOffset vs. scrollPosition interchangeably, and confusingly.
176         Longer term, I plan to make "scrollPosition" be the value that is relative to the 
177         contents, i.e. affected by scrollOrigin, and "scrollOffset" be the zero-based value
178         that's used to set scrollbar values.
179         
180         To prepare for this, remove ScrollView::scrollOffset(), which is just the
181         scrollPosition as an IntSize.
182         
183         Add some typedefs in ScrollableArea, which will slowly propagate through the
184         code as position vs. offset is clarified.
185
186         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
187         (WebKit::InjectedBundleRangeHandle::renderedImage):
188         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
189         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
190         (WebKit::PDFPlugin::scrollPosition):
191         (WebKit::PDFPlugin::minimumScrollPosition):
192         (WebKit::PDFPlugin::maximumScrollPosition):
193         * WebProcess/WebPage/WebFrame.cpp:
194         (WebKit::WebFrame::scrollOffset):
195         * WebProcess/WebPage/WebPage.cpp:
196         (WebKit::WebPage::scrollMainFrameIfNotAtMaxScrollPosition):
197         (WebKit::WebPage::updateMainFrameScrollOffsetPinning):
198
199 2015-12-25  Andy Estes  <aestes@apple.com>
200
201         Stop moving local objects in return statements
202         https://bugs.webkit.org/show_bug.cgi?id=152557
203
204         Reviewed by Brady Eidson.
205
206         Calling std::move() on a local object in a return statement prevents the compiler from applying the return value optimization.
207
208         Clang can warn about these mistakes with -Wpessimizing-move, although only when std::move() is called directly.
209         I found these issues by temporarily replacing WTF::move with std::move and recompiling.
210
211         * UIProcess/WebPageProxy.cpp:
212         (WebKit::ExceededDatabaseQuotaRecords::createRecord):
213
214 2015-12-26  Joonghun Park  <jh718.park@samsung.com>
215
216         [WK2][EFL] Use eina_file_path_join at platformDefaultIconDatabasePath in WebProcessPoolEfl
217         https://bugs.webkit.org/show_bug.cgi?id=152565
218
219         Reviewed by Gyuyoung Kim.
220
221         Use eina_file_path_join and EINA_PATH_SEP_S at platformDefaultIconDatabasePath
222         instead of operator+ and separator "/" respectively
223         to concatenate paths.
224
225         * UIProcess/API/efl/APIWebsiteDataStoreEfl.cpp:
226         * UIProcess/efl/WebProcessPoolEfl.cpp:
227         (WebKit::WebProcessPool::platformDefaultIconDatabasePath):
228
229 2015-12-25  David Kilzer  <ddkilzer@apple.com>
230
231         ResourceError should store failingURL as URL instead of String to avoid reparsing and to address FIXME comments in ResourceErrorCF.cpp and ResourceErrorMac.mm
232         <http://webkit.org/b/146391>
233
234         Reviewed by Antti Koivisto.
235
236         * NetworkProcess/Downloads/efl/DownloadSoupErrorsEfl.cpp:
237         (WebKit::platformDownloadNetworkError):
238         * NetworkProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp:
239         (WebKit::platformDownloadNetworkError):
240         * NetworkProcess/Downloads/soup/DownloadSoup.cpp:
241         (WebKit::DownloadClient::didReceiveResponse):
242         * NetworkProcess/Downloads/soup/DownloadSoupErrors.h:
243         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
244         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
245         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
246         * UIProcess/API/gtk/WebKitLoaderClient.cpp:
247         (LoaderClient::didFailProvisionalLoadWithErrorForFrame):
248         (LoaderClient::didFailLoadWithErrorForFrame):
249         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
250         (webkit_uri_scheme_request_finish_error):
251         * WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp:
252         (WebKit::internalError):
253         * WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp:
254         (WebKit::internalError):
255         - Update for type change of 'failingURL' argument to
256           ResourceError().
257
258 2015-12-23  Simon Fraser  <simon.fraser@apple.com>
259
260         Use "constrainedBetween" in more places
261         https://bugs.webkit.org/show_bug.cgi?id=152543
262
263         Reviewed by Zalan Bujtas.
264
265         Replace code that contrains points via shrunkTo/expandedTo() with calls
266         to constrainedBetween(), and implement constrainedBetween() on IntPoint,
267         FloatPoint and LayoutPoint.
268
269         Convert some functions that return points to more modern syntax.
270
271         * UIProcess/API/Cocoa/WKWebView.mm:
272         (constrainContentOffset):
273
274 2015-12-22  Hunseop Jeong  <hs85.jeong@samsung.com>
275
276         [EFL] ewk_application_cache_manager test failed after r193812
277         https://bugs.webkit.org/show_bug.cgi?id=152498
278
279         Reviewed by Gyuyoung Kim.
280
281         Need to enable the offline_web_application_cache for the ewk_application_cache_manager test.
282
283         * UIProcess/API/efl/tests/test_ewk2_application_cache_manager.cpp:
284         (TEST_F):
285
286 2015-12-22  Andy Estes  <aestes@apple.com>
287
288         [CF] Replace CFNetwork-related WebKitSystemInterface calls with SPI
289         https://bugs.webkit.org/show_bug.cgi?id=152463
290
291         Reviewed by Alexey Proskuryakov.
292
293         Replaced WebkitSystemInterface calls that wrapped CFNetwork SPI with direct calls to SPI that is now forward
294         declared in CFNetworkSPI.h.
295
296         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
297         (WebKit::initializeNetworkSettings):
298         * NetworkProcess/mac/NetworkProcessMac.mm:
299         (WebKit::overrideSystemProxies):
300         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
301         (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts):
302         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
303         (InitWebCoreSystemInterface):
304
305 2015-12-22  Brent Fulgham  <bfulgham@apple.com>
306
307         Allow JavaScript to iterate over plugins for local SecurityOrigins
308         https://bugs.webkit.org/show_bug.cgi?id=152489
309
310         Reviewed by Alexey Proskuryakov.
311
312         The 'getWebVisiblePluginInfo' is filtering plugins, even when we want to list
313         all plugins. To avoid this, we check the Document's SecurityOrigin. If no such
314         origin exists, we construct a SecurityOrigin from the URL.
315         
316         If the relevant SecurityOrigin satsifies 'isLocal', we show all plugins.
317
318         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
319         (WebKit::WebPlatformStrategies::getWebVisiblePluginInfo):
320
321 2015-12-21  Hunseop Jeong  <hs85.jeong@samsung.com>
322
323         [EFL] test_ewk2_context failed after r192808
324         https://bugs.webkit.org/show_bug.cgi?id=151846
325
326         Reviewed by Gyuyoung Kim.
327
328         As we can make the single WebProcess behavior by setting the miximum number
329         of WebProcess to 1 after r192808, I remove the ewk_context_process_model_{set|get}
330         apis and add the ewk_context_web_process_count_limit_{set|get} apis and tests.
331
332         * UIProcess/API/efl/ewk_context.cpp:
333         (EwkContext::EwkContext):
334         (EwkContext::setProcessCountLimit):
335         (EwkContext::processCountLimit):
336         (ewk_context_web_process_count_limit_set):
337         (ewk_context_web_process_count_limit_get):
338         (EwkContext::setProcessModel): Deleted.
339         (EwkContext::processModel): Deleted.
340         (ewk_context_process_model_set): Deleted.
341         (ewk_context_process_model_get): Deleted.
342         * UIProcess/API/efl/ewk_context.h:
343         * UIProcess/API/efl/ewk_context_private.h:
344         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:
345         (EWK2UnitTest::EWK2UnitTestBase::SetUp):
346         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
347         (TEST_F): Changed the ewk_context_{web|network}_process_model tests to
348         ewk_context_{web|network}_process_count_limit tests.
349
350 2015-12-21  Joonghun Park  <jh718.park@samsung.com>
351
352         [WK2][EFL] Use cacheDirectoryFileSystemRepresentation and websiteDataDirectoryFileSystemRepresentation
353         to refactor APIWebsiteDataStoreEfl
354         https://bugs.webkit.org/show_bug.cgi?id=152475
355
356         Reviewed by Gyuyoung Kim.
357
358         Use cacheDirectoryFileSystemRepresentation and websiteDataDirectoryFileSystemRepresentation
359         instead of to use efreet_cache_home_get
360         and efreet_data_home_get directly.
361         And also use EINA_PATH_SEP_S instead of "/" as directory separator,
362         and WebCore::pathByAppendingComponent instead of operator+.
363
364         * UIProcess/API/efl/APIWebsiteDataStoreEfl.cpp:
365         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
366         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
367         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
368         (API::WebsiteDataStore::defaultLocalStorageDirectory):
369         (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
370         (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
371         (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
372         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
373
374 2015-12-21  Antti Koivisto  <antti@apple.com>
375
376         Factor NetworkResourceLoader code for storing a cache entry into a function
377         https://bugs.webkit.org/show_bug.cgi?id=152467
378
379         Reviewed by Andreas Kling.
380
381         * NetworkProcess/NetworkResourceLoader.cpp:
382         (WebKit::NetworkResourceLoader::didFinishLoading):
383
384             Having m_cacheEntryForValidation already implies canUseCache() so remove the test from this path.
385             Move storing to the end of the function so we don't delay DidFinishResourceLoad message on it.
386
387         (WebKit::NetworkResourceLoader::sendBufferMaybeAborting):
388         (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
389
390             Factor to a function.
391             Remove m_response.isHTTP() test as it is covered by NetworkCache::store().
392             Remove !isPrivateSession test as it is covered by NetworkResourceLoader::canUseCache().
393
394         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
395         * NetworkProcess/NetworkResourceLoader.h:
396
397 2015-12-21  Antti Koivisto  <antti@apple.com>
398
399         Limit cached redirect chain length
400         https://bugs.webkit.org/show_bug.cgi?id=152477
401
402         Reviewed by Andreas Kling.
403
404         Networking layer prevents cycles and limits the redirect chain length so creating cache cycles is difficult.
405         For robustness the network cache should still limit the maximum redirect chain length.
406
407         This patch adds a limit of five redirects both when storing and retrieving cache entries.
408
409         * NetworkProcess/NetworkResourceLoader.cpp:
410         (WebKit::NetworkResourceLoader::canUseCache):
411         (WebKit::NetworkResourceLoader::canUseCachedRedirect):
412         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
413         (WebKit::NetworkResourceLoader::continueWillSendRequest):
414         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
415         * NetworkProcess/NetworkResourceLoader.h:
416
417 2015-12-21  Dan Bernstein  <mitz@apple.com>
418
419         Different and incorrect flags are passed to sendSync when accessibility is enabled, SpinRunLoopWhileWaitingForReply
420         https://bugs.webkit.org/show_bug.cgi?id=126021
421
422         Reviewed by Darin Adler.
423
424         Get rid of SpinRunLoopWhileWaitingForReply because it’s not used anymore.
425
426         * Platform/IPC/Connection.cpp:
427         (IPC::Connection::waitForSyncReply): Removed the SpinRunLoopWhileWaitingForReply branch.
428
429         * Platform/IPC/Connection.h: Removed SpinRunLoopWhileWaitingForReply.
430
431         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
432         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel): Don’t check
433           WebPage::synchronousMessagesShouldSpinRunLoop() and don’t specify
434           SpinRunLoopWhileWaitingForReply.
435         (WebKit::WebChromeClient::runJavaScriptAlert): Ditto.
436         (WebKit::WebChromeClient::runJavaScriptConfirm): Ditto.
437         (WebKit::WebChromeClient::runJavaScriptPrompt): Ditto.
438         (WebKit::WebChromeClient::print): Ditto.
439         (WebKit::WebChromeClient::exceededDatabaseQuota): Ditto.
440         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota): Ditto.
441
442         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
443         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): Ditto.
444
445         * WebProcess/WebPage/WebPage.cpp:
446         (WebKit::WebPage::synchronousMessagesShouldSpinRunLoop): Deleted.
447         * WebProcess/WebPage/WebPage.h:
448
449 2015-12-20  Joonghun Park  <jh718.park@samsung.com>
450
451         [WK2][EFL] Use WebsiteDataStore instead of WebDatabaseManager which has been deleted in r194295
452         https://bugs.webkit.org/show_bug.cgi?id=152460
453
454         Reviewed by Gyuyoung Kim.
455
456         Use WebsiteDataStore to support EFL WebDatabase API and to fix build break.
457
458         * PlatformEfl.cmake:
459         * UIProcess/API/APIWebsiteDataStore.cpp:
460         * UIProcess/API/efl/APIWebsiteDataStoreEfl.cpp: Copied from Source/WebKit2/UIProcess/API/APIWebsiteDataStore.cpp.
461         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
462         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
463         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
464         (API::WebsiteDataStore::defaultLocalStorageDirectory):
465         (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
466         (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
467         (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
468         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
469         (API::WebsiteDataStore::defaultDataStoreConfiguration):
470         * UIProcess/API/efl/ewk_context.cpp:
471         (EwkContext::EwkContext):
472         * UIProcess/API/efl/ewk_database_manager.cpp:
473         (EwkDatabaseManager::EwkDatabaseManager):
474         (EwkDatabaseManager::getDatabaseOrigins):
475         * UIProcess/API/efl/ewk_database_manager_private.h:
476         * UIProcess/efl/WebProcessPoolEfl.cpp:
477         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory):
478         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
479         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
480         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
481         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
482         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
483
484 2015-12-20  Dan Bernstein  <mitz@apple.com>
485
486         Remove unused setToolbarHeight
487         https://bugs.webkit.org/show_bug.cgi?id=152466
488
489         Reviewed by Darin Adler.
490
491         * UIProcess/WebInspectorProxy.cpp:
492         (WebKit::WebInspectorProxy::platformSetToolbarHeight): Deleted.
493         * UIProcess/WebInspectorProxy.h:
494         (WebKit::WebInspectorProxy::setToolbarHeight): Deleted.
495         * UIProcess/WebInspectorProxy.messages.in:
496         * UIProcess/efl/WebInspectorProxyEfl.cpp:
497         (WebKit::WebInspectorProxy::platformSetToolbarHeight): Deleted.
498         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
499         (WebKit::WebInspectorProxy::platformSetToolbarHeight): Deleted.
500         * UIProcess/mac/WebInspectorProxyMac.mm:
501         (WebKit::WebInspectorProxy::platformSetToolbarHeight): Deleted.
502         * WebProcess/WebPage/WebInspectorUI.cpp:
503         (WebKit::WebInspectorUI::setToolbarHeight): Deleted.
504         * WebProcess/WebPage/WebInspectorUI.h:
505
506 2015-12-19  Dan Bernstein  <mitz@apple.com>
507
508         [Mac] WebKit contains dead source code for OS X Mavericks and earlier
509         https://bugs.webkit.org/show_bug.cgi?id=152462
510
511         Reviewed by Alexey Proskuryakov.
512
513         - Removed build setting definitions for OS X 10.9 and earlier, and simplified defintions
514           that became uniform across all OS X versions as a result:
515
516         * Configurations/BaseTarget.xcconfig:
517         * Configurations/BaseXPCService.xcconfig:
518         * Configurations/DebugRelease.xcconfig:
519         * Configurations/FeatureDefines.xcconfig:
520         * Configurations/Version.xcconfig:
521         * Configurations/WebKit.xcconfig:
522
523         - Removed the definition of BUNDLE_LOCALIZATION_KEY:
524
525         * Configurations/WebContentService.Development.xcconfig:
526         * Configurations/WebContentService.xcconfig:
527
528         - Added CFBundleFollowParentLocalization set to true:
529
530         * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-OSX.plist:
531         * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-iOS.plist:
532         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist:
533         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
534         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:
535
536         * WebKit2.xcodeproj/project.pbxproj: Removed the “Add CFBundle Localization Info.plist Key”
537           script build phases from the Web Content Service targets.
538
539         - Simplified expressions involving __MAC_OS_X_VERSION_MIN_REQUIRED and removed code that was
540           never getting compiled:
541
542         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
543         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
544         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
545         * Platform/IPC/mac/ConnectionMac.mm:
546         * Platform/IPC/mac/ImportanceAssertion.h:
547         * Platform/mac/MenuUtilities.h:
548         * Platform/mac/MenuUtilities.mm:
549         * Platform/mac/StringUtilities.h:
550         * Platform/mac/StringUtilities.mm:
551         * Shared/API/Cocoa/WKFoundation.h:
552         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
553         * UIProcess/API/Cocoa/WKViewPrivate.h:
554         * UIProcess/API/Cocoa/WKWebView.mm:
555         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
556         * UIProcess/API/mac/WKView.mm:
557         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
558         * UIProcess/Cocoa/WebViewImpl.h:
559         * UIProcess/Cocoa/WebViewImpl.mm:
560         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
561         * UIProcess/mac/PageClientImpl.mm:
562         * UIProcess/mac/WKImmediateActionController.h:
563         * UIProcess/mac/WKImmediateActionController.mm:
564         * UIProcess/mac/WebInspectorProxyMac.mm:
565         * WebProcess/WebPage/FindController.cpp:
566         * WebProcess/WebPage/WebPage.cpp:
567         * WebProcess/com.apple.WebProcess.sb.in:
568         * config.h:
569
570 2015-12-18  Antti Koivisto  <antti@apple.com>
571
572         Cache redirects as separate entries
573         https://bugs.webkit.org/show_bug.cgi?id=152424
574
575         Reviewed by Alex Christensen.
576
577         We are currently caching redirect chains. This has correctness issues and can be inefficient in cases
578         where multiple URLs redirect to the same destination.
579
580         After this patch we write a cache entry for each redirect individually.
581
582         * NetworkProcess/NetworkLoad.cpp:
583         (WebKit::NetworkLoad::sharedWillSendRedirectedRequest):
584         * NetworkProcess/NetworkLoad.h:
585         (WebKit::NetworkLoad::currentRequest):
586         (WebKit::NetworkLoad::clearCurrentRequest):
587         * NetworkProcess/NetworkLoadClient.h:
588
589             Add original request as a parameter for willSendRedirectedRequest.
590
591         * NetworkProcess/NetworkResourceLoader.cpp:
592         (WebKit::NetworkResourceLoader::~NetworkResourceLoader):
593         (WebKit::NetworkResourceLoader::canUseCache):
594
595             Factor to a function.
596
597         (WebKit::NetworkResourceLoader::isSynchronous):
598         (WebKit::NetworkResourceLoader::start):
599         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
600
601             Factor to a function.
602             Call dispatchWillSendRequestForCacheEntry for cached redirects.
603
604         (WebKit::NetworkResourceLoader::startNetworkLoad):
605
606             Make this take request as argument instead of always loading originalRequest().
607
608         (WebKit::NetworkResourceLoader::abort):
609         (WebKit::NetworkResourceLoader::didFinishLoading):
610
611             Remove redirect chain code.
612             Store cache entry for current request instead of the original request.
613
614         (WebKit::NetworkResourceLoader::didFailLoading):
615         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
616
617             Write cache entry for redirect.
618
619         (WebKit::NetworkResourceLoader::continueWillSendRequest):
620
621             If we are playing back cached redirect continue with another cache lookup.
622
623         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
624
625             No need to synthesize fake willSendRequest anymore.
626
627         (WebKit::NetworkResourceLoader::validateCacheEntry):
628         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
629
630             Route via web process willSendRequest so cached redirects looks exactly like network ones.
631
632         (WebKit::NetworkResourceLoader::messageSenderConnection):
633         * NetworkProcess/NetworkResourceLoader.h:
634         * NetworkProcess/cache/NetworkCache.cpp:
635         (WebKit::NetworkCache::makeUseDecision):
636
637             Ignore validation headers for cached redirects.
638
639         (WebKit::NetworkCache::makeRetrieveDecision):
640         (WebKit::NetworkCache::makeStoreDecision):
641         (WebKit::NetworkCache::Cache::retrieve):
642         (WebKit::NetworkCache::Cache::store):
643
644             Rename originalRequest -> request since it is not really the original request anymore in all cases.
645
646         (WebKit::NetworkCache::Cache::storeRedirect):
647
648             Stored redirects include the network layer generated ResourceRequest instead of body data.
649
650         (WebKit::NetworkCache::Cache::update):
651         * NetworkProcess/cache/NetworkCache.h:
652         * NetworkProcess/cache/NetworkCacheEntry.cpp:
653         (WebKit::NetworkCache::Entry::Entry):
654
655             New constructor for making redirect entries.
656
657         (WebKit::NetworkCache::Entry::encodeAsStorageRecord):
658         (WebKit::NetworkCache::Entry::decodeStorageRecord):
659
660             Encoding support.
661
662         * NetworkProcess/cache/NetworkCacheEntry.h:
663         (WebKit::NetworkCache::Entry::varyingRequestHeaders):
664         (WebKit::NetworkCache::Entry::redirectRequest):
665         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
666         (WebKit::NetworkCache::SpeculativeLoad::~SpeculativeLoad):
667         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
668         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
669         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
670         (WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
671
672 2015-12-18  Michael Catanzaro  <mcatanzaro@igalia.com>
673
674         Avoid triggering clang's -Wundefined-bool-conversion
675         https://bugs.webkit.org/show_bug.cgi?id=152408
676
677         Reviewed by Mark Lam.
678
679         Use ASSERT_THIS_GC_OBJECT_INHERITS where needed.
680
681         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
682         (WebKit::JSNPObject::callMethod):
683         (WebKit::JSNPObject::callObject):
684         (WebKit::JSNPObject::callConstructor):
685         (WebKit::JSNPObject::deleteProperty):
686
687 2015-12-15  Anders Carlsson  <andersca@apple.com>
688
689         Get rid of WebDatabaseManager, it's been replaced by WebsiteDataStore
690         https://bugs.webkit.org/show_bug.cgi?id=152318
691
692         Reviewed by Tim Horton.
693
694         Build fixes by Ossy.
695
696         * DerivedSources.make:
697         * Shared/API/APIObject.h:
698         * Shared/API/c/WKBase.h:
699         * UIProcess/API/C/WKAPICast.h:
700         * UIProcess/API/C/WKContext.cpp:
701         (WKContextGetDatabaseManager): Deleted.
702         * UIProcess/API/C/WKContext.h:
703         * UIProcess/API/C/WKDatabaseManager.cpp: Removed.
704         (WKDatabaseManagerGetTypeID): Deleted.
705         (WKDatabaseManagerGetOriginKey): Deleted.
706         (WKDatabaseManagerGetOriginQuotaKey): Deleted.
707         (WKDatabaseManagerGetOriginUsageKey): Deleted.
708         (WKDatabaseManagerGetDatabaseDetailsKey): Deleted.
709         (WKDatabaseManagerGetDatabaseDetailsNameKey): Deleted.
710         (WKDatabaseManagerGetDatabaseDetailsDisplayNameKey): Deleted.
711         (WKDatabaseManagerGetDatabaseDetailsExpectedUsageKey): Deleted.
712         (WKDatabaseManagerGetDatabaseDetailsCurrentUsageKey): Deleted.
713         (WKDatabaseManagerGetDatabaseDetailsCreationTimeKey): Deleted.
714         (WKDatabaseManagerGetDatabaseDetailsModificationTimeKey): Deleted.
715         (WKDatabaseManagerSetClient): Deleted.
716         (WKDatabaseManagerGetDatabasesByOrigin): Deleted.
717         (WKDatabaseManagerGetDatabaseOrigins): Deleted.
718         (WKDatabaseManagerDeleteDatabasesWithNameForOrigin): Deleted.
719         (WKDatabaseManagerDeleteDatabasesForOrigin): Deleted.
720         (WKDatabaseManagerDeleteAllDatabases): Deleted.
721         (WKDatabaseManagerSetQuotaForOrigin): Deleted.
722         * UIProcess/API/C/WKDatabaseManager.h: Removed.
723         * UIProcess/WebDatabaseManagerProxy.cpp: Removed.
724         (WebKit::WebDatabaseManagerProxy::supplementName): Deleted.
725         (WebKit::WebDatabaseManagerProxy::originKey): Deleted.
726         (WebKit::WebDatabaseManagerProxy::originQuotaKey): Deleted.
727         (WebKit::WebDatabaseManagerProxy::originUsageKey): Deleted.
728         (WebKit::WebDatabaseManagerProxy::databaseDetailsKey): Deleted.
729         (WebKit::WebDatabaseManagerProxy::databaseDetailsNameKey): Deleted.
730         (WebKit::WebDatabaseManagerProxy::databaseDetailsDisplayNameKey): Deleted.
731         (WebKit::WebDatabaseManagerProxy::databaseDetailsExpectedUsageKey): Deleted.
732         (WebKit::WebDatabaseManagerProxy::databaseDetailsCurrentUsageKey): Deleted.
733         (WebKit::WebDatabaseManagerProxy::databaseDetailsCreationTimeKey): Deleted.
734         (WebKit::WebDatabaseManagerProxy::databaseDetailsModificationTimeKey): Deleted.
735         (WebKit::WebDatabaseManagerProxy::create): Deleted.
736         (WebKit::WebDatabaseManagerProxy::WebDatabaseManagerProxy): Deleted.
737         (WebKit::WebDatabaseManagerProxy::~WebDatabaseManagerProxy): Deleted.
738         (WebKit::WebDatabaseManagerProxy::initializeClient): Deleted.
739         (WebKit::WebDatabaseManagerProxy::processPoolDestroyed): Deleted.
740         (WebKit::WebDatabaseManagerProxy::processDidClose): Deleted.
741         (WebKit::WebDatabaseManagerProxy::shouldTerminate): Deleted.
742         (WebKit::WebDatabaseManagerProxy::refWebContextSupplement): Deleted.
743         (WebKit::WebDatabaseManagerProxy::derefWebContextSupplement): Deleted.
744         (WebKit::WebDatabaseManagerProxy::getDatabasesByOrigin): Deleted.
745         (WebKit::WebDatabaseManagerProxy::didGetDatabasesByOrigin): Deleted.
746         (WebKit::WebDatabaseManagerProxy::getDatabaseOrigins): Deleted.
747         (WebKit::WebDatabaseManagerProxy::didGetDatabaseOrigins): Deleted.
748         (WebKit::WebDatabaseManagerProxy::deleteDatabaseWithNameForOrigin): Deleted.
749         (WebKit::WebDatabaseManagerProxy::deleteDatabasesForOrigin): Deleted.
750         (WebKit::WebDatabaseManagerProxy::deleteAllDatabases): Deleted.
751         (WebKit::WebDatabaseManagerProxy::setQuotaForOrigin): Deleted.
752         (WebKit::WebDatabaseManagerProxy::didModifyOrigin): Deleted.
753         (WebKit::WebDatabaseManagerProxy::didModifyDatabase): Deleted.
754         * UIProcess/WebDatabaseManagerProxy.h: Removed.
755         * UIProcess/WebDatabaseManagerProxy.messages.in: Removed.
756         * UIProcess/WebDatabaseManagerProxyClient.cpp: Removed.
757         (WebKit::WebDatabaseManagerProxyClient::didModifyOrigin): Deleted.
758         (WebKit::WebDatabaseManagerProxyClient::didModifyDatabase): Deleted.
759         * UIProcess/WebDatabaseManagerProxyClient.h: Removed.
760         * UIProcess/WebProcessPool.cpp:
761         * WebKit2.xcodeproj/project.pbxproj:
762         * WebProcess/InjectedBundle/InjectedBundle.cpp:
763         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp: Removed.
764         (WebKit::WebDatabaseManager::supplementName): Deleted.
765         (WebKit::WebDatabaseManager::WebDatabaseManager): Deleted.
766         (WebKit::WebDatabaseManager::initialize): Deleted.
767         (WebKit::WebDatabaseManager::getDatabasesByOrigin): Deleted.
768         (WebKit::WebDatabaseManager::getDatabaseOrigins): Deleted.
769         (WebKit::WebDatabaseManager::deleteDatabaseWithNameForOrigin): Deleted.
770         (WebKit::WebDatabaseManager::deleteDatabasesForOrigin): Deleted.
771         (WebKit::WebDatabaseManager::deleteAllDatabases): Deleted.
772         (WebKit::WebDatabaseManager::closeAllDatabases): Deleted.
773         (WebKit::WebDatabaseManager::setQuotaForOrigin): Deleted.
774         (WebKit::WebDatabaseManager::dispatchDidModifyOrigin): Deleted.
775         (WebKit::WebDatabaseManager::dispatchDidModifyDatabase): Deleted.
776         * WebProcess/WebCoreSupport/WebDatabaseManager.h: Removed.
777         * WebProcess/WebCoreSupport/WebDatabaseManager.messages.in: Removed.
778         * WebProcess/WebCoreSupport/ios/WebDatabaseManagerIOS.mm: Removed.
779         (WebKit::WebDatabaseManager::dispatchDidAddNewOrigin): Deleted.
780         (WebKit::WebDatabaseManager::dispatchDidDeleteDatabase): Deleted.
781         (WebKit::WebDatabaseManager::dispatchDidDeleteDatabaseOrigin): Deleted.
782         * WebProcess/WebProcess.cpp:
783         (WebKit::WebProcess::processWillSuspendImminently):
784         (WebKit::m_webSQLiteDatabaseTracker): Deleted.
785
786 2015-12-18  Michael Catanzaro  <mcatanzaro@igalia.com>
787
788         [GTK] Unreviewed, fix GtkDoc after r193620
789
790         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
791
792 2015-12-18  Dan Bernstein  <mitz@apple.com>
793
794         WebPage::didCompleteUserMediaPermissionCheck and WebPage::didReceiveUserMediaPermissionDecision are exported
795         https://bugs.webkit.org/show_bug.cgi?id=152429
796
797         Reviewed by Tim Horton.
798
799         * WebProcess/WebPage/WebPage.h: Removed WK_EXPORT specifiers from these two declarations.
800
801 2015-12-18  Alex Christensen  <achristensen@webkit.org>
802
803         Move networking code from Shared to NetworkProcess
804         https://bugs.webkit.org/show_bug.cgi?id=152421
805
806         Reviewed by Antti Koivisto.
807
808         Since recently removing the non-NetworkProcess configurations, this code is no longer shared with the WebProcess.
809
810         * CMakeLists.txt:
811         * DerivedSources.make:
812         * NetworkProcess/CustomProtocols: Copied from Source/WebKit2/Shared/Network/CustomProtocols.
813         * NetworkProcess/Downloads: Copied from Source/WebKit2/Shared/Downloads.
814         * NetworkProcess/Downloads/Download.cpp: Copied from Source/WebKit2/Shared/Downloads/Download.cpp.
815         * NetworkProcess/Downloads/Download.h: Copied from Source/WebKit2/Shared/Downloads/Download.h.
816         * NetworkProcess/Downloads/DownloadID.h: Copied from Source/WebKit2/Shared/Downloads/DownloadID.h.
817         * NetworkProcess/Downloads/DownloadManager.cpp: Copied from Source/WebKit2/Shared/Downloads/DownloadManager.cpp.
818         * NetworkProcess/Downloads/DownloadManager.h: Copied from Source/WebKit2/Shared/Downloads/DownloadManager.h.
819         * NetworkProcess/NetworkProcessCreationParameters.cpp: Copied from Source/WebKit2/Shared/Network/NetworkProcessCreationParameters.cpp.
820         * NetworkProcess/NetworkProcessCreationParameters.h: Copied from Source/WebKit2/Shared/Network/NetworkProcessCreationParameters.h.
821         * NetworkProcess/NetworkProcessSupplement.h: Copied from Source/WebKit2/Shared/Network/NetworkProcessSupplement.h.
822         * NetworkProcess/NetworkResourceLoadParameters.cpp: Copied from Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.cpp.
823         * NetworkProcess/NetworkResourceLoadParameters.h: Copied from Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.h.
824         * PlatformEfl.cmake:
825         * PlatformGTK.cmake:
826         * PlatformMac.cmake:
827         * Shared/Downloads: Removed.
828         * Shared/Downloads/Download.cpp: Removed.
829         * Shared/Downloads/Download.h: Removed.
830         * Shared/Downloads/DownloadAuthenticationClient.cpp: Removed.
831         * Shared/Downloads/DownloadAuthenticationClient.h: Removed.
832         * Shared/Downloads/DownloadID.h: Removed.
833         * Shared/Downloads/DownloadManager.cpp: Removed.
834         * Shared/Downloads/DownloadManager.h: Removed.
835         * Shared/Downloads/cocoa: Removed.
836         * Shared/Downloads/cocoa/DownloadCocoa.mm: Removed.
837         * Shared/Downloads/efl: Removed.
838         * Shared/Downloads/efl/DownloadSoupErrorsEfl.cpp: Removed.
839         * Shared/Downloads/gtk: Removed.
840         * Shared/Downloads/gtk/DownloadSoupErrorsGtk.cpp: Removed.
841         * Shared/Downloads/ios: Removed.
842         * Shared/Downloads/ios/DownloadIOS.mm: Removed.
843         * Shared/Downloads/mac: Removed.
844         * Shared/Downloads/mac/DownloadMac.mm: Removed.
845         * Shared/Downloads/soup: Removed.
846         * Shared/Downloads/soup/DownloadSoup.cpp: Removed.
847         * Shared/Downloads/soup/DownloadSoupErrors.h: Removed.
848         * Shared/Network: Removed.
849         * Shared/Network/CustomProtocols: Removed.
850         * Shared/Network/CustomProtocols/Cocoa: Removed.
851         * Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm: Removed.
852         * Shared/Network/CustomProtocols/CustomProtocolManager.h: Removed.
853         * Shared/Network/CustomProtocols/CustomProtocolManager.messages.in: Removed.
854         * Shared/Network/CustomProtocols/soup: Removed.
855         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.cpp: Removed.
856         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.h: Removed.
857         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp: Removed.
858         * Shared/Network/NetworkProcessCreationParameters.cpp: Removed.
859         * Shared/Network/NetworkProcessCreationParameters.h: Removed.
860         * Shared/Network/NetworkProcessSupplement.h: Removed.
861         * Shared/Network/NetworkResourceLoadParameters.cpp: Removed.
862         * Shared/Network/NetworkResourceLoadParameters.h: Removed.
863         * WebKit2.xcodeproj/project.pbxproj:
864
865 2015-12-18  Michael Catanzaro  <mcatanzaro@igalia.com>
866
867         LayerTreeHostGtk triggers -Wunused-private-field
868         https://bugs.webkit.org/show_bug.cgi?id=152410
869
870         Reviewed by Carlos Garcia Campos.
871
872         Remove the unused member variable.
873
874         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
875
876 2015-12-18  Alex Christensen  <achristensen@webkit.org>
877
878         Add types for DownloadID and TaskIdentifier
879         https://bugs.webkit.org/show_bug.cgi?id=152401
880
881         Reviewed by Brady Eidson.
882
883         DownloadID and TaskIdentifier used to both be just uint64_t's.
884         It is confusing to distinguish between them, so now they both have names.
885         We need a HashMap<TaskIdentifier, DownloadID> instead of a HashMap<uint64_t, uint64_t>.
886
887         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
888         (WebKit::storageSession):
889         (WebKit::NetworkConnectionToWebProcess::startDownload):
890         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
891         * NetworkProcess/NetworkConnectionToWebProcess.h:
892         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
893         * NetworkProcess/NetworkProcess.cpp:
894         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
895         (WebKit::NetworkProcess::downloadRequest):
896         (WebKit::NetworkProcess::resumeDownload):
897         (WebKit::NetworkProcess::cancelDownload):
898         (WebKit::NetworkProcess::getNetworkProcessStatistics):
899         (WebKit::NetworkProcess::logDiagnosticMessage):
900         (WebKit::NetworkProcess::logDiagnosticMessageWithResult):
901         (WebKit::NetworkProcess::logDiagnosticMessageWithValue):
902         * NetworkProcess/NetworkProcess.h:
903         * NetworkProcess/NetworkProcess.messages.in:
904         * NetworkProcess/NetworkSession.h:
905         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
906         (WebKit::NetworkSession::createDataTaskWithRequest):
907         (WebKit::NetworkSession::dataTaskForIdentifier):
908         (WebKit::NetworkDataTask::resume):
909         (WebKit::NetworkDataTask::taskIdentifier): Deleted.
910         * Shared/Downloads/Download.cpp:
911         (WebKit::Download::Download):
912         (WebKit::Download::messageSenderDestinationID):
913         * Shared/Downloads/Download.h:
914         (WebKit::Download::downloadID):
915         * Shared/Downloads/DownloadID.h: Added.
916         (WebKit::DownloadID::DownloadID):
917         (WebKit::DownloadID::operator==):
918         (WebKit::DownloadID::downloadID):
919         (IPC::ArgumentCoder<WebKit::DownloadID>::encode):
920         (IPC::ArgumentCoder<WebKit::DownloadID>::decode):
921         (WTF::DownloadIDHash::hash):
922         (WTF::DownloadIDHash::equal):
923         (WTF::HashTraits<WebKit::DownloadID>::emptyValue):
924         (WTF::HashTraits<WebKit::DownloadID>::constructDeletedValue):
925         (WTF::HashTraits<WebKit::DownloadID>::isDeletedValue):
926         * Shared/Downloads/DownloadManager.cpp:
927         (WebKit::DownloadManager::DownloadManager):
928         (WebKit::DownloadManager::startDownload):
929         (WebKit::DownloadManager::convertHandleToDownload):
930         (WebKit::DownloadManager::resumeDownload):
931         (WebKit::DownloadManager::cancelDownload):
932         * Shared/Downloads/DownloadManager.h:
933         (WebKit::DownloadManager::isDownloading):
934         * UIProcess/API/C/WKDownload.cpp:
935         (WKDownloadGetID):
936         (WKDownloadCopyRequest):
937         * UIProcess/Downloads/DownloadProxy.h:
938         (WebKit::DownloadProxy::downloadID):
939         (WebKit::DownloadProxy::request):
940         (WebKit::DownloadProxy::resumeData):
941         * UIProcess/Downloads/DownloadProxyMap.cpp:
942         (WebKit::DownloadProxyMap::createDownloadProxy):
943         (WebKit::DownloadProxyMap::downloadFinished):
944         (WebKit::DownloadProxyMap::processDidClose):
945         * UIProcess/Downloads/DownloadProxyMap.h:
946         * UIProcess/WebPageProxy.cpp:
947         (WebKit::WebPageProxy::receivedPolicyDecision):
948         (WebKit::WebPageProxy::frameDidBecomeFrameSet):
949         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
950         (WebKit::WebPageProxy::decidePolicyForResponse):
951         (WebKit::WebPageProxy::decidePolicyForResponseSync):
952         * UIProcess/WebPageProxy.h:
953         * UIProcess/WebPageProxy.messages.in:
954         * WebKit2.xcodeproj/project.pbxproj:
955         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
956         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
957         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
958         * WebProcess/WebPage/WebFrame.cpp:
959         (WebKit::WebFrame::invalidatePolicyListener):
960         (WebKit::WebFrame::didReceivePolicyDecision):
961         (WebKit::WebFrame::startDownload):
962         (WebKit::WebFrame::convertMainResourceLoadToDownload):
963         * WebProcess/WebPage/WebFrame.h:
964         * WebProcess/WebPage/WebPage.cpp:
965         (WebKit::WebPage::setSessionID):
966         (WebKit::WebPage::didReceivePolicyDecision):
967         * WebProcess/WebPage/WebPage.h:
968         * WebProcess/WebPage/WebPage.messages.in:
969
970 2015-12-17  Dan Bernstein  <mitz@apple.com>
971
972         Fixed a typo from r194022.
973
974         * Configurations/WebKit.xcconfig: Changed PlugInProcessShim.dylib to PluginProcessShim.dylib.
975
976 2015-12-17  Commit Queue  <commit-queue@webkit.org>
977
978         Unreviewed, rolling out r194250 and r194254.
979         https://bugs.webkit.org/show_bug.cgi?id=152414
980
981         broke api tests (Requested by alexchristensen on #webkit).
982
983         Reverted changesets:
984
985         "Add types for DownloadID and TaskIdentifier"
986         https://bugs.webkit.org/show_bug.cgi?id=152401
987         http://trac.webkit.org/changeset/194250
988
989         "Build fix after r194250"
990         http://trac.webkit.org/changeset/194254
991
992 2015-12-17  Alex Christensen  <achristensen@webkit.org>
993
994         Build fix after r194250
995
996         * WebKit2.xcodeproj/project.pbxproj:
997         Change target membership from all to WebKit.
998
999 2015-12-17  Alex Christensen  <achristensen@webkit.org>
1000
1001         Add types for DownloadID and TaskIdentifier
1002         https://bugs.webkit.org/show_bug.cgi?id=152401
1003
1004         Reviewed by Brady Eidson.
1005
1006         DownloadID and TaskIdentifier used to both be just uint64_t's.
1007         It is confusing to distinguish between them, so now they both have names.
1008         We need a HashMap<TaskIdentifier, DownloadID> instead of a HashMap<uint64_t, uint64_t>.
1009
1010         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1011         (WebKit::storageSession):
1012         (WebKit::NetworkConnectionToWebProcess::startDownload):
1013         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
1014         * NetworkProcess/NetworkConnectionToWebProcess.h:
1015         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1016         * NetworkProcess/NetworkProcess.cpp:
1017         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
1018         (WebKit::NetworkProcess::downloadRequest):
1019         (WebKit::NetworkProcess::resumeDownload):
1020         (WebKit::NetworkProcess::cancelDownload):
1021         (WebKit::NetworkProcess::getNetworkProcessStatistics):
1022         (WebKit::NetworkProcess::logDiagnosticMessage):
1023         (WebKit::NetworkProcess::logDiagnosticMessageWithResult):
1024         (WebKit::NetworkProcess::logDiagnosticMessageWithValue):
1025         * NetworkProcess/NetworkProcess.h:
1026         * NetworkProcess/NetworkProcess.messages.in:
1027         * NetworkProcess/NetworkSession.h:
1028         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1029         (WebKit::NetworkSession::createDataTaskWithRequest):
1030         (WebKit::NetworkSession::dataTaskForIdentifier):
1031         (WebKit::NetworkDataTask::resume):
1032         (WebKit::NetworkDataTask::taskIdentifier): Deleted.
1033         * Shared/Downloads/Download.cpp:
1034         (WebKit::Download::Download):
1035         (WebKit::Download::messageSenderDestinationID):
1036         * Shared/Downloads/Download.h:
1037         (WebKit::Download::downloadID):
1038         * Shared/Downloads/DownloadID.h: Added.
1039         (WebKit::DownloadID::DownloadID):
1040         (WebKit::DownloadID::operator==):
1041         (WebKit::DownloadID::downloadID):
1042         (IPC::ArgumentCoder<WebKit::DownloadID>::encode):
1043         (IPC::ArgumentCoder<WebKit::DownloadID>::decode):
1044         (WTF::DownloadIDHash::hash):
1045         (WTF::DownloadIDHash::equal):
1046         (WTF::HashTraits<WebKit::DownloadID>::emptyValue):
1047         (WTF::HashTraits<WebKit::DownloadID>::constructDeletedValue):
1048         (WTF::HashTraits<WebKit::DownloadID>::isDeletedValue):
1049         * Shared/Downloads/DownloadManager.cpp:
1050         (WebKit::DownloadManager::DownloadManager):
1051         (WebKit::DownloadManager::startDownload):
1052         (WebKit::DownloadManager::convertHandleToDownload):
1053         (WebKit::DownloadManager::resumeDownload):
1054         (WebKit::DownloadManager::cancelDownload):
1055         * Shared/Downloads/DownloadManager.h:
1056         (WebKit::DownloadManager::isDownloading):
1057         * UIProcess/API/C/WKDownload.cpp:
1058         (WKDownloadGetID):
1059         (WKDownloadCopyRequest):
1060         * UIProcess/Downloads/DownloadProxy.h:
1061         (WebKit::DownloadProxy::downloadID):
1062         (WebKit::DownloadProxy::request):
1063         (WebKit::DownloadProxy::resumeData):
1064         * UIProcess/Downloads/DownloadProxyMap.cpp:
1065         (WebKit::DownloadProxyMap::createDownloadProxy):
1066         (WebKit::DownloadProxyMap::downloadFinished):
1067         (WebKit::DownloadProxyMap::processDidClose):
1068         * UIProcess/Downloads/DownloadProxyMap.h:
1069         * UIProcess/WebPageProxy.cpp:
1070         (WebKit::WebPageProxy::receivedPolicyDecision):
1071         (WebKit::WebPageProxy::frameDidBecomeFrameSet):
1072         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1073         (WebKit::WebPageProxy::decidePolicyForResponse):
1074         (WebKit::WebPageProxy::decidePolicyForResponseSync):
1075         * UIProcess/WebPageProxy.h:
1076         * UIProcess/WebPageProxy.messages.in:
1077         * WebKit2.xcodeproj/project.pbxproj:
1078         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1079         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1080         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1081         * WebProcess/WebPage/WebFrame.cpp:
1082         (WebKit::WebFrame::invalidatePolicyListener):
1083         (WebKit::WebFrame::didReceivePolicyDecision):
1084         (WebKit::WebFrame::startDownload):
1085         (WebKit::WebFrame::convertMainResourceLoadToDownload):
1086         * WebProcess/WebPage/WebFrame.h:
1087         * WebProcess/WebPage/WebPage.cpp:
1088         (WebKit::WebPage::setSessionID):
1089         (WebKit::WebPage::didReceivePolicyDecision):
1090         * WebProcess/WebPage/WebPage.h:
1091         * WebProcess/WebPage/WebPage.messages.in:
1092
1093 2015-12-17  Simon Fraser  <simon.fraser@apple.com>
1094
1095         Disable viewport "shrink to fit" outside of multitasking mode
1096         https://bugs.webkit.org/show_bug.cgi?id=152403
1097         rdar://problem/23818102
1098
1099         Reviewed by Tim Horton.
1100         
1101         Plumb through a value that indicates whether the WKWebView is in split screen,
1102         and use it to conditionally enable shrink-to-fit mode only in split screen.
1103         
1104         * Shared/VisibleContentRectUpdateInfo.cpp: Added m_allowShrinkToFit, and sort
1105         the member variables, and encoding order, to optimize packing, with some initializers.
1106         (WebKit::VisibleContentRectUpdateInfo::encode):
1107         (WebKit::VisibleContentRectUpdateInfo::decode):
1108         * Shared/VisibleContentRectUpdateInfo.h:
1109         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
1110         (WebKit::VisibleContentRectUpdateInfo::allowShrinkToFit):
1111         (WebKit::operator==):
1112         * UIProcess/API/Cocoa/WKWebView.mm: Add _allowsViewportShrinkToFit member variable,
1113         with getter and setter.
1114         (-[WKWebView _updateVisibleContentRects]): Unwrap the line.
1115         (-[WKWebView _setAllowsViewportShrinkToFit:]):
1116         (-[WKWebView _allowsViewportShrinkToFit]):
1117         * UIProcess/API/Cocoa/WKWebViewPrivate.h: _allowsViewportShrinkToFit SPI.
1118         * UIProcess/WebPageProxy.h: Pass allowShrinkToFit through.
1119         * UIProcess/ios/WKContentView.mm: Ditto.
1120         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
1121         * UIProcess/ios/WebPageProxyIOS.mm:
1122         (WebKit::WebPageProxy::updateVisibleContentRects): Padd allowShrinkToFit to the web process via the VisibleContentRectUpdateInfo.
1123         * WebProcess/WebPage/WebPage.cpp:
1124         (WebKit::WebPage::updatePreferences): Store m_ignoreViewportScalingConstraints in a member variable since we can't
1125         get back to the prefs later.
1126         * WebProcess/WebPage/WebPage.h:
1127         * WebProcess/WebPage/ios/WebPageIOS.mm:
1128         (WebKit::WebPage::updateVisibleContentRects): This is the behavior change: call setCanIgnoreScalingConstraints()
1129         on the viewport configuration, consulting the pref (via m_ignoreViewportScalingConstraints) and the new
1130         visibleContentRectUpdateInfo.allowShrinkToFit().
1131
1132 2015-12-16  Simon Fraser  <simon.fraser@apple.com>
1133
1134         ViewportConfiguration functions should return a bool to say if anything changed
1135         https://bugs.webkit.org/show_bug.cgi?id=152353
1136
1137         Reviewed by Tim Horton.
1138
1139         Rather than callers all checking whether setting ViewportConfiguration values
1140         changes state, have its functions return a bool if the values change.
1141
1142         * WebProcess/WebPage/WebPage.cpp:
1143         (WebKit::WebPage::mainFrameDidLayout):
1144         (WebKit::WebPage::didCommitLoad):
1145         * WebProcess/WebPage/ios/WebPageIOS.mm:
1146         (WebKit::WebPage::viewportPropertiesDidChange):
1147         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
1148
1149 2015-12-16  Alex Christensen  <achristensen@webkit.org>
1150
1151         Progress towards implementing downloads with NetworkSession
1152         https://bugs.webkit.org/show_bug.cgi?id=152371
1153
1154         Reviewed by Darin Adler.
1155
1156         * NetworkProcess/NetworkProcess.cpp:
1157         (WebKit::NetworkProcess::downloadRequest):
1158         (WebKit::NetworkProcess::resumeDownload):
1159         (WebKit::NetworkProcess::cancelDownload):
1160         * NetworkProcess/NetworkProcess.h:
1161         * NetworkProcess/NetworkProcess.messages.in:
1162         * Shared/Authentication/AuthenticationManager.cpp:
1163         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
1164         * Shared/Authentication/AuthenticationManager.h:
1165         * Shared/Downloads/Download.cpp:
1166         (WebKit::Download::Download):
1167         (WebKit::Download::didReceiveAuthenticationChallenge):
1168         * Shared/Downloads/Download.h:
1169         * Shared/Downloads/DownloadManager.cpp:
1170         (WebKit::DownloadManager::startDownload):
1171         (WebKit::DownloadManager::convertHandleToDownload):
1172         (WebKit::DownloadManager::resumeDownload):
1173         (WebKit::DownloadManager::cancelDownload):
1174         (WebKit::DownloadManager::downloadFinished):
1175         (WebKit::DownloadManager::didCreateDownload):
1176         * Shared/Downloads/DownloadManager.h:
1177         * Shared/Downloads/cocoa: Added.
1178         * Shared/Downloads/cocoa/DownloadCocoa.mm: Added.
1179         (WebKit::Download::start):
1180         (WebKit::Download::resume):
1181         (WebKit::Download::cancel):
1182         (WebKit::Download::platformInvalidate):
1183         * Shared/Downloads/ios/DownloadIOS.mm:
1184         * Shared/Downloads/mac/DownloadMac.mm:
1185         (WebKit::Download::start):
1186         (WebKit::Download::startWithHandle):
1187         (WebKit::Download::resume):
1188         * UIProcess/WebProcessPool.cpp:
1189         (WebKit::WebProcessPool::resumeDownload):
1190         * UIProcess/WebProcessPool.h:
1191         * WebKit2.xcodeproj/project.pbxproj:
1192
1193 2015-12-16  Simon Fraser  <simon.fraser@apple.com>
1194
1195         ViewportConfiguration functions should return a bool to say if anything changed
1196         https://bugs.webkit.org/show_bug.cgi?id=152353
1197
1198         Reviewed by Tim Horton.
1199
1200         Rather than callers all checking whether setting ViewportConfiguration values
1201         changes state, have its functions return a bool if the values change.
1202
1203         * WebProcess/WebPage/WebPage.cpp:
1204         (WebKit::WebPage::mainFrameDidLayout):
1205         (WebKit::WebPage::didCommitLoad):
1206         * WebProcess/WebPage/ios/WebPageIOS.mm:
1207         (WebKit::WebPage::viewportPropertiesDidChange):
1208         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
1209
1210 2015-12-16  Tim Horton  <timothy_horton@apple.com>
1211
1212         REGRESSION (r191299): Zoom gestures are enabled even if allowsMagnification=NO
1213         https://bugs.webkit.org/show_bug.cgi?id=152373
1214         <rdar://problem/23931998>
1215
1216         Reviewed by Simon Fraser.
1217
1218         * UIProcess/Cocoa/WebViewImpl.mm:
1219         (WebKit::WebViewImpl::gestureEventWasNotHandledByWebCoreFromViewOnly):
1220         Don't pass the event on to ViewGestureController if we shouldn't handle it,
1221         just like we would have done in magnifyWithEvent before.
1222
1223 2015-12-16  Tim Horton  <timothy_horton@apple.com>
1224
1225         REGRESSION (r194125): Crashes in touchesEndedWithEvent on occasion when interacting with the page
1226         https://bugs.webkit.org/show_bug.cgi?id=152366
1227         <rdar://problem/23929672>
1228
1229         Reviewed by Beth Dakin.
1230
1231         * UIProcess/Cocoa/WebViewImpl.mm:
1232         (WebKit::WebViewImpl::touchesEndedWithEvent):
1233         (WebKit::WebViewImpl::touchesCancelledWithEvent):
1234         NSTouch identifiers aren't pointer-comparable. We need to use isEqual to
1235         compare them and find the ones to remove.
1236
1237 2015-12-16  Simon Fraser  <simon.fraser@apple.com>
1238
1239         Simplify isOverlayScrollbar() logic
1240         https://bugs.webkit.org/show_bug.cgi?id=152357
1241
1242         Reviewed by Beth Dakin.
1243
1244         Replace code that checks for isOverlayScrollbar() explicitly with calls to new
1245         occupiedWidth()/occupiedHeight() functions on Scrollbar, which do the overlay
1246         scrollbar check internally.
1247         
1248         Add ScrollableArea::scrollbarIntrusion() which returns an IntSize with the occupiedWidth
1249         and occupiedHeight of any scrollbars, and use it in a few places.
1250
1251         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1252         (WebKit::PDFPlugin::updateScrollbars):
1253         (WebKit::PDFPlugin::maximumScrollPosition):
1254
1255 2015-12-16  Alex Christensen  <achristensen@webkit.org>
1256
1257         Build fix when using NETWORK_SESSION after r193972.
1258
1259         Rubber-stamped by Joseph Pecoraro.
1260
1261         Renamed NetworkSessionDelegate to WKNetworkSessionDelegate to conform to the 
1262         newly-enforced style rule in check-for-inappropriate-objc-class-names.
1263
1264         * NetworkProcess/NetworkSession.h:
1265         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1266         (toNSURLSessionAuthChallengeDisposition):
1267         (-[WKNetworkSessionDelegate initWithNetworkSession:]):
1268         (WebKit::NetworkSession::NetworkSession):
1269         (-[NetworkSessionDelegate initWithNetworkSession:]): Deleted.
1270
1271 2015-12-16  Alex Christensen  <achristensen@webkit.org>
1272
1273         Implement Web Timing when using NETWORK_SESSION
1274         https://bugs.webkit.org/show_bug.cgi?id=152285
1275
1276         Reviewed by Darin Adler.
1277
1278         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1279         (-[NetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
1280         (WebKit::NetworkSession::NetworkSession):
1281         Use functions moved to ResourceLoadTiming.h.  setCollectsTimingData is for Mavericks, _timingDataOptions is post-Mavericks.
1282
1283 2015-12-16  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1284
1285         [Fetch API] Add fetch API compile time flag
1286         https://bugs.webkit.org/show_bug.cgi?id=152254
1287
1288         Reviewed by Darin Adler.
1289
1290         * Configurations/FeatureDefines.xcconfig:
1291
1292 2015-12-15  Tim Horton  <timothy_horton@apple.com>
1293
1294         [Mac] Gesture Events should not have negative scale
1295         https://bugs.webkit.org/show_bug.cgi?id=151065
1296         <rdar://problem/23474123>
1297
1298         Reviewed by Anders Carlsson.
1299
1300         * Shared/NativeWebGestureEvent.h:
1301         * Shared/mac/NativeWebGestureEventMac.mm:
1302         (WebKit::distanceForTouches):
1303         (WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
1304         Compute the distance between the two oldest touches, and use that as
1305         the scale (really the gesture diameter) on the event, instead of
1306         passing through AppKit's magnification (which is computed differently).
1307         This matches the documented behavior of the existing gesture events on iOS.
1308
1309         * UIProcess/API/Cocoa/WKWebView.mm:
1310         (-[WKWebView touchesBeganWithEvent:]):
1311         (-[WKWebView touchesMovedWithEvent:]):
1312         (-[WKWebView touchesEndedWithEvent:]):
1313         (-[WKWebView touchesCancelledWithEvent:]):
1314         * UIProcess/API/mac/WKView.mm:
1315         (-[WKView touchesBeganWithEvent:]):
1316         (-[WKView touchesMovedWithEvent:]):
1317         (-[WKView touchesEndedWithEvent:]):
1318         (-[WKView touchesCancelledWithEvent:]):
1319         Plumb touch events through to WebViewImpl.
1320
1321         * UIProcess/Cocoa/WebViewImpl.h:
1322         * UIProcess/Cocoa/WebViewImpl.mm:
1323         (WebKit::WebViewImpl::WebViewImpl):
1324         (WebKit::WebViewImpl::magnifyWithEvent):
1325         (WebKit::WebViewImpl::touchesOrderedByAge):
1326         (WebKit::WebViewImpl::touchesBeganWithEvent):
1327         (WebKit::WebViewImpl::touchesMovedWithEvent):
1328         (WebKit::WebViewImpl::touchesEndedWithEvent):
1329         (WebKit::WebViewImpl::touchesCancelledWithEvent):
1330         (WebKit::WebViewImpl::rotateWithEvent):
1331         Keep track of the most recent incoming touches, by identifier, in age order.
1332         Pass them through to NativeWebGestureEvent so it can determine the gesture diameter.
1333
1334 2015-12-15  Anders Carlsson  <andersca@apple.com>
1335
1336         Call DatabaseManager directly from WKBundle.cpp
1337         https://bugs.webkit.org/show_bug.cgi?id=152317
1338
1339         Reviewed by Tim Horton.
1340
1341         This is in preparation for getting rid of some old database manager code.
1342
1343         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1344         (WKBundleClearAllDatabases):
1345         (WKBundleSetDatabaseQuota):
1346         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1347         (WebKit::InjectedBundle::clearAllDatabases): Deleted.
1348         (WebKit::InjectedBundle::setDatabaseQuota): Deleted.
1349         * WebProcess/InjectedBundle/InjectedBundle.h:
1350
1351 2015-12-15  Daniel Bates  <dabates@apple.com>
1352
1353         Guard code that uses class LayerTreeHost with USE(COORDINATED_GRAPHICS) or USE(TEXTURE_MAPPER)
1354         https://bugs.webkit.org/show_bug.cgi?id=152265
1355
1356         Reviewed by Tim Horton.
1357
1358         We neither make use of LayerTreeHost on Mac nor on iOS. We should guard code that makes
1359         use of this class as applicable. This also fixes the iOS Simulator build when using
1360         Apple Internal software.
1361
1362         * WebProcess/WebCoreSupport/WebChromeClient.cpp: Guard code that used LayerTreeHost.
1363         * WebProcess/WebPage/LayerTreeHost.cpp: Guard contents of file with USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER).
1364         * WebProcess/WebPage/LayerTreeHost.h: Ditto.
1365         * WebProcess/WebPage/WebPage.cpp:
1366         (WebKit::WebPage::scalePage): Ditto.
1367         (WebKit::WebPage::setDeviceScaleFactor): Ditto.
1368         * WebProcess/WebPage/WebPage.h: Substitute header LayerTreeContext.h for LayerTreeHost.h since we make use
1369         of the enum class LayerHostingMode.
1370         * WebProcess/WebPage/ios/WebPageIOS.mm:
1371         (WebKit::WebPage::updateVisibleContentRects): Remove unnecessary code; DrawingArea::layerTreeHost() always
1372         returns nullptr on iOS.
1373
1374 2015-12-15  Zan Dobersek  <zdobersek@igalia.com>
1375
1376         [TexMap] Operate with a reference to the TextureMapper wherever possible
1377         https://bugs.webkit.org/show_bug.cgi?id=152118
1378
1379         Reviewed by Martin Robinson.
1380
1381         Replace pointers to the TextureMapper object with references.
1382
1383         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
1384         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
1385         (WebKit::CoordinatedBackingStore::paintTilesToTextureMapper):
1386         (WebKit::CoordinatedBackingStore::paintToTextureMapper):
1387         (WebKit::CoordinatedBackingStore::drawBorder):
1388         (WebKit::CoordinatedBackingStore::drawRepaintCounter):
1389         (WebKit::CoordinatedBackingStore::commitTileOperations):
1390         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
1391         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1392         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
1393         (WebKit::CoordinatedGraphicsScene::paintToGraphicsContext):
1394         (WebKit::CoordinatedGraphicsScene::commitPendingBackingStoreOperations):
1395
1396 2015-12-14  YongGeol Jung  <yg48.jung@samsung.com>
1397
1398         [Coordinated Graphics] CSS transition effect is not shown when transformed with "%" unit.
1399         https://bugs.webkit.org/show_bug.cgi?id=152278
1400
1401         Reviewed by Darin Adler.
1402
1403         boxSize is encoded as FloatSize type but decoded as IntSize type.
1404         So boxSize gets invalid value after decoding.
1405         Due to this layer goes to out of screen during animation.
1406
1407         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
1408         (IPC::ArgumentCoder<TextureMapperAnimation>::decode):
1409
1410 2015-12-14  Dan Bernstein  <mitz@apple.com>
1411
1412         <rdar://problem/23886216> REGRESSION (r194022): Production builds of PluginProcess crash on launch when not installed in /System
1413         https://bugs.webkit.org/show_bug.cgi?id=152291
1414
1415         Reviewed by Darin Adler.
1416
1417         * Configurations/PluginProcess.xcconfig: Added a FIXME.
1418         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1419         (WebKit::addDYLDEnvironmentAdditions): Set DYLD_LIBRARY_PATH to point to where the shims
1420         are. This is needed because starting in El Capitan, the processes’ main executables link
1421         directly against the shims, so the dynamic linker needs to be able to find them in the
1422         non-/System location. Also added a FIXME about not having to set DYLD_INSERT_LIBRARIES when
1423         the main executables link the them directly.
1424
1425 2015-12-14  Simon Fraser  <simon.fraser@apple.com>
1426
1427         Dump some more data in the RemoteLayerTreeTransaction
1428         https://bugs.webkit.org/show_bug.cgi?id=152283
1429
1430         Reviewed by Dean Jackson.
1431         
1432         Dump some scale factors, viewport meta tag width and render tree size.
1433
1434         * Shared/mac/RemoteLayerTreeTransaction.mm:
1435         (WebKit::RemoteLayerTreeTransaction::description):
1436
1437 2015-12-14  Tim Horton  <timothy_horton@apple.com>
1438
1439         Frequent crash under -[WKPDFView web_setMinimumSize:]_block_invoke
1440         https://bugs.webkit.org/show_bug.cgi?id=152266
1441         <rdar://problem/22092676>
1442
1443         Reviewed by Simon Fraser.
1444
1445         * UIProcess/ios/WKPDFView.mm:
1446         (-[WKPDFView web_setMinimumSize:]):
1447         We weren't retaining the UIScrollView, but depending on it surviving
1448         into this block's invocation.
1449
1450         We don't need to do this asynchronously anymore because the referenced
1451         bug is fixed, so make it happen synchronously. This also fixes the crash
1452         because there's no opportunity for the scroll view to be released.
1453
1454 2015-12-14  Tim Horton  <timothy_horton@apple.com>
1455
1456         TiledCoreAnimationDrawingAreaProxy::createFenceForGeometryUpdate() sets fence port on context twice
1457         https://bugs.webkit.org/show_bug.cgi?id=152239
1458         <rdar://problem/22893289>
1459
1460         Reviewed by Darin Adler.
1461
1462         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
1463         (WebKit::TiledCoreAnimationDrawingAreaProxy::createFenceForGeometryUpdate):
1464         No need to setFencePort; createFencePort also installs it on the creating context.
1465
1466 2015-12-12  Alex Christensen  <achristensen@webkit.org>
1467
1468         Use existing code for redirects when using NETWORK_SESSION
1469         https://bugs.webkit.org/show_bug.cgi?id=152207
1470         rdar://problem/23860624
1471
1472         Reviewed by Darin Adler.
1473         
1474         This fixes http/tests/cookies/set-cookie-on-redirect.html when using NETWORK_SESSION.
1475
1476         * NetworkProcess/NetworkLoad.cpp:
1477         (WebKit::NetworkLoad::continueWillSendRequest):
1478         (WebKit::NetworkLoad::convertTaskToDownload):
1479         (WebKit::NetworkLoad::willPerformHTTPRedirection):
1480         (WebKit::NetworkLoad::didReceiveChallenge):
1481         * NetworkProcess/NetworkLoad.h:
1482         * NetworkProcess/NetworkSession.h:
1483
1484 2015-12-13  Tim Horton  <timothy_horton@apple.com>
1485
1486         Adopt CGIOSurfaceContextCreateImageReference to avoid unnecessary readback
1487         https://bugs.webkit.org/show_bug.cgi?id=150988
1488         <rdar://problem/18993594>
1489
1490         Reviewed by Darin Adler.
1491
1492         * WebProcess/WebPage/WebFrame.cpp:
1493         (WebKit::WebFrame::createSelectionSnapshot):
1494         Adopt sinkIntoImage and drawConsumingImageBuffer in a few places.
1495
1496 2015-12-13  Dan Bernstein  <mitz@apple.com>
1497
1498         Another fix after r194018.
1499
1500         * Configurations/BaseTarget.xcconfig:
1501         * Configurations/BaseXPCService.xcconfig:
1502
1503 2015-12-13  Dan Bernstein  <mitz@apple.com>
1504
1505         [Mac] Shims used by XPC services are installed inside legacy process bundles
1506         https://bugs.webkit.org/show_bug.cgi?id=152233
1507
1508         Reviewed by Sam Weinig.
1509
1510         Have the shim dylibs installed in the framework’s Frameworks directory instead.
1511
1512         * Configurations/BaseLegacyProcess.xcconfig: Simplified now that EXCLUDED_SHIM_FILE_NAME is
1513           no longer defined, because shims aren’t copied into legacy processes.
1514
1515         * Configurations/NetworkProcess.xcconfig: Removed definition of EXCLUDED_SHIM_FILE_NAME.
1516         * Configurations/PluginProcess.xcconfig: Ditto.
1517         * Configurations/WebContentProcess.xcconfig: Ditto.
1518
1519         * Configurations/Shim.xcconfig: Install the shims when building for OS X. Added definitions
1520           of INSTALL_PATH and DYLIB_INSTALL_NAME_BASE which are now common to all shims.
1521
1522         * Configurations/PluginProcessShim.xcconfig: Removed definitions of INSTALL_PATH and
1523           DYLIB_INSTALL_NAME_BASE from here, now that they are defined for all shims in
1524           Shim.xcconfig.
1525         * Configurations/SecItemShim.xcconfig: Ditto.
1526         * Configurations/WebProcessShim.xcconfig:
1527
1528         * Configurations/WebKit.xcconfig: Added the shims to EXCLUDED_SOURCE_FILE_NAMES for iOS.
1529
1530         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist: Changed
1531           the value of DYLD_INSERT_LIBRARIES to point to the shim’s new location.
1532         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist: Ditto.
1533         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist: Ditto.
1534
1535         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1536         (WebKit::computeProcessShimPath): Changed to return the new paths, which are all inside the
1537           framework’s Frameworks directory.
1538
1539         * WebKit2.xcodeproj/project.pbxproj:
1540         - Removed references to WRAPPER_NAME from the “Copy XPC services for engineering builds”
1541           build phase in the All target, becase WRAPPER_NAME is empty in an aggregate target.
1542         - Removed the PlugInProcess target’s dependency on the PluginProcessShim target and its
1543           Copy Plug-in Process Shim build phase.
1544         - Removed the NetworkProcess target’s dependency on the SecItemShim target and its Copy
1545           Sec Item Shim build phase.
1546         - Removed the WebProcess target’s dependency on the WebProcessShim target and its Copy
1547           WebProcessShim build phase.
1548         - Made the WebKit target depend on the shim targets, and added to it a Copy Shims build
1549           phase that copies the shims into the framework’s Frameworks directory.
1550
1551 2015-12-13  Dan Bernstein  <mitz@apple.com>
1552
1553         Build fix.
1554
1555         * Configurations/PluginProcess.xcconfig:
1556
1557 2015-12-13  Dan Bernstein  <mitz@apple.com>
1558
1559         [Mac] Shims aren’t inserted properly on Yosemite when building with the El Capitan SDK
1560         https://bugs.webkit.org/show_bug.cgi?id=152229
1561
1562         Reviewed by Darin Adler.
1563
1564         * Configurations/BaseTarget.xcconfig: Defined WK_LINK_SHIM on OS X to YES or NO based on the
1565           target version.
1566         * Configurations/BaseXPCService.xcconfig: Define WK_XPC_SERVICE_INFOPLIST_SUFFIX to
1567           "-10.9-10.10" when targeting those OS X versions.
1568         * Configurations/NetworkService.xcconfig: Use WK_XPC_SERVICE_INFOPLIST_SUFFIX in the
1569           definition of INFOPLIST_FILE. Use WK_LINK_SHIM in the definition of OTHER_LDFLAGS.
1570         * Configurations/PluginProcess.xcconfig: Use WK_LINK_SHIM in the definition of
1571           LDFLAGS_SHIM_Production for OS X.
1572         * Configurations/PluginService.32.xcconfig: Use WK_XPC_SERVICE_INFOPLIST_SUFFIX in the
1573           definition of INFOPLIST_FILE. Use WK_LINK_SHIM in the definition of OTHER_LDFLAGS.
1574         * Configurations/PluginService.64.xcconfig: Ditto.
1575         * Configurations/WebContentService.xcconfig: Ditto.
1576
1577 2015-12-12  Katlyn Graff  <kgraff@apple.com>
1578
1579         Safari background tabs should be fully suspended where possible.
1580         https://bugs.webkit.org/show_bug.cgi?id=150515
1581
1582         Reviewed by Ryosuke Niwa.
1583
1584         Added a runtime flag enabling tab suspension, default off.
1585
1586         * Shared/WebProcessCreationParameters.cpp:
1587         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
1588         (WebKit::WebProcessCreationParameters::encode):
1589         (WebKit::WebProcessCreationParameters::decode):
1590         * Shared/WebProcessCreationParameters.h:
1591         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1592         (WebKit::registerUserDefaultsIfNeeded):
1593         (WebKit::WebProcessPool::platformInitializeWebProcess):
1594         * WebProcess/cocoa/WebProcessCocoa.mm:
1595         (WebKit::WebProcess::platformInitializeWebProcess):
1596
1597 2015-12-11  Eric Carlson  <eric.carlson@apple.com>
1598
1599         [MediaStream] Add a setting to allow the mock media capture devices to be enabled and disabled
1600         https://bugs.webkit.org/show_bug.cgi?id=152197
1601
1602         Reviewed by Dean Jackson.
1603
1604         * Shared/WebPreferencesDefinitions.h:
1605         * UIProcess/API/C/WKPreferences.cpp:
1606         (WKPreferencesSetMockCaptureDevicesEnabled):
1607         (WKPreferencesGetMockCaptureDevicesEnabled):
1608         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1609         * UIProcess/API/Cocoa/WKPreferences.mm:
1610         (-[WKPreferences _mockCaptureDevicesEnabled]):
1611         (-[WKPreferences _setMockCaptureDevicesEnabled:]):
1612         * WebProcess/WebPage/WebPage.cpp:
1613         (WebKit::WebPage::updatePreferences):
1614
1615 2015-12-11  Joseph Pecoraro  <pecoraro@apple.com>
1616
1617         check-for-inappropriate-objc-class-names should check all class names, not just externally visible ones
1618         https://bugs.webkit.org/show_bug.cgi?id=152156
1619
1620         Reviewed by Dan Bernstein.
1621
1622         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1623         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
1624         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1625         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1626         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
1627         Rename internal classes with "_WK" prefix.
1628
1629 2015-12-10  Eric Carlson  <eric.carlson@apple.com>
1630
1631         [MediaStream] Expose media capture devices persistent permissions to WebCore
1632         https://bugs.webkit.org/show_bug.cgi?id=152087
1633
1634         Reviewed by Chris Dumez.
1635
1636         * CMakeLists.txt: Add UserMediaPermissionCheckProxy.cpp and WKUserMediaPermissionCheck.cpp.
1637
1638         * Shared/API/APIObject.h: Define UserMediaPermissionCheck.
1639
1640         * Shared/API/c/WKBase.h: Add WKUserMediaPermissionCheckRef typedef.
1641
1642         * UIProcess/API/APIUIClient.h:
1643         (API::UIClient::checkUserMediaPermissionForOrigin): New.
1644
1645         * UIProcess/API/C/WKAPICast.h: Add WKUserMediaPermissionCheckRef/UserMediaPermissionCheckProxy mapping.
1646
1647         * UIProcess/API/C/WKPage.cpp:
1648         (WKPageSetPageUIClient): Implement checkUserMediaPermissionForOrigin.
1649
1650         * UIProcess/API/C/WKPageUIClient.h: Add WKCheckUserMediaPermissionCallback typedef and add
1651           checkUserMediaPermissionForOrigin to WKPageUIClientV6.
1652
1653         * UIProcess/API/C/WKUserMediaPermissionCheck.cpp: Added.
1654         (WKUserMediaPermissionCheckGetTypeID):
1655         (WKUserMediaPermissionCheckSetHasPermission):
1656
1657         * UIProcess/API/C/WKUserMediaPermissionCheck.h: Added.
1658
1659         * UIProcess/UserMediaPermissionCheckProxy.cpp: Added.
1660         (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy):
1661         (WebKit::UserMediaPermissionCheckProxy::setHasPermission):
1662         (WebKit::UserMediaPermissionCheckProxy::invalidate):
1663         * UIProcess/UserMediaPermissionCheckProxy.h: Added.
1664         (WebKit::UserMediaPermissionCheckProxy::create):
1665         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1666         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests):
1667         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
1668         (WebKit::UserMediaPermissionRequestManagerProxy::didReceiveUserMediaPermissionDecision):
1669         (WebKit::UserMediaPermissionRequestManagerProxy::createUserMediaPermissionCheck):
1670         (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck):
1671         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1672         * UIProcess/WebPageProxy.cpp:
1673         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
1674         (WebKit::WebPageProxy::checkUserMediaPermissionForFrame):
1675         (WebKit::WebPageProxy::requestNotificationPermission):
1676         * UIProcess/WebPageProxy.h:
1677         * UIProcess/WebPageProxy.messages.in:
1678
1679         * WebKit2.xcodeproj/project.pbxproj: Add UserMediaPermissionCheckProxy.*, and WKUserMediaPermissionCheck.*.
1680
1681         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1682         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): Renamed from startRequest.
1683         (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Renamed from cancelRequest.
1684         (WebKit::UserMediaPermissionRequestManager::didReceiveUserMediaPermissionDecision): m_requestToIDMap ->
1685           m_userMediaRequestToIDMap.remove.
1686         (WebKit::UserMediaPermissionRequestManager::startUserMediaPermissionCheck): New, start the request.
1687         (WebKit::UserMediaPermissionRequestManager::cancelUserMediaPermissionCheck): New, cancel
1688           the request.
1689         (WebKit::UserMediaPermissionRequestManager::didCompleteUserMediaPermissionCheck): New, 
1690           all the request completion method.
1691         (WebKit::UserMediaPermissionRequestManager::startRequest): Deleted.
1692         (WebKit::UserMediaPermissionRequestManager::cancelRequest): Deleted.
1693         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1694
1695         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
1696         (WebKit::WebUserMediaClient::requestUserMediaAccess): startRequest -> startUserMediaRequest.
1697         (WebKit::WebUserMediaClient::cancelUserMediaAccessRequest): cancelRequest -> cancelUserMediaRequest.
1698         (WebKit::WebUserMediaClient::checkUserMediaPermission): New.
1699         (WebKit::WebUserMediaClient::cancelUserMediaPermissionCheck): New.
1700         * WebProcess/WebCoreSupport/WebUserMediaClient.h:
1701
1702         * WebProcess/WebPage/WebPage.cpp:
1703         (WebKit::WebPage::didCompleteUserMediaPermissionCheck): New.
1704         * WebProcess/WebPage/WebPage.h:
1705         * WebProcess/WebPage/WebPage.messages.in: Add DidCompleteUserMediaPermissionCheck.
1706
1707 2015-12-10  Joseph Pecoraro  <pecoraro@apple.com>
1708
1709         Remote Inspector: Verify the identity of the other side of XPC connections
1710         https://bugs.webkit.org/show_bug.cgi?id=152153
1711
1712         Reviewed by Brian Burg.
1713
1714         * Shared/mac/SandboxUtilities.mm:
1715         * UIProcess/ApplicationStateTracker.mm:
1716         Use new header.
1717
1718 2015-12-10  Alex Christensen  <achristensen@webkit.org>
1719
1720         REGRESSION (r192796) WKBundlePageResourceLoadClient should be able to setHTTPBody in willSendRequestForFrame
1721         https://bugs.webkit.org/show_bug.cgi?id=152022
1722         rdar://problem/23763584
1723
1724         Reviewed by Darin Adler.
1725
1726         * Shared/API/c/WKURLRequest.cpp:
1727         (WKURLRequestCopyHTTPMethod):
1728         (WKURLRequestCopyWithHTTPBody):
1729         (WKURLRequestSetDefaultTimeoutInterval):
1730         * Shared/API/c/WKURLRequest.h:
1731         Make WKURLRequestCopyWithHTTPBody SPI for testing.
1732         * Shared/API/c/mac/WKURLRequestNS.mm:
1733         (WKURLRequestCreateWithNSURLRequest):
1734         Crash if someone tries to use an NSURLRequest with HTTPBodyStream, which will not work with the network process.
1735         * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp:
1736         (WebKit::InjectedBundlePageResourceLoadClient::willSendRequestForFrame):
1737         Use an HTTP body if the client's willSendRequestForFrame returned one.
1738         This is the functional change of this patch.
1739
1740 2015-12-10  Zan Dobersek  <zdobersek@igalia.com>
1741
1742         [CoordinatedGraphics] Reserve capacity for the children vector in CoordinatedGraphicsScene::setLayerChildrenIfNeeded()
1743         https://bugs.webkit.org/show_bug.cgi?id=152117
1744
1745         Reviewed by Martin Robinson.
1746
1747         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1748         (WebKit::CoordinatedGraphicsScene::setLayerChildrenIfNeeded): Reserve the capacity
1749         for the new Vector that will contain the same number of items as the Vector
1750         on the CoordinatedGraphicsLayerState object.
1751
1752 2015-12-09  Daniel Bates  <dabates@apple.com>
1753
1754         [iOS] Bail out if the page proxy is invalid when WebPageProxy::processWillBecome{Foreground, Suspended}() are called
1755         https://bugs.webkit.org/show_bug.cgi?id=151877
1756
1757         Reviewed by Darin Adler.
1758
1759         We cannot assume that a WebPageProxy is in a valid state when WebPageProxy::processWillBecome{Foreground, Suspended}()
1760         are called because these callbacks may occur after the web process crashed and before a
1761         WebPageProxy attaches to a new web process (and hence is considered in a valid state).
1762
1763         * UIProcess/WebPageProxy.cpp:
1764         (WebKit::WebPageProxy::processWillBecomeSuspended): Early return if the page proxy is invalid.
1765         (WebKit::WebPageProxy::processWillBecomeForeground): Ditto.
1766
1767 2015-12-09  Commit Queue  <commit-queue@webkit.org>
1768
1769         Unreviewed, rolling out r193864.
1770         https://bugs.webkit.org/show_bug.cgi?id=152100
1771
1772         caused all inspector tests to assert in WK2 Debug (Requested
1773         by brrian on #webkit).
1774
1775         Reverted changeset:
1776
1777         "Web Inspector: reproducible debug ASSERT when inspecting the
1778         inspector (WK2)"
1779         https://bugs.webkit.org/show_bug.cgi?id=152080
1780         http://trac.webkit.org/changeset/193864
1781
1782 2015-12-09  Brian Burg  <bburg@apple.com>
1783
1784         Web Inspector: reproducible debug ASSERT when inspecting the inspector (WK2)
1785         https://bugs.webkit.org/show_bug.cgi?id=152080
1786
1787         Reviewed by Timothy Hatcher.
1788
1789         We hit an assert underneath ChildProcessProxy::addMessageReceiver because
1790         we tried to connect the inspector page and inspected page more than once.
1791         This relationship is already set up in the constructor of WebProcessProxy.
1792
1793         * UIProcess/WebInspectorProxy.cpp:
1794         (WebKit::WebInspectorProxy::eagerlyCreateInspectorPage):
1795
1796 2015-12-09  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1797
1798         [EFL] Need to change expectation result in ewk_settings_offline_web_application_cache_enabled API test
1799         https://bugs.webkit.org/show_bug.cgi?id=152063
1800
1801         Reviewed by Csaba Osztrogonác.
1802
1803         Expect false initial value of ewk_settings_offline_web_application_cache_enabled_get()
1804         because r193812 didn't enable it by default.
1805
1806         * UIProcess/API/efl/tests/test_ewk2_settings.cpp:
1807         (TEST_F):
1808
1809 2015-12-09  Gwang Yoon Hwang  <yoon@igalia.com>
1810
1811         [ThreadedCompositor] Add support for HiDPI
1812         https://bugs.webkit.org/show_bug.cgi?id=152071
1813
1814         Reviewed by Carlos Garcia Campos.
1815
1816         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1817         (WebKit::ThreadedCompositor::setDeviceScaleFactor): Added to receive the
1818         device scale factor from the layer tree host.
1819         (WebKit::ThreadedCompositor::renderLayerTree):
1820         Apply device scale factor before rendering the page.
1821         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1822         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1823         (WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
1824         Send a updated device scale factor to the compositing thread.
1825
1826 2015-12-09  Ryuan Choi  <ryuan.choi@navercorp.com>
1827
1828         [CoordinatedGraphics] Remove unnecessary guards in CoordinatedDrawingArea
1829         https://bugs.webkit.org/show_bug.cgi?id=152068
1830
1831         Reviewed by Gyuyoung Kim.
1832
1833         CoordinatedDrawingArea is only for UI side compositor of CoordinatedGraphics.
1834         So, COORDINATED_GRAPHICS_MULTIPROCESS guards are not necessary.
1835         This patch also removes COORDINATED_GRAPHICS_MULTIPROCESS guards from DrawingAreaImpl
1836         because of same reason.
1837
1838         * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp:
1839         (WebKit::CoordinatedDrawingAreaProxy::CoordinatedDrawingAreaProxy): Deleted.
1840         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
1841         (WebKit::CoordinatedDrawingArea::CoordinatedDrawingArea): Deleted.
1842         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
1843         * WebProcess/WebPage/DrawingAreaImpl.h:
1844
1845 2015-12-09  Mario Sanchez Prada  <mario@endlessm.com>
1846
1847         [GTK] Crash in WebProcess when loading large content with custom URI schemes
1848         https://bugs.webkit.org/show_bug.cgi?id=144262
1849
1850         Reviewed by Carlos Garcia Campos.
1851
1852         Properly handle scenarios where errors happen after reading the first
1853         chunk of data coming from the GInputStream provided by the application.
1854
1855         * UIProcess/API/gtk/WebKitWebContextPrivate.h:
1856         * UIProcess/API/gtk/WebKitWebContext.cpp:
1857         (webkitWebContextIsLoadingCustomProtocol): New, checks whether a load
1858         is still in progress, after the startLoading method has been called.
1859         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
1860         (webkitURISchemeRequestReadCallback): Early return if the stream has been
1861         cancelled on finish_error, so that we make sure we don't keep on reading
1862         the GInputStream after that point.
1863         (webkit_uri_scheme_request_finish_error): Don't send a didFailWithError
1864         message to the Network process if the load is not longer in progress.
1865         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.cpp:
1866         (WebKit::CustomProtocolManagerImpl::didFailWithError): Handle the case where
1867         an error is notified from the UI process after the first chunk has been read.
1868         (WebKit::CustomProtocolManagerImpl::didReceiveResponse): Handle the case where
1869         data might no longer be available if an error happened even before this point.
1870         * WebProcess/soup/WebKitSoupRequestInputStream.h:
1871         * WebProcess/soup/WebKitSoupRequestInputStream.cpp:
1872         (webkitSoupRequestInputStreamDidFailWithError): Notify the custom GInputStream
1873         that we no longer want to keep reading data in chunks due to a specific error.
1874         (webkitSoupRequestInputStreamReadAsync): Early finish the GTask with a specific
1875         error whenever webkitSoupRequestInputStreamDidFailWithError() has been called.
1876
1877 2015-12-09  Ryuan Choi  <ryuan.choi@navercorp.com>
1878
1879         [CoordinatedGraphics][EFL] Fix unhandled web process message when launching MiniBrowser
1880         https://bugs.webkit.org/show_bug.cgi?id=152048
1881
1882         Reviewed by Gyuyoung Kim.
1883
1884         WebPage should be initialized before updating preferences.
1885
1886         * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
1887         (WKViewInitialize): Deleted.
1888         * UIProcess/API/C/CoordinatedGraphics/WKView.h:
1889         * UIProcess/API/efl/EwkView.cpp:
1890         (EwkView::EwkView):
1891         Calls WKViewSetIsActive instead of WKViewInitialize not to change the behavior
1892         of EFL port.
1893         * UIProcess/CoordinatedGraphics/WebView.cpp:
1894         (WebKit::WebView::WebView):
1895         Initialize just before creating WebPage because there is not use case to separate
1896         initializing WebPage from creating in CoordinatedGraphics.
1897         (WebKit::WebView::initialize): Deleted.
1898         * UIProcess/CoordinatedGraphics/WebView.h:
1899
1900 2015-12-09  Carlos Garcia Campos  <cgarcia@igalia.com>
1901
1902         [GTK] Add API to handle beforeunload events
1903         https://bugs.webkit.org/show_bug.cgi?id=139090
1904
1905         Reviewed by Gustavo Noronha Silva.
1906
1907         beforeunload is fired when a page is about to be closed, to ask
1908         the user for confirmation. This happens when reloading a page,
1909         when navigating to another page or when the page is closed by a
1910         user action (a tab or window closed). In the first two cases, the
1911         event is automatically fired by WebCore, but in the case of a user
1912         action we need additional API to ensure the event is fired before
1913         the page is closed. A new script dialog type has been added to
1914         handle beforeunload events and webkit_web_view_try_close() to
1915         allow applications to try to close the page.
1916
1917         * UIProcess/API/gtk/WebKitScriptDialog.cpp:
1918         (webkit_script_dialog_confirm_set_confirmed): BeforeUnloadConfirm
1919         dialogs can also be confirmed.
1920         * UIProcess/API/gtk/WebKitScriptDialog.h: Add
1921         WEBKIT_SCRIPT_DIALOG_BEFORE_UNLOAD_CONFIRM script dialog type.
1922         * UIProcess/API/gtk/WebKitUIClient.cpp: Implement
1923         canRunBeforeUnloadConfirmPanel() and runBeforeUnloadConfirmPanel().
1924         * UIProcess/API/gtk/WebKitWebView.cpp:
1925         (webkitWebViewCreateJavaScriptDialog): Add secondaryText optional
1926         parameter for BeforeUnloadConfirm dialogs. Do not set the default
1927         response if the dialog was created without buttons.
1928         (webkitWebViewScriptDialog): Handle
1929         WEBKIT_SCRIPT_DIALOG_BEFORE_UNLOAD_CONFIRM script dialog type to
1930         create a message dialog for beforeunlos events.
1931         (webkit_web_view_class_init): Update documentation of
1932         WebKitWebView::close and WebKitWebView::script-dialog.
1933         (webkitWebViewRunJavaScriptBeforeUnloadConfirm): Emit WebKitWebView::script-dialog.
1934         (webkit_web_view_try_close): Try to close the page.
1935         * UIProcess/API/gtk/WebKitWebView.h:
1936         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
1937         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbol.
1938
1939 2015-12-09  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1940
1941         [EFL] Missing to set ignoreTLSError to NetworkProcess
1942         https://bugs.webkit.org/show_bug.cgi?id=152047
1943
1944         Reviewed by Csaba Osztrogonác.
1945
1946         NetworkProcess has been enabled for all ports since r192796 though, EFL port
1947         didn't send the ignoreTLSError value to NetworkProcess. This has caused failure of EFL API tests
1948         related with ssl feature.
1949
1950         * UIProcess/efl/WebProcessPoolEfl.cpp:
1951         (WebKit::WebProcessPool::setIgnoreTLSErrors):
1952
1953 2015-12-09  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1954
1955         [EFL] REGRESSION(r193616): WKPreferences test has been failed since r193616
1956         https://bugs.webkit.org/show_bug.cgi?id=151942
1957
1958         Reviewed by Darin Adler.
1959
1960         As wkpreference settings were moved from EwkView to WKPreferenceEfl, the offline-web-application-cache feature
1961         is enabled by default when running API test. It seems this option should be enabled by MiniBrowser.
1962
1963         * UIProcess/efl/WebPreferencesEfl.cpp:
1964         (WebKit::WebPreferences::platformInitializeStore): Remove to enable web application cache feature here.
1965
1966 2015-12-09  Ryuan Choi  <ryuan.choi@navercorp.com>
1967
1968         [CoordinatedGraphics] layerTreeHost always exist in CoordinatedDrawingArea
1969         https://bugs.webkit.org/show_bug.cgi?id=151987
1970
1971         Reviewed by Darin Adler.
1972
1973         CoordinatedGraphics using UI side compositor always forces accelerated compositing.
1974         This patch cleans up dead code for layerTreeHost which always exists.
1975
1976         * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp:
1977         (WebKit::CoordinatedDrawingAreaProxy::paint): Deleted.
1978         (WebKit::CoordinatedDrawingAreaProxy::setBackingStoreIsDiscardable): Deleted.
1979         (WebKit::CoordinatedDrawingAreaProxy::update): Deleted.
1980         (WebKit::CoordinatedDrawingAreaProxy::didUpdateBackingStoreState): Deleted.
1981         (WebKit::CoordinatedDrawingAreaProxy::exitAcceleratedCompositingMode): Deleted.
1982         (WebKit::CoordinatedDrawingAreaProxy::incorporateUpdate): Deleted.
1983         (WebKit::CoordinatedDrawingAreaProxy::enterAcceleratedCompositingMode): Deleted.
1984         (WebKit::CoordinatedDrawingAreaProxy::discardBackingStoreSoon): Deleted.
1985         (WebKit::CoordinatedDrawingAreaProxy::discardBackingStore): Deleted.
1986         * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.h:
1987         (WebKit::CoordinatedDrawingAreaProxy::setBackingStoreIsDiscardable):
1988         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
1989         (WebKit::CoordinatedDrawingArea::CoordinatedDrawingArea): Deleted.
1990         (WebKit::CoordinatedDrawingArea::layerHostDidFlushLayers): Deleted.
1991         (WebKit::CoordinatedDrawingArea::scheduleCompositingLayerFlush): Deleted.
1992         (WebKit::CoordinatedDrawingArea::didUpdate): Deleted.
1993         (WebKit::CoordinatedDrawingArea::enterAcceleratedCompositingMode): Deleted.
1994         (WebKit::CoordinatedDrawingArea::scheduleDisplay): Deleted.
1995         (WebKit::CoordinatedDrawingArea::displayTimerFired): Deleted.
1996         (WebKit::CoordinatedDrawingArea::display): Deleted.
1997         (WebKit::shouldPaintBoundsRect): Deleted.
1998         (WebKit::CoordinatedDrawingArea::attachViewOverlayGraphicsLayer): Deleted.
1999         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
2000
2001 2015-12-08  Alex Christensen  <achristensen@webkit.org>
2002
2003         Progress towards implementing downloads with NetworkSession
2004         https://bugs.webkit.org/show_bug.cgi?id=151883
2005
2006         Reviewed by Brady Eidson.
2007
2008         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2009         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
2010         * NetworkProcess/NetworkLoad.cpp:
2011         (WebKit::NetworkLoad::~NetworkLoad):
2012         (WebKit::NetworkLoad::continueDidReceiveResponse):
2013         (WebKit::NetworkLoad::convertTaskToDownload):
2014         (WebKit::NetworkLoad::willPerformHTTPRedirection):
2015         (WebKit::NetworkLoad::didReceiveChallenge):
2016         (WebKit::NetworkLoad::didReceiveResponse):
2017         (WebKit::NetworkLoad::didReceiveData):
2018         (WebKit::NetworkLoad::didCompleteWithError):
2019         (WebKit::NetworkLoad::didBecomeDownload):
2020         (WebKit::NetworkLoad::didReceiveResponseAsync):
2021         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
2022         * NetworkProcess/NetworkLoad.h:
2023         * NetworkProcess/NetworkLoadClient.h:
2024         * NetworkProcess/NetworkResourceLoader.cpp:
2025         (WebKit::NetworkResourceLoader::cleanup):
2026         (WebKit::NetworkResourceLoader::didConvertToDownload):
2027         (WebKit::NetworkResourceLoader::abort):
2028         (WebKit::NetworkResourceLoader::didConvertHandleToDownload): Deleted.
2029         * NetworkProcess/NetworkResourceLoader.h:
2030         * NetworkProcess/NetworkSession.h:
2031         (WebKit::NetworkSessionTaskClient::~NetworkSessionTaskClient):
2032         (WebKit::NetworkSession::~NetworkSession): Deleted.
2033         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
2034         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2035         (-[NetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
2036         (-[NetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
2037         (WebKit::NetworkSession::NetworkSession):
2038         (WebKit::NetworkSession::~NetworkSession):
2039         (WebKit::NetworkSession::createDataTaskWithRequest):
2040         * Shared/Downloads/Download.h:
2041         * Shared/Downloads/DownloadManager.h:
2042         (WebKit::DownloadManager::isDownloading):
2043         (WebKit::DownloadManager::activeDownloadCount):
2044
2045 2015-12-08  Joseph Pecoraro  <pecoraro@apple.com>
2046
2047         Create a Sandbox SPI header
2048         https://bugs.webkit.org/show_bug.cgi?id=151981
2049
2050         Reviewed by Andy Estes.
2051
2052         * PluginProcess/mac/PluginProcessShim.mm:
2053         * Shared/ios/ChildProcessIOS.mm:
2054         * Shared/mac/ChildProcessMac.mm:
2055         * Shared/mac/SandboxUtilities.mm:
2056
2057 2015-12-08  Eric Carlson  <eric.carlson@apple.com>
2058
2059         [MediaStream] Rename UserMediaClient and UserMediaController methods
2060         https://bugs.webkit.org/show_bug.cgi?id=152001
2061
2062         Reviewed by Brady Eidson.
2063
2064         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
2065         (WebKit::WebUserMediaClient::pageDestroyed):
2066         (WebKit::WebUserMediaClient::requestUserMediaAccess):
2067         (WebKit::WebUserMediaClient::cancelUserMediaAccessRequest):
2068         (WebKit::WebUserMediaClient::requestPermission): Deleted.
2069         (WebKit::WebUserMediaClient::cancelRequest): Deleted.
2070         * WebProcess/WebCoreSupport/WebUserMediaClient.h:
2071
2072 2015-12-08  Tomas Popela  <tpopela@redhat.com>
2073
2074         [GTK] Remove an unused variable from WebKitWebContext
2075         https://bugs.webkit.org/show_bug.cgi?id=151999
2076
2077         Reviewed by Carlos Garcia Campos.
2078
2079         * UIProcess/API/gtk/WebKitWebContext.cpp:
2080
2081 2015-12-08  Chris Dumez  <cdumez@apple.com>
2082
2083         Add diagnostic logging to measure speculative revalidation accuracy
2084         https://bugs.webkit.org/show_bug.cgi?id=151953
2085         <rdar://problem/23092196>
2086
2087         Reviewed by Darin Adler.
2088
2089         We track the following:
2090         1. Resources we knew about AND did not get requested
2091            A. We did not speculate (Good)
2092            B. We speculated but did not go to network (Bad)
2093            C. We speculated and went to network (Very bad)
2094         2. Resources we did not know about (Neutral)
2095         3. Resources we knew about AND got requested
2096            A. We did not speculate (Bad)
2097            B. We speculated but did not go to network (Good)
2098            C. We speculated and went to network (Very good)
2099
2100         * NetworkProcess/cache/NetworkCache.cpp:
2101         (WebKit::NetworkCache::Cache::retrieve):
2102         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2103         (WebKit::NetworkCache::allSpeculativeLoadingDiagnosticMessages):
2104         (WebKit::NetworkCache::printSpeculativeLoadingDiagnosticMessageCounts):
2105         (WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
2106         (WebKit::NetworkCache::SpeculativeLoadManager::ExpiringEntry::ExpiringEntry):
2107         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry):
2108         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::wasRevalidated):
2109         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::markLoadAsCompleted):
2110         (WebKit::NetworkCache::SpeculativeLoadManager::retrieve):
2111         (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
2112         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):
2113         (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
2114         (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
2115         (WebKit::NetworkCache::makeSubresourcesKey): Deleted.
2116         (WebKit::NetworkCache::constructRevalidationRequest): Deleted.
2117         (WebKit::NetworkCache::responseNeedsRevalidation): Deleted.
2118         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady): Deleted.
2119         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage): Deleted.
2120         (WebKit::NetworkCache::SpeculativeLoadManager::satisfyPendingRequests): Deleted.
2121         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
2122
2123 2015-12-08  Csaba Osztrogonác  <ossy@webkit.org>
2124
2125         [EFL] REGRESSION(r173394): MiniBrowser stucked in an infinite loop if NETWORK_CACHE is disabled
2126         https://bugs.webkit.org/show_bug.cgi?id=137692
2127
2128         Reviewed by Darin Adler.
2129
2130         * WebProcess/Network/WebLoaderStrategy.cpp:
2131         (WebKit::maximumBufferingTime): Disable caching if NETWORK_CACHE is disabled.
2132
2133 2015-12-08  Ryuan Choi  <ryuan.choi@navercorp.com>
2134
2135         [EFL] Add API to provide preferences before creating ewk_view
2136         https://bugs.webkit.org/show_bug.cgi?id=151587
2137
2138         Reviewed by Gyuyoung Kim.
2139
2140         This patch adds ewk_view_configuration_settings_get to provide preferences
2141         before createing ewk_view.
2142
2143         * PlatformEfl.cmake:
2144         * UIProcess/API/efl/ewk_view_configuration.cpp:
2145         (EwkViewConfiguration::EwkViewConfiguration):
2146         (ewk_view_configuration_settings_get):
2147         * UIProcess/API/efl/ewk_view_configuration.h:
2148         * UIProcess/API/efl/ewk_view_configuration_private.h:
2149         (EwkViewConfiguration::pageGroup):
2150         * UIProcess/API/efl/tests/test_ewk2_view_configuration.cpp:
2151         (TEST_F): Added test case for ewk_view_configuration_settings_get().
2152
2153 2015-12-07  Gustavo Noronha Silva  <gns@gnome.org>
2154
2155         [GTK] Notify WebCore when notification is clicked
2156         https://bugs.webkit.org/show_bug.cgi?id=151951
2157
2158         Reviewed by Carlos Garcia Campos.
2159
2160         * UIProcess/API/gtk/WebKitNotification.cpp:
2161         (webkit_notification_class_init): new clicked signal.
2162         (webkit_notification_clicked): method to emit the clicked signal.
2163         * UIProcess/API/gtk/WebKitNotification.h:
2164         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
2165         (WebKitNotificationProvider::notificationClickedCallback): handle the clicked signal and tell WebProcess about the click.
2166         (WebKitNotificationProvider::show): connect to the clicked signal in addition to closed.
2167         * UIProcess/API/gtk/WebKitNotificationProvider.h:
2168         * UIProcess/API/gtk/WebKitWebView.cpp:
2169         (notifyNotificationClicked): handle the click on our libnotify notification.
2170         (webkitWebViewShowNotification): add the "default" action to our libnotify notification to be notified of the click.
2171         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2172
2173 2015-12-07  Commit Queue  <commit-queue@webkit.org>
2174
2175         Unreviewed, rolling out r193655.
2176         https://bugs.webkit.org/show_bug.cgi?id=151970
2177
2178         This change broke existing LayoutTests on mac-wk2 (Requested
2179         by ryanhaddad on #webkit).
2180
2181         Reverted changeset:
2182
2183         "UIProcess should determine AppNap state for WebPage"
2184         https://bugs.webkit.org/show_bug.cgi?id=151964
2185         http://trac.webkit.org/changeset/193655
2186
2187 2015-12-05  Gavin Barraclough  <barraclough@apple.com>
2188
2189         UIProcess should determine AppNap state for WebPage
2190         https://bugs.webkit.org/show_bug.cgi?id=151964
2191
2192         Reviewed by Anders Carlson.
2193
2194         Step 1 in unifying this with the iOS process suppression mechanism is to move the decision out of the WebContent process.
2195
2196         * UIProcess/WebPageProxy.cpp:
2197         (WebKit::WebPageProxy::WebPageProxy):
2198         (WebKit::WebPageProxy::dispatchViewStateChange):
2199         (WebKit::WebPageProxy::setPageActivityState):
2200         (WebKit::WebPageProxy::updateActivityToken):
2201         (WebKit::WebPageProxy::preferencesDidChange):
2202         * UIProcess/WebPageProxy.h:
2203         (WebKit::WebPageProxy::isInWindow):
2204         (WebKit::WebPageProxy::didUpdateViewState):
2205         * UIProcess/WebPageProxy.messages.in:
2206             - WebPage now propagates PageActivityState to the WebPageProxy, for use
2207               determining the supression state of the WebProcess.
2208         * WebProcess/WebPage/WebPage.cpp:
2209         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
2210         (WebKit::WebPage::setPageActivityState):
2211         (WebKit::WebPage::setUserActivityStarted):
2212         (WebKit::WebPage::setViewState):
2213         (WebKit::WebPage::updatePreferences):
2214         (WebKit::WebPage::updateUserActivity): Deleted.
2215         * WebProcess/WebPage/WebPage.h:
2216         * WebProcess/WebPage/WebPage.messages.in:
2217             - WebPage no longer determines when to update it's own UserActivity - instead,
2218               let the UI process do so. As such, no longer need to track whether process
2219               supression is enabled. Instead, add message to
2220
2221 2015-12-07  Chris Dumez  <cdumez@apple.com>
2222
2223         [WK2] Regression(r187691): If a page is showing an auth pane in one tab, any new tabs with same page hang until credentials are entered in first tab
2224         https://bugs.webkit.org/show_bug.cgi?id=151960
2225         <rdar://problem/23618112>
2226
2227         Reviewed by Alex Christensen.
2228
2229         After r187691, if a page is showing an auth pane in one tab, any new
2230         tabs with same page hang until credentials are entered in first tab.
2231         This is because we coalescing all authentication challenges from the
2232         same domain, no matter what tab they are for. This can be confusing
2233         so we now only coalesce authentication challenges within each tab,
2234         by leveraging the pageID (in addition to the domain).
2235
2236         * Shared/Authentication/AuthenticationManager.cpp:
2237         (WebKit::AuthenticationManager::shouldCoalesceChallenge):
2238         (WebKit::AuthenticationManager::coalesceChallengesMatching):
2239         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
2240         * Shared/Authentication/AuthenticationManager.h:
2241
2242 2015-12-07  Beth Dakin  <bdakin@apple.com>
2243
2244         Hook up request and show for typing candidates in WK1
2245         https://bugs.webkit.org/show_bug.cgi?id=151831
2246         -and corresponding-
2247         <rdar://problem/23751214>
2248
2249         Reviewed by Enrica Casucci.
2250
2251         Empty client for now.
2252         * WebProcess/WebCoreSupport/WebEditorClient.h:
2253
2254 2015-12-07  Philippe Normand  <pnormand@igalia.com>
2255
2256         [GTK][Mac] socketpair assertion failure
2257         https://bugs.webkit.org/show_bug.cgi?id=151293
2258
2259         Reviewed by Carlos Garcia Campos.
2260
2261         * Platform/IPC/unix/ConnectionUnix.cpp: Don't use SEQPACKET sockets on Darwin.
2262
2263 2015-12-07  Gwang Yoon Hwang  <yoon@igalia.com>
2264
2265         [ThreadedCompositor] Add support for PlatformLayer.
2266         https://bugs.webkit.org/show_bug.cgi?id=143299
2267
2268         Reviewed by Žan Doberšek.
2269
2270         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2271         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
2272         Swap pending buffers of TextureMapperPlatformLayerProxies before painting contents.
2273         (WebKit::CoordinatedGraphicsScene::syncPlatformLayerIfNeeded):
2274         In threaded compositor, CoordinatedGraphicsScence only cares about creation and deletion
2275         of platform layers.
2276
2277         (WebKit::CoordinatedGraphicsScene::onNewBufferAvailable):
2278         Whenever new buffer comes via TextureMapperPlatformLayerProxy, CoordinatedGraphicsScene will
2279         update the scene if it is needed.
2280
2281 2015-12-07  Mario Sanchez Prada  <mario@endlessm.com>
2282
2283         [GTK] Allow applications to force Accelerated Compositing mode
2284         https://bugs.webkit.org/show_bug.cgi?id=150558
2285
2286         Reviewed by Carlos Garcia Campos.
2287
2288         Enable forcing Accelerated Compositing mode to be always on if
2289         a WEBKIT_FORCE_COMPOSITING_MODE environment variable is set.
2290
2291         This can be useful for controlled environments where we know that
2292         AC always on works well enough, to get smoother animations.
2293
2294         * UIProcess/gtk/WebPreferencesGtk.cpp:
2295         (WebKit::WebPreferences::platformInitializeStore): Set forceCompositingMode
2296         setting to true if the environment variable is found.
2297
2298 2015-12-07  Jon Forsberg  <jon.orebro@gmail.com>
2299
2300         [GTK] Add webkit_uri_request_get_http_method
2301         https://bugs.webkit.org/show_bug.cgi?id=151601
2302
2303         Reviewed by Martin Robinson.
2304
2305         Add a method to get the HTTP method of a WebKitURIRequest.
2306
2307         * UIProcess/API/gtk/WebKitURIRequest.cpp:
2308         (webkit_uri_request_get_http_method):
2309         * UIProcess/API/gtk/WebKitURIRequest.h:
2310         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2311
2312 2015-12-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2313
2314         [GTK] Add WebKitWebPage::console-message-sent signal to Web Extensions API
2315         https://bugs.webkit.org/show_bug.cgi?id=79918
2316
2317         Reviewed by Gustavo Noronha Silva.
2318
2319         Add WebKitConsoleMessage boxed type that is passed to the
2320         WebKitWebPage::console-message-sent signal with all the details
2321         about the message.
2322
2323         * PlatformGTK.cmake: Add new files to compilation.
2324         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
2325         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Add webkit_console_message_get_type.
2326         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section to the docs.
2327         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
2328         (API::InjectedBundle::PageUIClient::willAddMessageToConsole): Add
2329         paramaters for all console message details.
2330         * WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.cpp: Added.
2331         (webkit_console_message_copy):
2332         (webkit_console_message_free):
2333         (webkit_console_message_get_source):
2334         (webkit_console_message_get_level):
2335         (webkit_console_message_get_text):
2336         (webkit_console_message_get_line):
2337         (webkit_console_message_get_source_id):
2338         * WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.h: Added.
2339         * WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessagePrivate.h: Added.
2340         (_WebKitConsoleMessage::_WebKitConsoleMessage):
2341         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
2342         (webkitWebPageDidSendConsoleMessage): Emit the
2343         WebKitWebPage::console-message-sent signal.
2344         (didReceiveResponseForResource): Generate a console message in
2345         case of HTTP failure >= 400 for consistency with the inspector.
2346         (didFailLoadForResource): Generate a console message in case of
2347         resource load failure for consistency with the inspector.
2348         (webkit_web_page_class_init): Add WebKitWebPage::console-message-sent signal.
2349         (webkitWebPageCreate): Set custom UI client.
2350         * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
2351         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
2352         (WebKit::InjectedBundlePageUIClient::willAddMessageToConsole):
2353         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
2354         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2355         (WebKit::WebChromeClient::addMessageToConsole): Pass all the
2356         console message details to the ui client.
2357
2358 2015-12-07  Ryuan Choi  <ryuan.choi@navercorp.com>
2359
2360         [EFL] MiniBrowser doesn't exit when called ewk_view_try_close()
2361         https://bugs.webkit.org/show_bug.cgi?id=151934
2362
2363         Reviewed by Csaba Osztrogonác.
2364
2365         * UIProcess/API/efl/ewk_view.cpp:
2366         (ewk_view_try_close):
2367         Called window_close callback immediately when WKPageTryClose returns true.
2368         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
2369         (TEST_F): Improved test cases for try_close to test when content does not contain
2370         onbeforeunload callback.
2371
2372 2015-12-07  Jaehun Lim  <ljaehun.lim@samsung.com>
2373
2374         [EFL] Moving preference settings from EwkView to WebPreferencesEfl
2375         https://bugs.webkit.org/show_bug.cgi?id=151928
2376
2377         Reviewed by Gyuyoung Kim.
2378
2379         It implements WebPreferences::platformInitializeStore() in WebPreferencesEfl.cpp.
2380
2381         * UIProcess/API/efl/EwkView.cpp:
2382         (EwkView::EwkView):
2383         * UIProcess/efl/WebPreferencesEfl.cpp:
2384         (WebKit::WebPreferences::platformInitializeStore):
2385
2386 2015-12-04  Anders Carlsson  <andersca@apple.com>
2387
2388         Crash when secondary clicking on a link on yahoo.com
2389         https://bugs.webkit.org/show_bug.cgi?id=151900
2390         rdar://problem/23765149
2391
2392         Reviewed by Beth Dakin.
2393
2394         Don't use +[NSURL URLWithString:] since it doesn't handle invalid URLs as well as WebCore::URL.
2395
2396         * UIProcess/mac/WebContextMenuProxyMac.mm:
2397         (WebKit::WebContextMenuProxyMac::createShareMenuItem):
2398
2399 2015-12-04  Beth Dakin  <bdakin@apple.com>
2400
2401         Crash in clients using userData in 
2402         _immediateActionAnimationControllerForHitTestResult
2403         https://bugs.webkit.org/show_bug.cgi?id=151887
2404
2405         Rubber-stamped by Anders Carlsson.
2406
2407         Follow-up fix to handle null userData.
2408         * UIProcess/API/Cocoa/WKWebView.mm:
2409         (-[WKWebView _web_immediateActionAnimationControllerForHitTestResultInternal:withType:userData:]):
2410
2411 2015-12-04  Beth Dakin  <bdakin@apple.com>
2412
2413         Crash in clients using userData in 
2414         _immediateActionAnimationControllerForHitTestResult
2415         https://bugs.webkit.org/show_bug.cgi?id=151887
2416
2417         Reviewed by Sam Weinig.
2418
2419         Cast this correctly.
2420         * UIProcess/API/Cocoa/WKWebView.mm:
2421         (-[WKWebView _web_immediateActionAnimationControllerForHitTestResultInternal:withType:userData:]):
2422
2423 2015-12-04  Gavin Barraclough  <barraclough@apple.com>
2424
2425         Background state not being tracked correctly for PDFs on iOS
2426         https://bugs.webkit.org/show_bug.cgi?id=151886
2427
2428         Reviewed by Anders Carlson.
2429
2430         The problem here is that when viewing a PDF we don't have an ApplicationStateTracker.
2431         (While we do have a content view - which normally holds the ApplicationStateTracker -
2432         the content view is not in a window, and only has an ApplicationStateTracker while in a
2433         window). For now, let's give the WKPDFView an ApplicationStateTracker of its very own.
2434         In the future we may want to refactor ownership of the ApplicationStateTracker up to
2435         the WKWebView.
2436
2437         * UIProcess/API/Cocoa/WKWebView.mm:
2438         (-[WKWebView _isBackground]):
2439             - Added, checks background state of content/PDF view.
2440         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2441             - expose _isBackground to PageClientImplIOS.
2442         * UIProcess/ApplicationStateTracker.h:
2443         (WebKit::ApplicationStateTracker::isInBackground):
2444         * UIProcess/ApplicationStateTracker.mm:
2445         (WebKit::isBackgroundState):
2446         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
2447             - generalize WKContentView -> UIView, so this may now also be a WKPDFView.
2448         * UIProcess/ios/PageClientImplIOS.mm:
2449         (WebKit::PageClientImpl::isViewVisible):
2450             - check background state via the WKWebView.
2451         * UIProcess/ios/WKPDFView.h:
2452         * UIProcess/ios/WKPDFView.mm:
2453         (-[WKPDFView willMoveToWindow:]):
2454         (-[WKPDFView didMoveToWindow]):
2455         (-[WKPDFView isBackground]):
2456         (-[WKPDFView _applicationDidEnterBackground]):
2457         (-[WKPDFView _applicationWillEnterForeground]):
2458             - added methods to initialize ApplicationStateTracker, access background state, & callbacks to the page proxy.
2459
2460 2015-12-04  Antti Koivisto  <antti@apple.com>
2461
2462         Rename WebResourceLoadScheduler to WebLoaderStrategy
2463         https://bugs.webkit.org/show_bug.cgi?id=151854
2464
2465         Reviewed by Anders Carlsson.
2466
2467         It implements WebCore::LoaderStrategy and doesn't do any scheduling.
2468
2469         * CMakeLists.txt:
2470         * WebKit2.xcodeproj/project.pbxproj:
2471         * WebProcess/Network/NetworkProcessConnection.cpp:
2472         (WebKit::NetworkProcessConnection::didReceiveMessage):
2473         * WebProcess/Network/WebLoaderStrategy.cpp: Copied from Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp.
2474         (WebKit::WebLoaderStrategy::WebLoaderStrategy):
2475         (WebKit::WebLoaderStrategy::~WebLoaderStrategy):
2476         (WebKit::WebLoaderStrategy::loadResource):
2477         (WebKit::WebLoaderStrategy::schedulePluginStreamLoad):
2478         (WebKit::maximumBufferingTime):
2479         (WebKit::WebLoaderStrategy::scheduleLoad):
2480         (WebKit::WebLoaderStrategy::scheduleInternallyFailedLoad):
2481         (WebKit::WebLoaderStrategy::internallyFailedLoadTimerFired):
2482         (WebKit::WebLoaderStrategy::startLocalLoad):
2483         (WebKit::WebLoaderStrategy::remove):
2484         (WebKit::WebLoaderStrategy::setDefersLoading):
2485         (WebKit::WebLoaderStrategy::crossOriginRedirectReceived):
2486         (WebKit::WebLoaderStrategy::servePendingRequests):
2487         (WebKit::WebLoaderStrategy::suspendPendingRequests):
2488         (WebKit::WebLoaderStrategy::resumePendingRequests):
2489         (WebKit::WebLoaderStrategy::networkProcessCrashed):
2490         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
2491         (WebKit::WebLoaderStrategy::createPingHandle):
2492         (WebKit::WebResourceLoadScheduler::WebResourceLoadScheduler): Deleted.
2493         (WebKit::WebResourceLoadScheduler::~WebResourceLoadScheduler): Deleted.
2494         (WebKit::WebResourceLoadScheduler::loadResource): Deleted.
2495         (WebKit::WebResourceLoadScheduler::schedulePluginStreamLoad): Deleted.
2496         (WebKit::WebResourceLoadScheduler::scheduleLoad): Deleted.
2497         (WebKit::WebResourceLoadScheduler::scheduleInternallyFailedLoad): Deleted.
2498         (WebKit::WebResourceLoadScheduler::internallyFailedLoadTimerFired): Deleted.
2499         (WebKit::WebResourceLoadScheduler::startLocalLoad): Deleted.
2500         (WebKit::WebResourceLoadScheduler::remove): Deleted.
2501         (WebKit::WebResourceLoadScheduler::setDefersLoading): Deleted.
2502         (WebKit::WebResourceLoadScheduler::crossOriginRedirectReceived): Deleted.
2503         (WebKit::WebResourceLoadScheduler::servePendingRequests): Deleted.
2504         (WebKit::WebResourceLoadScheduler::suspendPendingRequests): Deleted.
2505         (WebKit::WebResourceLoadScheduler::resumePendingRequests): Deleted.
2506         (WebKit::WebResourceLoadScheduler::networkProcessCrashed): Deleted.
2507         (WebKit::WebResourceLoadScheduler::loadResourceSynchronously): Deleted.
2508         (WebKit::WebResourceLoadScheduler::createPingHandle): Deleted.
2509         * WebProcess/Network/WebLoaderStrategy.h: Copied from Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.h.
2510         (WebKit::WebLoaderStrategy::webResourceLoaderForIdentifier):
2511         (WebKit::WebResourceLoadScheduler::webResourceLoaderForIdentifier): Deleted.
2512         * WebProcess/Network/WebResourceLoadScheduler.cpp: Removed.
2513         * WebProcess/Network/WebResourceLoadScheduler.h: Removed.
2514         * WebProcess/Plugins/PluginView.cpp:
2515         (WebKit::PluginView::Stream::start):
2516         (WebKit::PluginView::Stream::cancel):
2517         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2518         (WebKit::WebPlatformStrategies::createLoaderStrategy):
2519         (WebKit::WebPlatformStrategies::createPasteboardStrategy):
2520         * WebProcess/WebProcess.cpp:
2521         (WebKit::WebProcess::WebProcess):
2522         (WebKit::WebProcess::initializeWebProcess):
2523         (WebKit::WebProcess::networkProcessConnectionClosed):
2524         (WebKit::WebProcess::webLoaderStrategy):
2525         (WebKit::WebProcess::webResourceLoadScheduler): Deleted.
2526         * WebProcess/WebProcess.h:
2527
2528 2015-12-03  Simon Fraser  <simon.fraser@apple.com>
2529
2530         Have layer memory use consult the backing store format
2531         https://bugs.webkit.org/show_bug.cgi?id=151827
2532         rdar://problem/23746497
2533
2534         Reviewed by Dean Jackson.
2535
2536         When computing the backing store memory size, take the pixel format into account,
2537         rather than assuming 4 bytes per pixel.
2538
2539         * Shared/mac/RemoteLayerBackingStore.h:
2540         * Shared/mac/RemoteLayerBackingStore.mm:
2541         (WebKit::RemoteLayerBackingStore::bytesPerPixel):
2542         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2543         (WebKit::PlatformCALayerRemote::backingStoreBytesPerPixel):
2544         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2545
2546 2015-12-03  Jer Noble  <jer.noble@apple.com>
2547
2548         Expose WebCore's InvisibleAutoplayNotPermitted setting to WebKit & WebKit2
2549         https://bugs.webkit.org/show_bug.cgi?id=151830
2550
2551         Reviewed by Anders Carlsson.
2552
2553         Add a new, private WKWebViewConfiguration property _invisibleAutoplayNotPermitted.
2554
2555         * Shared/WebPreferencesDefinitions.h:
2556         * UIProcess/API/Cocoa/WKWebView.mm:
2557         (-[WKWebView initWithFrame:configuration:]):
2558         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2559         (-[WKWebViewConfiguration init]):
2560         (-[WKWebViewConfiguration copyWithZone:]):
2561         (-[WKWebViewConfiguration _invisibleAutoplayNotPermitted]):
2562         (-[WKWebViewConfiguration _setInvisibleAutoplayNotPermitted:]):
2563         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2564         * WebProcess/WebPage/WebPage.cpp:
2565         (WebKit::WebPage::updatePreferences):
2566
2567 2015-12-03  Sam Weinig  <sam@webkit.org>
2568
2569         It should be possible to use version 6 of the WKPageUIClient without adopting the new createNewPage
2570         https://bugs.webkit.org/show_bug.cgi?id=151826
2571
2572         Reviewed by Anders Carlsson.
2573
2574         * UIProcess/API/C/WKPage.cpp:
2575         (WKPageSetPageUIClient):
2576         Pick which variant of createNewPage to use based on which function pointer is available,
2577         not the version number.
2578
2579 2015-12-03  Anders Carlsson  <andersca@apple.com>
2580
2581         Remove Objective-C GC support
2582         https://bugs.webkit.org/show_bug.cgi?id=151819
2583         rdar://problem/23746991
2584
2585         Reviewed by Dan Bernstein.
2586
2587         * Configurations/Base.xcconfig:
2588         * Configurations/BaseLegacyProcess.xcconfig:
2589         * Configurations/BaseXPCService.xcconfig:
2590         * Shared/Cocoa/APIObject.mm:
2591         (API::Object::newObject): Deleted.
2592
2593 2015-12-03  Jer Noble  <jer.noble@apple.com>
2594
2595         Unreviewed build-fix; fix !HAVE(AVKIT) build after r193340.
2596
2597         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2598         (WebKit::WebVideoFullscreenManagerProxy::applicationDidBecomeActive):
2599
2600 2015-12-03  Sam Weinig  <sam@webkit.org>
2601
2602         Need completionHandler-based WebKit C SPI for alert, confirm, and prompt
2603         <rdar://problem/23320863>
2604         https://bugs.webkit.org/show_bug.cgi?id=151708
2605
2606         (Add missing function definitions)
2607
2608         * UIProcess/API/C/WKPage.cpp:
2609         (WKPageRunJavaScriptAlertResultListenerGetTypeID):
2610         (WKPageRunJavaScriptAlertResultListenerCall):
2611         (WKPageRunJavaScriptConfirmResultListenerGetTypeID):
2612         (WKPageRunJavaScriptConfirmResultListenerCall):
2613         (WKPageRunJavaScriptPromptResultListenerGetTypeID):
2614         (WKPageRunJavaScriptPromptResultListenerCall):
2615
2616 2015-12-03  Jer Noble  <jer.noble@apple.com>
2617
2618         [iOS] Fullscreen -> PiP should resume to Fullscreen, not inline
2619         https://bugs.webkit.org/show_bug.cgi?id=150906
2620
2621         Reviewed by Simon Fraser.
2622
2623         Add methods to pass isVisible(), applicationDidBecomeActive(), and requestFullscreenMode()
2624         to and from models and interfaces.
2625
2626         * UIProcess/ios/WebPageProxyIOS.mm:
2627         (WebKit::WebPageProxy::applicationDidBecomeActive): Notify the fullscreen manager, if preset.
2628
2629         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2630         (WebKit::WebVideoFullscreenModelContext::requestFullscreenMode): Renamed from requestExitFullscreen(); takes a mode enum.
2631         (WebKit::WebVideoFullscreenModelContext::isVisible): Added.
2632         (WebKit::WebVideoFullscreenManagerProxy::applicationDidBecomeActive): Pass to all existing interfaces.
2633         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Do not re-create the view if it already exists.
2634         (WebKit::WebVideoFullscreenManagerProxy::requestFullscreenMode): Renamed from requestExitFullscreen(); takes a mode enum.
2635         (WebKit::WebVideoFullscreenManagerProxy::isVisible): Added. Query Page::isVisible() and Page::isInWindow(), the latter because
2636                 PiP will cause Page::isVisible() to be TRUE even when the containing tab is backgrounded.
2637         (WebKit::WebVideoFullscreenModelContext::requestExitFullscreen): Deleted.
2638         (WebKit::WebVideoFullscreenManagerProxy::requestExitFullscreen): Deleted.
2639         * WebProcess/ios/WebVideoFullscreenManager.mm:
2640         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): Only resize the view if we are not already in one of
2641                 the fullscreen modes.
2642         (WebKit::WebVideoFullscreenManager::requestFullscreenMode): Renamed from requestExitFullscreen().
2643         (WebKit::WebVideoFullscreenManager::requestExitFullscreen): Deleted.
2644
2645 2015-12-02  Antti Koivisto  <antti@apple.com>
2646
2647         Move ResourceLoadScheduler to WebKit1
2648         https://bugs.webkit.org/show_bug.cgi?id=151743
2649
2650         Reviewed by Alex Christensen.
2651
2652         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
2653         (WebKit::NetworkProcessPlatformStrategies::createCookiesStrategy):
2654         (WebKit::NetworkProcessPlatformStrategies::createLoaderStrategy):
2655         (WebKit::NetworkProcessPlatformStrategies::createPasteboardStrategy):
2656         (WebKit::NetworkProcessPlatformStrategies::createPluginStrategy):
2657         (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
2658         (WebKit::NetworkProcessPlatformStrategies::resourceLoadScheduler): Deleted.
2659         (WebKit::NetworkProcessPlatformStrategies::loadResourceSynchronously): Deleted.
2660         * NetworkProcess/NetworkProcessPlatformStrategies.h:
2661         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2662         * WebProcess/Network/WebResourceLoadScheduler.cpp:
2663         (WebKit::WebResourceLoadScheduler::~WebResourceLoadScheduler):
2664         (WebKit::WebResourceLoadScheduler::loadResource):
2665         (WebKit::WebResourceLoadScheduler::resumePendingRequests):
2666         (WebKit::WebResourceLoadScheduler::networkProcessCrashed):
2667         (WebKit::WebResourceLoadScheduler::loadResourceSynchronously):
2668         (WebKit::WebResourceLoadScheduler::createPingHandle):
2669         (WebKit::WebResourceLoadScheduler::scheduleSubresourceLoad): Deleted.
2670         (WebKit::WebResourceLoadScheduler::setSerialLoadingEnabled): Deleted.
2671         * WebProcess/Network/WebResourceLoadScheduler.h:
2672         (WebKit::WebResourceLoadScheduler::webResourceLoaderForIdentifier):
2673         * WebProcess/Plugins/PluginView.cpp:
2674         (WebKit::PluginView::Stream::start):
2675         (WebKit::PluginView::Stream::cancel):
2676         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2677         (WebKit::WebPlatformStrategies::createLoaderStrategy):
2678         (WebKit::WebPlatformStrategies::createPasteboardStrategy):
2679         (WebKit::WebPlatformStrategies::createPluginStrategy):
2680         (WebKit::WebPlatformStrategies::createBlobRegistry):
2681         (WebKit::WebPlatformStrategies::cookiesForDOM):
2682         (WebKit::WebPlatformStrategies::deleteCookie):
2683         (WebKit::WebPlatformStrategies::refreshPlugins):
2684         (WebKit::WebPlatformStrategies::resourceLoadScheduler): Deleted.
2685         (WebKit::WebPlatformStrategies::loadResourceSynchronously): Deleted.
2686         (WebKit::WebPlatformStrategies::createPingHandle): Deleted.
2687         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2688
2689 2015-12-02  Alex Christensen  <achristensen@webkit.org>
2690
2691         Fix authentication requests with NetworkSession and canHandleHTTPSServerTrustEvaluation true
2692         https://bugs.webkit.org/show_bug.cgi?id=151775
2693         rdar://problem/23586265
2694
2695         Reviewed by Chris Dumez.
2696
2697         In https://bugs.webkit.org/show_bug.cgi?id=150968 I copied functionality from 
2698         NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync into NetworkLoad::didReceiveChallenge
2699         but I overlooked the call to m_client.canAuthenticateAgainstProtectionSpaceAsync which is needed
2700         if canHandleHTTPSServerTrustEvaluation is true.  This adds that call and moves what should happen
2701         after that to NetworkLoad::continueCanAuthenticateAgainstProtectionSpace.
2702
2703         * NetworkProcess/NetworkLoad.cpp:
2704         (WebKit::NetworkLoad::didReceiveChallenge):
2705         (WebKit::NetworkLoad::didReceiveResponse):
2706         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
2707         * NetworkProcess/NetworkLoad.h:
2708         * NetworkProcess/NetworkSession.h:
2709         * Shared/Authentication/AuthenticationManager.h:
2710
2711 2015-12-01  Hunseop Jeong  <hs85.jeong@samsung.com>
2712
2713         Unreviewed, fix build after r192931.
2714
2715         * CMakeLists.txt: Remove the WKOriginDataManager in CMakeLists.txt.
2716
2717 2015-12-01  Yusuke Suzuki  <utatane.tea@gmail.com>
2718
2719         [ES6] Implement LLInt/Baseline Support for ES6 Generators and enable this feature
2720         https://bugs.webkit.org/show_bug.cgi?id=150792
2721
2722         Reviewed by Saam Barati.
2723
2724         * Configurations/FeatureDefines.xcconfig:
2725
2726 2015-12-01  Commit Queue  <commit-queue@webkit.org>
2727
2728         Unreviewed, rolling out r192914.
2729         https://bugs.webkit.org/show_bug.cgi?id=151734
2730
2731         JSC tests for this change are failing on 32 and 64-bit bots
2732         (Requested by ryanhaddad on #webkit).
2733
2734         Reverted changeset:
2735
2736         "[ES6] Implement LLInt/Baseline Support for ES6 Generators and
2737         enable this feature"
2738         https://bugs.webkit.org/show_bug.cgi?id=150792
2739         http://trac.webkit.org/changeset/192914
2740
2741 2015-12-01  Anders Carlsson  <andersca@apple.com>
2742
2743         Remove WKOriginDataManager
2744         https://bugs.webkit.org/show_bug.cgi?id=151723
2745
2746         Reviewed by Andy Estes.
2747
2748         * UIProcess/API/C/WKOriginDataManager.cpp: Removed.
2749         (WKOriginDataManagerGetTypeID): Deleted.
2750         (WKOriginDataManagerGetOrigins): Deleted.
2751         (WKOriginDataManagerDeleteEntriesForOrigin): Deleted.
2752         (WKOriginDataManagerDeleteEntriesModifiedBetweenDates): Deleted.
2753         (WKOriginDataManagerDeleteAllEntries): Deleted.
2754         * UIProcess/API/C/WKOriginDataManager.h: Removed.
2755         * WebKit2.xcodeproj/project.pbxproj:
2756
2757 2015-12-01  Yusuke Suzuki  <utatane.tea@gmail.com>
2758
2759         [ES6] Implement LLInt/Baseline Support for ES6 Generators and enable this feature
2760         https://bugs.webkit.org/show_bug.cgi?id=150792
2761
2762         Reviewed by Saam Barati.
2763
2764         * Configurations/FeatureDefines.xcconfig:
2765
2766 2015-12-01  Sam Weinig  <sam@webkit.org>
2767
2768         Need completionHandler-based WebKit C SPI for alert, confirm, and prompt
2769         <rdar://problem/23320863>
2770         https://bugs.webkit.org/show_bug.cgi?id=151708
2771
2772         Reviewed by Anders Carlsson.
2773
2774         Add listener based versions of alert, confirm and prompt.
2775
2776         * Shared/API/APIObject.h:
2777         * Shared/API/c/WKBase.h:
2778         * UIProcess/API/C/WKPage.cpp:
2779         (WebKit::RunJavaScriptAlertResultListener::create):
2780         (WebKit::RunJavaScriptAlertResultListener::~RunJavaScriptAlertResultListener):
2781         (WebKit::RunJavaScriptAlertResultListener::call):
2782         (WebKit::RunJavaScriptAlertResultListener::RunJavaScriptAlertResultListener):
2783         (WebKit::RunJavaScriptConfirmResultListener::create):
2784         (WebKit::RunJavaScriptConfirmResultListener::~RunJavaScriptConfirmResultListener):
2785         (WebKit::RunJavaScriptConfirmResultListener::call):
2786         (WebKit::RunJavaScriptConfirmResultListener::RunJavaScriptConfirmResultListener):
2787         (WebKit::RunJavaScriptPromptResultListener::create):
2788         (WebKit::RunJavaScriptPromptResultListener::~RunJavaScriptPromptResultListener):
2789         (WebKit::RunJavaScriptPromptResultListener::call):
2790         (WebKit::RunJavaScriptPromptResultListener::RunJavaScriptPromptResultListener):
2791         (WKPageSetPageUIClient):
2792         * UIProcess/API/C/WKPageUIClient.h:
2793
2794 2015-12-01  Anders Carlsson  <andersca@apple.com>
2795
2796         Remove WebKit2.framework
2797         https://bugs.webkit.org/show_bug.cgi?id=151715
2798
2799         Reviewed by Dan Bernstein.
2800
2801         * Configurations/WebKit2.xcconfig: Removed.
2802         * UIProcess/API/Cocoa/WebKit2.h: Removed.
2803         * WebKit2.xcodeproj/project.pbxproj:
2804         * mac/Info-WebKit2.plist: Removed.
2805         * mac/MigrateHeadersToWebKit2.make: Removed.
2806         * mac/WebKit2.m: Removed.
2807
2808 2015-12-01  Alex Christensen  <achristensen@webkit.org>
2809
2810         Use Optional for matrix inverses
2811         https://bugs.webkit.org/show_bug.cgi?id=151575
2812
2813         Reviewed by Myles C. Maxfield.
2814
2815         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2816         (WebKit::NetscapePlugin::convertFromRootView):
2817         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2818         (WebKit::NetscapePlugin::convertPoint):
2819         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
2820         (WebKit::PDFPlugin::convertFromPDFViewToRootView):
2821         (WebKit::PDFPlugin::convertFromPDFViewToScreen):
2822         (WebKit::PDFPlugin::boundsOnScreen):
2823         (WebKit::PDFPlugin::geometryDidChange):
2824         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2825         (WebKit::PDFPlugin::geometryDidChange):
2826
2827 2015-12-01  Tim Horton  <timothy_horton@apple.com>
2828
2829         Remove swipe snapshot before main document load if scroll position is already restored
2830         https://bugs.webkit.org/show_bug.cgi?id=151224
2831
2832         Reviewed by Darin Adler.
2833
2834         * UIProcess/Cocoa/WebViewImpl.h:
2835         * UIProcess/Cocoa/WebViewImpl.mm:
2836         (WebKit::WebViewImpl::didRestoreScrollPosition):
2837         * UIProcess/PageClient.h:
2838         * UIProcess/WebPageProxy.cpp:
2839         (WebKit::WebPageProxy::didRestoreScrollPosition):
2840         * UIProcess/WebPageProxy.h:
2841         * UIProcess/WebPageProxy.messages.in:
2842         * UIProcess/mac/PageClientImpl.h:
2843         * UIProcess/mac/PageClientImpl.mm:
2844         (WebKit::PageClientImpl::didRestoreScrollPosition):
2845         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2846         (WebKit::WebFrameLoaderClient::didRestoreScrollPosition):
2847         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2848         * WebProcess/WebPage/WebPage.cpp:
2849         (WebKit::WebPage::didRestoreScrollPosition):
2850         * WebProcess/WebPage/WebPage.h:
2851         Plumb didRestoreScrollPosition through to ViewGestureController (yikes!).
2852
2853         * UIProcess/ViewGestureController.cpp:
2854         (WebKit::ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame):
2855         Cancel waiting for any more loads if we get to firstVisuallyNonEmptyLayout.
2856
2857         (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
2858         Cancel waiting for scroll position restoration if we make it to main frame load,
2859         because there is a chance we won't be able to restore the old scroll position, and
2860         by main frame load time we've tried as hard as we're going to to restore it.
2861
2862         * UIProcess/mac/ViewGestureControllerMac.mm:
2863         (WebKit::ViewGestureController::endSwipeGesture):
2864         Make some legacy-style-only code clearer that it's legacy-style-only.
2865         Wait for scroll position restoration.
2866
2867 2015-12-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2868
2869         REGRESSION(r192834): [GTK] Test /webkit2/WebKitWebView/editor-state/typing-attributes times out after r192834
2870         https://bugs.webkit.org/show_bug.cgi?id=151699
2871
2872         Reviewed by Tim Horton.
2873
2874         In r192834 the code to send EditorStateChanged message to the UI
2875         process from WebPage::didChangeSelection was removed for non-mac
2876         ports.
2877
2878         * WebProcess/WebPage/WebPage.cpp:
2879         (WebKit::WebPage::didChangeSelection): Send EditorStateChanged
2880         message to the UI process also for non-mac ports, as before r192834.
2881
2882 2015-12-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2883
2884         Unreviewed. Fix timeouts in several HTTP layout tests in GTK+ after r192796.
2885
2886         In r192796, the initialization of m_ignoreTLSErrors in
2887         WebProcessPool was removed by mistake, making all HTTP tests that use
2888         HTTPS fail due to invalid certificate errors.
2889
2890         * UIProcess/WebProcessPool.h: Bring back m_ignoreTLSErrors initialization.
2891
2892 2015-12-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2893
2894         REGRESSION(r192247): [GTK] ASSERTION FAILED: type == WebCore::ActionType || type == WebCore::CheckableActionType || type == WebCore::SeparatorType
2895         https://bugs.webkit.org/show_bug.cgi?id=151513
2896
2897         Reviewed by Martin Robinson.
2898
2899         This happens because we are using our own WebContextMenuItemGtk
2900         derived from WebContextMenuItemData, but using our own submenu
2901         items handling. We are using the non-submenu
2902         WebContextMenuItemData constructor to create our submenu items
2903         too, because WebContextMenuItemData always expect the submenu
2904         items to be passed to the constructor, but we have a set_submenu
2905         method in the public API. So we consider that a
2906         WebContextMenuItemGtk is SubmenuType if it has submenu items, but
2907         we use the action type internally. When converting a
2908         WebContextMenuItemGtk to a generic WebContextMenuItemData, we
2909         correctly set the type and pass the submenu items to the
2910         approriate constructor.
2911
2912         * Shared/gtk/WebContextMenuItemGtk.cpp:
2913         (WebKit::WebContextMenuItemGtk::WebContextMenuItemGtk): When
2914         constructing from a WebContextMenuItemData, set the type as
2915         ActionType when it's a submenu type.
2916         * Shared/gtk/WebContextMenuItemGtk.h:
2917         (WebKit::WebContextMenuItemGtk::type): Return SubmenuType if
2918         submenu items vector is not empty, otherwise use the parent method.
2919         * UIProcess/API/gtk/WebKitContextMenuItem.cpp:
2920         (webkit_context_menu_item_new_with_submenu): Create the
2921         WebContextMenuItemGtk as ActionType.
2922
2923 2015-12-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2924
2925         Unreviewed. Add missing inspector files to the GTK+ build.
2926
2927         * PlatformGTK.cmake: Add also Debug css files.
2928
2929 2015-11-30  Alexey Proskuryakov  <ap@apple.com>
2930
2931         Build fix for some compiler versions.
2932
2933         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: Disable deprecation warnings while
2934         processing SOFT_LINK_CLASS too.
2935
2936 2015-11-30  Jiewen Tan  <jiewen_tan@apple.com>
2937
2938         Null dereference loading Blink layout test http/tests/misc/detach-during-notifyDone.html
2939         https://bugs.webkit.org/show_bug.cgi?id=149309
2940         <rdar://problem/22748363>
2941
2942         Reviewed by Brent Fulgham.
2943
2944         Callback of bundle clients could kill the documentloader. Therefore, make a copy
2945         of the navigationID before invoking the callback.
2946
2947         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2948         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
2949         (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage):
2950         (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage):
2951         (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage):
2952         (WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
2953         (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
2954         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoad):
2955
2956 2015-11-30  Tim Horton  <timothy_horton@apple.com>
2957
2958         Get rid of the !USE(ASYNC_NSTEXTINPUTCLIENT) codepath
2959         https://bugs.webkit.org/show_bug.cgi?id=151673
2960
2961         Reviewed by Anders Carlsson.
2962
2963         * UIProcess/API/Cocoa/WKWebView.mm:
2964         * UIProcess/API/mac/WKView.mm:
2965         * UIProcess/Cocoa/WebViewImpl.h:
2966         * UIProcess/Cocoa/WebViewImpl.mm:
2967         (WebKit::WebViewImpl::resignFirstResponder): Deleted.
2968         (WebKit::WebViewImpl::interpretKeyEvent): Deleted.
2969         (WebKit::WebViewImpl::executeSavedKeypressCommands): Deleted.
2970         (WebKit::WebViewImpl::doCommandBySelector): Deleted.
2971         (WebKit::WebViewImpl::insertText): Deleted.
2972         (WebKit::WebViewImpl::inputContext): Deleted.
2973         (WebKit::WebViewImpl::selectedRange): Deleted.
2974         (WebKit::WebViewImpl::hasMarkedText): Deleted.
2975         (WebKit::WebViewImpl::unmarkText): Deleted.
2976         (WebKit::WebViewImpl::setMarkedText): Deleted.
2977         (WebKit::WebViewImpl::markedRange): Deleted.
2978         (WebKit::WebViewImpl::attributedSubstringForProposedRange): Deleted.
2979         (WebKit::WebViewImpl::characterIndexForPoint): Deleted.
2980         (WebKit::WebViewImpl::firstRectForCharacterRange): Deleted.
2981         (WebKit::WebViewImpl::performKeyEquivalent): Deleted.
2982         (WebKit::WebViewImpl::keyUp): Deleted.
2983         (WebKit::WebViewImpl::keyDown): Deleted.
2984         (WebKit::WebViewImpl::flagsChanged): Deleted.
2985         * UIProcess/PageClient.h:
2986         * UIProcess/WebPageProxy.cpp:
2987         (WebKit::WebPageProxy::WebPageProxy): Deleted.
2988         (WebKit::WebPageProxy::resetStateAfterProcessExited): Deleted.
2989         * UIProcess/WebPageProxy.h:
2990         * UIProcess/mac/PageClientImpl.h:
2991         * UIProcess/mac/PageClientImpl.mm:
2992         (WebKit::PageClientImpl::notifyApplicationAboutInputContextChange): Deleted.
2993         * UIProcess/mac/WebPageProxyMac.mm:
2994         (WebKit::WebPageProxy::setComposition): Deleted.
2995         (WebKit::WebPageProxy::confirmComposition): Deleted.
2996         (WebKit::WebPageProxy::insertText): Deleted.
2997         (WebKit::WebPageProxy::insertDictatedText): Deleted.
2998         (WebKit::WebPageProxy::getMarkedRange): Deleted.
2999         (WebKit::WebPageProxy::getSelectedRange): Deleted.
3000         (WebKit::WebPageProxy::getAttributedSubstringFromRange): Deleted.
3001         (WebKit::WebPageProxy::characterIndexForPoint): Deleted.
3002         (WebKit::WebPageProxy::firstRectForCharacterRange): Deleted.
3003         (WebKit::WebPageProxy::executeKeypressCommands): Deleted.
3004         (WebKit::WebPageProxy::cancelComposition): Deleted.
3005         (WebKit::WebPageProxy::editorStateChanged): Deleted.
3006         * WebProcess/WebPage/WebPage.cpp:
3007         (WebKit::WebPage::didChangeSelection):
3008         * WebProcess/WebPage/WebPage.h:
3009         * WebProcess/WebPage/WebPage.messages.in:
3010         * WebProcess/WebPage/mac/WebPageMac.mm:
3011         (WebKit::WebPage::setComposition): Deleted.
3012         (WebKit::WebPage::confirmComposition): Deleted.
3013         (WebKit::WebPage::insertText): Deleted.
3014         (WebKit::WebPage::insertDictatedText): Deleted.
3015         (WebKit::WebPage::getMarkedRange): Deleted.
3016         (WebKit::WebPage::getSelectedRange): Deleted.
3017         (WebKit::WebPage::getAttributedSubstringFromRange): Deleted.
3018         (WebKit::WebPage::characterIndexForPoint): Deleted.
3019         (WebKit::WebPage::firstRectForCharacterRange): Deleted.
3020         (WebKit::WebPage::executeKeypressCommands): Deleted.
3021         (WebKit::WebPage::cancelComposition): Deleted.
3022
3023 2015-11-30  Tim Horton  <timothy_horton@apple.com>
3024
3025         Remove some unused synchronous drawing SPI
3026         https://bugs.webkit.org/show_bug.cgi?id=151672
3027
3028         Reviewed by Anders Carlsson.
3029
3030         * UIProcess/API/Cocoa/WKViewPrivate.h:
3031         * UIProcess/API/mac/WKView.mm:
3032         (-[WKView forceAsyncDrawingAreaSizeUpdate:]): Deleted.
3033         (-[WKView waitForAsyncDrawingAreaSizeUpdate]): Deleted.
3034         * UIProcess/Cocoa/WebViewImpl.h:
3035         * UIProcess/Cocoa/WebViewImpl.mm:
3036         (WebKit::WebViewImpl::forceAsyncDrawingAreaSizeUpdate): Deleted.
3037         (WebKit::WebViewImpl::waitForAsyncDrawingAreaSizeUpdate): Deleted.
3038
3039 2015-11-30  Tim Horton  <timothy_horton@apple.com>
3040
3041         Get rid of the legacy swipe shadow style
3042         https://bugs.webkit.org/show_bug.cgi?id=151671
3043
3044         Reviewed by Anders Carlsson.
3045
3046         * UIProcess/mac/ViewGestureControllerMac.mm:
3047         (WebKit::ViewGestureController::beginSwipeGesture): Deleted.
3048         (WebKit::ViewGestureController::handleSwipeGesture): Deleted.
3049         (WebKit::ViewGestureController::removeSwipeSnapshot): Deleted.
3050         It is no longer needed.
3051
3052 2015-11-30  Tim Horton  <timothy_horton@apple.com>
3053
3054         [iOS] Option-up and Option-down should scroll a little less than a full page
3055         https://bugs.webkit.org/show_bug.cgi?id=151538
3056         <rdar://problem/23642675>
3057
3058         Reviewed by Simon Fraser.
3059
3060         * UIProcess/ios/WKContentViewInteraction.mm:
3061         (-[WKContentView _scrollOffsetForEvent:]):
3062         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
3063         Clean up the code a little, and adjust so that we *always* use pageStep
3064         instead of just scrolling by the unobscured rect when scrolling by a page.
3065         Previously, we did for the spacebar, but not for option-up and option-down.
3066
3067 2015-11-30  Brian Burg  <bburg@apple.com>
3068
3069         Web Inspector: using "Reload Web Inspector" when docked breaks dock-specific styles
3070         https://bugs.webkit.org/show_bug.cgi?id=151642
3071
3072         Reviewed by Timothy Hatcher.
3073
3074         After a frontend loads, explicitly tell it about the current dock
3075         state. This is necessary for force-reloading the inspector, since
3076         the dock state isn't sent from UIProcess in this case.
3077
3078         * WebProcess/WebPage/WebInspectorUI.cpp:
3079         (WebKit::WebInspectorUI::frontendLoaded):
3080         (WebKit::WebInspectorUI::setDockingUnavailable):
3081         * WebProcess/WebPage/WebInspectorUI.h:
3082
3083 2015-11-30  Alex Christensen  <achristensen@webkit.org>
3084
3085         Make ProcessModel always MultipleSecondaryProcesses
3086         https://bugs.webkit.org/show_bug.cgi?id=151662
3087
3088         Reviewed by Antti Koivisto.
3089
3090         Single WebProcess behavior can still be achieved by setting the maximum number of WebProcesses to 1.
3091
3092         * Shared/API/c/WKDeprecatedFunctions.cpp:
3093         (WKContextSetUsesNetworkProcess):
3094         (WKContextSetProcessModel):
3095         (WKContextGetProcessModel):
3096         (WKGraphicsContextGetCGContext):
3097         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3098         (API::ProcessPoolConfiguration::createWithLegacyOptions):
3099         (API::ProcessPoolConfiguration::copy):
3100         * UIProcess/API/APIProcessPoolConfiguration.h:
3101         * UIProcess/API/C/WKAPICast.h:
3102         (WebKit::toAPI):
3103         (WebKit::toFontSmoothingLevel):
3104         (WebKit::toProcessModel): Deleted.
3105         * UIProcess/API/C/WKContext.cpp:
3106         (WKContextGetCacheModel):
3107         (WKContextSetMaximumNumberOfProcesses):
3108         (WKContextSetProcessModel): Deleted.
3109         (WKContextGetProcessModel): Deleted.
3110         * UIProcess/API/C/WKContext.h:
3111         * UIProcess/API/Cocoa/WKProcessGroup.mm:
3112         (-[WKProcessGroup initWithInjectedBundleURL:]):
3113         * UIProcess/API/Cocoa/WKProcessPool.mm:
3114         * UIProcess/API/efl/ewk_context.cpp:
3115         (EwkContext::cacheModel):
3116         (EwkContext::setProcessModel):
3117         (EwkContext::processModel):
3118         (EwkContext::clearResourceCache):
3119         (EwkContext::jsGlobalContext):
3120         (ewk_context_message_from_extensions_callback_set):
3121         (ewk_context_process_model_set):
3122         (ewk_context_process_model_get):
3123         (ewk_context_tls_error_policy_get):
3124         (toWKProcessModel): Deleted.
3125         (toEwkProcessModel): Deleted.
3126         * UIProcess/API/gtk/WebKitWebContext.cpp:
3127         * UIProcess/ProcessModel.h: Removed.
3128         * UIProcess/WebCookieManagerProxy.cpp:
3129         (WebKit::WebCookieManagerProxy::shouldTerminate):
3130         (WebKit::WebCookieManagerProxy::refWebContextSupplement):
3131         * UIProcess/WebInspectorProxy.cpp:
3132         (WebKit::WebInspectorProxy::inspectorProcessPool):
3133         * UIProcess/WebPageProxy.cpp:
3134         (WebKit::WebPageProxy::reattachToWebProcess):
3135         * UIProcess/WebProcessPool.cpp:
3136         (WebKit::WebProcessPool::create):
3137         (WebKit::WebProcessPool::setDownloadClient):
3138         (WebKit::WebProcessPool::setMaximumNumberOfProcesses):
3139         (WebKit::WebProcessPool::processDidCachePage):
3140         (WebKit::WebProcessPool::createNewWebProcess):
3141         (WebKit::WebProcessPool::disconnectProcess):
3142         (WebKit::WebProcessPool::createWebPage):
3143         (WebKit::WebProcessPool::postMessageToInjectedBundle):
3144         (WebKit::WebProcessPool::requestWebContentStatistics):
3145         (WebKit::WebProcessPool::requestNetworkingStatistics):
3146         (WebKit::WebProcessPool::setProcessModel): Deleted.
3147         (WebKit::WebProcessPool::ensureSharedWebProcess): Deleted.
3148         * UIProcess/WebProcessPool.h:
3149         (WebKit::WebProcessPool::sendToAllProcessesRelaunchingThemIfNecessary):
3150         (WebKit::WebProcessPool::sendToOneProcess):
3151         * WebKit2.xcodeproj/project.pbxproj:
3152
3153 2015-11-30  Chris Dumez  <cdumez@apple.com>
3154
3155         [WK2][Cache] We should not speculatively revalidate transient resources
3156         https://bugs.webkit.org/show_bug.cgi?id=151402
3157         <rdar://problem/23092196>
3158
3159         Reviewed by Antti Koivisto.
3160
3161         We should not speculatively revalidate transient resources. This patch
3162         adds a simple and conservative algorithm to detect that a subresource is
3163         transient and then ignores those when doing the speculative revalidation.
3164
3165         The algorithm is question marks as transient all subresources that are
3166         not common to the 2 last loads of a main resource.
3167
3168         This is not perfect as I see the number of non-speculative revalidations
3169         going up to 11-12 from 9 in the context of the warm PLT. However, it is
3170         best to be conservative at first and we can improve this later.
3171
3172         * NetworkProcess/cache/NetworkCache.cpp:
3173         (WebKit::NetworkCache::Cache::retrieve):
3174         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3175         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::create):
3176         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::~PendingFrameLoad):
3177         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::registerSubresource):
3178         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::markLoadAsCompleted):
3179         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::setExistingSubresourcesEntry):
3180         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::PendingFrameLoad):
3181         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
3182         (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad):
3183         (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
3184         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
3185         (WebKit::NetworkCache::SpeculativeLoadManager::retrieve): Deleted.
3186         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry): Deleted.
3187         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
3188         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
3189         (WebKit::NetworkCache::SubresourcesEntry::encodeAsStorageRecord):
3190         (WebKit::NetworkCache::SubresourcesEntry::decodeStorageRecord):
3191         (WebKit::NetworkCache::SubresourcesEntry::SubresourcesEntry):
3192         (WebKit::NetworkCache::SubresourcesEntry::updateSubresourceKeys):
3193         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
3194         (WebKit::NetworkCache::SubresourcesEntry::SubresourceInfo::encode):
3195         (WebKit::NetworkCache::SubresourcesEntry::SubresourceInfo::decode):
3196         (WebKit::NetworkCache::SubresourcesEntry::SubresourceInfo::SubresourceInfo):
3197         (WebKit::NetworkCache::SubresourcesEntry::subresources):
3198
3199 2015-11-30  Brent Fulgham  <bfulgham@apple.com>
3200
3201         [Mac] Add font service permission to the sandbox profile
3202         https://bugs.webkit.org/show_bug.cgi?id=151509
3203         <rdar://problem/23508753>
3204
3205         Reviewed by Anders Carlsson.
3206
3207         Update the sandbox profile for Mac WebKit to allow access to the
3208         "com.apple.fonts" service.
3209
3210         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb:
3211         * WebProcess/com.apple.WebProcess.sb.in:
3212
3213 2015-11-30  Alex Christensen  <achristensen@webkit.org>
3214
3215         Make usesNetworkProcess always true
3216         https://bugs.webkit.org/show_bug.cgi?id=151580
3217
3218         Reviewed by Darin Adler.
3219
3220         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3221         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
3222         * Shared/API/c/WKDeprecatedFunctions.cpp:
3223         (WKInspectorToggleJavaScriptProfiling):
3224         (WKContextSetUsesNetworkProcess):
3225         (WKGraphicsContextGetCGContext):
3226         * Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
3227         (WebKit::CustomProtocolManager::initializeConnection):
3228         (WebKit::CustomProtocolManager::initialize):
3229         * Shared/Network/CustomProtocols/CustomProtocolManager.h:
3230         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
3231         (WebKit::CustomProtocolManager::initialize):
3232         * Shared/WebProcessCreationParameters.cpp:
3233         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
3234         (WebKit::WebProcessCreationParameters::encode):
3235         (WebKit::WebProcessCreationParameters::decode):
3236         * Shared/WebProcessCreationParameters.h:
3237         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3238         (API::ProcessPoolConfiguration::createWithLegacyOptions):
3239         (API::ProcessPoolConfiguration::copy):
3240         * UIProcess/API/APIProcessPoolConfiguration.h:
3241         * UIProcess/API/C/WKContext.cpp:
3242         (WKContextSetJavaScriptGarbageCollectorTimerEnabled):
3243         (WKContextUseTestingNetworkSession):
3244         (WKContextSetUsesNetworkProcess): Deleted.
3245         * UIProcess/API/C/WKContextPrivate.h:
3246         * UIProcess/API/Cocoa/WKProcessGroup.mm:
3247         (-[WKProcessGroup initWithInjectedBundleURL:]):
3248         * UIProcess/API/efl/ewk_context.cpp:
3249         (EwkContext::setProcessModel):
3250         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3251         (WebKit::WebProcessPool::updateProcessSuppressionState):
3252         (WebKit::WebProcessPool::platformInitializeWebProcess):
3253         * UIProcess/Downloads/DownloadProxy.cpp:
3254         (WebKit::DownloadProxy::cancel):
3255         (WebKit::DownloadProxy::invalidate):
3256         * UIProcess/WebCookieManagerProxy.cpp:
3257         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
3258         (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
3259         * UIProcess/WebProcessPool.cpp:
3260         (WebKit::WebProcessPool::WebProcessPool):
3261         (WebKit::m_processSuppressionDisabledForPageCounter):
3262         (WebKit::WebProcessPool::networkingProcessConnection):
3263         (WebKit::WebProcessPool::languageChanged):
3264         (WebKit::WebProcessPool::textCheckerStateChanged):
3265         (WebKit::WebProcessPool::ensureNetworkProcess):
3266         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
3267         (WebKit::WebProcessPool::createNewWebProcess):
3268         (WebKit::WebProcessPool::download):
3269         (WebKit::WebProcessPool::resumeDownload):
3270         (WebKit::WebProcessPool::setCanHandleHTTPSServerTrustEvaluation):
3271         (WebKit::WebProcessPool::setCacheModel):
3272         (WebKit::WebProcessPool::createDownloadProxy):
3273         (WebKit::WebProcessPool::addMessageReceiver):
3274         (WebKit::WebProcessPool::allowSpecificHTTPSCertificateForHost):
3275         (WebKit::WebProcessPool::setHTTPPipeliningEnabled):
3276         (WebKit::WebProcessPool::requestNetworkingStatistics):
3277         (WebKit::WebProcessPool::setUsesNetworkProcess): Deleted.
3278         (WebKit::WebProcessPool::usesNetworkProcess): Deleted.
3279         * UIProcess/WebProcessPool.h:
3280         (WebKit::WebProcessPool::sendToNetworkingProcess):
3281         (WebKit::WebProcessPool::sendToNetworkingProcessRelaunchingIfNecessary):
3282         * UIProcess/WebProcessProxy.cpp:
3283         (WebKit::WebProcessProxy::shutDown):
3284         (WebKit::WebProcessProxy::removeWebPage):
3285         (WebKit::WebProcessProxy::canTerminateChildProcess):
3286         (WebKit::WebProcessProxy::updateTextCheckerState):
3287         (WebKit::WebProcessProxy::didSaveToPageCache):
3288         (WebKit::WebProcessProxy::didSetAssertionState):
3289         (WebKit::WebProcessProxy::createDownloadProxy): Deleted.
3290         * UIProcess/WebProcessProxy.h:
3291         * UIProcess/efl/WebProcessPoolEfl.cpp:
3292         (WebKit::WebProcessPool::platformInitializeWebProcess):
3293         (WebKit::WebProcessPool::setIgnoreTLSErrors):
3294         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
3295         (WebKit::BlobRegistryProxy::registerFileBlobURL):
3296         (WebKit::BlobRegistryProxy::registerBlobURL):
3297         (WebKit::BlobRegistryProxy::unregisterBlobURL):
3298         (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
3299         (WebKit::BlobRegistryProxy::blobSize):
3300         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3301         (WebKit::WebPlatformStrategies::cookiesForDOM):
3302         (WebKit::WebPlatformStrategies::setCookiesFromDOM):
3303         (WebKit::WebPlatformStrategies::cookiesEnabled):
3304         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
3305         (WebKit::WebPlatformStrategies::getRawCookies):
3306         (WebKit::WebPlatformStrategies::deleteCookie):
3307         (WebKit::WebPlatformStrategies::resourceLoadScheduler):
3308         (WebKit::WebPlatformStrategies::loadResourceSynchronously):
3309         (WebKit::WebPlatformStrategies::createPingHandle):
3310         (WebKit::WebPlatformStrategies::createBlobRegistry):
3311         * WebProcess/WebPage/WebFrame.cpp:
3312         (WebKit::WebFrame::startDownload):
3313         (WebKit::WebFrame::convertMainResourceLoadToDownload):
3314         (WebKit::WebFrame::source):
3315         * WebProcess/WebProcess.cpp:
3316         (WebKit::WebProcess::WebProcess):
3317         (WebKit::m_webSQLiteDatabaseTracker):
3318         (WebKit::WebProcess::initializeConnection):
3319         (WebKit::WebProcess::initializeWebProcess):
3320         (WebKit::WebProcess::ensureNetworkProcessConnection):
3321         (WebKit::WebProcess::destroyPrivateBrowsingSession):
3322         (WebKit::WebProcess::pluginProcessConnectionManager):
3323         (WebKit::WebProcess::shouldTerminate):
3324         (WebKit::WebProcess::setInjectedBundleParameters):
3325         (WebKit::WebProcess::networkConnection):
3326         (WebKit::WebProcess::setEnhancedAccessibility):
3327         (WebKit::WebProcess::prefetchDNS):
3328         (WebKit::WebProcess::didCreateDownload): Deleted.
3329         (WebKit::WebProcess::didDestroyDownload): Deleted.
3330         (WebKit::WebProcess::downloadProxyConnection): Deleted.
3331         (WebKit::WebProcess::downloadsAuthenticationManager): Deleted.
3332         (WebKit::WebProcess::downloadManager): Deleted.
3333         (WebKit::WebProcess::usesNetworkProcess): Deleted.
3334         (WebKit::WebProcess::downloadRequest): Deleted.
3335         (WebKit::WebProcess::resumeDownload): Deleted.
3336         (WebKit::WebProcess::cancelDownload): Deleted.
3337         * WebProcess/WebProcess.h:
3338         (WebKit::WebProcess::textCheckerState):
3339         (WebKit::WebProcess::eventDispatcher):
3340         * WebProcess/WebProcess.messages.in:
3341         * WebProcess/soup/WebProcessSoup.cpp:
3342         (WebKit::WebProcess::platformSetCacheModel):
3343         (WebKit::WebProcess::platformClearResourceCaches):
3344         (WebKit::WebProcess::platformInitializeWebProcess):
3345         (WebKit::WebProcess::platformTerminate):
3346         (WebKit::getCacheDiskFreeSize): Deleted.
3347         (WebKit::setSoupSessionAcceptLanguage): Deleted.
3348         (WebKit::languageChanged): Deleted.
3349         (WebKit::WebProcess::setIgnoreTLSErrors): Deleted.
3350         (WebKit::WebProcess::allowSpecificHTTPSCertificateForHost): Deleted.
3351
3352 2015-11-30  Carlos Garcia Campos  <cgarcia@igalia.com>
3353
3354         [GTK] UI process crash when the screensaver DBus proxy is being created while the web view is destroyed
3355         https://bugs.webkit.org/show_bug.cgi?id=151653
3356
3357         Reviewed by Martin Robinson.
3358
3359         We correctly cancel the proxy creation, but when the async ready
3360         callback is called, the view could be destroyed already. In that
3361         case g_dbus_proxy_new_for_bus_finish() will return nullptr and
3362         fail with cancelled error, but we are using the passed web view
3363         without checking first if the creation failed or not.
3364
3365         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3366         (screenSaverProxyCreatedCallback):
3367
3368 2015-11-28  Tim Horton  <timothy_horton@apple.com>
3369
3370         Stop unnecessarily copying WKWebViewConfiguration in a few places
3371         https://bugs.webkit.org/show_bug.cgi?id=151639
3372
3373         Reviewed by Dan Bernstein.
3374
3375         * UIProcess/API/Cocoa/WKWebView.mm:
3376         (-[WKWebView initWithFrame:configuration:]):
3377         (-[WKWebView dealloc]):
3378         (-[WKWebView _contentProviderRegistry]):
3379         (-[WKWebView _selectionGranularity]):
3380         (-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
3381         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3382         * UIProcess/ios/PageClientImplIOS.mm:
3383         (WebKit::PageClientImpl::mimeTypesWithCustomContentProviders):
3384         * UIProcess/ios/WKContentViewInteraction.mm:
3385         (-[WKContentView setupInteraction]):
3386         (-[WKContentView _stopAssistingKeyboard]):
3387         Looking at allocation traces I noticed that we were making way more
3388         WKWebViewConfigurations than made sense; looking at backtraces I found
3389         a few internal callers of -[WKWebView configuration], which copies the
3390         configuration. There's no reason for these internal callers to make 
3391         such a copy, though.
3392
3393         I'm not exactly sure what the usual approach is here, but I added
3394         getters so WKContentViewInteraction and PageClientImplIOS can get to
3395         the values they're looking for without using the configuration property.
3396
3397 2015-11-27  Brady Eidson  <beidson@apple.com>
3398
3399         Modern IDB: Class-ify IDBGetResult making it impossible to get the data members wrong.
3400         https://bugs.webkit.org/show_bug.cgi?id=151627
3401
3402         Reviewed by Alexey Proskuryakov.
3403
3404         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
3405         (WebKit::UniqueIDBDatabase::getRecordFromBackingStore):
3406         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
3407         
3408         * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
3409         
3410         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
3411         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getIndexRecord):
3412         
3413         * Shared/WebCoreArgumentCoders.cpp:
3414         (IPC::ArgumentCoder<IDBGetResult>::encode):
3415         (IPC::ArgumentCoder<IDBGetResult>::decode):
3416         * Shared/WebCoreArgumentCoders.h:
3417         
3418         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:
3419
3420 2015-11-27  Carlos Garcia Campos  <cgarcia@igalia.com>
3421
3422         [GTK] Remove the remaining uses of GMainLoopSource
3423         https://bugs.webkit.org/show_bug.cgi?id=151632
3424
3425         Reviewed by Žan Doberšek.
3426
3427         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3428         (_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate):
3429         (_WebKitWebViewBasePrivate::clearRedirectedWindowSoonTimerFired):
3430         (webkitWebViewBaseClearRedirectedWindowSoon):
3431         (webkitWebViewBaseEnterAcceleratedCompositingMode):
3432
3433 2015-11-23  Carlos Garcia Campos  <cgarcia@igalia.com>
3434
3435         [GTK] Use the network process unconditionally
3436         https://bugs.we