8b113180efdf066f0147445d63231a2cda693420
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-03-09  Conrad Shultz  <conrad_shultz@apple.com>
2
3         WebsiteDataStore::Configuration::legacyWebsiteDataStoreConfiguration() should respect the passed-in configuration
4         https://bugs.webkit.org/show_bug.cgi?id=155250
5
6         Reviewed by Anders Carlsson.
7
8         Note that the legacy directories are already set by default in ProcessPoolConfiguration::createWithLegacyOptions(),
9         which is also where the shouldHaveLegacyDataStore flag, which will cause this code path to be reached, is set.
10
11         * UIProcess/WebProcessPool.cpp:
12         (WebKit::legacyWebsiteDataStoreConfiguration):
13         Use the passed-in configuration to set the application cache, network cache, and media keys storage directories.
14
15 2016-03-09  Chris Dumez  <cdumez@apple.com>
16
17         Speculative disk cache resource revalidations are sometimes wasted
18         https://bugs.webkit.org/show_bug.cgi?id=155187
19         <rdar://problem/25032905>
20
21         Reviewed by Antti Koivisto.
22
23         Speculative disk cache resource revalidations were sometimes wasted.
24
25         We would sometimes correctly revalidate a resource but the
26         NetworkResourceLoader then either:
27         1. Fail to reuse the speculatively validated entry
28         2. Reuse the speculatively validated entry but then validate it again
29
30         Bug 1 was caused by the revalidated entry key sometimes being
31         different from the cached entry key. This could happen when
32         revalidation fails (the server did not send back a 304) in
33         which case we call NetworkCache::store() which creates a new
34         cache Entry, generating a cache key from our revalidation
35         request. If the original request has a cache partition or a
36         range, then the keys would not match because we did not set
37         the cache partition or the range on the revalidation request.
38         This has been addressed by setting the cache partition on the
39         revalidation request in constructRevalidationRequest() and by
40         not doing revalidation if the original request had a 'range'
41         header.
42
43         Bug 2 was caused by us marking a speculatively revalidated entry
44         as "not needing revalidating" only in Cache::update(). Cache::update()
45         is only called in the case the revalidation was successful (server
46         returned a 304). If revalidation was not successful, Cache::store()
47         would be called instead was we would fail to update the
48         needsRevalidation flag. NetworkResourceLoader would then validate
49         again the resource that was already speculatively revalidated.
50         To address the problem, we now update the 'needsRevalidation' flag
51         as soon as the speculative revalidation completes, in
52         SpeculativeLoad::didComplete().
53
54         * NetworkProcess/cache/NetworkCache.cpp:
55         (WebKit::NetworkCache::Cache::retrieve):
56         (WebKit::NetworkCache::makeCacheKey):
57         (WebKit::NetworkCache::Cache::update):
58         * NetworkProcess/cache/NetworkCacheEntry.cpp:
59         (WebKit::NetworkCache::Entry::setNeedsValidation):
60         * NetworkProcess/cache/NetworkCacheEntry.h:
61         * NetworkProcess/cache/NetworkCacheKey.cpp:
62         (WebKit::NetworkCache::noPartitionString):
63         (WebKit::NetworkCache::Key::Key):
64         (WebKit::NetworkCache::Key::hasPartition):
65         * NetworkProcess/cache/NetworkCacheKey.h:
66         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
67         (WebKit::NetworkCache::SpeculativeLoad::didComplete):
68         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
69         (WebKit::NetworkCache::constructRevalidationRequest):
70         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
71         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):
72
73 2016-03-09  Brent Fulgham  <bfulgham@apple.com>
74
75         Local HTML should be blocked from localStorage access unless "Disable Local File Restrictions" is checked
76         https://bugs.webkit.org/show_bug.cgi?id=155185
77
78         Reviewed by Anders Carlsson.
79         <rdar://problem/11101440>
80
81         Tested by TestWebKitAPI tests IndexedDB.IndexedDBMultiProcess and IndexedDB.IndexedDBPersistence.
82
83         Allow Cocoa WKWebViewConfiguration access to the 'allowUniversalAccessFromFileURLs' setting.
84
85         * UIProcess/API/Cocoa/WKWebView.mm:
86         (- [WKWebView _initializeWithConfiguration]): Set 'allowUniversalAccessFromFileURLsKey' in
87         page configuration.
88         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
89         (-[WKWebViewConfiguration _allowUniversalAccessFromFileURLs]): Added,
90         (-[WKWebViewConfiguration _setAllowUniversalAccessFromFileURLs:]): Added.
91         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
92
93 2016-03-09  Enrica Casucci  <enrica@apple.com>
94
95         Add two finger tap on links.
96         https://bugs.webkit.org/show_bug.cgi?id=155205
97         rdar://problem/22937516
98
99         Reviewed by Sam Weinig.
100
101         Adds two finger tap gesture recognizer. When performed
102         on a link, it calls the delegate.
103
104         * Platform/spi/ios/UIKitSPI.h:
105         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
106         * UIProcess/WebPageProxy.h:
107         * UIProcess/ios/WKContentViewInteraction.h:
108         * UIProcess/ios/WKContentViewInteraction.mm:
109         (-[WKContentView setupInteraction]):
110         (-[WKContentView cleanupInteraction]):
111         (-[WKContentView _removeDefaultGestureRecognizers]):
112         (-[WKContentView _addDefaultGestureRecognizers]):
113         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
114         * UIProcess/ios/WebPageProxyIOS.mm:
115         (WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
116         * WebProcess/WebPage/WebPage.h:
117         * WebProcess/WebPage/WebPage.messages.in:
118         * WebProcess/WebPage/ios/WebPageIOS.mm:
119         (WebKit::WebPage::handleTwoFingerTapAtPoint):
120
121 2016-03-09  Alex Christensen  <achristensen@webkit.org>
122
123         Always call NSURLSession completion handlers
124         https://bugs.webkit.org/show_bug.cgi?id=155137
125
126         Reviewed by Darin Adler.
127
128         There are some edge cases which should not be hit, but if they are they would cause the
129         network process to hang and network resources to be leaked.  This can be avoided.
130         There are also a few release asserts that do not need to crash release builds.
131
132         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
133         (WebKit::NetworkDataTask::NetworkDataTask):
134         (WebKit::NetworkDataTask::didReceiveChallenge):
135         (WebKit::NetworkDataTask::didCompleteWithError):
136         (WebKit::NetworkDataTask::didReceiveResponse):
137         (WebKit::NetworkDataTask::didReceiveData):
138         (WebKit::NetworkDataTask::willPerformHTTPRedirection):
139         (WebKit::NetworkDataTask::scheduleFailure):
140         (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
141         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
142         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
143         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
144         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
145
146 2016-03-08  Sam Weinig  <sam@webkit.org>
147
148         Roll r197632 back in now that the bots have caught up.
149
150         * UIProcess/ios/WKContentViewInteraction.mm:
151         (-[WKContentView textInputTraits]):
152
153 2016-03-08  Oliver Hunt  <oliver@apple.com>
154
155         Start moving to separated writable and executable mappings in the JIT
156         https://bugs.webkit.org/show_bug.cgi?id=155178
157
158         Reviewed by Fil Pizlo.
159
160         Update feature defines.
161
162         * Configurations/FeatureDefines.xcconfig:
163
164 2016-03-08  Brent Fulgham  <bfulgham@apple.com>
165
166         [WK2][Mac] Allow processes to set "fast-dev-casheable" bit in Network Process
167         https://bugs.webkit.org/show_bug.cgi?id=155189
168         <rdar://problem/25042678>
169
170         Reviewed by Alexey Proskuryakov.
171
172         Update the NetworkProcess sandbox profiles with a declaration that using the
173         system-fctl to touch the "hot file" flag (to support caching operations)
174         is allowed. I should have done this in Bug 154503, but did not.
175
176         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: Add sandbox permission.
177
178 2016-03-08  Commit Queue  <commit-queue@webkit.org>
179
180         Unreviewed, rolling out r197793 and r197799.
181         https://bugs.webkit.org/show_bug.cgi?id=155195
182
183         something weird happened while landing this and everything
184         broke (Requested by olliej on #webkit).
185
186         Reverted changesets:
187
188         "Start moving to separated writable and executable mappings in
189         the JIT"
190         https://bugs.webkit.org/show_bug.cgi?id=155178
191         http://trac.webkit.org/changeset/197793
192
193         "arm64 build fix after r197793."
194         http://trac.webkit.org/changeset/197799
195
196 2016-03-08  Brent Fulgham  <bfulgham@apple.com>
197
198         [WK2] Grant explicit read access to ManagedPreferences
199         https://bugs.webkit.org/show_bug.cgi?id=155173
200         <rdar://problem/24910550>
201
202         Reviewed by Alexey Proskuryakov.
203
204         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Add new
205         read permission.
206
207 2016-03-08  Anders Carlsson  <andersca@apple.com>
208
209         Ignore deprecation warnings.
210
211         * Shared/mac/ChildProcessMac.mm:
212         (WebKit::ChildProcess::stopNSAppRunLoop):
213         * Shared/mac/WebEventFactory.mm:
214         (WebKit::mouseButtonForEvent):
215         (WebKit::mouseEventTypeForEvent):
216         (WebKit::clickCountForEvent):
217         (WebKit::globalPointForEvent):
218         (WebKit::pointForEvent):
219         (WebKit::textFromEvent):
220         (WebKit::unmodifiedTextFromEvent):
221         (WebKit::isKeypadEvent):
222         (WebKit::isKeyUpEvent):
223         (WebKit::modifiersForEvent):
224         (WebKit::WebEventFactory::createWebKeyboardEvent):
225         * UIProcess/API/Cocoa/WKNavigationAction.mm:
226         (toNSEventModifierFlags):
227         * UIProcess/Cocoa/WebViewImpl.mm:
228         (WebKit::WebViewImpl::becomeFirstResponder):
229         (WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
230         (WebKit::WebViewImpl::viewDidMoveToWindow):
231         (WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent):
232         (WebKit::WebViewImpl::createFullScreenWindow):
233         (WebKit::WebViewImpl::sendToolTipMouseExited):
234         (WebKit::WebViewImpl::sendToolTipMouseEntered):
235         (WebKit::applicationFlagsForDrag):
236         (WebKit::WebViewImpl::setLastMouseDownEvent):
237         (WebKit::WebViewImpl::doneWithKeyEvent):
238         (WebKit::WebViewImpl::collectKeyboardLayoutCommandsForEvent):
239         (WebKit::WebViewImpl::performKeyEquivalent):
240         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
241         (WebKit::PluginProcessProxy::beginModal):
242         * UIProcess/mac/WebContextMenuProxyMac.mm:
243         (WebKit::WebContextMenuProxyMac::showContextMenu):
244         * UIProcess/mac/WebInspectorProxyMac.mm:
245         (WebKit::WebInspectorProxy::platformCanAttach):
246         * UIProcess/mac/WebPopupMenuProxyMac.mm:
247         (WebKit::WebPopupMenuProxyMac::populate):
248         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
249         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
250         (WebKit::modifierFlagsFromWebEvent):
251         (WebKit::getEventTypeFromWebEvent):
252         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
253         (WebKit::cssAlignmentValueForNSTextAlignment):
254         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
255         (WebKit::convertImageToBitmap):
256
257 2016-03-08  Oliver Hunt  <oliver@apple.com>
258
259         Start moving to separated writable and executable mappings in the JIT
260         https://bugs.webkit.org/show_bug.cgi?id=155178
261
262         Reviewed by Filip Pizlo.
263
264         Update feature defines.
265
266         * Configurations/FeatureDefines.xcconfig:
267
268 2016-03-08  Commit Queue  <commit-queue@webkit.org>
269
270         Unreviewed, rolling out r197766.
271         https://bugs.webkit.org/show_bug.cgi?id=155183
272
273         Has platform-specific code in non-platform files (Requested by
274         smfr on #webkit).
275
276         Reverted changeset:
277
278         "AX: Force allow user zoom"
279         https://bugs.webkit.org/show_bug.cgi?id=155056
280         http://trac.webkit.org/changeset/197766
281
282 2016-03-04  Ada Chan  <adachan@apple.com>
283
284         Fix lifetime issues regarding WebVideoFullscreenInterfaceMac
285         https://bugs.webkit.org/show_bug.cgi?id=155130
286
287         Reviewed by Beth Dakin.
288
289         Now that both fullscreen and video controls manager rely on WebVideoFullscreenInterface,
290         we now keep track of a "client count" for each context ID so we'll only remove it
291         from the context map after all the "clients" are done with it.
292
293         Before this change, every time WebVideoFullscreenManager::setUpVideoControlsManager()
294         is called, the existing interface is cleared and a new one is created even when there's
295         an existing interface for that. With this change, we reuse the existing interface for
296         the video element.
297
298         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
299         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
300         (WebKit::WebVideoFullscreenManagerProxy::invalidate):
301         Also clear out m_clientCounts.
302         (WebKit::WebVideoFullscreenManagerProxy::addClientForContext):
303         If the context ID is not in m_clientCounts yet, add the count of 1 to
304         that table for that ID. Otherwise, increment the count by 1.
305         (WebKit::WebVideoFullscreenManagerProxy::removeClientForContext):
306         Assert that we have added this context id to m_clientCounts before.
307         Decrement the count. If it reaches 0, remove this context ID from both
308         m_clientCounts and m_contextMap.
309         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
310         We have started a new fullscreen session using this interface. Call
311         addClientForContext() to update the client count.
312         (WebKit::WebVideoFullscreenManagerProxy::setUpVideoControlsManagerWithID):
313         If the current controls manager set up has the same context ID as the one
314         passed in, we don't have to do anything. Otherwise, if we have set up
315         the video controls manager with a different ID before, call removeClientForContext()
316         on the old ID to decrement its client count. Set m_controlsManagerContextId
317         to the new value and call addClientForContext() with it.
318         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen):
319         Instead of removing the mapping from m_contextMap directly, reset the fullscreen
320         mode on the interface and call removeClientForContext(), which removes the mapping
321         only if there's no more client using the interface.
322         * WebProcess/cocoa/WebVideoFullscreenManager.h:
323         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
324         (WebKit::WebVideoFullscreenManager::~WebVideoFullscreenManager):
325         Clear m_clientCounts.
326         (WebKit::WebVideoFullscreenManager::removeContext):
327         Add a helper method for removing the context.
328         (WebKit::WebVideoFullscreenManager::addClientForContext):
329         If the context ID is not in m_clientCounts yet, add the count of 1 to
330         that table for that ID. Otherwise, increment the count by 1.
331         (WebKit::WebVideoFullscreenManager::removeClientForContext):
332         Assert that we have added this context id to m_clientCounts before.
333         Decrement the count. If it reaches 0, remove this context ID from
334         m_clientCounts and call removeContext() to clean up this context.
335         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
336         We have started a new fullscreen session using this interface. Call
337         addClientForContext() to update the client count. Create a layer hosting
338         context if it's not there.
339         (WebKit::WebVideoFullscreenManager::setUpVideoControlsManager):
340         If we have set up a context for this video element before, see if it's
341         the one we are currently managing video controls for. If it is, return early.
342         Otherwise, call removeClientForContext() on the previous m_controlsManagerContextId
343         and update m_controlsManagerContextId to the context ID of this video element.
344         If there's no context created for this video element yet, set one up.
345         Send a SetUpVideoControlsManagerWithID message to the proxy object in the UI process
346         so it'll update its controls manager context ID. Also, conditionalize all of this
347         under PLATFORM(MAC) to be consistent with WebVideoFullscreenManagerProxy.
348         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
349         Just reset the fullscreen mode on the interface and call removeClientForContext() which
350         only cleans up the context if there's no more client using it.
351
352 2016-03-08  Timothy Hatcher  <timothy@apple.com>
353
354         Web Inspector: Add automation protocol methods for navigation
355
356         https://bugs.webkit.org/show_bug.cgi?id=155163
357         rdar://problem/25029054
358
359         Reviewed by Darin Adler.
360
361         * UIProcess/Automation/Automation.json:
362         * UIProcess/Automation/WebAutomationSession.cpp:
363         (WebKit::WebAutomationSession::getBrowsingContexts): Set url.
364         (WebKit::WebAutomationSession::getBrowsingContext): Added.
365         (WebKit::WebAutomationSession::navigateBrowsingContext): Added.
366         (WebKit::WebAutomationSession::goBackInBrowsingContext): Added.
367         (WebKit::WebAutomationSession::goForwardInBrowsingContext): Added.
368         (WebKit::WebAutomationSession::reloadBrowsingContext): Added.
369         * UIProcess/Automation/WebAutomationSession.h:
370
371 2016-03-08  Nan Wang  <n_wang@apple.com>
372
373         AX: Force allow user zoom
374         https://bugs.webkit.org/show_bug.cgi?id=155056
375
376         Reviewed by Chris Fleizach.
377
378         Soft linked libAccessibility library so that we can observe the accessibility
379         setting change for the force always user scalable feature.
380
381         * WebProcess/WebPage/WebPage.cpp:
382         (WebKit::forceAlwaysUserScalableChangedCallback):
383         (WebKit::WebPage::create):
384         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
385         (WebKit::WebPage::~WebPage):
386         (WebKit::WebPage::preferencesDidChange):
387         (WebKit::WebPage::updateForceAlwaysUserScalable):
388         (WebKit::WebPage::updatePreferences):
389         * WebProcess/WebPage/WebPage.h:
390
391 2016-03-08  Csaba Osztrogonác  <ossy@webkit.org>
392
393         One more unreviewed speculative buildfix after r197728.
394
395         * NetworkProcess/NetworkResourceLoader.cpp:
396         (WebKit::NetworkResourceLoader::didFinishLoading):
397         (WebKit::NetworkResourceLoader::continueWillSendRequest):
398
399 2016-03-08  Csaba Osztrogonác  <ossy@webkit.org>
400
401         Unreviewed speculative buildfix after r197728.
402
403         * WebProcess/Network/WebLoaderStrategy.cpp:
404         (WebKit::WebLoaderStrategy::scheduleLoad):
405
406 2016-03-08  Timothy Hatcher  <timothy@apple.com>
407
408         Web Inspector: Make WebAutomationSession::closeBrowsingContext work as expected
409
410         https://bugs.webkit.org/show_bug.cgi?id=155162
411         rdar://problem/25027191
412
413         Reviewed by Brian Burg.
414
415         * UIProcess/Automation/WebAutomationSession.cpp:
416         (WebKit::WebAutomationSession::closeBrowsingContext):
417         Call closePage, the same method ultimately used by window.close().
418
419         * UIProcess/WebPageProxy.h: Make closePage public.
420
421 2016-03-07  Carlos Garcia Campos  <cgarcia@igalia.com>
422
423         REGRESSION(r197062): [GTK] Transparent backgrounds no longer work after r197062
424         https://bugs.webkit.org/show_bug.cgi?id=155119
425
426         Reviewed by Martin Robinson.
427
428         This is because after r197062 we are now realizing the view too
429         early, even before the toplevel window has been realized, forcing
430         the toplevel window to be realized. If the RGBA visual is set on
431         the window after it has been realzied it doesn't have any
432         effect. We should wait until the toplevel window is realized to
433         realize the web view, giving time to the application to set RGBA
434         visual and background color. If the toplevel window is already
435         realized we realize the web view immediately, so that this doesn't
436         affect the tearing problems fixed in r197062.
437
438         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
439         (toplevelWindowRealized):
440         (webkitWebViewBaseSetToplevelOnScreenWindow):
441
442 2016-03-07  Keith Rollin  <krollin@apple.com>
443
444         Enhance logging: Use "always on" macros
445         https://bugs.webkit.org/show_bug.cgi?id=154499
446         <rdar://problem/24757730>
447
448         Reviewed by Chris Dumez.
449
450         Make use of new logging macros by reporting on frame and resource
451         load activity.
452
453         Connection updated to report IPC errors, helping us identify when
454         messaging between processes breaks down.
455
456         ChildProcess updated to log if it is terminating early. Some
457         sysdiagnose logging from customers indicate that this is happening in
458         the wild.
459
460         * NetworkProcess/NetworkResourceLoader.cpp:
461         (WebKit::NetworkResourceLoader::startNetworkLoad):
462         (WebKit::NetworkResourceLoader::didFinishLoading):
463         (WebKit::NetworkResourceLoader::didFailLoading):
464         (WebKit::NetworkResourceLoader::continueWillSendRequest):
465         (WebKit::NetworkResourceLoader::isAlwaysOnLoggingAllowed):
466         * NetworkProcess/NetworkResourceLoader.h:
467         * Platform/IPC/Connection.cpp:
468         (IPC::Connection::waitForSyncReply):
469         * Shared/ChildProcess.cpp:
470         (WebKit::didCloseOnConnectionWorkQueue):
471         * WebProcess/Network/WebLoaderStrategy.cpp:
472         (WebKit::WebLoaderStrategy::scheduleLoad):
473         * WebProcess/Network/WebResourceLoader.cpp:
474         (WebKit::WebResourceLoader::willSendRequest):
475         (WebKit::WebResourceLoader::didReceiveResponse):
476         (WebKit::WebResourceLoader::didReceiveData):
477         (WebKit::WebResourceLoader::didFinishResourceLoad):
478         (WebKit::WebResourceLoader::didFailResourceLoad):
479         (WebKit::WebResourceLoader::didReceiveResource):
480         (WebKit::WebResourceLoader::isAlwaysOnLoggingAllowed):
481         * WebProcess/Network/WebResourceLoader.h:
482
483 2016-03-07  Brent Fulgham  <bfulgham@apple.com>
484
485         Reduce startup and shutdown cost of resource load statistics
486         https://bugs.webkit.org/show_bug.cgi?id=155120
487         <rdar://problem/25010167>
488
489         Reviewed by Andy Estes.
490
491         Use a dedicated WorkQueue to process resource load statistics data. Allow
492         processing to load (and save) previously stored statistics asynchronously so
493         that it does not delay startup.
494         
495         Now that we have a more rational storage situation, get rid of the 'writeToDisk'
496         method since it is no longer needed in the WK2 layer.
497
498         Move all of the Resource Load Statistics file handling code from WebCore to this
499         API layer.
500
501         * UIProcess/WebResourceLoadStatisticsStore.cpp:
502         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Initialize
503         member variable with storage path, rather than passing to WebCore code.
504         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): Revised to
505         use the new WorkQueue code.
506         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsEnabled): When
507         activating the feature, purge any old statistics before loading from disk.
508         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): Added.
509         (WebKit::WebResourceLoadStatisticsStore::processWillOpenConnection): Added.
510         (WebKit::WebResourceLoadStatisticsStore::processDidCloseConnection): Added.
511         (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate): Make sure all
512         of the WorkQueue tasks are done before terminating.
513         (WebKit::WebResourceLoadStatisticsStore::persistentStoragePath): Moved from WebCore.
514         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): Ditto.
515         (WebKit::WebResourceLoadStatisticsStore::createDecoderFromDisk): Ditto.
516         (WebKit::WebResourceLoadStatisticsStore::writeToDisk): Deleted.
517         * UIProcess/WebResourceLoadStatisticsStore.h:
518         (WebKit::WebResourceLoadStatisticsStore::coreStore):
519         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
520         (WebKit::WebsiteDataStore::webProcessWillOpenConnection): Call new WebResourceLoadStatisticsStore code.
521         (WebKit::WebsiteDataStore::webProcessDidCloseConnection): Ditto.
522
523 2016-03-07  Alex Christensen  <achristensen@webkit.org>
524
525         Fix cookies with private browsing and NetworkSession
526         https://bugs.webkit.org/show_bug.cgi?id=155147
527         rdar://problem/25018279
528
529         Reviewed by Brady Eidson.
530
531         In the NetworkSession constructor, we look for a NetworkStorageSession in the SessionTracker
532         and use that NetworkStorageSession's CFHTTPCookieStorageRef in the NSURLSessionConfiguration.
533         NetworkStorageSessions were being set in SessionTracker's storageSessionMap after NetworkSessions
534         were created, causing the NSHTTPCookieStorage of the NSURLSession to be different from the
535         CFHTTPCookieStorageRef used by document.cookie in newly created private browsing sessions.
536         This fixes that problem by passing the NetworkStorageSession as a constructor parameter to the
537         NetworkSession so it can use the correct CFHTTPCookieStorageRef in its NSURLSessionConfiguration
538         before it is in the storageSessionMap.
539
540         * NetworkProcess/NetworkSession.h:
541         (WebKit::NetworkSession::sessionID):
542         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
543         (WebKit::NetworkSession::defaultSession):
544         (WebKit::NetworkSession::NetworkSession):
545         * NetworkProcess/mac/RemoteNetworkingContext.mm:
546         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
547         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
548         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
549
550 2016-03-07  Brent Fulgham  <bfulgham@apple.com>
551
552         Correct bug in resource load statistics debug flag for legacy clients
553         https://bugs.webkit.org/show_bug.cgi?id=155118
554         <rdar://problem/25020088>
555
556         Reviewed by Andy Estes.
557
558         Some clients launch WebKit2 using the "legacy" configuration for the website data store.
559         The Resource Load Statistics code was not added to this type of configuration, which
560         prevents various WebKit2 clients from using this code.
561
562         * UIProcess/WebProcessPool.cpp:
563         (WebKit::legacyWebsiteDataStoreConfiguration): Tell the legacy initializer where to
564         find the resource load statistics data.
565
566 2016-03-07  Daniel Bates  <dabates@apple.com>
567
568         Cleanup: Add convenience function URL::procotolIsBlob()
569         https://bugs.webkit.org/show_bug.cgi?id=155127
570         <rdar://problem/25016829>
571
572         Reviewed by Brent Fulgham.
573
574         * NetworkProcess/NetworkLoad.cpp:
575         (WebKit::NetworkLoad::NetworkLoad): Modified to use URL::protocolIsBlob().
576         * NetworkProcess/NetworkResourceLoader.cpp:
577         (WebKit::NetworkResourceLoader::NetworkResourceLoader): Ditto.
578         * WebProcess/WebPage/WebPage.cpp:
579         (WebKit::WebPage::canHandleRequest): Ditto.
580
581 2016-03-07  Simon Fraser  <simon.fraser@apple.com>
582
583         Use CGColorSpaceCopyICCData instead of CGColorSpaceCopyICCProfile
584         https://bugs.webkit.org/show_bug.cgi?id=155123
585         rdar://problem/24990256
586
587         Reviewed by Tim Horton.
588         
589         On newer OSes, use CGColorSpaceCopyICCData().
590
591         * Shared/mac/ColorSpaceData.mm:
592         (WebKit::ColorSpaceData::encode):
593
594 2016-03-07  Gavin Barraclough  <barraclough@apple.com>
595
596         Last opened tab does not receive SetHiddenPageTimerThrottlingIncreaseLimit message
597         https://bugs.webkit.org/show_bug.cgi?id=155126
598
599         Reviewed by Chris Dumez.
600
601         WebPageProxy will increment the hidden page throttling counter from within its constructor,
602         which currently causes the WebProcessPool to try to synchronously message all processes.
603         The web page triggering the increment then fails to receive the message, since it was
604         still being constructed. Make the update of the limit async, such that the page is fully
605         constructed before the WebProcessPool processes the update.
606
607         * UIProcess/WebProcessPool.cpp:
608         (WebKit::m_hiddenPageThrottlingAutoIncreasesCounter):
609             - This now schedules a zero-delay timer to handle the update.
610         (WebKit::m_hiddenPageThrottlingTimer):
611             - This is now responsible for calling updateHiddenPageThrottlingAutoIncreaseLimit.
612         * UIProcess/WebProcessPool.h:
613             - Added m_hiddenPageThrottlingTimer.
614
615 2016-03-05  Enrica Casucci  <enrica@apple.com>
616
617         Support preview on attachment elements.
618         https://bugs.webkit.org/show_bug.cgi?id=155074
619         rdar://problem/24806079
620
621         Reviewed by Sam Weinig.
622
623         Allowing preview to start on attachment elements.
624         Adding a private UIDelegate method to provide the data for the preview.
625
626         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
627         * UIProcess/ios/WKContentViewInteraction.mm:
628         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
629         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
630
631 2016-03-06  Andreas Kling  <akling@apple.com>
632
633         Reduce page cache capacity from 3 to 2.
634         <https://webkit.org/b/155087>
635
636         Reviewed by Antti Koivisto.
637
638         It's extremely rare that users go back more than 2 pages in the page cache,
639         and nowadays the network cache makes even un-cached pages fast to reload.
640
641         Trimming the page cache from 3 to 2 entries has a very nice effect on heap
642         fragmentation. I'm seeing a ~5% progression on the iPad PLUM test locally;
643         average memory usage across 300 loads goes from ~121MB to ~114MB.
644
645         * Shared/CacheModel.cpp:
646         (WebKit::calculateCacheSizes):
647
648 2016-03-05  Sam Weinig  <sam@webkit.org>
649
650         Revert usage of autofill field name for use with UITextInputTraits
651         until our bots can catch up.
652
653         * UIProcess/ios/WKContentViewInteraction.mm:
654         (-[WKContentView textInputTraits]):
655
656 2016-03-05  Chris Dumez  <cdumez@apple.com>
657
658         Consolidate RuntimeApplicationChecks and RuntimeApplicationChecksIOS
659         https://bugs.webkit.org/show_bug.cgi?id=155035
660
661         Reviewed by Darin Adler.
662
663         Update runtime application checks.
664
665         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
666         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
667         * UIProcess/Cocoa/VersionChecks.mm:
668         (WebKit::linkedOnOrAfter):
669         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
670         (WebKit::WebProcessPool::platformInitializeWebProcess):
671         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory):
672         * UIProcess/ios/WKContentViewInteraction.mm:
673         * UIProcess/mac/WebPageProxyMac.mm:
674         (WebKit::expectsLegacyImplicitRubberBandControl):
675         (WebKit::WebPageProxy::appleMailPaginationQuirkEnabled):
676
677 2016-03-05  Sam Weinig  <sam@webkit.org>
678
679         Add support for processing the autofill field name out of form control elements ultimately to aid input methods
680         <rdar://problem/23041180>
681         https://bugs.webkit.org/show_bug.cgi?id=155079
682
683         Reviewed by Enrica Casucci.
684
685         * Shared/AssistedNodeInformation.cpp:
686         (WebKit::AssistedNodeInformation::encode):
687         (WebKit::AssistedNodeInformation::decode):
688         * Shared/AssistedNodeInformation.h:
689         Add AutofillFieldName. Convert some coders to use encodeEnum/decodeEnum instead of casting.
690
691         * UIProcess/ios/WKContentViewInteraction.mm:
692         (-[WKContentView textInputTraits]):
693         Map AutofillFieldNames to the associated UITextContentTypes.
694
695         * WebProcess/WebPage/ios/WebPageIOS.mm:
696         (WebKit::WebPage::getAssistedNodeInformation):
697         Extract the AutofillFieldNames onto the AssistedNodeInformation for <input> elements 
698         and <textarea> elements.
699
700 2016-03-05  Timothy Hatcher  <timothy@apple.com>
701
702         Implement the Automation protocol commands by tracking WebPageProxy objects
703         that are controlled by automation and assigning them a UUID handle.
704
705         https://bugs.webkit.org/show_bug.cgi?id=154953
706         rdar://problem/24947489
707
708         Reviewed by Brian Burg.
709
710         * UIProcess/API/APIAutomationSessionClient.h:
711         (API::AutomationSessionClient::didRequestNewWindow):
712         Return a WebPageProxy instead of void so it can be assigned a UUID handle.
713
714         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
715         Return a WKPageRef from _automationSessionDidRequestNewWindow:.
716
717         * UIProcess/Automation/WebAutomationSession.cpp:
718         (WebKit::WebAutomationSession::webPageProxyForHandle):
719         (WebKit::WebAutomationSession::handleForWebPageProxy):
720         (WebKit::WebAutomationSession::getBrowsingContexts):
721         (WebKit::WebAutomationSession::createBrowsingContext):
722         (WebKit::WebAutomationSession::closeBrowsingContext):
723         (WebKit::WebAutomationSession::switchToBrowsingContext):
724
725         * UIProcess/Automation/WebAutomationSession.h:
726         Added new methods and maps to track pages and handles.
727
728         * UIProcess/Cocoa/AutomationSessionClient.h:
729         * UIProcess/Cocoa/AutomationSessionClient.mm:
730         (WebKit::AutomationSessionClient::didRequestNewWindow):
731         Return a WebPageProxy from the WKPageRef.
732
733         * UIProcess/WebPageProxy.h: Make setFocus public.
734
735         * UIProcess/WebProcessPool.cpp:
736         (WebKit::WebProcessPool::setAutomationSession):
737         Set the WebProcessPool on the WebAutomationSession so it can be used to find
738         WebPageProxy objects controlled by automation.
739
740 2016-03-05  Timothy Hatcher  <timothy@apple.com>
741
742         Rename Automation protocol methods to use "BrowsingContext" instead of "Window".
743         Also flesh out the protocol commands more by adding switchToBrowsingContext
744         and return a BrowsingContextHandle for createBrowsingContext.
745
746         https://bugs.webkit.org/show_bug.cgi?id=154953
747         rdar://problem/24947489
748
749         Reviewed by Brian Burg.
750
751         * UIProcess/Automation/Automation.json:
752         * UIProcess/Automation/WebAutomationSession.cpp:
753         (WebKit::WebAutomationSession::getBrowsingContexts):
754         (WebKit::WebAutomationSession::createBrowsingContext):
755         (WebKit::WebAutomationSession::closeBrowsingContext):
756         (WebKit::WebAutomationSession::switchToBrowsingContext):
757         (WebKit::WebAutomationSession::getWindows): Deleted.
758         (WebKit::WebAutomationSession::openWindow): Deleted.
759         (WebKit::WebAutomationSession::closeWindow): Deleted.
760         * UIProcess/Automation/WebAutomationSession.h:
761
762 2016-03-05  Yusuke Suzuki  <utatane.tea@gmail.com>
763
764         [ES6] Support Reflect.construct
765         https://bugs.webkit.org/show_bug.cgi?id=147330
766
767         Reviewed by Saam Barati.
768
769         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
770         (WebKit::JSNPMethod::getCallData):
771         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
772         (WebKit::JSNPObject::getCallData):
773         (WebKit::JSNPObject::getConstructData):
774         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
775         (WebKit::NPJSObject::hasMethod):
776         (WebKit::NPJSObject::construct):
777         (WebKit::NPJSObject::invoke):
778
779 2016-03-04  Alex Christensen  <achristensen@webkit.org>
780
781         Fix file mime-types when using NetworkSession
782         https://bugs.webkit.org/show_bug.cgi?id=155058
783
784         Reviewed by Andy Estes.
785
786         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
787         (WebKit::NetworkDataTask::NetworkDataTask):
788         Call adjustMIMETypeIfNecessary like we do in connection didReceiveResponse in 
789         WebCoreResourceHandleAsOperationQueueDelegate.mm.
790         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
791         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
792         Don't content sniff file urls.  This check is analogous to ResourceHandle::shouldContentSniffURL.
793
794 2016-03-04  Sam Weinig  <sam@webkit.org>
795
796         [WebKit2] Add WebKit2 equivalent of -[WebView _insertNewlineInQuotedContent]
797         <rdar://problem/24943591>
798         https://bugs.webkit.org/show_bug.cgi?id=155057
799
800         Reviewed by Tim Horton.
801
802         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
803         (WKBundlePageInsertNewlineInQuotedContent):
804         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
805         * WebProcess/WebPage/WebPage.cpp:
806         (WebKit::WebPage::insertNewlineInQuotedContent):
807         * WebProcess/WebPage/WebPage.h:
808         Expose WKBundlePageInsertNewlineInQuotedContent as SPI.
809
810 2016-03-04  Brent Fulgham  <bfulgham@apple.com>
811
812         Stub API to support a debug menu option for measuring resource load statistics
813         https://bugs.webkit.org/show_bug.cgi?id=154998
814         <rdar://problem/24944604>
815
816         Reviewed by Andy Estes.
817
818         * UIProcess/API/APIWebsiteDataStore.cpp:
819         (API::WebsiteDataStore::resourceLoadStatisticsEnabled): Added stub.
820         (API::WebsiteDataStore::setResourceLoadStatisticsEnabled): Ditto.
821         * UIProcess/API/APIWebsiteDataStore.h:
822         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
823         (WKWebsiteDataStoreSetResourceLoadStatisticsEnabled): Added method that calls through
824         to the underlying APIWebsiteDataStore class.
825         (WKWebsiteDataStoreGetResourceLoadStatisticsEnabled): Ditto.
826         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
827
828 2016-03-03  Enrica Casucci  <enrica@apple.com>
829
830         Add a mechanism to customize the long press action.
831         https://bugs.webkit.org/show_bug.cgi?id=154995
832         rdar://problem/24823732
833
834         Reviewed by Tim Horton.
835
836         Adding a new private delegate method to allow clients to
837         replace the action sheet displayed for images and links.
838         The change also adds support for attachment elements.
839
840         * Shared/ios/InteractionInformationAtPosition.h:
841         * Shared/ios/InteractionInformationAtPosition.mm:
842         (WebKit::InteractionInformationAtPosition::encode):
843         (WebKit::InteractionInformationAtPosition::decode):
844         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
845         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
846         * UIProcess/ios/WKActionSheetAssistant.h:
847         * UIProcess/ios/WKActionSheetAssistant.mm:
848         (-[WKActionSheetAssistant showImageSheet]):
849         (-[WKActionSheetAssistant showLinkSheet]):
850         * UIProcess/ios/WKContentViewInteraction.mm:
851         (-[WKContentView _showImageSheet]):
852         (-[WKContentView _showAttachmentSheet]):
853         (-[WKContentView _showLinkSheet]):
854         (-[WKContentView _actionForLongPress]):
855         (-[WKContentView actionSheetAssistant:shouldIncludeAppLinkActionsForElement:]):
856         (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
857         (-[WKContentView actionSheetAssistant:decideActionsForElement:defaultActions:]):
858         * WebProcess/WebPage/ios/WebPageIOS.mm:
859         (WebKit::WebPage::getPositionInformation):
860
861 2016-03-04  Brent Fulgham  <bfulgham@apple.com>
862
863         [WK2] Gather resource load statistics
864         https://bugs.webkit.org/show_bug.cgi?id=154278
865         <rdar://problem/24702892>
866
867         Reviewed by Andy Estes.
868
869         Revise the WebProcess to notify the UIProcess about resource load statistics. These
870         updates are not time-critical, and do not need to be done in concert with the actual
871         load. As resource loads are made, each WebProcess notifies the UIProcess of the new
872         load counts, then clears its local state. These statistics are then aggregated in
873         the UIProcess.
874
875         * CMakeLists.txt: Add new ResourceLoadStatisticsState files to build.
876         * DerivedSources.make: Ditto.
877         * Platform/IPC/ArgumentCoders.h: Update to support HashCountedSets.
878         * PlatformEfl.cmake: Add new ResourceLoadStatisticsState files to build.
879         * PlatformGTK.cmake: Ditto.
880         * PlatformMac.cmake: Ditto.
881         * Shared/API/APIObject.h: Add new ResourceLoadStatistics type.
882         * Shared/WebCoreArgumentCoders.cpp:
883         (IPC::ArgumentCoder<ExceptionDetails>::decode): Support new ResourceLoadStatistics type.
884         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode): Added.
885         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode): Added.
886         * Shared/WebCoreArgumentCoders.h:
887         * Shared/WebProcessCreationParameters.cpp:
888         (WebKit::WebProcessCreationParameters::encode): Handle 'resourceLoadStatisticsEnabled' flag.
889         (WebKit::WebProcessCreationParameters::decode): Ditto.
890         * Shared/WebProcessCreationParameters.h:
891         * UIProcess/API/APIProcessPoolConfiguration.cpp:
892         (API::ProcessPoolConfiguration::ProcessPoolConfiguration): Add storage location for the
893         resource load statistics.
894         (API::ProcessPoolConfiguration::copy): Handle the new storage location and the feature flag.
895         * UIProcess/API/APIProcessPoolConfiguration.h:
896         * UIProcess/API/APIWebsiteDataStore.cpp:
897         (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory): Added stub.
898         * UIProcess/API/APIWebsiteDataStore.h:
899         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
900         (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory): Added.
901         (API::WebsiteDataStore::defaultDataStoreConfiguration): Added support for the new resource
902         load statistics storage location.
903         * UIProcess/API/Cocoa/WKWebView.mm:
904         (-[WKWebView _initializeWithConfiguration:]): Sync Process Pool configuration parameters
905         with the state of our websiteData object's "ResourceLoadStatisticsEnabled" flag, so that
906         new processes are created in the right state.
907         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
908         (-[WKWebsiteDataStore _resourceLoadStatisticsEnabled]): Added.
909         (-[WKWebsiteDataStore _setResourceLoadStatisticsEnabled:]): Added.
910         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
911         * UIProcess/WebProcessPool.cpp:
912         (WebKit::WebProcessPool::createNewWebProcess): Handle new flag for enabling resource
913         load statistics.
914         * UIProcess/WebResourceLoadStatisticsStore.cpp: Added.
915         (WebKit::WebResourceLoadStatisticsStore::create):
916         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
917         (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
918         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
919         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsEnabled):
920         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsEnabled):
921         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
922         (WebKit::WebResourceLoadStatisticsStore::writeToDisk):
923         (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
924         * UIProcess/WebResourceLoadStatisticsStore.h: Added.
925         (WebKit::WebResourceLoadStatisticsStore::coreStore):
926         * UIProcess/WebResourceLoadStatisticsStore.messages.in: Added.
927         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
928         (WebKit::WebsiteDataStore::platformInitialize): Register a termination handler
929         to close down the resource load statistics store.
930         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
931         (WebKit::WebsiteDataStore::WebsiteDataStore): Initialize the new WebResourceLoadStatisticsStore
932         member.
933         (WebKit::WebsiteDataStore::webProcessWillOpenConnection): Register the WebResourceLoadStatisticsStore
934         object as a work queue message receiver
935         (WebKit::WebsiteDataStore::webProcessDidCloseConnection): Unregister WebResourceLoadStatisticsStore.
936         (WebKit::WebsiteDataStore::resourceLoadStatisticsEnabled): Added.
937         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled): Ditto.
938         * UIProcess/WebsiteData/WebsiteDataStore.h:
939         (WebKit::WebsiteDataStore::resourceLoadStatisticsStore): Added.
940         * WebKit2.xcodeproj/project.pbxproj: Add new ResourceLoadStatisticsState files to build.
941         * WebProcess/WebProcess.cpp:
942         (WebKit::WebProcess::initializeWebProcess): Take into account the new parameter
943         specifying whether resource load statistics are being captured.
944         (WebKit::WebProcess::WebProcess): Initialized statistics changed notification timer.
945         (WebKit::WebProcess::statisticsChangedTimerFired): Added. Send bundles of site load
946         statistics to the UIProcess on a set interval. Clear out local cache after each send.
947         (WebKit::WebProcess::setResourceLoadStatisticsEnabled): Added.
948         * WebProcess/WebProcess.h:
949         * WebProcess/WebProcess.messages.in: Add new SetResourceLoadStatisticsEnabled message.
950
951 2016-03-04  Daniel Bates  <dabates@apple.com>
952
953         Temporarily use bundle identifier as part of user directory suffix
954         https://bugs.webkit.org/show_bug.cgi?id=155042
955         <rdar://problem/24983174>
956
957         Reviewed by Brent Fulgham and Brady Eidson.
958
959         * Shared/mac/ChildProcessMac.mm:
960         (WebKit::ChildProcess::initializeSandbox):
961
962 2016-03-04  Alex Christensen  <achristensen@webkit.org>
963
964         Release build fix after r197572.
965         https://bugs.webkit.org/show_bug.cgi?id=154993
966
967         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
968         (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
969
970 2016-03-04  Alex Christensen  <achristensen@webkit.org>
971
972         Use NSURLSession for loading in WebKit2
973         https://bugs.webkit.org/show_bug.cgi?id=154993
974
975         Reviewed by Sam Weinig.
976
977         * config.h:
978
979 2016-03-04  Alex Christensen  <achristensen@webkit.org>
980
981         Use NetworkSession for pings
982         https://bugs.webkit.org/show_bug.cgi?id=154984
983
984         Reviewed by Antti Koivisto.
985
986         Before this patch, we were using NSURLConnection for pings when the rest of the loading was being 
987         done with NSURLSession.  To fix this, I implemented PingLoad, which is the NetworkSession equivalent
988         of PingHandle.
989
990         This fixes http/tests/security/contentSecurityPolicy/report-status-code-zero-when-using-https.html
991
992         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
993         (WebKit::NetworkConnectionToWebProcess::loadPing):
994         (WebKit::NetworkConnectionToWebProcess::removeLoadIdentifier):
995         * NetworkProcess/PingLoad.h: Added.
996         (WebKit::PingLoad::PingLoad):
997         (WebKit::PingLoad::willPerformHTTPRedirection):
998         (WebKit::PingLoad::didReceiveChallenge):
999         (WebKit::PingLoad::didReceiveResponseNetworkSession):
1000         (WebKit::PingLoad::didReceiveData):
1001         (WebKit::PingLoad::didCompleteWithError):
1002         (WebKit::PingLoad::didBecomeDownload):
1003         (WebKit::PingLoad::didSendData):
1004         (WebKit::PingLoad::wasBlocked):
1005         (WebKit::PingLoad::cannotShowURL):
1006         (WebKit::PingLoad::timeoutTimerFired):
1007         (WebKit::PingLoad::~PingLoad):
1008         * WebKit2.xcodeproj/project.pbxproj:
1009
1010 2016-03-04  Timothy Hatcher  <timothy@apple.com>
1011
1012         Inform WebKit and WebCore if a page is controlled by automation.
1013
1014         https://bugs.webkit.org/show_bug.cgi?id=154991
1015         rdar://problem/24965784
1016
1017         Reviewed by Joseph Pecoraro.
1018
1019         * Shared/WebPageCreationParameters.cpp:
1020         (WebKit::WebPageCreationParameters::encode):
1021         (WebKit::WebPageCreationParameters::decode):
1022         * Shared/WebPageCreationParameters.h:
1023         * UIProcess/API/C/WKPage.cpp:
1024         (WKPageGetIsControlledByAutomation):
1025         (WKPageSetControlledByAutomation):
1026         * UIProcess/API/C/WKPagePrivate.h:
1027         * UIProcess/WebPageProxy.cpp:
1028         (WebKit::WebPageProxy::setControlledByAutomation):
1029         (WebKit::WebPageProxy::creationParameters):
1030         * UIProcess/WebPageProxy.h:
1031         (WebKit::WebPageProxy::isControlledByAutomation):
1032         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1033         (WKBundlePageIsControlledByAutomation):
1034         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1035         * WebProcess/WebPage/WebPage.cpp:
1036         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
1037         (WebKit::WebPage::isControlledByAutomation):
1038         (WebKit::WebPage::setControlledByAutomation):
1039         * WebProcess/WebPage/WebPage.h:
1040         * WebProcess/WebPage/WebPage.messages.in:
1041
1042 2016-03-03  Chris Dumez  <cdumez@apple.com>
1043
1044         Regression(r196770): Unable to use HipChat Mac app
1045         https://bugs.webkit.org/show_bug.cgi?id=154999
1046         <rdar://problem/24931959>
1047
1048         Reviewed by Darin Adler.
1049
1050         Have the NetworkProcess and the WebProcess pass the UIProcess bundle
1051         identifier to WebCore so that we can do app detection of applications
1052         using a WK2 WebView (such as HipChat).
1053
1054         * NetworkProcess/NetworkProcess.cpp:
1055         (WebKit::NetworkProcess::initializeNetworkProcess):
1056         * WebProcess/WebProcess.cpp:
1057         (WebKit::WebProcess::initializeWebProcess):
1058
1059 2016-03-03  Simon Fraser  <simon.fraser@apple.com>
1060
1061         Use larger tiles when possible to reduce per-tile painting overhead
1062         https://bugs.webkit.org/show_bug.cgi?id=154985
1063         rdar://problem/23635219
1064
1065         Reviewed by Tim Horton.
1066
1067         Do a bit of #include cleanup.
1068
1069         * Shared/mac/RemoteLayerBackingStore.mm:
1070         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1071         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
1072         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
1073
1074 2016-03-03  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1075
1076         Use std::make_unique<> when creating std::unique_ptr<>
1077         https://bugs.webkit.org/show_bug.cgi?id=154574
1078
1079         Reviewed by Darin Adler.
1080
1081         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1082         (WebKit::NetworkCache::Statistics::open):
1083         * NetworkProcess/cache/NetworkCacheStatistics.h:
1084         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1085         (WebKit::WebChromeClient::createColorChooser):
1086
1087 2016-03-03  Alex Christensen  <achristensen@webkit.org>
1088
1089         Move SPI to CFNetworkSPI.h
1090         https://bugs.webkit.org/show_bug.cgi?id=154992
1091
1092         Reviewed by Andy Estes.
1093
1094         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1095         (WebKit::applyBasicAuthorizationHeader):
1096
1097 2016-03-03  Alex Christensen  <achristensen@webkit.org>
1098
1099         Use CredentialStorage with NetworkSession
1100         https://bugs.webkit.org/show_bug.cgi?id=154939
1101
1102         Reviewed by Darin Adler.
1103
1104         * config.h:
1105         Added compile-time flag to help us be able to keep track and remove this code when we can.
1106         * NetworkProcess/NetworkDataTask.h:
1107         (WebKit::NetworkDataTask::pendingDownloadLocation):
1108         * NetworkProcess/NetworkProcess.cpp:
1109         (WebKit::NetworkProcess::clearCachedCredentials):
1110         (WebKit::NetworkProcess::ensurePrivateBrowsingSession):
1111         * NetworkProcess/NetworkSession.h:
1112         (WebKit::NetworkSession::sessionID):
1113         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1114         (WebKit::applyBasicAuthorizationHeader):
1115         (WebKit::NetworkDataTask::NetworkDataTask):
1116         Use a credential storage and preemptively apply basic authentication headers if we have credentials from the storage.
1117         This is analogous to code in ResourceHandle::createNSURLConnection.
1118         
1119         (WebKit::NetworkDataTask::didReceiveChallenge):
1120         Make this look more like ResourceHandle::didReceiveAuthenticationChallenge.
1121         The call to tryPasswordBasedAuthentication was moved from the delegate callback to here.
1122         
1123         (WebKit::NetworkDataTask::willPerformHTTPRedirection):
1124         Use credentials from the credential storage if they exist.  This is analogous to code in ResourceHandle::willSendRequest.
1125         
1126         (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
1127         Use credentials from the credential storage if they exist.  This is analogous to code in ResourceHandle::tryHandlePasswordBasedAuthentication.
1128         
1129         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1130         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1131         If we are given a credential with CredentialPersistenceForSession, put it in the credential storage and give 
1132         CFNetwork a credential with CredentialPersistenceNone so it won't automatically be used again until the credential
1133         storage says its ok to use again.  This gives us the ability to clear session credentials when logout credentials are used.
1134         This is analogous to code in ResourceHandle::receivedCredential.
1135         
1136         (WebKit::NetworkSession::defaultSession):
1137         (WebKit::NetworkSession::NetworkSession):
1138         (WebKit::NetworkSession::~NetworkSession):
1139         (WebKit::NetworkSession::dataTaskForIdentifier):
1140         (WebKit::NetworkSession::clearCredentials): Deleted.
1141         * WebProcess/WebProcess.cpp:
1142         (WebKit::WebProcess::clearCachedCredentials):
1143         (WebKit::WebProcess::focusedWebPage):
1144         We no longer need to clear credentials from the NSURLSessions because we don't store session credentials in them.
1145         Instead, calling CredentialStorage.clearCredentials is sufficient.
1146
1147 2016-03-03  Andy Estes  <aestes@apple.com>
1148
1149         Adopt CFNetwork storage partitioning SPI
1150         https://bugs.webkit.org/show_bug.cgi?id=154957
1151         rdar://problem/23614620
1152
1153         Reviewed by Darin Adler.
1154
1155         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1156         (WebKit::NetworkDataTask::NetworkDataTask): Computed the storage partition identifier for the new session task.
1157         If non-empty, set it using a NSURLSessionTask SPI.
1158
1159 2016-03-03  Alex Christensen  <achristensen@webkit.org>
1160
1161         [WK2] testRunner.setPrivateBrowsingEnabled doesn't work with NetworkProcess
1162         https://bugs.webkit.org/show_bug.cgi?id=115274
1163
1164         Reviewed by Darin Adler.
1165
1166         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1167         (WebKit::NetworkConnectionToWebProcess::blobSize):
1168         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
1169         * NetworkProcess/NetworkConnectionToWebProcess.h:
1170         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1171         * NetworkProcess/NetworkProcess.h:
1172         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1173         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
1174         * WebProcess/WebProcess.cpp:
1175         (WebKit::WebProcess::destroyPrivateBrowsingSession):
1176         (WebKit::WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess):
1177         (WebKit::WebProcess::pluginProcessConnectionManager):
1178         * WebProcess/WebProcess.h:
1179
1180 2016-03-02  Alex Christensen  <achristensen@webkit.org>
1181
1182         Properly cancel downloads when using NetworkSession
1183         https://bugs.webkit.org/show_bug.cgi?id=154893
1184
1185         Reviewed by Brady Eidson.
1186
1187         * NetworkProcess/Downloads/Download.cpp:
1188         (WebKit::Download::Download):
1189         * NetworkProcess/Downloads/Download.h:
1190         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
1191         (WebKit::Download::cancel):
1192         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1193         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
1194
1195 2016-03-01  Ada Chan  <adachan@apple.com>
1196
1197         Update the media element's presentation mode properly after going in and out of full screen via the Full Screen API
1198         https://bugs.webkit.org/show_bug.cgi?id=154834
1199
1200         Reviewed by Simon Fraser.
1201
1202         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
1203         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
1204         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1205         (WebKit::WebVideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode):
1206         Call the new exitFullscreenWithoutAnimationToMode() method on WebVideoFullscreenInterfaceMac.
1207         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1208         (WebKit::WebChromeClient::exitVideoFullscreenToModeWithoutAnimation):
1209         * WebProcess/WebCoreSupport/WebChromeClient.h:
1210         * WebProcess/cocoa/WebVideoFullscreenManager.h:
1211         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
1212         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation):
1213
1214 2016-03-02  Beth Dakin  <bdakin@apple.com>
1215
1216         Crashes in media tests after http://trac.webkit.org/changeset/197461
1217         https://bugs.webkit.org/show_bug.cgi?id=154933
1218
1219         Reviewed by Eric Carlson.
1220
1221         Since the controlsManagerInterface is not guaranteed to exist, it doesn't 
1222         make sense to return a reference. Return a pointer instead.
1223         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
1224         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1225         (WebKit::WebVideoFullscreenManagerProxy::isVisible):
1226         (WebKit::WebVideoFullscreenManagerProxy::controlsManagerInterface):
1227         (WebKit::WebVideoFullscreenManagerProxy::fullscreenMayReturnToInline):
1228
1229 2016-03-02  Beth Dakin  <bdakin@apple.com>
1230
1231         Add support for playbackControlsManager
1232         https://bugs.webkit.org/show_bug.cgi?id=154742
1233         -and corresponding-
1234         rdar://problem/23833753
1235
1236         Reviewed by Jer Noble.
1237
1238         WebVideoFullscreenManagerProxy ensures the model and interface for the 
1239         UIProcess side of the playbackControlsManager. It also caches the 
1240         m_controlsManagerContextId so that it can return the 
1241         controlsManagerInterface.
1242         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
1243         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
1244         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1245         (WebKit::WebVideoFullscreenManagerProxy::setUpVideoControlsManagerWithID):
1246         (WebKit::WebVideoFullscreenManagerProxy::controlsManagerInterface):
1247
1248         Pipe isPlayingMediaDidChange() to WebViewImpl, and use that information to 
1249         update WebViewImplAdditions.
1250         * UIProcess/Cocoa/WebViewImpl.h:
1251         * UIProcess/Cocoa/WebViewImpl.mm:
1252         (WebKit::WebViewImpl::isPlayingMediaDidChange):
1253         * UIProcess/PageClient.h:
1254         * UIProcess/WebPageProxy.cpp:
1255         (WebKit::WebPageProxy::isPlayingMediaDidChange):
1256         (WebKit::WebPageProxy::isPlayingVideoWithAudio):
1257         * UIProcess/WebPageProxy.h:
1258         (WebKit::WebPageProxy::isPlayingAudio):
1259         * UIProcess/mac/PageClientImpl.h:
1260         * UIProcess/mac/PageClientImpl.mm:
1261         (WebKit::PageClientImpl::isPlayingMediaDidChange):
1262
1263         Pipe setUpVideoControlsManager to the WebVideoFullscreenManager.
1264         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1265         (WebKit::WebChromeClient::setUpVideoControlsManager):
1266         * WebProcess/WebCoreSupport/WebChromeClient.h:
1267
1268         Ensure the model an interface for the playbackControlsManager on the 
1269         WebProcess side and pass the message to the UIProcess to do the same.
1270         * WebProcess/cocoa/WebVideoFullscreenManager.h:
1271         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
1272         (WebKit::WebVideoFullscreenManager::setUpVideoControlsManager):
1273
1274 2016-03-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1275
1276         REGRESSION(r197409): [GTK] Web process always crashes on WebPage construction after r197409
1277         https://bugs.webkit.org/show_bug.cgi?id=154918
1278
1279         Reviewed by Žan Doberšek.
1280
1281         We have an incorrect check in DrawingAreaImpl constructor that has
1282         never actually worked because it uses the page settings before
1283         they were initialized. But that has been fixed in r197409 and now
1284         we are always forcing accelerated compositing mode incorrectly,
1285         because m_alwaysUseCompositing is set in the constructor and never
1286         changed again.
1287
1288         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1289         (WebKit::DrawingAreaImpl::DrawingAreaImpl): Remove code to set
1290         settings and m_alwaysUseCompositing, since that should be done in
1291         updatePreferences().
1292         (WebKit::DrawingAreaImpl::updatePreferences): Update the settings
1293         accordingly and always update m_alwaysUseCompositing when AC is
1294         enabled and forced in the settings.
1295         * WebProcess/WebPage/WebPage.cpp:
1296         (WebKit::WebPage::WebPage): WebPage::updatePreferences() calls
1297         DrawingArea::updatePreferences(), but since r197409 it happens
1298         before the drawing area has been created. So, call
1299         DrawingArea::updatePreferences() in the constructor right after
1300         the main frame has been created, since
1301         DrawingArea::updatePreferences() uses the main frame.
1302
1303 2016-02-29  Ada Chan  <adachan@apple.com>
1304
1305         Adopt the new version of AVOutputDeviceMenuController's showMenuForRect method.
1306         https://bugs.webkit.org/show_bug.cgi?id=154823
1307
1308         Reviewed by Tim Horton.
1309
1310         * UIProcess/WebPageProxy.cpp:
1311         (WebKit::WebPageProxy::showPlaybackTargetPicker):
1312         (WebKit::WebPageProxy::customPlaybackActionSelected):
1313         * UIProcess/WebPageProxy.h:
1314         * UIProcess/WebPageProxy.messages.in:
1315         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1316         (WebKit::WebChromeClient::showPlaybackTargetPicker):
1317         * WebProcess/WebCoreSupport/WebChromeClient.h:
1318         * WebProcess/WebPage/WebPage.h:
1319         * WebProcess/WebPage/WebPage.messages.in:
1320         * WebProcess/WebPage/mac/WebPageMac.mm:
1321         (WebKit::WebPage::customPlaybackActionSelected):
1322
1323 2016-02-29  Brent Fulgham  <bfulgham@apple.com>
1324
1325         [WK2] Stub support for WebsiteDataTypeResourceLoadStatistics
1326         https://bugs.webkit.org/show_bug.cgi?id=154689
1327         <rdar://problem/24702576>
1328
1329         Reviewed by Sam Weinig.
1330
1331         * Shared/WebsiteData/WebsiteDataType.h: Add new WebsiteDataTypeResourceLoadStatistics.
1332         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
1333         (dataTypesToString): Handle new type.
1334         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
1335         (WebKit::toWebsiteDataTypes): Ditto.
1336         (WebKit::toWKWebsiteDataTypes): Ditto.
1337         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h: Add new _WebsiteDataTypeResourceLoadStatistics.
1338
1339 2016-03-01  Alex Christensen  <achristensen@webkit.org>
1340
1341         Correctly keep track of NetworkDataTasks with and without credentials when using NetworkSession
1342         https://bugs.webkit.org/show_bug.cgi?id=154876
1343
1344         Reviewed by Brady Eidson.
1345
1346         I was seeing an assertion failure from ASSERT(!m_session.m_dataTaskMap.contains(taskIdentifier()))
1347         in the NetworkDataTask constructor sometimes.  This is because a task identifier is not enough information
1348         to uniquely find a NetworkDataTask in a NetworkSession since r196034 because there are two NSURLSessions
1349         in a NetworkSession, one with credentials and one without.  The assertion would fire in a case like if we
1350         made the first NetworkDataTask with credentials (taskIdentifier is 1) and the first NetworkDataTask 
1351         without credentials before the first NetworkDataTask with credentials was finished.  In that case, the 
1352         taskIdentifier would also be 1, which would conflict with the other taskIdentifier.  That taskIdentifier
1353         would uniquely identify the task in the correct NSURLSession, though, so the solution is to keep a map
1354         for each NSURLSession in the NetworkSession.
1355
1356         * NetworkProcess/NetworkDataTask.h:
1357         * NetworkProcess/NetworkSession.h:
1358         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1359         (WebKit::NetworkDataTask::NetworkDataTask):
1360         (WebKit::NetworkDataTask::~NetworkDataTask):
1361         (WebKit::NetworkDataTask::suspend):
1362         (WebKit::serverTrustCredential):
1363         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1364         (-[WKNetworkSessionDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]):
1365         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1366         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1367         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
1368         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
1369         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
1370         (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
1371         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
1372         (WebKit::NetworkSession::clearCredentials):
1373         (WebKit::NetworkSession::dataTaskForIdentifier):
1374         (WebKit::NetworkSession::addDownloadID):
1375
1376 2016-03-01  Andreas Kling  <akling@apple.com>
1377
1378         REGRESSION (r154616): Accelerated drawing is off during the initial load
1379         <https://webkit.org/b/123812>
1380
1381         Reviewed by Tim Horton.
1382
1383         Load preferences before instantiating the first DrawingArea. This ensures that we do the
1384         initial paint using accelerated drawing, and avoids allocating persistent data structures
1385         only needed by the software rendering path.
1386
1387         * WebProcess/WebPage/WebPage.cpp:
1388
1389 2016-03-01  Alex Christensen  <achristensen@webkit.org>
1390
1391         Fix tests when using NetworkSession
1392         https://bugs.webkit.org/show_bug.cgi?id=154866
1393
1394         Reviewed by Brady Eidson.
1395
1396         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1397         (WebKit::globalCustomProtocolManager):
1398         (WebKit::NetworkSession::setCustomProtocolManager):
1399         
1400         Use a static NeverDestroyed instead of a local NeverDestroyed.
1401         This fix was suggested by Darin after I broke the custom protocol tests in r197362.
1402         
1403         (WebKit::NetworkSession::clearCredentials):
1404         
1405         In r197223 I added code that I thought cleared the credentials of a session, but it was
1406         actually trying (and failing) to remove the credentials from the NSURLCredentialStorage that
1407         were stored with NSURLCredentialPersistencePermanent.
1408         This was causing credentials stored in an NSURLSession with NSURLCredentialPersistenceForSession
1409         to remain for the next tests, and was causing credentials from previous tests, usually from
1410         http/tests/loading/basic-credentials-sent-automatically.html, to be used in future tests.
1411         Creating a new NSURLSession is the equivalent of CredentialStorage::clearCredentials because it
1412         removes all credentials stored with NSURLCredentialPersistenceForSession.
1413
1414 2016-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1415
1416         NetworkCache: Web process leaks resource buffer when using shareable reasources
1417         https://bugs.webkit.org/show_bug.cgi?id=154852
1418
1419         Reviewed by Darin Adler.
1420
1421         ResourceLoader::didReceiveBuffer() expects a PassRefPtr, but we
1422         are passing a raw pointer making PassRefPtr to take another
1423         reference instead of transfering the ownership as expected.
1424
1425         * WebProcess/Network/WebResourceLoader.cpp:
1426         (WebKit::WebResourceLoader::didReceiveResource):
1427
1428 2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
1429
1430         ThreadedCompositor: clean up composition-specific resources before shutting down the thread
1431         https://bugs.webkit.org/show_bug.cgi?id=154793
1432
1433         Reviewed by Carlos Garcia Campos.
1434
1435         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1436         (WebKit::ThreadedCompositor::runCompositingThread): Before concluding the
1437         compositing thread run, clean up all the resources that were allocated at
1438         the start, and in the reverse order. Specifically, we now also deallocate
1439         the CoordinatedGraphicsScene and the SimpleViewportController objects. This
1440         way these are not deallocated on the main thread when the ThreadedCompositor
1441         destructor would otherwise clean them up.
1442
1443 2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
1444
1445         ThreadSafeCoordinatedSurface: remove the unused private create() static method
1446         https://bugs.webkit.org/show_bug.cgi?id=154792
1447
1448         Reviewed by Carlos Garcia Campos.
1449
1450         Remove the static ThreadSafeCoordinatedSurface::create() method that accepted
1451         a std::unique_ptr<ImageBuffer> object as its third parameter. This was not used
1452         anywhere.
1453
1454         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp:
1455         (WebKit::ThreadSafeCoordinatedSurface::create): Deleted.
1456         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.h:
1457
1458 2016-02-29  Simon Fraser  <simon.fraser@apple.com>
1459
1460         Remove the experimental feature of antialiased font dilation
1461         https://bugs.webkit.org/show_bug.cgi?id=154843
1462
1463         Reviewed by Zalan Bujtas.
1464
1465         Remove the "antialiased font dilation" code path, and related prefs.
1466
1467         * Shared/WebPreferencesDefinitions.h:
1468         * UIProcess/API/C/WKPreferences.cpp:
1469         (WKPreferencesSetAntialiasedFontDilationEnabled):
1470         (WKPreferencesGetAntialiasedFontDilationEnabled):
1471         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1472         * UIProcess/API/Cocoa/WKPreferences.mm:
1473         (-[WKPreferences _antialiasedFontDilationEnabled]): Deleted.
1474         (-[WKPreferences _setAntialiasedFontDilationEnabled:]): Deleted.
1475         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1476         * WebProcess/WebPage/WebPage.cpp:
1477         (WebKit::WebPage::updatePreferences): Deleted.
1478
1479 2016-02-29  Brady Eidson  <beidson@apple.com>
1480
1481         Modern IDB: WebKit 2 IPC layer easily confused about multiple web processes being connected.
1482         https://bugs.webkit.org/show_bug.cgi?id=154837
1483
1484         Reviewed by Alex Christensen.
1485
1486         The crux of the bug is that WebProcesses cannot assign themselves server-unique identifiers...
1487         The server must do that for them.
1488         
1489         A once-per-session-per-WebProcess sync message and a few updates to connection management fix this.
1490         
1491         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
1492         (WebKit::DatabaseToWebProcessConnection::didReceiveSyncMessage):
1493         (WebKit::generateConnectionToServerIdentifier):
1494         (WebKit::DatabaseToWebProcessConnection::establishIDBConnectionToServer):
1495         * DatabaseProcess/DatabaseToWebProcessConnection.h:
1496         * DatabaseProcess/DatabaseToWebProcessConnection.messages.in:
1497
1498         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1499         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
1500         (WebKit::generateConnectionToServerIdentifier): Deleted.
1501
1502         * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
1503         (WebKit::WebToDatabaseProcessConnection::didReceiveMessage):
1504         (WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession):
1505         * WebProcess/Databases/WebToDatabaseProcessConnection.h:
1506
1507 2016-02-29  Alex Christensen  <achristensen@webkit.org>
1508
1509         Don't call NetworkProcess::singleton from WebProcess when using NetworkSession
1510         https://bugs.webkit.org/show_bug.cgi?id=154829
1511
1512         Reviewed by Anders Carlsson.
1513
1514         We were calling NetworkProcess::singleton when making the default session in the 
1515         WebProcess, which caused bad things to happen.  We also were never clearing the 
1516         credentials in the WebProcess between tests because it used to always call
1517         NetworkProcess::singleton, which caused flaky tests.
1518
1519         This fixes repeatable crashes in http/tests/media/media-document-referer.html and 
1520         http/tests/media/media-document.html when using NetworkSession.
1521
1522         * NetworkProcess/NetworkProcess.cpp:
1523         (WebKit::NetworkProcess::NetworkProcess):
1524         (WebKit::NetworkProcess::~NetworkProcess):
1525         * NetworkProcess/NetworkSession.h:
1526         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1527         (WebKit::configurationForType):
1528         (WebKit::globalCustomProtocolManager):
1529         (WebKit::NetworkSession::setCustomProtocolManager):
1530         (WebKit::NetworkSession::defaultSession):
1531         * WebProcess/WebProcess.cpp:
1532         (WebKit::WebProcess::clearCachedCredentials):
1533
1534 2016-02-29  Gavin Barraclough  <barraclough@apple.com>
1535
1536         RefCounter<T>::Event -> RefCounterEvent
1537         https://bugs.webkit.org/show_bug.cgi?id=154767
1538
1539         Reviewed by Darin Adler.
1540
1541         RefCounter<T>::Event is kinda verbose to use, and there is no need for this
1542         to be specific to a particular typeof RefCounter. Move the enum class up to
1543         the top level & rename to RefCounterEvent.
1544
1545         Also remove UserObservablePageToken - this is vestigial & not really offering
1546         anything over just using UserObservablePageCounter::Token directly.
1547
1548         * UIProcess/Plugins/PluginProcessManager.cpp:
1549         (WebKit::PluginProcessManager::PluginProcessManager):
1550         * UIProcess/Plugins/PluginProcessManager.h:
1551         * UIProcess/Plugins/mac/PluginProcessManagerMac.mm:
1552         (WebKit::PluginProcessManager::updateProcessSuppressionDisabled):
1553         * UIProcess/ProcessThrottler.cpp:
1554         (WebKit::ProcessThrottler::ProcessThrottler):
1555         (WebKit::m_backgroundCounter):
1556         (WebKit::m_suspendMessageCount):
1557         * UIProcess/ProcessThrottler.h:
1558         * UIProcess/WebPageProxy.h:
1559         * UIProcess/WebProcessPool.cpp:
1560         (WebKit::WebProcessPool::WebProcessPool):
1561         (WebKit::m_processSuppressionDisabledForPageCounter):
1562         (WebKit::m_hiddenPageThrottlingAutoIncreasesCounter):
1563         * UIProcess/WebProcessPool.h:
1564
1565 2016-02-29  Konstantin Tokarev  <annulen@yandex.ru>
1566
1567         Fixed compilation with !ENABLE(DATABASE_PROCESS).
1568         https://bugs.webkit.org/show_bug.cgi?id=154813
1569
1570         Reviewed by Michael Catanzaro.
1571
1572         * UIProcess/WebProcessPool.cpp:
1573         (WebKit::WebProcessPool::terminateDatabaseProcess): Added missing #if
1574         guard.
1575
1576 2016-02-29  Adrien Plazas  <aplazas@igalia.com>
1577
1578         [GTK] Touch slider test fails due to assertion in webkitWebViewBaseTouchEvent()
1579         https://bugs.webkit.org/show_bug.cgi?id=153829
1580
1581         Reviewed by Carlos Garcia Campos.
1582
1583         Once a touch event sequence is identified as a gesture, remove it
1584         from the list of handled touch events.
1585
1586         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1587         (webkitWebViewBaseTouchEvent):
1588
1589 2016-02-29  Csaba Osztrogonác  <ossy@webkit.org>
1590
1591         [Mac][cmake] Unreviewed buildfix after r197177. Just for fun.
1592
1593         * PlatformMac.cmake:
1594
1595 2016-02-28  Sam Weinig  <sam@webkit.org>
1596
1597         Reimplement WKPageGroup in terms of WKUserContentController
1598         https://bugs.webkit.org/show_bug.cgi?id=154804
1599
1600         Reviewed by Dan Bernstein.
1601
1602         Instead of having both WebPageGroup and WebUserContentControllerProxy both keep track
1603         of user scripts and user stylesheets, give WebPageGroup a WebUserContentControllerProxy
1604         and let it take care of things. This allows us to remove a ton of duplicate code, and
1605         provides a convenient way for clients currently using PageGroup based user content insertion
1606         to start using UserContentController, since they can now be used at the same time.
1607
1608         When using WKPageConfigurationRef, the rule is:
1609             - If you don't set a WKUserContentControllerRef, the one from the WKPageGroupRef will be used.
1610             - If you do set a WKUserContentControllerRef, it will be used, and the one from the WKPageGroupRef
1611               will do nothing for that web view.
1612
1613         * DerivedSources.make:
1614         Remove WebPageGroupProxy. It no longer is a MessageReceiver.
1615
1616         * Shared/WebPageGroupData.cpp:
1617         (WebKit::WebPageGroupData::encode):
1618         (WebKit::WebPageGroupData::decode):
1619         * Shared/WebPageGroupData.h:
1620         Stop encoding/decoding user content, instead just encode the identifier to the UserContentController.
1621
1622         * UIProcess/API/C/WKPageGroup.cpp:
1623         (WKPageGroupGetUserContentController):
1624         * UIProcess/API/C/WKPageGroup.h:
1625         Add getter for the underlying WKUserContentControllerRef.
1626
1627         * UIProcess/API/cpp/WKRetainPtr.h:
1628         (WebKit::retainWK):
1629         Add retainWK() helper to match RetainPtr's retainPtr() helper.
1630
1631         * UIProcess/WebPageGroup.cpp:
1632         (WebKit::WebPageGroup::WebPageGroup):
1633         (WebKit::WebPageGroup::userContentController):
1634         (WebKit::WebPageGroup::addUserStyleSheet):
1635         (WebKit::WebPageGroup::addUserScript):
1636         (WebKit::WebPageGroup::removeAllUserStyleSheets):
1637         (WebKit::WebPageGroup::removeAllUserScripts):
1638         (WebKit::WebPageGroup::removeAllUserContent):
1639         (WebKit::WebPageGroup::addUserContentExtension):
1640         (WebKit::WebPageGroup::removeUserContentExtension):
1641         (WebKit::WebPageGroup::removeAllUserContentExtensions):
1642         * UIProcess/WebPageGroup.h:
1643         Pass through to the WebUserContentControllerProxy.
1644
1645         * UIProcess/WebPageProxy.cpp:
1646         (WebKit::WebPageProxy::WebPageProxy):
1647         (WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch):
1648         (WebKit::WebPageProxy::creationParameters):
1649         * UIProcess/WebPageProxy.h:
1650         WebPageProxies always have a WebUserContentControllerProxy now, so it can go in a Ref and
1651         a few branches can be removed.
1652
1653         * UIProcess/WebProcessPool.cpp:
1654         (WebKit::WebProcessPool::createWebPage):
1655         If a UserContentController is not passed in, use the one from the PageGroup.
1656
1657         * WebKit2.xcodeproj/project.pbxproj:
1658         Remove files.
1659
1660         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1661         Add some #includes that are now needed.
1662
1663         * WebProcess/UserContent/WebUserContentController.cpp:
1664         (WebKit::WebUserContentController::getOrCreate):
1665         * WebProcess/UserContent/WebUserContentController.h:
1666         Modernize WebUserContentController::getOrCreate to return a Ref.
1667
1668         * WebProcess/WebPage/WebPage.cpp:
1669         (WebKit::WebPage::WebPage):
1670         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
1671         (WebKit::WebPage::addUserScript):
1672         (WebKit::WebPage::addUserStyleSheet):
1673         (WebKit::WebPage::removeAllUserContent):
1674         * WebProcess/WebPage/WebPage.h:
1675         Store the WebUserContentController in Ref, remove unnecessary branches/asserts.
1676
1677         * WebProcess/WebPage/WebPageGroupProxy.cpp:
1678         (WebKit::WebPageGroupProxy::WebPageGroupProxy):
1679         (WebKit::WebPageGroupProxy::~WebPageGroupProxy):
1680         (WebKit::WebPageGroupProxy::userContentController):
1681         (WebKit::WebPageGroupProxy::addUserStyleSheet): Deleted.
1682         (WebKit::WebPageGroupProxy::addUserScript): Deleted.
1683         (WebKit::WebPageGroupProxy::removeAllUserStyleSheets): Deleted.
1684         (WebKit::WebPageGroupProxy::removeAllUserScripts): Deleted.
1685         (WebKit::WebPageGroupProxy::removeAllUserContent): Deleted.
1686         (WebKit::WebPageGroupProxy::addUserContentExtension): Deleted.
1687         (WebKit::WebPageGroupProxy::removeUserContentExtension): Deleted.
1688         (WebKit::WebPageGroupProxy::removeAllUserContentExtensions): Deleted.
1689         * WebProcess/WebPage/WebPageGroupProxy.h:
1690         Store a WebUserContentController in a Ref, remove now unnecessary message handling functions.
1691
1692         * WebProcess/WebPage/WebPageGroupProxy.messages.in:
1693         Removed.
1694
1695         * WebProcess/WebProcess.cpp:
1696         (WebKit::WebProcess::didReceiveMessage):
1697         Remove routing to WebPageGroupProxy, which is no longer a MessageReceiver.
1698
1699 2016-02-28  Sam Weinig  <sam@webkit.org>
1700
1701         Bind _WKUserStyleSheets to _WKUserContentWorlds to allow for grouping of user content by associating to a world
1702         https://bugs.webkit.org/show_bug.cgi?id=154798
1703
1704         Reviewed by Dan Bernstein.
1705
1706         Treat _WKUserStyleSheets like WKUserScripts and allow them to be bound to a _WKUserContentWorld.
1707         The immediate benefit of this is allowing a client to bind a set of user content (scripts and stylesheets
1708         for now) to a world and have them easily remove all user content associated with that world easily.
1709
1710         * Shared/API/APIArray.h:
1711         Add helpers removeAllMatching and removeAllOfTypeMatching.
1712
1713         * UIProcess/API/APIUserStyleSheet.h:
1714         Add API::UserContentWorld member.
1715
1716         * UIProcess/API/Cocoa/WKUserContentController.mm:
1717         (-[WKUserContentController _removeAllUserScriptsAssociatedWithUserContentWorld:]):
1718         (-[WKUserContentController _removeAllUserStyleSheetsAssociatedWithUserContentWorld:]):
1719         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
1720         Add _removeAllUserScriptsAssociatedWithUserContentWorld and _removeAllUserStyleSheetsAssociatedWithUserContentWorld.
1721
1722         * UIProcess/API/Cocoa/WKUserScript.mm:
1723         (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
1724         (toStringVector): Deleted.
1725         * UIProcess/API/Cocoa/_WKUserContentWorldInternal.h:
1726         (API::toStringVector):
1727         Move toStringVector to a location where it can be shared.
1728
1729         * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
1730         * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
1731         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
1732         Add new initializer which has a world to be bound to. While here, match WKUserScript and add support for the 
1733         legacy whitelist and blacklists.
1734
1735         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
1736         (WebKit::WebUserContentControllerProxy::addProcess):
1737         (WebKit::WebUserContentControllerProxy::removeProcess):
1738         (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
1739         (WebKit::WebUserContentControllerProxy::shouldSendRemoveUserContentWorldsMessage):
1740         (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
1741         (WebKit::WebUserContentControllerProxy::addUserScript):
1742         (WebKit::WebUserContentControllerProxy::removeUserScript):
1743         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
1744         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
1745         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
1746         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
1747         * UIProcess/UserContent/WebUserContentControllerProxy.h:
1748         Refactor to share the code which decides whether to send AddUserContentWorlds/RemoveUserContentWorlds
1749         messages.
1750
1751         * WebProcess/UserContent/WebUserContentController.cpp:
1752         (WebKit::WebUserContentController::addUserContentWorlds):
1753         (WebKit::WebUserContentController::removeUserContentWorlds):
1754         (WebKit::WebUserContentController::addUserScripts):
1755         (WebKit::WebUserContentController::removeUserScript):
1756         (WebKit::WebUserContentController::removeAllUserScripts):
1757         (WebKit::WebUserContentController::addUserStyleSheets):
1758         (WebKit::WebUserContentController::removeUserStyleSheet):
1759         (WebKit::WebUserContentController::removeAllUserStyleSheets):
1760         * WebProcess/UserContent/WebUserContentController.h:
1761         * WebProcess/UserContent/WebUserContentController.messages.in:
1762         Add support for binding stylesheets to worlds and allow removing all the scripts/stylesheets from a 
1763         set of worlds at once by passing Vectors of world identifiers in the remove messages.
1764
1765 2016-02-27  Commit Queue  <commit-queue@webkit.org>
1766
1767         Unreviewed, rolling out r197204, r197207, r197211, r197217,
1768         r197218, and r197219.
1769         https://bugs.webkit.org/show_bug.cgi?id=154780
1770
1771         Caused crashes in WebVideoFullscreenManagerProxy (Requested by
1772         ap on #webkit).
1773
1774         Reverted changesets:
1775
1776         "Add support for playbackControlsManager"
1777         https://bugs.webkit.org/show_bug.cgi?id=154742
1778         http://trac.webkit.org/changeset/197204
1779
1780         "Attempted build fix."
1781         http://trac.webkit.org/changeset/197207
1782
1783         "Attempted build fix."
1784         http://trac.webkit.org/changeset/197211
1785
1786         "Attempted 32-bit build fix."
1787         http://trac.webkit.org/changeset/197217
1788
1789         "Another 32-bit build fix."
1790         http://trac.webkit.org/changeset/197218
1791
1792         "32-bit!!!"
1793         http://trac.webkit.org/changeset/197219
1794
1795 2016-02-26  Carlos Garcia Campos  <cgarcia@igalia.com>
1796
1797         Unreviewed. Fix GTK+ clean build.
1798
1799         Add missing header include.
1800
1801         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1802
1803 2016-02-26  Carlos Garcia Campos  <cgarcia@igalia.com>
1804
1805         Network cache: old pages returned by disk cache on history navigation after session is restored
1806         https://bugs.webkit.org/show_bug.cgi?id=153230
1807
1808         Reviewed by Chris Dumez.
1809
1810         Since r181734, the network cache never revalidates resources for
1811         history navigation. This is good for the memory cache, but in the
1812         case of disk cache, we might end up with outdated pages when
1813         restoring the session. When restoring the session happens because
1814         of an API request (we also restore the session when recovering
1815         from a web process crash), we should revalidate back forward list
1816         requests in the disk cache if needed. This will only happen the
1817         first time they are loaded after a session restore. After a web process
1818         crash, resources will be used uncondionally from the disk cache.
1819
1820         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1821         (WebKit::WebBackForwardListProxy::addItemFromUIProcess): Use Ref&&
1822         instead of PassRefPtr.
1823         * WebProcess/WebPage/WebBackForwardListProxy.h:
1824         * WebProcess/WebPage/WebPage.cpp:
1825         (WebKit::WePage::WebPage): Call restoreSessionInternal passing
1826         No as restoredByAPIRequest parameter.
1827         (WebKit::WebPage::restoreSessionInternal): Set restoredFromSession
1828         flag to the created HistoryItem if the item was restored from
1829         session by an API request.
1830         (WebKit::WebPage::restoreSession): Call restoreSessionInternal
1831         passing Yes as restoredByAPIRequest parameter.
1832         * WebProcess/WebPage/WebPage.h:
1833
1834 2016-02-26  Michael Catanzaro  <mcatanzaro@igalia.com>
1835
1836         Fix a typo.
1837
1838         Unreviewed. Shame I didn't notice in the previous commit.
1839
1840         * WebProcess/UserContent/WebUserContentController.cpp:
1841         (WebKit::WebUserContentController::removeUserContentWorld):
1842
1843 2016-02-26  Michael Catanzaro  <mcatanzaro@igalia.com>
1844
1845         Fix GTK and maybe EFL build after r197172.
1846
1847         Unreviewed.
1848
1849         * CMakeLists.txt:
1850         * UIProcess/API/gtk/WebKitUserContent.cpp:
1851         (_WebKitUserScript::_WebKitUserScript):
1852         * WebProcess/UserContent/WebUserContentController.cpp:
1853         (WebKit::WebUserContentController::removeUserContentWorld):
1854         (WebKit::WebUserContentController::addUserScripts):
1855         (WebKit::WebUserContentController::removeUserScript):
1856         (WebKit::WebUserContentController::removeAllUserScripts):
1857
1858 2016-02-26  Michael Catanzaro  <mcatanzaro@igalia.com>
1859
1860         [GTK] Fix order of parameters in gtkdoc for webkit_web_view_get_snapshot
1861
1862         Unreviewed.
1863
1864         * UIProcess/API/gtk/WebKitWebView.cpp:
1865
1866 2016-02-26  Brady Eidson  <beidson@apple.com>
1867
1868         Modern IDB: New database versions are never committed to SQLite.
1869         <rdar://problem/24860952> and https://bugs.webkit.org/show_bug.cgi?id=154741
1870         
1871         Modern IDB: If a database handle is not open, files are not actually deleted from disk
1872         https://bugs.webkit.org/show_bug.cgi?id=154756
1873
1874         Reviewed by Alex Christensen.
1875
1876         Add WK2 SPI to force termination of the database process.
1877
1878         * UIProcess/API/Cocoa/WKProcessPool.mm:
1879         (-[WKProcessPool _terminateDatabaseProcess]):
1880         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1881         * UIProcess/WebProcessPool.cpp:
1882         (WebKit::WebProcessPool::terminateDatabaseProcess):
1883         * UIProcess/WebProcessPool.h:
1884
1885 2016-02-26  Alex Christensen  <achristensen@webkit.org>
1886
1887         Clear credentials and prevent unauthorized credential storage when using NetworkSession
1888         https://bugs.webkit.org/show_bug.cgi?id=154755
1889
1890         Reviewed by Brady Eidson.
1891
1892         Credentials from previous tests were being used sometimes, notably in 
1893         http/tests/misc/401-alternative-content.php when running multiple credential-based
1894         tests with the same WebKitTestRunner.
1895
1896         * NetworkProcess/NetworkDataTask.h:
1897         * NetworkProcess/NetworkProcess.cpp:
1898         (WebKit::NetworkProcess::clearCachedCredentials):
1899         (WebKit::NetworkProcess::ensurePrivateBrowsingSession):
1900         * NetworkProcess/NetworkSession.h:
1901         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1902         (WebKit::NetworkDataTask::NetworkDataTask):
1903         (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
1904         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1905         (WebKit::NetworkSession::~NetworkSession):
1906         (WebKit::NetworkSession::clearCredentials):
1907         (WebKit::NetworkSession::dataTaskForIdentifier):
1908
1909 2016-02-26  Gavin Barraclough  <barraclough@apple.com>
1910
1911         Page TimerAlignmentIntervalIncrease mechanism should have upper limit
1912         https://bugs.webkit.org/show_bug.cgi?id=154744
1913
1914         Reviewed by Geoff Garen.
1915
1916         There would be diminishing returns from throttling timers in background pages infinitely.
1917         Add a heuristic to limit appropriately.
1918
1919         The flow of data here is WebPageProxy informs WebProcessPool of the number of pages
1920         participating in this mechanism, WebProcessPool computes an apropriate limit and pushes
1921         this out to the WebProcesses, which in turn update each of their pages.
1922
1923         * UIProcess/WebPageProxy.cpp:
1924         (WebKit::WebPageProxy::WebPageProxy):
1925             - Call updateHidenPageThrottingAutoIncreases on creation.
1926         (WebKit::WebPageProxy::updateHidenPageThrottingAutoIncreases):
1927             - If increasing timer throttling is enabled increment the counter on WebProcessPool.
1928         (WebKit::WebPageProxy::preferencesDidChange):
1929             - Call updateHidenPageThrottingAutoIncreases on preferences change.
1930         * UIProcess/WebPageProxy.h:
1931         * UIProcess/WebProcessPool.cpp:
1932         (WebKit::WebProcessPool::WebProcessPool):
1933             - initialize new RefCounter.
1934         (WebKit::WebProcessPool::updateHidenPageThrottingAutoIncreaseLimit):
1935             - When count of participating pages changes, update the limit.
1936         * UIProcess/WebProcessPool.h:
1937         * WebProcess/WebPage/WebPage.h:
1938         (WebKit::WebPage::setHiddenPageTimerThrottlingIncreaseLimit):
1939             - Propagate limit to WebCore::Page.
1940         * WebProcess/WebProcess.cpp:
1941         (WebKit::WebProcess::setHiddenPageTimerThrottlingIncreaseLimit):
1942             - Propagate limit to WebPages.
1943         * WebProcess/WebProcess.h:
1944         * WebProcess/WebProcess.messages.in:
1945             - Added new message.
1946
1947 2016-02-26  Beth Dakin  <bdakin@apple.com>
1948
1949         Attempted build fix.
1950
1951         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1952         (WebKit::WebVideoFullscreenManagerProxy::setUpVideoControlsManagerWithID):
1953         (WebKit::WebVideoFullscreenManagerProxy::resetMediaState):
1954
1955 2016-02-26  Anders Carlsson  <andersca@apple.com>
1956
1957         Fix Yosemite build.
1958
1959         * UIProcess/API/Cocoa/_WKWebsiteDataSize.mm:
1960         (-[_WKWebsiteDataSize sizeOfDataTypes:]):
1961
1962 2016-02-26  Beth Dakin  <bdakin@apple.com>
1963
1964         Add support for playbackControlsManager
1965         https://bugs.webkit.org/show_bug.cgi?id=154742
1966         -and corresponding-
1967         rdar://problem/23833753
1968
1969         Reviewed by Jer Noble.
1970
1971         WebVideoFullscreenManagerProxy ensures the model and interface for the 
1972         UIProcess side of the playbackControlsManager. It also caches the 
1973         m_controlsManagerContextId so that it can return the 
1974         controlsManagerInterface.
1975         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
1976         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
1977         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1978         (WebKit::WebVideoFullscreenManagerProxy::setUpVideoControlsManagerWithID):
1979         (WebKit::WebVideoFullscreenManagerProxy::controlsManagerInterface):
1980
1981         Pipe isPlayingMediaDidChange() to WebViewImpl, and use that information to 
1982         update WebViewImplAdditions.
1983         * UIProcess/Cocoa/WebViewImpl.h:
1984         * UIProcess/Cocoa/WebViewImpl.mm:
1985         (WebKit::WebViewImpl::isPlayingMediaDidChange):
1986         * UIProcess/PageClient.h:
1987         * UIProcess/WebPageProxy.cpp:
1988         (WebKit::WebPageProxy::isPlayingMediaDidChange):
1989         (WebKit::WebPageProxy::isPlayingVideoWithAudio):
1990         * UIProcess/WebPageProxy.h:
1991         (WebKit::WebPageProxy::isPlayingAudio):
1992         * UIProcess/mac/PageClientImpl.h:
1993         * UIProcess/mac/PageClientImpl.mm:
1994         (WebKit::PageClientImpl::isPlayingMediaDidChange):
1995
1996         Pipe setUpVideoControlsManager to the WebVideoFullscreenManager.
1997         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1998         (WebKit::WebChromeClient::setUpVideoControlsManager):
1999         * WebProcess/WebCoreSupport/WebChromeClient.h:
2000
2001         Ensure the model an interface for the playbackControlsManager on the 
2002         WebProcess side and pass the message to the UIProcess to do the same.
2003         * WebProcess/cocoa/WebVideoFullscreenManager.h:
2004         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
2005         (WebKit::WebVideoFullscreenManager::setUpVideoControlsManager):
2006
2007 2016-02-26  Anders Carlsson  <andersca@apple.com>
2008
2009         WKWebsiteDataStore/WKWebsiteDataRecord needs to provide size information about each type of data
2010         https://bugs.webkit.org/show_bug.cgi?id=154750
2011
2012         Reviewed by Tim Horton.
2013
2014         * DatabaseProcess/DatabaseProcess.cpp:
2015         (WebKit::DatabaseProcess::fetchWebsiteData):
2016         WebsiteData::Entry now takes a size.
2017
2018         * NetworkProcess/NetworkProcess.cpp:
2019         (WebKit::fetchDiskCacheEntries):
2020         If necessary, compute sizes.
2021
2022         (WebKit::NetworkProcess::fetchWebsiteData):
2023         Just pass 0 for the CF cache for now.
2024
2025         * NetworkProcess/NetworkProcess.h:
2026         * NetworkProcess/NetworkProcess.messages.in:
2027         FetchWebsiteData now takes a OptionSet<WebsiteDataFetchOption>.
2028
2029         * Shared/WebsiteData/WebsiteData.cpp:
2030         (WebKit::WebsiteData::Entry::encode):
2031         (WebKit::WebsiteData::Entry::decode):
2032         Encode and decode the size.
2033
2034         * Shared/WebsiteData/WebsiteData.h:
2035         Add size.
2036
2037         * Shared/WebsiteData/WebsiteDataFetchOption.h:
2038         Add new enum.
2039
2040         * UIProcess/API/C/WKApplicationCacheManager.cpp:
2041         (WKApplicationCacheManagerGetApplicationCacheOrigins):
2042         Pass an empty OptionSet<WebsiteDataFetchOption>.
2043
2044         * UIProcess/API/C/WKResourceCacheManager.cpp:
2045         (WKResourceCacheManagerGetCacheOrigins):
2046         Pass an empty OptionSet<WebsiteDataFetchOption>.
2047
2048         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
2049         (-[WKWebsiteDataRecord description]):
2050         If we have a size, print it out as well.
2051
2052         (-[WKWebsiteDataRecord _dataSize]):
2053         Return a size if we have one.
2054
2055         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
2056         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2057         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
2058         Call through to the SPI.
2059
2060         (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
2061         Compute the right options.
2062
2063         * UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h:
2064         Import WKWebsiteDataStorePrivate.h.
2065
2066         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2067         Add SPI.
2068
2069         * UIProcess/API/Cocoa/_WKWebsiteDataSize.h:
2070         * UIProcess/API/Cocoa/_WKWebsiteDataSize.mm:
2071         (-[_WKWebsiteDataSize initWithSize:]):
2072         (-[_WKWebsiteDataSize totalSize]):
2073         (-[_WKWebsiteDataSize sizeOfDataTypes:]):
2074         Add _WKWebsiteDataSize header.
2075
2076         * UIProcess/API/Cocoa/_WKWebsiteDataSizeInternal.h: Add IPI header.
2077
2078         * UIProcess/Network/NetworkProcessProxy.cpp:
2079         (WebKit::NetworkProcessProxy::fetchWebsiteData):
2080         This now takes a OptionSet<WebsiteDataFetchOption>.
2081
2082         * UIProcess/Network/NetworkProcessProxy.h:
2083         Update members.
2084
2085         * UIProcess/WebsiteData/WebsiteDataRecord.h:
2086         Add a hash map from types to sizes.
2087
2088         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2089         (WebKit::WebsiteDataStore::fetchData):
2090         This now takes a OptionSet<WebsiteDataFetchOption>.
2091
2092         * UIProcess/WebsiteData/WebsiteDataStore.h:
2093         Update member functions.
2094
2095         * WebKit2.xcodeproj/project.pbxproj:
2096         Add new files.
2097
2098         * WebProcess/WebProcess.cpp:
2099         (WebKit::WebProcess::fetchWebsiteData):
2100         This now takes a OptionSet<WebsiteDataFetchOption>.
2101
2102 2016-02-26  Anders Carlsson  <andersca@apple.com>
2103
2104         Add a toWebsiteDataType and reimplement toWebsiteDataTypes using it
2105         https://bugs.webkit.org/show_bug.cgi?id=154746
2106
2107         Reviewed by Sam Weinig.
2108
2109         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
2110         (WebKit::toWebsiteDataType):
2111         (WebKit::toWebsiteDataTypes):
2112         (WebKit::toWKWebsiteDataTypes):
2113
2114 2016-02-26  Anders Carlsson  <andersca@apple.com>
2115
2116         Add WTF::OptionSet and use it for the website data types enum
2117         https://bugs.webkit.org/show_bug.cgi?id=154733
2118
2119         Reviewed by Geoffrey Garen.
2120
2121         This is a pretty mechanical change:
2122         
2123         Convert all uses of the WebsiteDataTypes enum to WTF::OptionSet. Rename the WebsiteDataTypes enum to
2124         WebsiteDataType (since it only represents a single data type), and rename headers. Encode and decode WTF::OptionSet properly.
2125
2126         * DatabaseProcess/DatabaseProcess.cpp:
2127         (WebKit::DatabaseProcess::fetchWebsiteData):
2128         (WebKit::DatabaseProcess::deleteWebsiteData):
2129         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
2130         * DatabaseProcess/DatabaseProcess.h:
2131         * DatabaseProcess/DatabaseProcess.messages.in:
2132         * NetworkProcess/NetworkProcess.cpp:
2133         (WebKit::fetchDiskCacheEntries):
2134         (WebKit::NetworkProcess::fetchWebsiteData):
2135         (WebKit::NetworkProcess::deleteWebsiteData):
2136         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
2137         * NetworkProcess/NetworkProcess.h:
2138         * NetworkProcess/NetworkProcess.messages.in:
2139         * Platform/IPC/ArgumentCoders.h:
2140         (IPC::ArgumentCoder<OptionSet<T>>::encode):
2141         (IPC::ArgumentCoder<OptionSet<T>>::decode):
2142         * Scripts/webkit/messages.py:
2143         (class_template_headers):
2144         * Shared/WebsiteData/WebsiteData.h:
2145         * Shared/WebsiteData/WebsiteDataType.h: Renamed from Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h.
2146         * UIProcess/API/C/WKApplicationCacheManager.cpp:
2147         (WKApplicationCacheManagerGetApplicationCacheOrigins):
2148         (WKApplicationCacheManagerDeleteEntriesForOrigin):
2149         (WKApplicationCacheManagerDeleteAllEntries):
2150         * UIProcess/API/C/WKResourceCacheManager.cpp:
2151         (toWebsiteDataTypes):
2152         (WKResourceCacheManagerClearCacheForOrigin):
2153         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
2154         (WebKit::toWebsiteDataTypes):
2155         (WebKit::toWKWebsiteDataTypes):
2156         * UIProcess/Databases/DatabaseProcessProxy.cpp:
2157         (WebKit::DatabaseProcessProxy::fetchWebsiteData):
2158         (WebKit::DatabaseProcessProxy::deleteWebsiteData):
2159         (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins):
2160         * UIProcess/Databases/DatabaseProcessProxy.h:
2161         * UIProcess/Network/NetworkProcessProxy.cpp:
2162         (WebKit::NetworkProcessProxy::fetchWebsiteData):
2163         (WebKit::NetworkProcessProxy::deleteWebsiteData):
2164         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
2165         * UIProcess/Network/NetworkProcessProxy.h:
2166         * UIProcess/WebProcessProxy.cpp:
2167         (WebKit::WebProcessProxy::fetchWebsiteData):
2168         (WebKit::WebProcessProxy::deleteWebsiteData):
2169         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
2170         * UIProcess/WebProcessProxy.h:
2171         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
2172         (WebKit::WebsiteDataRecord::add):
2173         (WebKit::WebsiteDataRecord::addCookieHostName):
2174         (WebKit::WebsiteDataRecord::addPluginDataHostName):
2175         * UIProcess/WebsiteData/WebsiteDataRecord.h:
2176         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2177         (WebKit::computeNetworkProcessAccessTypeForDataFetch):
2178         (WebKit::computeWebProcessAccessTypeForDataFetch):
2179         (WebKit::WebsiteDataStore::fetchData):
2180         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
2181         (WebKit::computeWebProcessAccessTypeForDataRemoval):
2182         (WebKit::WebsiteDataStore::removeData):
2183         * UIProcess/WebsiteData/WebsiteDataStore.h:
2184         * WebKit2.xcodeproj/project.pbxproj:
2185         * WebProcess/WebProcess.cpp:
2186         (WebKit::WebProcess::fetchWebsiteData):
2187         (WebKit::WebProcess::deleteWebsiteData):
2188         (WebKit::WebProcess::deleteWebsiteDataForOrigins):
2189         * WebProcess/WebProcess.h:
2190         * WebProcess/WebProcess.messages.in:
2191
2192 2016-02-26  Sam Weinig  <sam@webkit.org>
2193
2194         Try to fix the Yosemite build again.
2195
2196         * UIProcess/API/Cocoa/WKUserScript.mm:
2197         (toStringVector):
2198         (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
2199
2200 2016-02-26  Sam Weinig  <sam@webkit.org>
2201
2202         Try to fix the Yosemite build.
2203
2204         * UIProcess/API/Cocoa/WKUserScriptPrivate.h:
2205
2206 2016-02-25  Anders Carlsson  <andersca@apple.com>
2207
2208         Cache::traverse should pass the record info to its traversal handler
2209         https://bugs.webkit.org/show_bug.cgi?id=154695
2210
2211         Reviewed by Antti Koivisto.
2212
2213         * NetworkProcess/NetworkProcess.cpp:
2214         (WebKit::fetchDiskCacheEntries):
2215         (WebKit::clearDiskCacheEntries):
2216         * NetworkProcess/cache/NetworkCache.cpp:
2217         (WebKit::NetworkCache::Cache::traverse):
2218         * NetworkProcess/cache/NetworkCache.h:
2219
2220 2016-02-25  Gavin Barraclough  <barraclough@apple.com>
2221
2222         RefCounter value changed callback should be called on all changes (not just zero edge).
2223         https://bugs.webkit.org/show_bug.cgi?id=154699
2224
2225         Reviewed by Anders Carlsson.
2226
2227         RefCounter currently only triggers a callback when the count goes from zero
2228         to non-zero and vice-versa. Change that, to be useful to more clients.
2229
2230         * UIProcess/Plugins/PluginProcessManager.cpp:
2231         (WebKit::PluginProcessManager::PluginProcessManager):
2232             - Updated for change in RefCounter callback siganture.
2233         * UIProcess/Plugins/PluginProcessManager.h:
2234             - Updated for change in RefCounter callback siganture.
2235         * UIProcess/Plugins/mac/PluginProcessManagerMac.mm:
2236         (WebKit::PluginProcessManager::updateProcessSuppressionDisabled):
2237             - updated logic for enabling process supression.
2238         * UIProcess/ProcessThrottler.cpp:
2239         (WebKit::ProcessThrottler::ProcessThrottler):
2240             - Updated for change in RefCounter callback siganture.
2241         * UIProcess/WebProcessPool.cpp:
2242         (WebKit::WebProcessPool::WebProcessPool):
2243             - Updated for change in RefCounter callback siganture.
2244
2245 2016-02-26  Andreas Kling  <akling@apple.com>
2246
2247         Remove unused CFNetwork disk cache mmap optimization in WebKit2.
2248         <https://webkit.org/b/154727>
2249
2250         Reviewed by Darin Adler.
2251
2252         Nuke all the code related to the mmap optimization we had for CFNetwork's disk cache.
2253         This code has not been used since we moved to the WebKit2 network cache.
2254
2255         * NetworkProcess/Downloads/PendingDownload.h:
2256         * NetworkProcess/NetworkLoadClient.h:
2257         * NetworkProcess/NetworkResourceLoader.cpp:
2258         (WebKit::NetworkResourceLoader::sendBufferMaybeAborting): Deleted.
2259         * NetworkProcess/NetworkResourceLoader.h:
2260         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
2261         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2262         (WebKit::NetworkProcess::platformLowMemoryHandler): Deleted.
2263         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): Deleted.
2264         * NetworkProcess/mac/NetworkDiskCacheMonitor.h: Removed.
2265         * NetworkProcess/mac/NetworkDiskCacheMonitor.mm: Removed.
2266         * NetworkProcess/mac/NetworkLoadMac.mm:
2267         (WebKit::NetworkLoad::willCacheResponseAsync): Deleted.
2268         * NetworkProcess/mac/NetworkResourceLoaderMac.mm: Removed.
2269         * WebKit2.xcodeproj/project.pbxproj:
2270
2271 2016-02-26  Commit Queue  <commit-queue@webkit.org>
2272
2273         Unreviewed, rolling out r197168.
2274         https://bugs.webkit.org/show_bug.cgi?id=154728
2275
2276         crashing on some devices (Requested by kling on #webkit).
2277
2278         Reverted changeset:
2279
2280         "[Darwin] Use vm_kernel_page_size for WTF::pageSize()."
2281         https://bugs.webkit.org/show_bug.cgi?id=154726
2282         http://trac.webkit.org/changeset/197168
2283
2284 2016-02-25  Sam Weinig  <sam@webkit.org>
2285
2286         Allow WKUserScripts to be run in isolated worlds
2287         https://bugs.webkit.org/show_bug.cgi?id=154701
2288
2289         Reviewed by Anders Carlsson.
2290
2291         Adds support for using isolated worlds, called _WKUserContentWorlds in the SPI,
2292         from the UIProcess.
2293
2294         * Shared/API/APIObject.h:
2295         * Shared/Cocoa/APIObject.mm:
2296         * UIProcess/API/APIUserContentWorld.cpp: Added.
2297         (API::generateIdentifier):
2298         (API::UserContentWorld::worldWithName):
2299         (API::UserContentWorld::normalWorld):
2300         (API::UserContentWorld::UserContentWorld):
2301         (API::UserContentWorld::~UserContentWorld):
2302         * UIProcess/API/APIUserContentWorld.h: Added.
2303         Add new UserContentWorld type.
2304
2305         * UIProcess/API/APIUserScript.h:
2306         Bind each user script to a particular _WKUserContentWorld.
2307
2308         * UIProcess/API/C/WKUserScriptRef.cpp:
2309         (WKUserScriptCreateWithSource):
2310         (WKUserScriptCopySource):
2311         Existing APIs create user scripts for the normal world, preserving existing behavior.
2312
2313         * UIProcess/API/Cocoa/WKUserScript.mm:
2314         (-[WKUserScript initWithSource:injectionTime:forMainFrameOnly:]):
2315         Existing APIs create user scripts for the normal world, preserving existing behavior.
2316
2317         (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
2318         Add a new initializer which takes a world to bind to.  Also add support for the legacy whitelist/blacklist mechanism
2319         while we are here, as the expected client needs these as well.
2320
2321         (-[WKUserScript _userContentWorld]):
2322         Add accessor for the bound world.
2323
2324         * UIProcess/API/Cocoa/WKUserScriptInternal.h:
2325         * UIProcess/API/Cocoa/WKUserScriptPrivate.h: Added.
2326         Add new private header.
2327
2328         * UIProcess/API/Cocoa/_WKUserContentWorld.h: Added.
2329         * UIProcess/API/Cocoa/_WKUserContentWorld.mm: Added.
2330         (+[_WKUserContentWorld worldWithName:]):
2331         (+[_WKUserContentWorld normalWorld]):
2332         (-[_WKUserContentWorld dealloc]):
2333         (-[_WKUserContentWorld name]):
2334         (-[_WKUserContentWorld _apiObject]):
2335         * UIProcess/API/Cocoa/_WKUserContentWorldInternal.h: Added.
2336         Add SPI wrapper.
2337
2338         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2339         (WebKit::WebUserContentControllerProxy::addProcess):
2340         (WebKit::WebUserContentControllerProxy::addUserScript):
2341         (WebKit::WebUserContentControllerProxy::removeUserScript):
2342         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
2343         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
2344         * UIProcess/UserContent/WebUserContentControllerProxy.h:
2345         (WebKit::WebUserContentControllerProxy::userScripts):
2346         (WebKit::WebUserContentControllerProxy::userStyleSheets):
2347         Add support for registering the worlds with the associated WebContentProcesses and then using
2348         their identifiers to map user scripts to the correct world.
2349         
2350         * WebKit2.xcodeproj/project.pbxproj:
2351         Add new files.
2352
2353         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
2354         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm:
2355         (-[WKWebProcessPlugInScriptWorld name]):
2356         Expose the name property.
2357
2358         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
2359         (WKBundleScriptWorldCopyName):
2360         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.h:
2361         Expose the name property.
2362
2363         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
2364         (WebKit::allWorlds):
2365         (WebKit::InjectedBundleScriptWorld::create):
2366         (WebKit::InjectedBundleScriptWorld::getOrCreate):
2367         (WebKit::InjectedBundleScriptWorld::normalWorld):
2368         (WebKit::InjectedBundleScriptWorld::InjectedBundleScriptWorld):
2369         (WebKit::InjectedBundleScriptWorld::~InjectedBundleScriptWorld):
2370         (WebKit::InjectedBundleScriptWorld::coreWorld):
2371         (WebKit::InjectedBundleScriptWorld::clearWrappers):
2372         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
2373         (WebKit::InjectedBundleScriptWorld::name):
2374         Add the name property and do some drive-by RefPtr -> Ref conversions.
2375
2376         * WebProcess/UserContent/WebUserContentController.cpp:
2377         (WebKit::userContentControllers):
2378         (WebKit::worldMap):
2379         (WebKit::WebUserContentController::getOrCreate):
2380         (WebKit::WebUserContentController::~WebUserContentController):
2381         (WebKit::WebUserContentController::addUserContentWorlds):
2382         (WebKit::WebUserContentController::removeUserContentWorld):
2383         (WebKit::WebUserContentController::addUserScripts):
2384         (WebKit::WebUserContentController::removeUserScript):
2385         (WebKit::WebUserContentController::removeAllUserScripts):
2386         (WebKit::WebUserContentController::addUserStyleSheets):
2387         * WebProcess/UserContent/WebUserContentController.h:
2388         * WebProcess/UserContent/WebUserContentController.messages.in:
2389         Track and use worlds passed from the UIProcess.
2390
2391 2016-02-26  Andreas Kling  <akling@apple.com>
2392
2393         [Darwin] Use vm_kernel_page_size for WTF::pageSize().
2394         <https://webkit.org/b/154726>
2395
2396         Reviewed by Antti Koivisto.
2397
2398         Use WTF::pageSize() for the SharedMemory page size.
2399
2400         * Platform/mac/SharedMemoryMac.cpp:
2401         (WebKit::SharedMemory::systemPageSize):
2402
2403 2016-02-25  Ryuan Choi  <ryuan.choi@navercorp.com>
2404
2405         [EFL] Remove WebUIPopupMenuClient
2406         https://bugs.webkit.org/show_bug.cgi?id=154717
2407
2408         Reviewed by Gyuyoung Kim.
2409
2410         WebUIPopupMenuClient is only for EFL to expose WebPopupMenuProxy and WebPopupItem to WK C APIs.
2411         This patch removes it and related code.
2412
2413         * PlatformEfl.cmake: Removed WKPopupItem related files from source list.
2414         * UIProcess/API/C/efl/WKAPICastEfl.h: Removed WKPopupMenu related code.
2415         * UIProcess/API/C/efl/WKPageEfl.cpp: Removed.
2416         * UIProcess/API/C/efl/WKPageEfl.h: Removed.
2417         * UIProcess/API/C/efl/WKPopupItem.cpp: Removed.
2418         * UIProcess/API/C/efl/WKPopupItem.h: Removed.
2419         * UIProcess/API/C/efl/WKPopupMenuListener.cpp: Removed.
2420         * UIProcess/API/C/efl/WKPopupMenuListener.h: Removed.
2421         * UIProcess/API/efl/EwkView.cpp:
2422         (EwkView::requestPopupMenu):
2423         * UIProcess/API/efl/EwkView.h:
2424         * UIProcess/API/efl/ewk_popup_menu.cpp:
2425         (EwkPopupMenu::EwkPopupMenu):
2426         (EwkPopupMenu::close):
2427         (EwkPopupMenu::setSelectedIndex):
2428         * UIProcess/API/efl/ewk_popup_menu_item.cpp: Used WebPopupItem and others instead of WK C APIs.
2429         * UIProcess/API/efl/ewk_popup_menu_item_private.h: Ditto.
2430         * UIProcess/API/efl/ewk_popup_menu_private.h:
2431         * UIProcess/WebPageProxy.cpp:
2432         (WebKit::WebPageProxy::close): Removed unnecessary EFL guards.
2433         (WebKit::WebPageProxy::showPopupMenu): Ditto.
2434         (WebKit::WebPageProxy::hidePopupMenu): Ditto.
2435         * UIProcess/WebPageProxy.h:
2436         * UIProcess/WebPopupMenuProxy.h:
2437         * UIProcess/efl/PageUIClientEfl.cpp: Removed WKPopupMenuListener related code.
2438         (WebKit::PageUIClientEfl::PageUIClientEfl): Deleted.
2439         (WebKit::PageUIClientEfl::showPopupMenu): Deleted.
2440         (WebKit::PageUIClientEfl::hidePopupMenu): Deleted.
2441         * UIProcess/efl/PageUIClientEfl.h:
2442         * UIProcess/efl/WebPageProxyEfl.cpp:
2443         (WebKit::WebPageProxy::initializeUIPopupMenuClient): Deleted.
2444         * UIProcess/efl/WebPopupMenuListenerEfl.cpp:
2445         (WebKit::WebPopupMenuListenerEfl::WebPopupMenuListenerEfl): Deleted.
2446         (WebKit::WebPopupMenuListenerEfl::valueChanged): Deleted.
2447         * UIProcess/efl/WebPopupMenuListenerEfl.h:
2448         (WebKit::WebPopupMenuListenerEfl::create): Deleted.
2449         * UIProcess/efl/WebPopupMenuProxyEfl.cpp: Used WebPopupItem and others instead of WK C APIs.
2450         * UIProcess/efl/WebPopupMenuProxyEfl.h: Ditto.
2451         (WebKit::WebPopupMenuProxyEfl::create):
2452         * UIProcess/efl/WebUIPopupMenuClient.cpp: Removed.
2453         * UIProcess/efl/WebUIPopupMenuClient.h: Removed.
2454         * UIProcess/efl/WebView.cpp:
2455         (WebKit::WebView::createPopupMenuProxy): Used WebPopupItem and others instead of WK C APIs.
2456
2457 2016-02-25  Andreas Kling  <akling@apple.com>
2458
2459         [iOS] Enable PageCache backing store clearing optimization for WebKit2.
2460         <https://webkit.org/b/154712>
2461
2462         Reviewed by Anders Carlsson.
2463
2464         We had an optimization for iOS where we'd tear down the compositing tree for
2465         pages in the page cache, to save memory, but we were only enabling it when
2466         instantiating a WebKit1 web view.
2467
2468         This patch enables the optimization for WebKit2 as well.
2469
2470         * WebProcess/WebProcess.cpp:
2471         (WebKit::WebProcess::WebProcess):
2472
2473 2016-02-25  Ada Chan  <adachan@apple.com>
2474
2475         Update the definition of ENABLE_VIDEO_PRESENTATION_MODE for Mac platform
2476         https://bugs.webkit.org/show_bug.cgi?id=154702
2477
2478         Reviewed by Dan Bernstein.
2479
2480         * Configurations/FeatureDefines.xcconfig:
2481
2482 2016-02-25  Jiewen Tan  <jiewen_tan@apple.com>
2483
2484         Restrict information passed with navigation action which is triggered by untrusted event
2485         https://bugs.webkit.org/show_bug.cgi?id=154571
2486         <rdar://problem/15967937>
2487
2488         Reviewed by Andy Estes.
2489
2490         When navigation action is triggered by an untrusted event, we should be more restricted of
2491         what information should be passed to the clients to lower the risk that clients could
2492         be fooled by the untrusted event.
2493
2494         In this patch, we drop the modifiers for key state events and set the mouse button to NoButton
2495         for mouse events.
2496
2497         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
2498         (WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):
2499
2500 2016-02-25  Ada Chan  <adachan@apple.com>
2501
2502         Hook up fullscreenMayReturnToInline() in WKPageUIClient
2503         https://bugs.webkit.org/show_bug.cgi?id=154661
2504
2505         Reviewed by Tim Horton.
2506
2507         * UIProcess/API/C/WKPage.cpp:
2508         (WKPageSetPageUIClient):
2509         * UIProcess/API/C/WKPageUIClient.h:
2510
2511 2016-02-25  Gavin Barraclough  <barraclough@apple.com>
2512
2513         Should template RefCounter instead of RefCounter::Token
2514         https://bugs.webkit.org/show_bug.cgi?id=154691
2515
2516         Reviewed by Anders Carlsson.
2517
2518         Mechanical update per RefCounter interface change.
2519
2520         * UIProcess/Plugins/PluginProcessManager.h:
2521         (WebKit::PluginProcessManager::processSuppressionDisabledToken):
2522         (WebKit::PluginProcessManager::processSuppressionDisabled):
2523         * UIProcess/ProcessThrottler.h:
2524         (WebKit::ProcessThrottler::foregroundActivityToken):
2525         (WebKit::ProcessThrottler::backgroundActivityToken):
2526         * UIProcess/WebProcessPool.h:
2527
2528 2016-02-25  Brady Eidson  <beidson@apple.com>
2529
2530         Remove LegacyIDB.
2531         https://bugs.webkit.org/show_bug.cgi?id=150854
2532
2533         Reviewed by Alex Christensen.
2534
2535         * CMakeLists.txt:
2536         * DatabaseProcess/DatabaseProcess.cpp:
2537         (WebKit::DatabaseProcess::getOrCreateLegacyUniqueIDBDatabase): Deleted.
2538         (WebKit::DatabaseProcess::removeLegacyUniqueIDBDatabase): Deleted.
2539         * DatabaseProcess/DatabaseProcess.h:
2540         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
2541         (WebKit::DatabaseToWebProcessConnection::didClose):
2542         (WebKit::DatabaseToWebProcessConnection::didReceiveMessage): Deleted.
2543         (WebKit::DatabaseToWebProcessConnection::didReceiveSyncMessage): Deleted.
2544         (WebKit::DatabaseToWebProcessConnection::establishIDBConnection): Deleted.
2545         (WebKit::DatabaseToWebProcessConnection::removeDatabaseProcessIDBConnection): Deleted.
2546         * DatabaseProcess/DatabaseToWebProcessConnection.h:
2547         * DatabaseProcess/DatabaseToWebProcessConnection.messages.in:
2548         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: Removed.
2549         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h: Removed.
2550         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in: Removed.
2551         * DatabaseProcess/IndexedDB/IDBIdentifier.h: Removed.
2552         * DatabaseProcess/IndexedDB/IDBSerialization.cpp: Removed.
2553         * DatabaseProcess/IndexedDB/IDBSerialization.h: Removed.
2554         * DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabase.cpp: Removed.
2555         * DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabase.h: Removed.
2556         * DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabaseIdentifier.cpp: Removed.
2557         * DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabaseIdentifier.h: Removed.
2558         * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: Removed.
2559         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
2560         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp: Removed.
2561         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.h: Removed.
2562         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.cpp: Removed.
2563         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.h: Removed.
2564         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: Removed.
2565         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: Removed.
2566         * DerivedSources.make:
2567         * Shared/WebCrossThreadCopier.cpp:
2568         (WebCore::LegacyUniqueIDBDatabaseIdentifier>::copy): Deleted.
2569         (WebCore::IDBIdentifier>::copy): Deleted.
2570         * Shared/WebCrossThreadCopier.h:
2571         * WebKit2.xcodeproj/project.pbxproj:
2572         * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp: Removed.
2573         * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.h: Removed.
2574         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp: Removed.
2575         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h: Removed.
2576         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in: Removed.
2577         * WebProcess/Databases/WebDatabaseProvider.cpp:
2578         (WebKit::WebDatabaseProvider::createIDBFactoryBackend): Deleted.
2579         * WebProcess/Databases/WebDatabaseProvider.h:
2580         * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
2581         (WebKit::WebToDatabaseProcessConnection::didReceiveMessage): Deleted.
2582         (WebKit::WebToDatabaseProcessConnection::registerWebIDBServerConnection): Deleted.
2583         (WebKit::WebToDatabaseProcessConnection::removeWebIDBServerConnection): Deleted.
2584         * WebProcess/Databases/WebToDatabaseProcessConnection.h:
2585         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2586
2587 2016-02-25  Brady Eidson  <beidson@apple.com>
2588
2589         Modern IDB: WebKit 2 IPC layer.
2590         https://bugs.webkit.org/show_bug.cgi?id=153808
2591
2592         Reviewed by Alex Christensen.
2593
2594         * NetworkProcess/NetworkLoad.cpp:
2595         (WebKit::NetworkLoad::NetworkLoad): This ASSERT fires on most WK2 tests. Alex said remove it.
2596         
2597         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2598         (WebKit::WebIDBConnectionToServer::putOrAdd): Properly encode the overwrite flag.
2599         
2600         * WebProcess/Databases/WebDatabaseProvider.h: Enable Modern IDB.
2601
2602 2016-02-25  Eric Carlson  <eric.carlson@apple.com>
2603
2604         [MediaStream] MediaDeviceInfo deviceId and groupId must be unique to the page's origin
2605         https://bugs.webkit.org/show_bug.cgi?id=153163
2606         <rdar://problem/24334526>
2607
2608         Reviewed by Tim Horton.
2609
2610         * CMakeLists.txt: Add WKFrameHandleRef.cpp.
2611
2612         * Shared/API/c/WKBase.h: Add WKFrameHandleRef.
2613         * UIProcess/API/APIUIClient.h:
2614         (API::UIClient::decidePolicyForUserMediaPermissionRequest): Add parameter top level document
2615           security context.
2616         (API::UIClient::checkUserMediaPermissionForOrigin): Ditto.
2617
2618         * UIProcess/API/C/WKAPICast.h: Add FrameHandle.
2619
2620         * UIProcess/API/C/WKFrameHandleRef.cpp: Added.
2621         * UIProcess/API/C/WKFrameHandleRef.h: Added.
2622
2623         * UIProcess/API/C/WKFrameInfoRef.cpp:
2624         (WKFrameInfoGetFrameHandleRef): Added.
2625         * UIProcess/API/C/WKFrameInfoRef.h:
2626
2627         * UIProcess/API/C/WKPage.cpp:
2628         (WKPageSetPageUIClient): Add parameters to decidePolicyForUserMediaPermissionRequest and
2629           checkUserMediaPermissionForOrigin for top level document security context.
2630
2631         * UIProcess/API/C/WKPageUIClient.h: Ditto.
2632
2633         * UIProcess/API/C/WKUserMediaPermissionCheck.cpp:
2634         (WKUserMediaPermissionCheckSetUserMediaAccessInfo): Renamed from WKUserMediaPermissionCheckSetHasPersistentPermission,
2635           add parameter for top level document security context.
2636         (WKUserMediaPermissionCheckSetHasPersistentPermission): Deleted.
2637         * UIProcess/API/C/WKUserMediaPermissionCheck.h:
2638
2639         * UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp:
2640         (webkitUserMediaPermissionRequestCreate): Add top level document origin.
2641
2642         * UIProcess/UserMediaPermissionCheckProxy.cpp:
2643         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): Renamed from setHasPersistentPermission.
2644         (WebKit::UserMediaPermissionCheckProxy::setHasPersistentPermission): Deleted.
2645         * UIProcess/UserMediaPermissionCheckProxy.h:
2646
2647         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2648         (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Add parameter
2649          for device id hash salt.
2650         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2651
2652         * UIProcess/UserMediaPermissionRequestProxy.h:
2653         (WebKit::UserMediaPermissionRequestProxy::requiresAudio): Deleted, unused.
2654         (WebKit::UserMediaPermissionRequestProxy::requiresVideo): Ditto.
2655         (WebKit::UserMediaPermissionRequestProxy::firstVideoDeviceUID): Ditto.
2656         (WebKit::UserMediaPermissionRequestProxy::firstAudioDeviceUID): Ditto.
2657
2658         * UIProcess/WebPageProxy.cpp:
2659         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame): Pass through parameter for top
2660           level document security context.
2661         (WebKit::WebPageProxy::checkUserMediaPermissionForFrame): Ditto.
2662         * UIProcess/WebPageProxy.h:
2663         * UIProcess/WebPageProxy.messages.in:
2664
2665         * WebKit2.xcodeproj/project.pbxproj: Add WKFrameHandleRef.cpp|.h.
2666
2667         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2668         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): Pass through parameter for top
2669           level document security context.
2670         (WebKit::UserMediaPermissionRequestManager::startUserMediaPermissionCheck): Ditto.
2671         (WebKit::UserMediaPermissionRequestManager::didCompleteUserMediaPermissionCheck): Pass through
2672           device id hash salt.
2673         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
2674
2675         * WebProcess/WebPage/WebPage.cpp:
2676         (WebKit::WebPage::didCompleteUserMediaPermissionCheck): Ditto.
2677         * WebProcess/WebPage/WebPage.h:
2678         * WebProcess/WebPage/WebPage.messages.in:
2679
2680 2016-02-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2681
2682         [GTK] Tearing when entering AC mode
2683         https://bugs.webkit.org/show_bug.cgi?id=150955
2684
2685         Reviewed by Michael Catanzaro.
2686
2687         When entering accelerated compositing mode, we keep rendering the
2688         non accelerated contents until we have the first frame of
2689         accelerated compositing contents. When the view is created hidden,
2690         for example when the browser opens a link in a new tab, the view
2691         is not realized until it is mapped. The native surface handle for
2692         compositing, needed by the web process to render accelerated
2693         compositing contents, is not available until the view is realized,
2694         because it depends on the properties of the parent. When a web
2695         view is mapped for the first time, and then realized, we send the
2696         native surface handle for compositing to the web process, and keep
2697         rendering the non composited contents until we get the first
2698         frame, but in this case we never had non composited contents and
2699         we end up rendering an untinitalized surface. This sometimes just
2700         produces flickering and sometimes rendering artifacts.
2701         We can prevent this from happening by realizing the web view as
2702         soon as possible. A GtkWidget can't be realized until it has been
2703         added to a toplevel, so we can realize our view right after it is
2704         added to a toplevel window, and wait until the view is actually
2705         mapped to notify the web process that it has been added to a
2706         window. This way can we enter accelerated compositing mode before
2707         the web view is mapped, so that when mapped we don't try to paint
2708         the previous contents and don't need to wait for the first frame.
2709
2710         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2711         (toplevelWindowFocusInEvent): Handle the case of the window being
2712         hidden when receiving focus in. According to
2713         gtk_window_focus_in_event, this can happen.
2714         (webkitWebViewBaseSetToplevelOnScreenWindow): When the web view is
2715         removed from its toplevel parent, update the IsInWindow and
2716         WindowIsActive flags accordingly. When the view is added to a
2717         toplevel, realize it and don't update the window flags, they will be
2718         updated when the view is mapped the first time.
2719         (webkitWebViewBaseMap): Also update IsInWindow and WindowIsActive
2720         flags if needed. This way, if for example you open a youtube video
2721         in a new tab, the video won't start playing until you visit the
2722         tab, like we did when the view was realized on map.
2723         (webkitWebViewBaseHierarchyChanged): Use hierarchy-changed signal
2724         instead of parent-set to be notified when the view is added to or
2725         removed from a toplevel.
2726         (webkit_web_view_base_class_init): Implement hierarchy-changed
2727         instead of parent-set.
2728         (webkitWebViewBaseRealize): Do not call
2729         webkitWebViewBaseSetToplevelOnScreenWindow on realize, it's now
2730         webkitWebViewBaseSetToplevelOnScreenWindow the one realizing the view.
2731         * UIProcess/cairo/BackingStoreCairo.cpp:
2732         (WebKit::BackingStore::createBackend): Do not realize the view
2733         here, it should be realized already at this point. If it's not
2734         realized at this point is because it hasn't been added to a
2735         toplevel and gtk_widget_realize will not work anyway.
2736         (WebKit::BackingStore::paint): This is changing the cairo source
2737         operator, so save/restore the cairo context to ensure it doesn't
2738         affect other drawing done after this.
2739
2740 2016-02-24  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
2741
2742         [web-animations] Add AnimationTimeline, DocumentTimeline and add extensions to Document interface
2743         https://bugs.webkit.org/show_bug.cgi?id=151688
2744
2745         Reviewed by Dean Jackson.
2746
2747         Enables the WEB_ANIMATIONS compiler switch.
2748
2749         * Configurations/FeatureDefines.xcconfig:
2750
2751 2016-02-24  Gavin Barraclough  <barraclough@apple.com>
2752
2753         Add WKPreference for HiddenPageDOMTimerThrottlingAutoIncreases
2754         https://bugs.webkit.org/show_bug.cgi?id=154655
2755
2756         Reviewed by Geoff Garen.
2757
2758         Just plumbing WebCore.settings.setHiddenPageDOMTimerThrottlingAutoIncreases through as
2759         WKPreferencesSetHiddenPageDOMTimerThrottlingAutoIncreases.
2760
2761         * Shared/WebPreferencesDefinitions.h:
2762         * UIProcess/API/C/WKPreferences.cpp:
2763         (WKPreferencesSetHiddenPageDOMTimerThrottlingAutoIncreases):
2764         (WKPreferencesGetHiddenPageDOMTimerThrottlingAutoIncreases):
2765         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2766         * UIProcess/API/Cocoa/WKPreferences.mm:
2767         (-[WKPreferences _hiddenPageDOMTimerThrottlingAutoIncreases]):
2768         (-[WKPreferences _setHiddenPageDOMTimerThrottlingAutoIncreases:]):
2769         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2770         * WebProcess/WebPage/WebPage.cpp:
2771         (WebKit::WebPage::updatePreferences):
2772
2773 2016-02-24  Alex Christensen  <achristensen@webkit.org>
2774
2775         Fix downloads when using NetworkSession
2776         https://bugs.webkit.org/show_bug.cgi?id=154620
2777
2778         Reviewed by Brady Eidson.
2779
2780         This fixes all the _WKDownload API tests when using NetworkSession.
2781
2782         * NetworkProcess/Downloads/DownloadManager.cpp:
2783         (WebKit::DownloadManager::willDecidePendingDownloadDestination):
2784         When we store the NetworkDataTask in m_downloadsWaitingForDestination, we want to remove its owner
2785         from m_pendingDownloads to prevent memory leaks.
2786         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
2787         If a file exists and the UIProcess has told us to overwrite the file, delete the file
2788         before starting a new download in its place.  This used to be done by CFNetwork in
2789         NSURLDownload's setDestination:allowOverwrite:, but the NSURLSession equivalent (setting
2790         NSURLSessionDataTask's _pathToDownloadTaskFile attribute) does not overwrite the file for us.
2791         (WebKit::DownloadManager::cancelDownload):
2792         If a download is canceled while it is waiting for its destination from the UIProcess, the Download
2793         object does not exist yet.  Instead, we have a completion handler stored in m_downloadsWaitingForDestination.
2794         In this case, we want to send the UIProcess a DownloadProxy::DidCancel message, which I did through
2795         NetworkProcess::pendingDownloadCanceled because the DownloadManager is not a MessageSender, and then
2796         call the completion handler with PolicyIgnore to cancel the download.
2797         (WebKit::DownloadManager::downloadFinished):
2798         * NetworkProcess/Downloads/DownloadManager.h:
2799         * NetworkProcess/Downloads/PendingDownload.cpp:
2800         (WebKit::PendingDownload::continueCanAuthenticateAgainstProtectionSpace):
2801         (WebKit::PendingDownload::didBecomeDownload):
2802         (WebKit::PendingDownload::didFailLoading):
2803         (WebKit::PendingDownload::messageSenderConnection):
2804         (WebKit::PendingDownload::didConvertToDownload): Deleted.
2805         * NetworkProcess/Downloads/PendingDownload.h:
2806         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
2807         (WebKit::Download::cancel):
2808         Send a didCancel message to the UIProcess when a download was cancelled.
2809         Use cancelByProducingResumeData so we can resume canceled downloads.
2810         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2811         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
2812         didConvertToDownload is needed when using NetworkSession to tell the NetworkResourceLoader
2813         not to call cancel on the NetworkLoad after converting it to a download.
2814         * NetworkProcess/NetworkDataTask.h:
2815         (WebKit::NetworkDataTask::setPendingDownload):
2816         (WebKit::NetworkDataTask::pendingDownloadLocation):
2817         * NetworkProcess/NetworkLoad.cpp:
2818         (WebKit::NetworkLoad::convertTaskToDownload):
2819         (WebKit::NetworkLoad::setPendingDownloadID):
2820         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
2821         Don't call findPendingDownloadLocation as a method on the NetworkDataTask to avoid memory leaks
2822         in DownloadManager.m_pendingDownloads.
2823         (WebKit::NetworkLoad::didBecomeDownload):
2824         Call m_client.didBecomeDownload which is being separated from didConvertToDownload.  The former is
2825         called after the NetworkDataTask becomes a Download, the latter is called as soon as 
2826         convertMainResourceLoadToDownload is called.
2827         * NetworkProcess/NetworkLoadClient.h:
2828         * NetworkProcess/NetworkProcess.cpp:
2829         (WebKit::NetworkProcess::continueWillSendRequest):
2830         (WebKit::NetworkProcess::pendingDownloadCanceled):
2831         Send a DownloadProxy::DidCancel message when a pending download is canceled.
2832         (WebKit::NetworkProcess::findPendingDownloadLocation):
2833         (WebKit::NetworkProcess::continueDecidePendingDownloadDestination):
2834         * NetworkProcess/NetworkProcess.h:
2835         * NetworkProcess/NetworkProcess.messages.in:
2836         * NetworkProcess/NetworkResourceLoader.cpp:
2837         (WebKit::NetworkResourceLoader::didConvertToDownload):
2838         (WebKit::NetworkResourceLoader::didBecomeDownload):
2839         Separate setting m_didConvertToDownload, which needs to happen before the didReceiveResponse completion
2840         handler is called to tell the NetworkResourceLoader not to call cancel in NetworkResourceLoader::abort,
2841         from deleting the NetworkLoad, which can be done after the NSURLSessionDataTask has been converted to a
2842         NSURLSessionDownloadTask.
2843         * NetworkProcess/NetworkResourceLoader.h:
2844         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
2845         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2846         (WebKit::NetworkDataTask::failureTimerFired):
2847         (WebKit::NetworkDataTask::setPendingDownloadLocation):
2848         (WebKit::NetworkDataTask::transferSandboxExtensionToDownload):
2849         (WebKit::NetworkDataTask::suggestedFilename):
2850         (WebKit::NetworkDataTask::currentRequest):
2851         (WebKit::NetworkDataTask::findPendingDownloadLocation): Deleted.
2852         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2853         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
2854         Take the downloadID if it failed because we will report that download as failed and not use it again.
2855         (WebKit::NetworkSession::takeDownloadID):
2856         * UIProcess/Downloads/DownloadProxy.cpp:
2857         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
2858         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
2859
2860 2016-02-24  Anders Carlsson  <andersca@apple.com>
2861
2862         Add more WebKitAdditions extension points
2863         https://bugs.webkit.org/show_bug.cgi?id=154648
2864         rdar://problem/24820040
2865
2866         Reviewed by Beth Dakin.
2867
2868         * Shared/WebPreferencesDefinitions.h:
2869         * UIProcess/API/Cocoa/WKWebView.mm:
2870         (-[WKWebView _initializeWithConfiguration:]):
2871         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2872         (-[WKWebViewConfiguration copyWithZone:]):
2873         * WebProcess/WebPage/WebPage.cpp:
2874         (WebKit::WebPage::updatePreferences):
2875
2876 2016-02-24  Ryosuke Niwa  <rniwa@webkit.org>
2877
2878         Move FocusNavigationScope into FocusController.cpp
2879         https://bugs.webkit.org/show_bug.cgi?id=154630
2880
2881         Reviewed by Darin Adler.
2882
2883         * WebProcess/WebPage/ios/WebPageIOS.mm:
2884         (WebKit::nextAssistableElement):
2885
2886 2016-02-23  Brian Burg  <bburg@apple.com>
2887
2888         Web Inspector: don't run the protocol generator once per output file
2889         https://bugs.webkit.org/show_bug.cgi?id=154635
2890
2891         Reviewed by Myles C. Maxfield.
2892
2893         * DerivedSources.make: Use $(firstword, ...) to take just one file as
2894         the target to be built so that the generator runs only once. Make isn't
2895         really designed to coalesce multiple file outputs to one production rule.
2896
2897 2016-02-23  Dan Bernstein  <mitz@apple.com>
2898
2899         [Xcode] Linker errors display mangled names, but no longer should
2900         https://bugs.webkit.org/show_bug.cgi?id=154632
2901
2902         Reviewed by Sam Weinig.
2903
2904         * Configurations/Base.xcconfig: Stop setting LINKER_DISPLAYS_MANGLED_NAMES to YES.
2905
2906 2016-02-23  Gavin Barraclough  <barraclough@apple.com>
2907
2908         Remove HIDDEN_PAGE_DOM_TIMER_THROTTLING feature define
2909         https://bugs.webkit.org/show_bug.cgi?id=112323
2910
2911         Reviewed by Chris Dumez.
2912
2913         This feature is controlled by a runtime switch, and defaults off.
2914
2915         * Configurations/FeatureDefines.xcconfig:
2916         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2917         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2918         * WebProcess/WebPage/WebPage.cpp:
2919         (WebKit::WebPage::updatePreferences):
2920
2921 2016-02-23  Anders Carlsson  <andersca@apple.com>
2922
2923         WKWebView should implement NSCoding
2924         https://bugs.webkit.org/show_bug.cgi?id=137160
2925         rdar://problem/17380562
2926
2927         Reviewed by Dan Bernstein.
2928
2929         * UIProcess/API/Cocoa/WKUserContentController.mm:
2930         (-[WKUserContentController initWithCoder:]):
2931         We need to call [self init] here, so that the wrapper will be initialized.
2932
2933         * UIProcess/API/Cocoa/WKWebView.h:
2934         -initWithCoder: shouldn't be unavailable, it should be a designated initializer.
2935
2936         * UIProcess/API/Cocoa/WKWebView.mm:
2937         (-[WKWebView _initializeWithConfiguration:]):
2938         Move initialization out into a common method.
2939
2940         (-[WKWebView initWithFrame:configuration:]):
2941         Call -initializeWithConfiguration: here.
2942
2943         (-[WKWebView initWithCoder:]):
2944         Decode everything.
2945
2946         (-[WKWebView encodeWithCoder:]):
2947         Encode everything.
2948
2949 2016-02-23  Anders Carlsson  <andersca@apple.com>
2950
2951         Fix an API test.
2952
2953         * UIProcess/API/APIWebsiteDataStore.cpp:
2954         (API::WebsiteDataStore::defaultDataStore):
2955         Make sure to initialize WebKit2.
2956
2957 2016-02-23  Anders Carlsson  <andersca@apple.com>
2958
2959         WKWebViewConfiguration should encode more of its properties
2960         https://bugs.webkit.org/show_bug.cgi?id=154611
2961
2962         Reviewed by Sam Weinig.
2963
2964         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2965         (-[WKWebViewConfiguration encodeWithCoder:]):
2966         (-[WKWebViewConfiguration initWithCoder:]):
2967
2968 2016-02-23  Anders Carlsson  <andersca@apple.com>
2969
2970         WKUserContentController should conform to NSCoding
2971         https://bugs.webkit.org/show_bug.cgi?id=154609
2972
2973         Reviewed by Sam Weinig.
2974
2975         Since we just want to be able to encode WKUserContentController from WKWebViewConfiguration,
2976         we don't encode anything inside WKUserContentController.
2977
2978         * UIProcess/API/Cocoa/WKUserContentController.h:
2979         * UIProcess/API/Cocoa/WKUserContentController.mm:
2980         (-[WKUserContentController encodeWithCoder:]):
2981         (-[WKUserContentController initWithCoder:]):
2982
2983 2016-02-23  Anders Carlsson  <andersca@apple.com>
2984
2985         WKProcessPool should conform to NSCoding
2986         https://bugs.webkit.org/show_bug.cgi?id=154608
2987
2988         Reviewed by Sam Weinig.
2989
2990         Add +[WKProcessPool _sharedProcessPool] and encode/decode whether the process pool is shared.
2991
2992         * UIProcess/API/Cocoa/WKProcessPool.h:
2993         * UIProcess/API/Cocoa/WKProcessPool.mm:
2994         (-[WKProcessPool encodeWithCoder:]):
2995         (-[WKProcessPool initWithCoder:]):
2996         (+[WKProcessPool _sharedProcessPool]):
2997         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2998
2999 2016-02-23  Anders Carlsson  <andersca@apple.com>
3000
3001         WKWebsiteDataStore should conform to NSCoding
3002         https://bugs.webkit.org/show_bug.cgi?id=154605
3003
3004         Reviewed by Dan Bernstein.
3005
3006         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
3007         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3008         (-[WKWebsiteDataStore initWithCoder:]):
3009         (-[WKWebsiteDataStore encodeWithCoder:]):
3010
3011 2016-02-23  Anders Carlsson  <andersca@apple.com>
3012
3013         Fix iOS build.
3014
3015         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3016         (-[WKWebViewConfiguration initWithCoder:]):
3017
3018 2016-02-23  Anders Carlsson  <andersca@apple.com>
3019
3020         WKWebViewConfiguration should conform to NSCoding
3021         https://bugs.webkit.org/show_bug.cgi?id=154602
3022
3023         Reviewed by Beth Dakin.
3024
3025         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
3026         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3027         (-[WKWebViewConfiguration encodeWithCoder:]):
3028         (-[WKWebViewConfiguration initWithCoder:]):
3029
3030 2016-02-23  Anders Carlsson  <andersca@apple.com>
3031
3032         WKPreferences should conform to NSCoding
3033         https://bugs.webkit.org/show_bug.cgi?id=154597
3034
3035         Reviewed by Sam Weinig.
3036
3037         Add NSCoding implementation.
3038
3039         * UIProcess/API/Cocoa/WKPreferences.h:
3040         * UIProcess/API/Cocoa/WKPreferences.mm:
3041         (-[WKPreferences encodeWithCoder:]):
3042         (-[WKPreferences initWithCoder:]):
3043
3044 2016-02-23  Alex Christensen  <achristensen@webkit.org>
3045
3046         Implement downloads with NetworkSession
3047         https://bugs.webkit.org/show_bug.cgi?id=154473
3048
3049         Reviewed by Brady Eidson.
3050
3051         * NetworkProcess/Downloads/Download.cpp:
3052         (WebKit::Download::~Download):
3053         (WebKit::Download::didStart):
3054         (WebKit::Download::shouldDecodeSourceDataOfMIMEType):
3055         (WebKit::Download::decideDestinationWithSuggestedFilename):
3056         (WebKit::Download::didCreateDestination):
3057         * NetworkProcess/Downloads/Download.h:
3058         (WebKit::Download::downloadID):
3059         (WebKit::Download::setSandboxExtension):
3060         * NetworkProcess/Downloads/DownloadManager.cpp:
3061         (WebKit::DownloadManager::startDownload):
3062         (WebKit::DownloadManager::dataTaskBecameDownloadTask):
3063         (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace):
3064         (WebKit::DownloadManager::continueWillSendRequest):
3065         (WebKit::DownloadManager::willDecidePendingDownloadDestination):
3066         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
3067         (WebKit::DownloadManager::convertHandleToDownload):
3068         * NetworkProcess/Downloads/DownloadManager.h:
3069         * NetworkProcess/NetworkDataTask.h:
3070         (WebKit::NetworkDataTask::clearClient):
3071
3072         NetworkDataTasks can now outlive their client, so we need to make client a pointer
3073         with the ability to be nulled from the client's destructor.
3074
3075         (WebKit::NetworkDataTask::pendingDownloadID):
3076         (WebKit::NetworkDataTask::pendingDownload):
3077         (WebKit::NetworkDataTask::setPendingDownload):
3078         (WebKit::NetworkDataTask::pendingDownloadLocation):
3079         (WebKit::NetworkDataTask::client): Deleted.
3080         * NetworkProcess/NetworkLoad.cpp:
3081         (WebKit::NetworkLoad::~NetworkLoad):
3082         (WebKit::NetworkLoad::convertTaskToDownload):
3083         (WebKit::NetworkLoad::setPendingDownloadID):
3084         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
3085
3086         Don't call the didReceiveResponse completion handler immediately when we know we are
3087         going to turn the load into a download.  Instead, save the completion handler until
3088         after we have determined the download destination and set it in the NetworkDataTask.
3089
3090         * NetworkProcess/NetworkProcess.cpp:
3091         (WebKit::NetworkProcess::continueWillSendRequest):
3092         (WebKit::NetworkProcess::findPendingDownloadLocation):
3093         (WebKit::NetworkProcess::continueDecidePendingDownloadDestination):
3094         (WebKit::NetworkProcess::setCacheModel):
3095         * NetworkProcess/NetworkProcess.h:
3096         * NetworkProcess/NetworkProcess.messages.in:
3097         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3098         (WebKit::NetworkDataTask::NetworkDataTask):
3099         (WebKit::NetworkDataTask::~NetworkDataTask):
3100         (WebKit::NetworkDataTask::didSendData):
3101         (WebKit::NetworkDataTask::didReceiveChallenge):
3102         (WebKit::NetworkDataTask::didCompleteWithError):
3103         (WebKit::NetworkDataTask::didReceiveResponse):
3104         (WebKit::NetworkDataTask::didReceiveData):
3105         (WebKit::NetworkDataTask::didBecomeDownload):
3106         (WebKit::NetworkDataTask::willPerformHTTPRedirection):
3107         (WebKit::NetworkDataTask::scheduleFailure):
3108         (WebKit::NetworkDataTask::failureTimerFired):
3109         (WebKit::NetworkDataTask::findPendingDownloadLocation):
3110         (WebKit::NetworkDataTask::setPendingDownloadLocation):
3111         (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
3112         (WebKit::NetworkDataTask::transferSandboxExtensionToDownload):
3113         (WebKit::NetworkDataTask::currentRequest):
3114         (WebKit::NetworkDataTask::cancel):
3115         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3116         (-[WKNetworkSessionDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]):
3117         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
3118         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
3119         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
3120         
3121         This delegate callback is used for downloads, too.
3122
3123         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
3124         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
3125         (-[WKNetworkSessionDelegate URLSession:downloadTask:didFinishDownloadingToURL:]):
3126         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
3127         
3128         Call didCreateDestination now, which is after the file has been opened on the disk.
3129         A DownloadProxy::DidStart message is now sent from NetworkProcess::findPendingDownloadLocation before
3130         we ask the UIProcess where the download should end up on disk.
3131         Null check the NetworkDataTask's client before using it because it is now a pointer that could be null. 
3132         
3133         * UIProcess/Downloads/DownloadProxy.cpp:
3134         (WebKit::DownloadProxy::shouldDecodeSourceDataOfMIMEType):
3135         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
3136         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
3137         (WebKit::DownloadProxy::didCreateDestination):
3138         * UIProcess/Downloads/DownloadProxy.h:
3139         * UIProcess/Downloads/DownloadProxy.messages.in:
3140
3141 2016-02-23  Brian Burg  <bburg@apple.com>
3142
3143         Connect WebAutomationSession to its backend dispatcher as if it were an agent and add stub implementations
3144         https://bugs.webkit.org/show_bug.cgi?id=154518
3145         <rdar://problem/24761096>
3146
3147         Reviewed by Timothy Hatcher.
3148
3149         Add a domain dispatcher for the 'Automation' domain, and register the
3150         WebAutomationSession itself as the handler for Automation commands.
3151         Stub out these command implementations so the code will compile.
3152
3153         * UIProcess/Automation/Automation.json:
3154         Fix the createWindow command's parameters and description.
3155         Add an ErrorMessage string enumeration and document how it can be used
3156         to signal well-known errors to the frontend.
3157
3158         * UIProcess/Automation/WebAutomationSession.cpp:
3159         (WebKit::WebAutomationSession::WebAutomationSession):
3160         Add the domain backend dispatcher. It further parses commands that were deemed
3161         valid by the generic dispatcher and match the 'Automation' domain prefix.
3162
3163         (WebKit::WebAutomationSession::getWindows):
3164         (WebKit::WebAutomationSession::openWindow):
3165         (WebKit::WebAutomationSession::closeWindow):
3166         Stub these out with our new ErrorMessage enumeration and a macro to
3167         make this code pattern more readable.
3168
3169         * UIProcess/Automation/WebAutomationSession.h:
3170         Add new declarations and members.
3171
3172 2016-02-23  Antti Koivisto  <antti@apple.com>
3173
3174         Remove tab suspension code
3175         https://bugs.webkit.org/show_bug.cgi?id=154585
3176
3177         Reviewed by Andreas Kling.
3178
3179         * Shared/WebProcessCreationParameters.cpp:
3180         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
3181         (WebKit::WebProcessCreationParameters::encode):
3182         (WebKit::WebProcessCreationParameters::decode):
3183         * Shared/WebProcessCreationParameters.h:
3184         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3185         (WebKit::registerUserDefaultsIfNeeded):
3186         (WebKit::WebProcessPool::platformInitializeWebProcess):
3187         * WebProcess/cocoa/WebProcessCocoa.mm:
3188         (WebKit::WebProcess::platformInitializeWebProcess):
3189
3190 2016-02-22  Ryuan Choi  <ryuan.choi@navercorp.com>
3191
3192         [EFL] Merge WebView and WebViewEfl
3193         https://bugs.webkit.org/show_bug.cgi?id=154445
3194
3195         Reviewed by Gyuyoung Kim.
3196
3197         * PlatformEfl.cmake: Removed WebViewEfl.cpp from source list.
3198         * UIProcess/API/C/efl/WKViewEfl.cpp: Removed type cast for WebViewEfl.
3199         * UIProcess/API/efl/EwkView.cpp: Ditto.
3200         * UIProcess/API/efl/EwkView.h:
3201         * UIProcess/API/efl/GestureRecognizer.cpp: Removed type cast for WebViewEfl.
3202         * UIProcess/API/efl/WebAccessibility.cpp: Removed unnecessary includes.
3203         * UIProcess/API/efl/ewk_view.cpp: Ditto.
3204         * UIProcess/efl/ViewClientEfl.cpp: Ditto.
3205         * UIProcess/efl/WebColorPickerClient.cpp: Ditto.
3206         * UIProcess/efl/WebColorPickerClient.h:
3207         * UIProcess/efl/WebColorPickerEfl.cpp:
3208         (WebKit::WebColorPickerEfl::WebColorPickerEfl):
3209         * UIProcess/efl/WebColorPickerEfl.h:
3210         (WebKit::WebColorPickerEfl::create):
3211         * UIProcess/efl/WebView.cpp:
3212         * UIProcess/efl/WebView.h:
3213         * UIProcess/efl/WebViewEfl.cpp: Removed.
3214         * UIProcess/efl/WebViewEfl.h: Ditto.
3215
3216 2016-02-22  Brian Burg  <bburg@apple.com>
3217
3218         Web Inspector: add 'Automation' protocol domain and generate its backend classes separately in WebKit2
3219         https://bugs.webkit.org/show_bug.cgi?id=154509
3220         <rdar://problem/24759098>
3221
3222         Reviewed by Timothy Hatcher.
3223
3224         Add a new 'Automation' domain which presents an RPC interface
3225         for sending automation commands to an active WebAutomationSession
3226         in the UIProcess via RemoteInspector. This is similar to how the
3227         Inspector backend communicates bidirectionally with a remote
3228         Inspector frontend.
3229
3230         Add build system logic to generate JSON-RPC protocol bindings
3231         for the 'Automation' domain using the inspector code generators.
3232
3233         Move automation-related files that are not API or SPI into their
3234         own directory.
3235
3236         * Configurations/BaseTarget.xcconfig: Tell where JavaScriptCore's
3237         private headers are, since that's where the code generators live.
3238
3239         * CMakeLists.txt: Look in UIProcess/Automation directory.
3240         * PlatformMac.cmake:
3241         * DerivedSources.make: Generate protocol bindings for a single domain.
3242         The names of the generated files will be improved in a follow-up patch
3243         so that they do not clash with generated files in JavaScriptCore.
3244
3245         * UIProcess/Automation/Automation.json: Added.
3246         * UIProcess/Automation/WebAutomationSession.cpp: Renamed from Source/WebKit2/UIProcess/WebAutomationSession.cpp.
3247         (WebKit::WebAutomationSession::WebAutomationSession):
3248         (WebKit::WebAutomationSession::~WebAutomationSession):
3249         Set up a backend dispatcher and frontend router. They will be used later.
3250
3251         (WebKit::WebAutomationSession::dispatchMessageFromRemote):
3252         Forward messages from the remote to the backend dispatcher. When
3253         an agent / command handler is registered, it will receive the message.
3254
3255         (WebKit::WebAutomationSession::connect):
3256         (WebKit::WebAutomationSession::disconnect):
3257         Connenct and disconnect the frontend router to the remote channel.
3258
3259         * UIProcess/Automation/WebAutomationSession.h: Renamed from Source/WebKit2/UIProcess/WebAutomationSession.h.
3260         * WebKit2.xcodeproj/project.pbxproj: Add and move files.
3261
3262 2016-02-16  Ada Chan  <adachan@apple.com>
3263
3264         Implement basic functionality in WebVideoFullscreenInterfaceMac.
3265         https://bugs.webkit.org/show_bug.cgi?id=153241
3266
3267         Reviewed by Beth Dakin.
3268
3269         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
3270         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
3271         (WebKit::WebVideoFullscreenManagerProxy::exitFullscreen):
3272         (WebKit::WebVideoFullscreenManagerProxy::preparedToReturnToInline):
3273         * UIProcess/PageClient.h:
3274         * UIProcess/WebPageProxy.h:
3275         * UIProcess/mac/PageClientImpl.h:
3276         * UIProcess/mac/PageClientImpl.mm:
3277         (WebKit::PageClientImpl::rootViewToWindow):
3278         * UIProcess/mac/WebPageProxyMac.mm:
3279         (WebKit::WebPageProxy::rootViewToWindow):
3280         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3281         (WebKit::WebChromeClient::supportsVideoFullscreen):
3282         * WebProcess/cocoa/WebVideoFullscreenManager.h:
3283         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
3284         (WebKit::WebVideoFullscreenManager::supportsVideoFullscreen):
3285
3286 2016-02-22  Commit Queue  <commit-queue@webkit.org>
3287
3288         Unreviewed, rolling out r196935.
3289         https://bugs.webkit.org/show_bug.cgi?id=154557
3290
3291         This change causes timeouts and crashes in LayoutTests
3292         (Requested by ryanhaddad on #webkit).
3293
3294         Reverted changeset:
3295
3296         "Enable AVFoundationNSURLSessionEnabled by default"
3297         https://bugs.webkit.org/show_bug.cgi?id=154469
3298         http://trac.webkit.org/changeset/196935
3299
3300 2016-02-22  Anders Carlsson  <andersca@apple.com>
3301
3302         Remove _mockCaptureDevicesEnabled getter and setter
3303         https://bugs.webkit.org/show_bug.cgi?id=154550
3304
3305         Reviewed by Beth Dakin.
3306
3307         The _mockCaptureDevicesEnabled property isn't declared anywhere, and this
3308         should be a WKWebViewConfiguration parameter if we ever want to expose it in the modern API.
3309
3310         * UIProcess/API/Cocoa/WKPreferences.mm:
3311         (-[WKPreferences _mockCaptureDevicesEnabled]): Deleted.
3312         (-[WKPreferences _setMockCaptureDevicesEnabled:]): Deleted.
3313
3314 2016-02-22  Konstantin Tokarev  <annulen@yandex.ru>
3315
3316         [cmake] Moved library setup code to WEBKIT_FRAMEWORK macro.
3317         https://bugs.webkit.org/show_bug.cgi?id=154450
3318
3319         Reviewed by Alex Christensen.
3320
3321         * CMakeLists.txt: Used WebKit2_SOURCES variable instead of separate
3322         WebKit2_DERIVED_SOURCES for compatibility with WEBKIT_FRAMEWORK macro.
3323         There is no real need to separate derived sources from others.
3324         * PlatformGTK.cmake: Ditto.
3325
3326 2016-02-22  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3327
3328         [CMake] Unreviewed build fix after r196942.
3329
3330         * CMakeLists.txt: WKPluginSiteDataManager.cpp is gone.
3331
3332 2016-02-22  Keith Rollin  <krollin@apple.com>
3333
3334         Add mechanism to disable memory pressure handling
3335         https://bugs.webkit.org/show_bug.cgi?id=154254
3336         <rdar://problem/24662616>
3337
3338         Reviewed by Chris Dumez.
3339
3340         Add a mechanism to disable WebKit's response to memory pressure
3341         triggers. This was asked for by another group for testing purposes.
3342
3343         In order to disable WebKit's memory pressure handling, execute the
3344         following from the command line:
3345
3346             defaults write com.apple.Safari WebKitSuppressMemoryPressureHandler -bool true
3347
3348         To revert to standard behavior, delete the key or set it to False.
3349
3350         This flag is used when a new sub-process is being spawned. The value
3351         is read and stored in an initialization parameter block, which is then
3352         sent to the new sub-process.
3353
3354         In actuality, only the UI, WebContent, and Network processes heed the
3355         flag. The Plugin process isn't instrumented to heed this flag for
3356         three reasons. First, the Plugin process installs its memory pressure
3357         handler in initializeProcess, not initializePluginProcess. This is
3358         contrary to when the other processes install their handlers, which is
3359         in initialize<PluginType>Process, not initializeProcess. So in order
3360         to accomodate the Plugin process, we'd need to modify
3361         ChildProcessInitializationParameters. Doing this is awkward at best,
3362         but also seems to be opposed to what's supposed to be done in
3363         initializeProcess and conveyed in
3364         ChildProcessInitializationParameters. And even if we did add a boolean
3365         to this structure and added support for conveying it through the XPC
3366         port, it would end up being a Plugin process-only boolean in a general
3367         parameter block, which seems asymmetric with the other processes.
3368         Second, there's no convenient Cocoa function called in the flow that
3369         spawns the Plugin process, meaning that there's no convenient place to
3370         call NSUserDefaults to get the flag's value. And third, the Plugin
3371         process doesn't elegantly respond to the memory pressure trigger
3372         anyway. It might terminate itself, but that's it. As for the Database
3373         process, it doesn't seem to support responding to memory pressure at
3374         all, so we don't send it a flag telling it to ignore it.
3375
3376         Internally, the memory pressure handler is suppressed by not calling
3377         MemoryPressureHandler::install() if the flag is set. In the case of
3378         the Network process, the flag is saved so that it can be checked later
3379         in other places that manually kick off the memory pressure handling
3380         procedure.
3381
3382         * NetworkProcess/NetworkProcess.cpp:
3383         (WebKit::NetworkProcess::lowMemoryHandler):
3384         (WebKit::NetworkProcess::initializeNetworkProcess):
3385         * NetworkProcess/NetworkProcess.h:
3386         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3387         (WebKit::NetworkProcessCreationParameters::encode):
3388         (WebKit::NetworkProcessCreationParameters::decode):
3389         * NetworkProcess/NetworkProcessCreationParameters.h:
3390         * Shared/WebProcessCreationParameters.cpp:
3391         (WebKit::WebProcessCreationParameters::encode):
3392         (WebKit::WebProcessCreationParameters::decode):
3393         * Shared/WebProcessCreationParameters.h:
3394         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3395         (WebKit::WebProcessPool::platformInitializeWebProcess):
3396         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3397         * WebProcess/WebProcess.cpp:
3398         (WebKit::WebProcess::initializeWebProcess):
3399
3400 2016-02-22  Anders Carlsson  <andersca@apple.com>
3401
3402         Get rid of WKPluginSiteDataManager
3403         https://bugs.webkit.org/show_bug.cgi?id=154470
3404
3405         Reviewed by Tim Horton.
3406
3407         * Shared/API/c/WKBase.h:
3408         * UIProcess/API/C/WKContext.cpp:
3409         (WKContextGetPluginSiteDataManager): Deleted.
3410         * UIProcess/API/C/WKContext.h:
3411         * UIProcess/API/C/WKPluginSiteDataManager.cpp: Removed.
3412         (WKPluginSiteDataManagerGetTypeID): Deleted.
3413         (WKPluginSiteDataManagerGetSitesWithData): Deleted.
3414         (WKPluginSiteDataManagerClearSiteData): Deleted.
3415         (WKPluginSiteDataManagerClearAllSiteData): Deleted.
3416         * UIProcess/API/C/WKPluginSiteDataManager.h: Removed.
3417         * WebKit2.xcodeproj/project.pbxproj:
3418
3419 2016-02-21  Brent Fulgham  <bfulgham@apple.com>
3420
3421         [WK2][Mac] Allow processes to set "fast-dev-casheable" bit
3422         https://bugs.webkit.org/show_bug.cgi?id=154503
3423         <rdar://problem/22920815>
3424
3425         Reviewed by Alexey Proskuryakov.
3426
3427         Update the various sandbox profiles with a declaration that using the
3428         system-fctl to touch the "hot file" flag (to support caching operations)
3429         is allowed.
3430
3431         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in: Add sandbox permission.
3432         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: Ditto.
3433         * WebProcess/com.apple.WebProcess.sb.in: Ditto.
3434
3435 2016-02-22  Commit Queue  <commit-queue@webkit.org>
3436
3437         Unreviewed, rolling out r196891.
3438         https://bugs.webkit.org/show_bug.cgi?id=154539
3439
3440         it broke Production builds (Requested by brrian on #webkit).
3441
3442         Reverted changeset:
3443
3444         "Web Inspector: add 'Automation' protocol domain and generate
3445         its backend classes separately in WebKit2"
3446         https://bugs.webkit.org/show_bug.cgi?id=154509
3447         http://trac.webkit.org/changeset/196891
3448
3449 2016-02-22  Jer Noble  <jer.noble@apple.com>
3450
3451         Enable AVFoundationNSURLSessionEnabled by default
3452         https://bugs.webkit.org/show_bug.cgi?id=154469
3453
3454         Reviewed by Sam Weinig.
3455
3456         * Shared/WebPreferencesDefinitions.h:
3457
3458 2016-02-21  Brian Burg  <bburg@apple.com>
3459
3460         Web Inspector: add 'Automation' protocol domain and generate its backend classes separately in WebKit2
3461         https://bugs.webkit.org/show_bug.cgi?id=154509
3462         <rdar://problem/24759098>
3463
3464         Reviewed by Timothy Hatcher.
3465
3466         Add a new 'Automation' domain which presents an RPC interface
3467         for sending automation commands to an active WebAutomationSession
3468         in the UIProcess via RemoteInspector. This is similar to how the
3469         Inspector backend communicates bidirectionally with a remote
3470         Inspector frontend.
3471
3472         Add build system logic to generate JSON-RPC protocol bindings
3473         for the 'Automation' domain using the inspector code generators.
3474
3475         Move automation-related files that are not API or SPI into their
3476         own directory.
3477
3478         * Configurations/BaseTarget.xcconfig: Tell where JavaScriptCore's
3479         private headers are, since that's where the code generators live.
3480
3481         * CMakeLists.txt: Look in UIProcess/Automation directory.
3482         * PlatformMac.cmake:
3483         * DerivedSources.make: Generate protocol bindings for a single domain.
3484         The names of the generated files will be improved in a follow-up patch
3485         so that they do not clash with generated files in JavaScriptCore.
3486
3487         * UIProcess/Automation/Automation.json: Added.
3488         * UIProcess/Automation/WebAutomationSession.cpp: Renamed from Source/WebKit2/UIProcess/WebAutomationSession.cpp.
3489         (WebKit::WebAutomationSession::WebAutomationSession):
3490         (WebKit::WebAutomationSession::~WebAutomationSession):
3491         Set up a backend dispatcher and frontend router. They will be used later.
3492
3493         (WebKit::WebAutomationSession::dispatchMessageFromRemote):
3494         Forward messages from the remote to the backend dispatcher. When
3495         an agent / command handler is registered, it will receive the message.
3496
3497         (WebKit::WebAutomationSession::connect):
3498         (WebKit::WebAutomationSession::disconnect):
3499         Connenct and disconnect the frontend router to the remote channel.
3500
3501         * UIProcess/Automation/WebAutomationSession.h: Renamed from Source/WebKit2/UIProcess/WebAutomationSession.h.
3502         * WebKit2.xcodeproj/project.pbxproj: Add and move files.
3503
3504 2016-02-20  Olivier Blin  <olivier.blin@softathome.com>
3505
3506         [cmake] Use ICU include dirs in WebKit2 and WebKitTestRunner
3507         https://bugs.webkit.org/show_bug.cgi?id=154479
3508
3509         Reviewed by Michael Catanzaro.
3510
3511         * CMakeLists.txt:
3512
3513 2016-02-19  Brian Burg  <bburg@apple.com>
3514
3515         WebAutomationSession should tell its delegate when its remote end disconnects
3516         https://bugs.webkit.org/show_bug.cgi?id=154426
3517         <rdar://problem/24732382>
3518
3519         Reviewed by Timothy Hatcher.
3520
3521         The client might want to free up resources or close spawned windows
3522         if the remote end has disconnected from the automation session.
3523
3524         * UIProcess/API/APIAutomationSessionClient.h:
3525         (API::AutomationSessionClient::didDisconnectFromRemote): Added.
3526         (API::AutomationSessionClient::didRequestNewWindow):
3527         Remove WebProcessPool* argument as it is never used.
3528
3529         * UIProcess/API/Cocoa/_WKAutomationSession.h:
3530         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
3531         (-[_WKAutomationSession isPaired]):
3532         Expose whether the session is paired with a remote end.
3533
3534         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: Add method.
3535         * UIProcess/Cocoa/AutomationSessionClient.h: Add method.
3536         Remove WebProcessPool* argument as it is never used.
3537
3538         * UIProcess/Cocoa/AutomationSessionClient.mm:
3539         (WebKit::AutomationSessionClient::AutomationSessionClient):
3540         (WebKit::AutomationSessionClient::didRequestNewWindow):
3541         (WebKit::AutomationSessionClient::didDisconnectFromRemote):
3542         Add necessary forwarding boilerplate.
3543
3544         * UIProcess/WebAutomationSession.cpp:
3545         (WebKit::WebAutomationSession::disconnect): Inform the client.
3546
3547 2016-02-19  Beth Dakin  <bdakin@apple.com>
3548
3549         Enhance EditorState to include TypingAttributes, alignment, and color
3550         https://bugs.webkit.org/show_bug.cgi?id=154424
3551
3552         Reviewed by Dean Jackson and Sam Weinig.
3553
3554         TypingAttributes is already available for iOS and GTK. This patch hooks 
3555         that up on Mac as well, and it moves the calculation of that to the shared 
3556         file since there is no reason for this to be written in an iOS-only way. This 
3557         patch also adds textColor and textAlignment to EditorState, and since those 
3558         are not technically platform-specific either, they are also calculated in the 
3559         shared editorState() function.
3560
3561         * Shared/EditorState.cpp:
3562         (WebKit::EditorState::PostLayoutData::encode):
3563         (WebKit::EditorState::PostLayoutData::decode):
3564         * Shared/EditorState.h:
3565         * WebProcess/WebPage/WebPage.cpp:
3566         (WebKit::WebPage::editorState):
3567         * WebProcess/WebPage/ios/WebPageIOS.mm:
3568         (WebKit::WebPage::platformEditorState):
3569
3570 2016-02-19  Anders Carlsson  <andersca@apple.com>
3571
3572         Purge as much as we can from WKDeprecatedFunctions.cpp
3573         https://bugs.webkit.org/show_bug.cgi?id=154459
3574
3575         Reviewed by Sam Weinig.
3576
3577         * Shared/API/c/WKDeprecatedFunctions.cpp:
3578         (WKArrayIsMutable): Deleted.
3579         (WKPageSetVisibilityState): Deleted.
3580         (WKDictionaryIsMutable): Deleted.
3581         (WKDictionaryAddItem): Deleted.
3582         (WKDictionaryRemoveItem): Deleted.
3583         (WKPreferencesSetRegionBasedColumnsEnabled): Deleted.
3584         (WKPreferencesGetRegionBasedColumnsEnabled): Deleted.
3585         (WKPreferencesSetMultithreadedWebGLEnabled): Deleted.
3586         (WKPreferencesGetMultithreadedWebGLEnabled): Deleted.
3587         (WKPreferencesSetScreenFontSubstitutionEnabled): Deleted.
3588         (WKPreferencesGetScreenFontSubstitutionEnabled): Deleted.
3589         (WKInspectorIsDebuggingJavaScript): Deleted.
3590         (WKInspectorToggleJavaScriptDebugging): Deleted.
3591         (WKInspectorIsProfilingJavaScript): Deleted.
3592         (WKInspectorToggleJavaScriptProfiling): Deleted.
3593         (WKContextGetProcessModel): Deleted.
3594         (WKGraphicsContextGetCGContext): Deleted.
3595         (WKContextGetProcessSuppressionEnabled): Deleted.
3596         (WKContextSetProcessSuppressionEnabled): Deleted.
3597
3598 2016-02-19  Brady Eidson  <beidson@apple.com>
3599
3600         Add "databaseProcessDidCrash" to the WKContextClient; Adopt it in WKTR.
3601         https://bugs.webkit.org/show_bug.cgi?id=154428
3602
3603         Reviewed by Jer Noble.
3604
3605         * UIProcess/API/C/WKContext.h:
3606         * UIProcess/API/C/mac/WKContextPrivateMac.h:
3607         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
3608         (WKContextGetDatabaseProcessIdentifier):
3609
3610         * UIProcess/WebContextClient.cpp:
3611         (WebKit::WebContextClient::databaseProcessDidCrash):
3612         * UIProcess/WebContextClient.h:
3613
3614         * UIProcess/WebProcessPool.cpp:
3615         (WebKit::WebProcessPool::databaseProcessCrashed):
3616         (WebKit::WebProcessPool::databaseProcessIdentifier):
3617         * UIProcess/WebProcessPool.h:
3618
3619 2016-02-18  Gwang Yoon Hwang  <yoon@igalia.com>
3620
3621         [GTK] Limit the number of tiles according to the visible area
3622         https://bugs.webkit.org/show_bug.cgi?id=126122
3623
3624         Reviewed by Carlos Garcia Campos.
3625
3626         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
3627         (WebKit::LayerTreeHostGtk::initialize): Because we creates
3628         nonCompositingLayer with a size of current view, we should not apply
3629         the currently visible rect when creating / deleting tiles.
3630         (WebKit::LayerTreeHostGtk::flushPendingLayerChanges): Passes the current
3631         visible rect to the GraphicsLayers.
3632
3633 2016-02-18  Brady Eidson  <beidson@apple.com>
3634
3635         Modern IDB: Fix IDBGetResult encoder/decoder.
3636         https://bugs.webkit.org/show_bug.cgi?id=154421
3637
3638         Reviewed by Alex Christensen.
3639
3640         No new tests, as Modern IDB is still disabled for WK2.
3641         
3642         But if you manually enable it, "Basic IndexedDB Seems To Work"
3643
3644         * Shared/WebCoreArgumentCoders.cpp:
3645         (IPC::ArgumentCoder<IDBGetResult>::encode): Deleted.
3646         (IPC::ArgumentCoder<IDBGetResult>::decode): Deleted.
3647         * Shared/WebCoreArgumentCoders.h:
3648
3649 2016-02-18  Brady Eidson  <beidson@apple.com>
3650
3651         Modern IDB: Implement server->client operations in WK2.
3652         https://bugs.webkit.org/show_bug.cgi?id=154411
3653
3654         Reviewed by Alex Christensen.
3655
3656         No change in behavior yet; Just laying the groundwork.
3657
3658         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
3659         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
3660         (WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
3661
3662         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3663         (WebKit::WebIDBConnectionToServer::didDeleteDatabase):
3664         (WebKit::WebIDBConnectionToServer::didOpenDatabase):
3665         (WebKit::WebIDBConnectionToServer::didAbortTransaction):
3666         (WebKit::WebIDBConnectionToServer::didCommitTransaction):
3667         (WebKit::WebIDBConnectionToServer::didCreateObjectStore):
3668         (WebKit::WebIDBConnectionToServer::didDeleteObjectStore):
3669         (WebKit::WebIDBConnectionToServer::didClearObjectStore):
3670         (WebKit::WebIDBConnectionToServer::didCreateIndex):
3671         (WebKit::WebIDBConnectionToServer::didDeleteIndex):
3672         (WebKit::WebIDBConnectionToServer::didPutOrAdd):
3673         (WebKit::WebIDBConnectionToServer::didGetRecord):
3674         (WebKit::WebIDBConnectionToServer::didGetCount):
3675         (WebKit::WebIDBConnectionToServer::didDeleteRecord):
3676         (WebKit::WebIDBConnectionToServer::didOpenCursor):
3677         (WebKit::WebIDBConnectionToServer::didIterateCursor):
3678         (WebKit::WebIDBConnectionToServer::fireVersionChangeEvent):
3679         (WebKit::WebIDBConnectionToServer::didStartTransaction):
3680         (WebKit::WebIDBConnectionToServer::notifyOpenDBRequestBlocked):
3681         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
3682         
3683         * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
3684         (WebKit::WebToDatabaseProcessConnection::didReceiveMessage):
3685
3686 2016-02-18  Brian Burg  <bburg@apple.com>
3687
3688         RemoteInspector deadlocks if _WKAutomationDelegate creates/registers a target synchronously
3689         https://bugs.webkit.org/show_bug.cgi?id=154359
3690         <rdar://problem/24708897>
3691
3692         Reviewed by Joseph Pecoraro.
3693
3694         * UIProcess/Cocoa/AutomationClient.mm:
3695         (WebKit::AutomationClient::requestAutomationSession):
3696         Make an NSString out of the String reference so it gets captured correctly.
3697
3698 2016-02-18  Brady Eidson  <beidson@apple.com>
3699
3700         Modern IDB: Implement client->server operations in WK2.
3701         https://bugs.webkit.org/show_bug.cgi?id=154400
3702
3703         Reviewed by Alex Christensen.
3704
3705         No change in behavior yet; Just laying the groundwork.
3706
3707         * DatabaseProcess/DatabaseProcess.cpp:
3708         (WebKit::DatabaseProcess::idbServer):
3709         * DatabaseProcess/DatabaseProcess.h:
3710
3711         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
3712         (WebKit::DatabaseToWebProcessConnection::didReceiveMessage):
3713         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
3714
3715         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
3716         (WebKit::WebIDBConnectionToClient::deleteDatabase):
3717         (WebKit::WebIDBConnectionToClient::openDatabase):
3718         (WebKit::WebIDBConnectionToClient::abortTransaction):
3719         (WebKit::WebIDBConnectionToClient::commitTransaction):
3720         (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
3721         (WebKit::WebIDBConnectionToClient::createObjectStore):
3722         (WebKit::WebIDBConnectionToClient::deleteObjectStore):
3723         (WebKit::WebIDBConnectionToClient::clearObjectStore):
3724         (WebKit::WebIDBConnectionToClient::createIndex):
3725         (WebKit::WebIDBConnectionToClient::deleteIndex):
3726         (WebKit::WebIDBConnectionToClient::putOrAdd):
3727         (WebKit::WebIDBConnectionToClient::getRecord):
3728         (WebKit::WebIDBConnectionToClient::getCount):
3729         (WebKit::WebIDBConnectionToClient::deleteRecord):
3730         (WebKit::WebIDBConnectionToClient::openCursor):
3731         (WebKit::WebIDBConnectionToClient::iterateCursor):
3732         (WebKit::WebIDBConnectionToClient::establishTransaction):
3733         (WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
3734         (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
3735         (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
3736         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
3737         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
3738
3739 2016-02-18  ChangSeok Oh  <changseok.oh@collabora.com>
3740
3741         [GTK][Threaded Compositor] The web inspector doesn't work when using the threaded compositor
3742         https://bugs.webkit.org/show_bug.cgi?id=154067
3743
3744         Reviewed by Carlos Garcia Campos.
3745
3746         The forceCompositingMode should be true for threaded compositor. We set it true for a normal webView
3747         in _WebKitSettingsPrivate() but we do not for inspector anywhere. So DrawingArea is not
3748         properly created for the inspector. Let's move the setting to WebPreferences::platformInitializeStore
3749         which is a common place for the webView and the inspector.
3750
3751         * UIProcess/API/gtk/WebKitSettings.cpp:
3752         (_WebKitSettingsPrivate::_WebKitSettingsPrivate): Deleted.
3753         * UIProcess/gtk/WebPreferencesGtk.cpp:
3754         (WebKit::WebPreferences::platformInitializeStore):
3755
3756 2016-02-18  Commit Queue  <commit-queue@webkit.org>
3757
3758         Unreviewed, rolling out r196765.
3759         https://bugs.webkit.org/show_bug.cgi?id=154402
3760
3761         Broke Safari (Requested by andersca on #webkit).
3762
3763         Reverted changeset:
3764
3765         "Remove two unused functions"
3766         https://bugs.webkit.org/show_bug.cgi?id=154397
3767         http://trac.webkit.org/changeset/196765
3768
3769 2016-02-18  Anders Carlsson  <andersca@apple.com>
3770
3771         Remove two unused functions
3772         https://bugs.webkit.org/show_bug.cgi?id=154397
3773
3774         Reviewed by Tim Horton.
3775
3776         * UIProcess/API/C/WKContext.cpp:
3777         (WKContextGetPluginSiteDataManager): Deleted.
3778         (WKContextGetResourceCacheManager): Deleted.
3779         * UIProcess/API/C/WKContext.h:
3780
3781 2016-02-18  Carlos Garcia Campos  <cgarcia@igalia.com>
3782
3783         [GTK] Use G_TYPE_ERROR instead of G_TYPE_POINTER for GError parameters of signals
3784         https://bugs.webkit.org/show_bug.cgi?id=153786
3785
3786         Reviewed by Michael Catanzaro.
3787
3788         It's binary compatible and it's needed by binding generator to
3789         properly identify those parameters as GError.
3790
3791         * UIProcess/API/gtk/WebKitDownload.cpp:
3792         (webkit_download_class_init):
3793         * UIProcess/API/gtk/WebKitPrintOperation.cpp:
3794         (webkit_print_operation_class_init):
3795         * UIProcess/API/gtk/WebKitWebResource.cpp:
3796         (webkit_web_resource_class_init):
3797         * UIProcess/API/gtk/WebKitWebView.cpp:
3798         (webkit_web_view_class_init):
3799         * UIProcess/API/gtk/webkit2marshal.list:
3800
3801 2016-02-18  Ryuan Choi  <ryuan.choi@navercorp.com>
3802
3803         [EFL] Move WebView from CoordinatedGraphics to efl
3804         https://bugs.webkit.org/show_bug.cgi?id=154332
3805
3806         Reviewed by Csaba Osztrogonác.
3807
3808         * PlatformEfl.cmake:
3809         * UIProcess/efl/WebView.cpp: Renamed from Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp.
3810         * UIProcess/efl/WebView.h: Renamed from Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h.
3811         * UIProcess/efl/WebViewClient.cpp: Renamed from Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.cpp.
3812         * UIProcess/efl/WebViewClient.h: Renamed from Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.h.
3813
3814 2016-02-17  Brady Eidson  <beidson@apple.com>
3815
3816         Modern IDB: Rename some "UniqueIDBDatabase" classes that conflict with new classes in WebCore.
3817         https://bugs.webkit.org/show_bug.cgi?id=154363.
3818
3819         Reviewed by Alex Christensen.
3820
3821         Adding "Legacy" to the front of the name fixes problems for now.
3822         
3823         And all of this gunk will go away after Modern IDB is done, anyways.
3824         
3825         * CMakeLists.txt:
3826         * DatabaseProcess/DatabaseProcess.cpp:
3827         (WebKit::DatabaseProcess::getOrCreateLegacyUniqueIDBDatabase):
3828         (WebKit::DatabaseProcess::removeLegacyUniqueIDBDatabase):
3829         (WebKit::DatabaseProcess::getOrCreateUniqueIDBDatabase): Deleted.
3830         (WebKit::DatabaseProcess::removeUniqueIDBDatabase): Deleted.
3831         * DatabaseProcess/DatabaseProcess.h:
3832         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
3833         (WebKit::DatabaseProcessIDBConnection::establishConnection):
3834         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
3835         * DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabase.cpp: Renamed from Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp.
3836         (WebKit::LegacyUniqueIDBDatabase::calculateAbsoluteDatabaseFilename):
3837         (WebKit::LegacyUniqueIDBDatabase::LegacyUniqueIDBDatabase):
3838         (WebKit::LegacyUniqueIDBDatabase::~LegacyUniqueIDBDatabase):
3839         (WebKit::LegacyUniqueIDBDatabase::filenameForDatabaseName):
3840         (WebKit::LegacyUniqueIDBDatabase::databaseFilenameIdentifier):
3841         (WebKit::LegacyUniqueIDBDatabase::canShareDatabases):
3842         (WebKit::LegacyUniqueIDBDatabase::registerConnection):
3843         (WebKit::LegacyUniqueIDBDatabase::unregisterConnection):
3844         (WebKit::LegacyUniqueIDBDatabase::shutdown):
3845         (WebKit::LegacyUniqueIDBDatabase::shutdownBackingStore):
3846         (WebKit::LegacyUniqueIDBDatabase::didShutdownBackingStore):
3847         (WebKit::LegacyUniqueIDBDatabase::deleteDatabase):
3848         (WebKit::LegacyUniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata):
3849         (WebKit::LegacyUniqueIDBDatabase::openBackingStoreAndReadMetadata):
3850         (WebKit::LegacyUniqueIDBDatabase::didOpenBackingStoreAndReadMetadata):
3851         (WebKit::LegacyUniqueIDBDatabase::openTransaction):
3852         (WebKit::LegacyUniqueIDBDatabase::beginTransaction):
3853         (WebKit::LegacyUniqueIDBDatabase::commitTransaction):
3854         (WebKit::LegacyUniqueIDBDatabase::resetTransaction):
3855         (WebKit::LegacyUniqueIDBDatabase::rollbackTransaction):
3856         (WebKit::LegacyUniqueIDBDatabase::postTransactionOperation):
3857         (WebKit::LegacyUniqueIDBDatabase::didCompleteTransactionOperation):
3858         (WebKit::LegacyUniqueIDBDatabase::changeDatabaseVersion):
3859         (WebKit::LegacyUniqueIDBDatabase::didChangeDatabaseVersion):
3860         (WebKit::LegacyUniqueIDBDatabase::didCreateObjectStore):
3861         (WebKit::LegacyUniqueIDBDatabase::didDeleteObjectStore):
3862         (WebKit::LegacyUniqueIDBDatabase::didClearObjectStore):
3863         (WebKit::LegacyUniqueIDBDatabase::didCreateIndex):
3864         (WebKit::LegacyUniqueIDBDatabase::didDeleteIndex):
3865         (WebKit::LegacyUniqueIDBDatabase::didCompleteBoolRequest):
3866         (WebKit::LegacyUniqueIDBDatabase::createObjectStore):
3867         (WebKit::LegacyUniqueIDBDatabase::deleteObjectStore):
3868         (WebKit::LegacyUniqueIDBDatabase::clearObjectStore):
3869         (WebKit::LegacyUniqueIDBDatabase::createIndex):
3870         (WebKit::LegacyUniqueIDBDatabase::deleteIndex):
3871         (WebKit::LegacyUniqueIDBDatabase::putRecord):
3872         (WebKit::LegacyUniqueIDBDatabase::getRecord):
3873         (WebKit::LegacyUniqueIDBDatabase::openCursor):
3874         (WebKit::LegacyUniqueIDBDatabase::cursorAdvance):
3875         (WebKit::LegacyUniqueIDBDatabase::cursorIterate):
3876         (WebKit::LegacyUniqueIDBDatabase::count):
3877         (WebKit::LegacyUniqueIDBDatabase::deleteRange):
3878         (WebKit::LegacyUniqueIDBDatabase::openBackingStoreTransaction):
3879         (WebKit::LegacyUniqueIDBDatabase::beginBackingStoreTransaction):
3880         (WebKit::LegacyUniqueIDBDatabase::commitBackingStoreTransaction):
3881         (WebKit::LegacyUniqueIDBDatabase::resetBackingStoreTransaction):
3882         (WebKit::LegacyUniqueIDBDatabase::rollbackBackingStoreTransaction):
3883         (WebKit::LegacyUniqueIDBDatabase::changeDatabaseVersionInBackingStore):
3884         (WebKit::LegacyUniqueIDBDatabase::createObjectStoreInBackingStore):
3885         (WebKit::LegacyUniqueIDBDatabase::deleteObjectStoreInBackingStore):
3886         (WebKit::LegacyUniqueIDBDatabase::clearObjectStoreInBackingStore):
3887         (WebKit::LegacyUniqueIDBDatabase::createIndexInBackingStore):
3888         (WebKit::LegacyUniqueIDBDatabase::deleteIndexInBackingStore):
3889         (WebKit::LegacyUniqueIDBDatabase::putRecordInBackingStore):
3890         (WebKit::LegacyUniqueIDBDatabase::didPutRecordInBackingStore):
3891         (WebKit::LegacyUniqueIDBDatabase::getRecordFromBackingStore):
3892         (WebKit::LegacyUniqueIDBDatabase::didGetRecordFromBackingStore):
3893         (WebKit::LegacyUniqueIDBDatabase::openCursorInBackingStore):
3894         (WebKit::LegacyUniqueIDBDatabase::didOpenCursorInBackingStore):
3895         (WebKit::LegacyUniqueIDBDatabase::advanceCursorInBackingStore):
3896         (WebKit::LegacyUniqueIDBDatabase::didAdvanceCursorInBackingStore):
3897         (WebKit::LegacyUniqueIDBDatabase::iterateCursorInBackingStore):
3898         (WebKit::LegacyUniqueIDBDatabase::didIterateCursorInBackingStore):
3899         (WebKit::LegacyUniqueIDBDatabase::countInBackingStore):
3900         (WebKit::LegacyUniqueIDBDatabase::didCountInBackingStore):
3901         (WebKit::LegacyUniqueIDBDatabase::deleteRangeInBackingStore):
3902         (WebKit::LegacyUniqueIDBDatabase::didDeleteRangeInBackingStore):
3903         (WebKit::LegacyUniqueIDBDatabase::didEstablishTransaction):
3904         (WebKit::LegacyUniqueIDBDatabase::didResetTransaction):
3905         (WebKit::LegacyUniqueIDBDatabase::resetAllTransactions):
3906         (WebKit::LegacyUniqueIDBDatabase::finalizeRollback):
3907         (WebKit::LegacyUniqueIDBDatabase::absoluteDatabaseDirectory):
3908         (WebKit::LegacyUniqueIDBDatabase::postMainThreadTask):
3909         (WebKit::LegacyUniqueIDBDatabase::performNextMainThreadTask):
3910         (WebKit::LegacyUniqueIDBDatabase::postDatabaseTask):
3911         (WebKit::LegacyUniqueIDBDatabase::performNextDatabaseTask):
3912         * DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabase.h: Renamed from Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h.
3913         (WebKit::LegacyUniqueIDBDatabase::create):
3914         (WebKit::LegacyUniqueIDBDatabase::identifier):
3915         * DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabaseIdentifier.cpp: Renamed from Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.cpp.
3916         (WebKit::LegacyUniqueIDBDatabaseIdentifier::LegacyUniqueIDBDatabaseIdentifier):
3917         (WebKit::LegacyUniqueIDBDatabaseIdentifier::isHashTableDeletedValue):
3918         (WebKit::LegacyUniqueIDBDatabaseIdentifier::hash):
3919         (WebKit::LegacyUniqueIDBDatabaseIdentifier::isNull):
3920         (WebKit::LegacyUniqueIDBDatabaseIdentifier::isolatedCopy):
3921         (WebKit::operator==):
3922         * DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabaseIdentifier.h: Renamed from Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.h.
3923         (WebKit::LegacyUniqueIDBDatabaseIdentifier::databaseName):
3924         (WebKit::LegacyUniqueIDBDatabaseIdentifier::openingOrigin):
3925         (WebKit::LegacyUniqueIDBDatabaseIdentifier::mainFrameOrigin):
3926         (WebKit::LegacyUniqueIDBDatabaseIdentifierHash::hash):
3927         (WebKit::LegacyUniqueIDBDatabaseIdentifierHash::equal):
3928         (WebKit::LegacyUniqueIDBDatabaseIdentifierHashTraits::isEmptyValue):
3929         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
3930         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::UniqueIDBDatabaseBackingStoreSQLite):
3931         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata):
3932         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
3933         * Shared/WebCrossThreadCopier.cpp:
3934         (WebCore::LegacyUniqueIDBDatabaseIdentifier>::copy):
3935         (WebCore::UniqueIDBDatabaseIdentifier>::copy): Deleted.
3936         * Shared/WebCrossThreadCopier.h:
3937         * WebKit2.xcodeproj/project.pbxproj:
3938
3939 2016-02-17  Anders Carlsson  <andersca@apple.com>
3940
3941         Remove WebContextSupplement::shouldTerminate, it's no longer used
3942         https://bugs.webkit.org/show_bug.cgi?id=154367
3943
3944         Reviewed by Sam Weinig.
3945
3946         * UIProcess/WebContextSupplement.h:
3947         (WebKit::WebContextSupplement::shouldTerminate): Deleted.
3948         * UIProcess/WebCookieManagerProxy.cpp:
3949         (WebKit::WebCookieManagerProxy::shouldTerminate): Deleted.
3950         * UIProcess/WebCookieManagerProxy.h:
3951         * UIProcess/WebProcessPool.cpp:
3952         (WebKit::WebProcessPool::shouldTerminate): Deleted.
3953
3954 2016-02-17  Brian Burg  <bburg@apple.com>
3955
3956         RemoteInspector deadlocks if _WKAutomationDelegate creates/registers a target synchronously
3957         https://bugs.webkit.org/show_bug.cgi?id=154359
3958         <rdar://problem/24708897>
3959
3960         Reviewed by Joseph Pecoraro.
3961
3962         RemoteInspector always grabs a lock whenever receiving or sending XPC messages. If it
3963         forwards a new session request via _WKAutomationDelegate, and the client synchronously
3964         creates and registers a session, then RemoteInspector will try to grab the lock again
3965         while adding the session to its registry, causing a deadlock.
3966
3967         * UIProcess/Cocoa/AutomationClient.mm:
3968         (WebKit::AutomationClient::requestAutomationSession): Add a dispatch_async() to
3969         protect clients from accidentally deadlocking. They shouldn't have to care about
3970         RemoteInspector's locking mechanisms.
3971
3972 2016-02-17  Anders Carlsson  <andersca@apple.com>
3973
3974         Remove an unused function
3975         https://bugs.webkit.org/show_bug.cgi?id=154358
3976
3977         Reviewed by Sam Weinig.
3978
3979         * Platform/cg/CGUtilities.cpp:
3980         (WebKit::paintBitmapContext): Deleted.
3981         * Platform/cg/CGUtilities.h:
3982
3983 2016-02-17  Brady Eidson  <beidson@apple.com>
3984
3985         Modern IDB: More Encoder/Decoder/Messaging scaffolding for WK2 IPC.
3986         https://bugs.webkit.org/show_bug.cgi?id=154356
3987
3988         Reviewed by Alex Christensen.
3989
3990         No change in behavior yet; Just laying the groundwork.
3991
3992         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
3993         (WebKit::WebIDBConnectionToClient::didDeleteDatabase):
3994         (WebKit::WebIDBConnectionToClient::didOpenDatabase):
3995         (WebKit::WebIDBConnectionToClient::didAbortTransaction):
3996         (WebKit::WebIDBConnectionToClient::didCommitTransaction):
3997         (WebKit::WebIDBConnectionToClient::didCreateObjectStore):
3998         (WebKit::WebIDBConnectionToClient::didDeleteObjectStore):
3999         (WebKit::WebIDBConnectionToClient::didClearObjectStore):
4000         (WebKit::WebIDBConnectionToClient::didCreateIndex):
4001         (WebKit::WebIDBConnectionToClient::didDeleteIndex):
4002         (WebKit::WebIDBConnectionToClient::didPutOrAdd):
4003         (WebKit::WebIDBConnectionToClient::didGetRecord):
4004         (WebKit::WebIDBConnectionToClient::didGetCount):
4005         (WebKit::WebIDBConnectionToClient::didDeleteRecord):
4006         (WebKit::WebIDBConnectionToClient::didOpenCursor):
4007         (WebKit::WebIDBConnectionToClient::didIterateCursor):
4008         (WebKit::WebIDBConnectionToClient::fireVersionChangeEvent):
4009         (WebKit::WebIDBConnectionToClient::didStartTransaction):
4010         (WebKit::WebIDBConnectionToClient::notifyOpenDBRequestBlocked):
4011         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
4012         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
4013
4014 2016-02-17  Alex Christensen  <achristensen@webkit.org>
4015