[iOS] WKPreviewAction conforms to NSCopying but doesn’t override -
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-03-14  Beth Dakin  <bdakin@apple.com>
2
3         [iOS] WKPreviewAction conforms to NSCopying but doesn’t override -
4         copyWithZone:
5         https://bugs.webkit.org/show_bug.cgi?id=155395
6
7         Reviewed by Sam Weinig.
8
9         * UIProcess/API/Cocoa/WKPreviewActionItem.mm:
10         (-[WKPreviewAction copyWithZone:]):
11
12 2016-03-14  Anders Carlsson  <andersca@apple.com>
13
14         Remove usage of -[UIGestureRecognizer requireOtherGestureToFail:]
15         https://bugs.webkit.org/show_bug.cgi?id=155461
16         rdar://problem/25143282
17
18         Reviewed by Beth Dakin.
19
20         Use -[UIGestureRecognizer requireGestureRecognizerToFail:] instead, which has been API ever since UIGestureRecognizer was added.
21
22         * Platform/spi/ios/UIKitSPI.h:
23         * UIProcess/ios/WKContentViewInteraction.mm:
24         (-[WKContentView _createAndConfigureDoubleTapGestureRecognizer]):
25
26 2016-03-14  Anders Carlsson  <andersca@apple.com>
27
28         REGRESSION (r191691): Can't Share Selected Text
29         https://bugs.webkit.org/show_bug.cgi?id=155459
30         rdar://problem/24893625
31
32         Reviewed by Tim Horton.
33
34         Add the selected text as well. Somehow this got lost in the refactoring.
35
36         * UIProcess/mac/WebContextMenuProxyMac.mm:
37         (WebKit::WebContextMenuProxyMac::createShareMenuItem):
38
39 2016-03-14  Tim Horton  <timothy_horton@apple.com>
40
41         Revert r194125 and r194186: We're going to fix this a different way.
42
43         * Shared/NativeWebGestureEvent.h:
44         * Shared/mac/NativeWebGestureEventMac.mm:
45         (WebKit::pointForEvent):
46         (WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
47         (WebKit::distanceForTouches): Deleted.
48         * UIProcess/API/Cocoa/WKWebView.mm:
49         (-[WKWebView selectFindMatch:completionHandler:]):
50         (-[WKWebView _web_superInputContext]):
51         (-[WKWebView touchesBeganWithEvent:]): Deleted.
52         (-[WKWebView touchesMovedWithEvent:]): Deleted.
53         (-[WKWebView touchesEndedWithEvent:]): Deleted.
54         (-[WKWebView touchesCancelledWithEvent:]): Deleted.
55         * UIProcess/API/mac/WKView.mm:
56         (-[WKView namesOfPromisedFilesDroppedAtDestination:]):
57         (-[WKView initWithFrame:processPool:configuration:webView:]):
58         (-[WKView touchesBeganWithEvent:]): Deleted.
59         (-[WKView touchesMovedWithEvent:]): Deleted.
60         (-[WKView touchesEndedWithEvent:]): Deleted.
61         (-[WKView touchesCancelledWithEvent:]): Deleted.
62         * UIProcess/Cocoa/WebViewImpl.h:
63         * UIProcess/Cocoa/WebViewImpl.mm:
64         (WebKit::WebViewImpl::WebViewImpl):
65         (WebKit::WebViewImpl::magnifyWithEvent):
66         (WebKit::WebViewImpl::smartMagnifyWithEvent):
67         (WebKit::WebViewImpl::rotateWithEvent):
68         (WebKit::WebViewImpl::touchesOrderedByAge): Deleted.
69         (WebKit::WebViewImpl::touchesBeganWithEvent): Deleted.
70         (WebKit::WebViewImpl::touchesMovedWithEvent): Deleted.
71         (WebKit::WebViewImpl::touchesEndedWithEvent): Deleted.
72         (WebKit::WebViewImpl::touchesCancelledWithEvent): Deleted.
73
74 2016-03-14  Anders Carlsson  <andersca@apple.com>
75
76         Fix build.
77
78         Create an empty PDF selection.
79
80         * Shared/mac/PDFKitImports.h:
81         * Shared/mac/PDFKitImports.mm:
82         (WebKit::pdfSelectionClass):
83         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
84         (WebKit::PDFPlugin::nextMatchForString):
85
86 2016-03-14  Beth Dakin  <bdakin@apple.com>
87
88         Unable to commit previews in Mobile Safari
89         https://bugs.webkit.org/show_bug.cgi?id=155450
90         -and corresponding-
91         rdar://problem/25135529
92
93         Reviewed by Tim Horton.
94
95         _uiDelegateProvidedPreviewingViewController was being consulted before 
96         invoking the old SPI, which was always wrong. It should have been consulted 
97         before calling the new API! But also, it doesn’t seem to be necessary at all 
98         since [WKContentView _previewItemController:commitPreview:] is only invoked 
99         when a custom view controller has been provided.
100
101         * UIProcess/ios/WKContentViewInteraction.h:
102         * UIProcess/ios/WKContentViewInteraction.mm:
103         (-[WKContentView _registerPreview]):
104         (-[WKContentView _unregisterPreview]):
105         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
106         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
107         (-[WKContentView _previewItemController:commitPreview:]):
108
109 2016-03-14  Brent Fulgham  <bfulgham@apple.com>
110
111         PingHandle delete's itself but pointer is still used by handleDataURL
112         https://bugs.webkit.org/show_bug.cgi?id=154752
113         <rdar://problem/24872347>
114
115         Reviewed by Alex Christensen.
116
117         When a PingLoad is destroyed, we should tell its client so that the client can clear the pointer it
118         holds to the element to avoid accidentally attempting to use deallocated memory.
119
120         * NetworkProcess/PingLoad.h:
121         (WebKit::PingLoad::~PingLoad): Notify the client we are being destroyed.
122
123 2016-03-14  Carlos Garcia Campos  <cgarcia@igalia.com>
124
125         Unreviewed. Fix the GTK+ build after r198124.
126
127         WebsiteDataTypes is now an OptionSet.
128
129         * UIProcess/API/gtk/WebKitWebContext.cpp:
130         (webkit_web_context_clear_cache):
131
132 2016-03-14  Carlos Garcia Campos  <cgarcia@igalia.com>
133
134         [GTK] Reimplement webkit_web_context_clear_cache functionality.
135         https://bugs.webkit.org/show_bug.cgi?id=146041
136
137         Reviewed by Michael Catanzaro.
138
139         * UIProcess/API/gtk/WebKitWebContext.cpp:
140         (webkit_web_context_clear_cache):
141
142 2016-03-14  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
143
144         Install WebKit2 WebProcess NetworkProcess on OSX when not building the Mac PORT
145         https://bugs.webkit.org/show_bug.cgi?id=152651
146
147         Reviewed by Philippe Normand.
148
149         * CMakeLists.txt:
150
151 2016-03-13  Joseph Pecoraro  <pecoraro@apple.com>
152
153         Remove ENABLE(ES6_TEMPLATE_LITERAL_SYNTAX) guards
154         https://bugs.webkit.org/show_bug.cgi?id=155417
155
156         Reviewed by Yusuke Suzuki.
157
158         * Configurations/FeatureDefines.xcconfig:
159
160 2016-03-13  Dan Bernstein  <mitz@apple.com>
161
162         [Mac] Injected bundle in relocatable WebContent service can’t use XPC services from other relocatable frameworks
163         https://bugs.webkit.org/show_bug.cgi?id=155414
164         <rdar://problem/24428418>
165
166         Reviewed by Sam Weinig.
167
168         * Configurations/DebugRelease.xcconfig:
169           Set WK_WEBCONTENT_SERVICE_NEEDS_XPC_DOMAIN_EXTENSION_ENTITLEMENT to NO, because
170           engineering builds are ad-hoc signed and therefore can’t have a private entitlement.
171
172         * Configurations/WebContent-OSX.entitlements: Added. Includes the XPC domain extension
173           entitlement.
174
175         * Configurations/WebContentService.xcconfig:
176           Set WK_WEBCONTENT_SERVICE_NEEDS_XPC_DOMAIN_EXTENSION_ENTITLEMENT to YES if not already set
177           and the framework is relocatable. Set CODE_SIGN_ENTITLEMENTS to the new entitlements file
178           if the domain extension entitlement is needed.
179
180         * WebKit2.xcodeproj/project.pbxproj: Added reference to new file.
181
182 2016-03-13  Dean Jackson  <dino@apple.com>
183
184         <attachment> should be a runtime-enabled feature
185         https://bugs.webkit.org/show_bug.cgi?id=155413
186         <rdar://problem/25120753>
187
188         Reviewed by Sam Weinig and Anders Carlsson.
189
190         Add an internal setting on WKWebViewConfiguration
191         to enable the <attachment> element support.
192
193         * Shared/WebPreferencesDefinitions.h:
194         * UIProcess/API/Cocoa/WKWebView.mm:
195         (-[WKWebView _initializeWithConfiguration:]):
196         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
197         (-[WKWebViewConfiguration init]):
198         (-[WKWebViewConfiguration copyWithZone:]):
199         (-[WKWebViewConfiguration _attachmentElementEnabled]):
200         (-[WKWebViewConfiguration _setAttachmentElementEnabled:]):
201         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
202         * WebProcess/WebPage/WebPage.cpp:
203         (WebKit::WebPage::updatePreferences):
204
205 2016-03-12  Sam Weinig  <sam@webkit.org>
206
207         WebKit can easily crash below NetworkSession::dataTaskForIdentifier() with NSURLSession enabled
208         <rdar://problem/25129946>
209         https://bugs.webkit.org/show_bug.cgi?id=155401
210
211         Reviewed by Alex Christensen.
212
213         The issue was that NSURLSessionDataTasks can continue to invoke their NSURLSession's delegate methods
214         after -[NSURLSession invalidateAndCancel] is called. So, when the NetworkSession was destroyed, and
215         still had outstanding data tasks, the session delegate would get called, try to use the session, and
216         crash. To fix this I:
217         
218         - Made NetworkSession RefCounted.
219         - Gave NetworkSession two delegates, one for each NSURLSession.
220         - Made each delegate have a strong reference to the NetworkSession that gets cleared out in the
221           newly implemented URLSession:didBecomeInvalidWithError: method.
222         - Changed from simply destroying the NetworkSession in SessionTracker::destroySession(), to derefing
223           it and explicitly calling invalidateAndCancel on the two associated NSURLSessions (which in turn 
224           eventually cause the URLSession:didBecomeInvalidWithError: to fire).
225         - To ensure the correct lifetime of the WebCore::NetworkStorageSession, I made it a member of the
226           NetworkSession. This also allowed some simplification inside SessionTracker.
227
228         * NetworkProcess/NetworkDataTask.h:
229         (WebKit::NetworkDataTask::setPendingDownload):
230         (WebKit::NetworkDataTask::pendingDownloadLocation):
231         * NetworkProcess/NetworkLoad.cpp:
232         (WebKit::NetworkLoad::NetworkLoad):
233         * NetworkProcess/NetworkSession.h:
234         (WebKit::NetworkSession::sessionID):
235         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
236         (WebKit::NetworkDataTask::NetworkDataTask):
237         (WebKit::NetworkDataTask::~NetworkDataTask):
238         (WebKit::NetworkDataTask::willPerformHTTPRedirection):
239         (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
240         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
241         (-[WKNetworkSessionDelegate initWithNetworkSession:]):
242         (-[WKNetworkSessionDelegate URLSession:didBecomeInvalidWithError:]):
243         (WebKit::NetworkSession::setCustomProtocolManager):
244         (WebKit::NetworkSession::create):
245         (WebKit::NetworkSession::defaultSession):
246         (WebKit::NetworkSession::NetworkSession):
247         (WebKit::NetworkSession::~NetworkSession):
248         (WebKit::NetworkSession::invalidateAndCancel):
249         (WebKit::NetworkSession::networkStorageSession):
250         (WebKit::NetworkSession::clearCredentials):
251         * NetworkProcess/mac/RemoteNetworkingContext.mm:
252         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
253         * Shared/SessionTracker.cpp:
254         (WebKit::identifierBase):
255         (WebKit::SessionTracker::getIdentifierBase):
256         (WebKit::SessionTracker::setIdentifierBase):
257         (WebKit::staticSessionMap):
258         (WebKit::SessionTracker::networkSession):
259         (WebKit::SessionTracker::storageSession):
260         (WebKit::staticStorageSessionMap):
261         (WebKit::SessionTracker::sessionID):
262         (WebKit::SessionTracker::setSession):
263         (WebKit::SessionTracker::destroySession):
264         (WebKit::SessionTracker::forEachNetworkStorageSession):
265         (WebKit::storageSessionToID): Deleted.
266         (WebKit::SessionTracker::storageSessionMap): Deleted.
267         * Shared/SessionTracker.h:
268         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
269         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
270         (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts):
271         (WebKit::WebFrameNetworkingContext::localFileContentSniffingEnabled):
272         (WebKit::WebFrameNetworkingContext::scheduledRunLoopPairs):
273         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
274         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
275         (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts):
276         (WebKit::WebFrameNetworkingContext::WebFrameNetworkingContext):
277
278 2016-03-12  Myles C. Maxfield  <mmaxfield@apple.com>
279
280         Delete dead SVG Font code
281         https://bugs.webkit.org/show_bug.cgi?id=154718
282
283         Reviewed by Antti Koivisto.
284
285         * Configurations/FeatureDefines.xcconfig:
286
287 2016-03-12  Beth Dakin  <bdakin@apple.com>
288
289         Make preview inline navigation work API
290         https://bugs.webkit.org/show_bug.cgi?id=155383
291         -and corresponding-
292         rdar://problem/25117985
293
294         Reviewed by Dan Bernstein.
295
296         With this patch:
297         _WKElementInfo is now WKElementInfo in file and class names. Header is now 
298         public.
299
300         _WKPreviewElementInfo is now WKPreviewElementInfo in file and class names. 
301         Header is now public.
302
303         _WKPreviewAction is now WKPreviewActionItem in filenames (header is now 
304         public), the protocol _WKPreviewActionItem is now WKPreviewActionItem, and 
305         the _WKPreviewAction class is now WKPreviewAction. (The internal header is 
306         still project, of course.)
307         and
308         WKPreviewActionIdentifiersPrivate.h/mm is now
309         WKPreviewActionItemIdentifiers.h/mm and all the the identifiers have been 
310         updated. Header is now public.
311
312         * Shared/API/Cocoa/WebKit.h:
313         * UIProcess/API/Cocoa/WKElementInfo.h: Copied from UIProcess/API/Cocoa/_WKElementInfo.h.
314         * UIProcess/API/Cocoa/WKElementInfo.mm: Copied from UIProcess/API/Cocoa/_WKElementInfo.mm.
315         (-[WKElementInfo copyWithZone:]):
316         (-[_WKElementInfo copyWithZone:]): Deleted.
317         * UIProcess/API/Cocoa/WKElementInfoInternal.h: Copied from UIProcess/API/Cocoa/_WKElementInfoInternal.h.
318         * UIProcess/API/Cocoa/WKPreviewActionIdentifiersPrivate.h: Removed.
319         * UIProcess/API/Cocoa/WKPreviewActionIdentifiersPrivate.mm: Removed.
320         * UIProcess/API/Cocoa/WKPreviewActionItem.h: Copied from UIProcess/API/Cocoa/_WKPreviewAction.h.
321         * UIProcess/API/Cocoa/WKPreviewActionItem.mm: Copied from UIProcess/API/Cocoa/_WKPreviewAction.mm.
322         * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.h: Copied from UIProcess/API/Cocoa/WKPreviewActionIdentifiersPrivate.h.
323         * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.mm: Copied from UIProcess/API/Cocoa/WKPreviewActionIdentifiersPrivate.mm.
324         * UIProcess/API/Cocoa/WKPreviewActionItemInternal.h: Copied from UIProcess/API/Cocoa/_WKPreviewActionInternal.h.
325         * UIProcess/API/Cocoa/WKPreviewElementInfo.h: Copied from UIProcess/API/Cocoa/_WKPreviewElementInfo.h.
326         * UIProcess/API/Cocoa/WKPreviewElementInfo.mm: Copied from UIProcess/API/Cocoa/_WKPreviewElementInfo.mm.
327         (-[WKPreviewElementInfo _initWithLinkURL:]):
328         (-[_WKPreviewElementInfo _initWithLinkURL:]): Deleted.
329         * UIProcess/API/Cocoa/WKPreviewElementInfoInternal.h: Copied from UIProcess/API/Cocoa/_WKPreviewElementInfoInternal.h.
330         * UIProcess/API/Cocoa/WKUIDelegate.h:
331         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
332         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
333         * UIProcess/API/Cocoa/_WKElementInfo.h: Removed.
334         * UIProcess/API/Cocoa/_WKElementInfo.mm: Removed.
335         * UIProcess/API/Cocoa/_WKElementInfoInternal.h: Removed.
336         * UIProcess/API/Cocoa/_WKPreviewAction.h: Removed.
337         * UIProcess/API/Cocoa/_WKPreviewAction.mm: Removed.
338         * UIProcess/API/Cocoa/_WKPreviewActionInternal.h: Removed.
339         * UIProcess/API/Cocoa/_WKPreviewElementInfo.h: Removed.
340         * UIProcess/API/Cocoa/_WKPreviewElementInfo.mm: Removed.
341         * UIProcess/API/Cocoa/_WKPreviewElementInfoInternal.h: Removed.
342         * UIProcess/ios/WKContentViewInteraction.mm:
343         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
344         (previewIdentifierForElementAction):
345         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
346         (-[WKContentView _previewItemController:commitPreview:]):
347         * WebKit2.xcodeproj/project.pbxproj:
348
349 2016-03-12  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
350
351         [GTK][Mac] Use DYLD_LIBRARY_PATH on OSX rather then LD_LIBRARY_PATH
352         https://bugs.webkit.org/show_bug.cgi?id=152650
353
354         Reviewed by Carlos Garcia Campos.
355
356         * PlatformGTK.cmake:
357
358 2016-03-11  John Wilander  <wilander@apple.com>
359
360         Move prevalent resource classifier from WebCore to WebKit.
361         https://bugs.webkit.org/show_bug.cgi?id=155242
362         <rdar://problem/24913272>
363
364         Reviewed by Andy Estes.
365
366         * UIProcess/WebResourceLoadStatisticsStore.cpp:
367         (WebKit::WebResourceLoadStatisticsStore::create):
368         (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
369         (WebKit::hasPrevalentResourceCharacteristics):
370         (WebKit::classifyPrevalentResources):
371             - Moved these two functions from WebCore.
372         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
373             - Calls processStatistics with a lamda function to classify prevalent resources.
374         * WebKit2.xcodeproj/project.pbxproj:
375             - Fixed the ordering of source files.
376
377 2016-03-11  Sam Weinig  <sam@webkit.org>
378
379         WebKit needs a new sandbox profile addition for DataDetectors
380         <rdar://problem/25091102>
381
382         Reviewed by Brent Fulgham.
383
384         * WebProcess/com.apple.WebProcess.sb.in:
385
386 2016-03-11  Chris Dumez  <cdumez@apple.com>
387
388         Regression(r198040): WebKit2.DocumentStartUserScriptAlertCrashTest API test is crashing in debug
389         https://bugs.webkit.org/show_bug.cgi?id=155382
390
391         Reviewed by Alexey Proskuryakov.
392
393         r198040 introduced an assertion to make sure we never call
394         applicationBundleIsEqualTo() before setApplicationBundleIdentifier()
395         is called. This new assertion found a bug as it turns out we were
396         calling setApplicationBundleIdentifier() too late during the
397         WebProcess initialization and some runtime applications checks were
398         already done by then.
399
400         To address the problem, this patch moves the
401         setApplicationBundleIdentifier() call as early as possible during
402         the WebProcess and the NetworkProcess initialization. It also moves
403         it to the Cocoa specific files for clarity.
404
405         * NetworkProcess/NetworkProcess.cpp:
406         (WebKit::NetworkProcess::initializeNetworkProcess):
407         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
408         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
409         * WebProcess/WebProcess.cpp:
410         (WebKit::WebProcess::initializeWebProcess):
411         * WebProcess/cocoa/WebProcessCocoa.mm:
412         (WebKit::WebProcess::platformInitializeWebProcess):
413
414 2016-03-11  Enrica Casucci  <enrica@apple.com>
415
416         Use only selected text for Look up.
417         https://bugs.webkit.org/show_bug.cgi?id=155380
418
419         Reviewed by Tim Horton.
420
421         The corresponding piece that uses the extended context for Look up
422         is not ready yet. For the moment default to retrieving the selected text.
423
424         * UIProcess/ios/WKContentViewInteraction.mm:
425         (-[WKContentView _lookup:]):
426
427 2016-03-11  Chelsea Pugh  <cpugh@apple.com>
428
429         [iOS] Allow clients to specify text suggestions to be used for a form input session
430         https://bugs.webkit.org/show_bug.cgi?id=155343
431
432         Reviewed by Dan Bernstein.
433
434         * UIProcess/API/Cocoa/_WKFormInputSession.h:
435         * UIProcess/API/Cocoa/_WKInputDelegate.h:
436         * UIProcess/ios/WKContentViewInteraction.mm:
437         (-[WKFormInputSession suggestions]): Add a getter for suggestions.
438         (-[WKFormInputSession setSuggestions:]): Add a setter, which calls setSuggestions with our suggestions on the input delegate.
439         (-[WKContentView insertTextSuggestion:]): Call _webView:insertTextSuggestion:inInputSession: on our input delegate so clients know 
440         a text suggestion was tapped.
441
442 2016-03-11  Anders Carlsson  <andersca@apple.com>
443
444         Creating and releasing a WKBackForwardListItem crashes
445         https://bugs.webkit.org/show_bug.cgi?id=155376
446         rdar://problem/17377712
447
448         Reviewed by Dan Bernstein.
449
450         Make init unavailable.
451
452         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
453
454 2016-03-11  Beth Dakin  <bdakin@apple.com>
455
456         Follow-up to:
457
458         _WKPreviewAction should be in an internal header
459         https://bugs.webkit.org/show_bug.cgi?id=155370
460
461         Rubber-stamped by Dan Bernstein.
462
463         * UIProcess/API/Cocoa/_WKPreviewActionInternal.h:
464
465 2016-03-11  Beth Dakin  <bdakin@apple.com>
466
467         _WKPreviewAction should be in an internal header
468         https://bugs.webkit.org/show_bug.cgi?id=155370
469
470         Reviewed by Tim Horton.
471
472         Move _WKPreviewAction to an Internal header since only the protocol needs to 
473         be SPI.
474         * UIProcess/API/Cocoa/_WKPreviewAction.h:
475         * UIProcess/API/Cocoa/_WKPreviewAction.mm:
476         * UIProcess/API/Cocoa/_WKPreviewActionInternal.h: Added.
477         * UIProcess/ios/WKContentViewInteraction.mm:
478         * WebKit2.xcodeproj/project.pbxproj:
479
480 2016-03-11  Yusuke Suzuki  <utatane.tea@gmail.com>
481
482         [ES6] Implement Reflect.set without receiver support
483         https://bugs.webkit.org/show_bug.cgi?id=155024
484
485         Reviewed by Geoffrey Garen.
486
487         NPJSObject::setProperty may call `methodTable()->put` operation, but we intentionally do not propagate it to the caller's ::put.
488         In the current implementation, we just use the result of ::setProperty call.
489         This is `true` when ::setProperty attempts to call `methodTable()->put`.
490         In ::setProperty, after calling `methodTable()->put`, ::setProperty function clears the exception state.
491         So this is not the same semantics to the simple data property store. Rather, this is like the accessor.
492         In ECMA262 [[Set]], it returns true if there is a setter. So we just use the returned value of ::setProperty.
493         This indicates that there is a setter for the given [[Set]] operation.
494
495         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
496         (WebKit::JSNPObject::put):
497         * WebProcess/Plugins/Netscape/JSNPObject.h:
498
499 2016-03-10  David Kilzer  <ddkilzer@apple.com>
500
501         REGRESSION (r197986): Don't try to link to undefined $(WEBKIT_SYSTEM_INTERFACE_LIBRARY)
502
503         Follow-up build fix for:
504             AX: Force allow user zoom
505             <https://bugs.webkit.org/show_bug.cgi?id=155056>
506
507         Fixes the following build failure:
508             ld: library not found for -l-lAccessibility
509             clang: error: linker command failed with exit code 1 (use -v to see invocation)
510
511         * Configurations/WebKit.xcconfig: Remove
512         "-l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY)" from OTHER_LDFLAGS since
513         that macro is not defined, and there is no need to link to
514         libWebKitSystemInterface.a.
515
516 2016-03-10  Jeremy Jones  <jeremyj@apple.com>
517
518         Set AVURLAssetUsesNoPersistentCacheKey on AVAsset to match caching policy.
519         https://bugs.webkit.org/show_bug.cgi?id=155117
520         rdar://problem/6802240
521
522         Reviewed by Simon Fraser.
523
524         Make AVAsset AVURLAssetUsesNoPersistentCacheKey match !m_websiteDataStore->isPersistent()
525         This will prevent persistent media caches when webkit is using in-memory caching.
526
527         * Shared/WebPageCreationParameters.cpp: Add mediaShouldUsePersistentCache.
528         (WebKit::WebPageCreationParameters::encode):
529         (WebKit::WebPageCreationParameters::decode):
530         * Shared/WebPageCreationParameters.h:
531         * UIProcess/WebPageProxy.cpp:
532         (WebKit::WebPageProxy::creationParameters): Add mediaShouldUsePersistentCache.
533         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
534         (WebKit::WebChromeClient::mediaShouldUsePersistentCache): Added.
535         * WebProcess/WebCoreSupport/WebChromeClient.h:
536         * WebProcess/WebPage/WebPage.cpp:
537         (WebKit::m_mediaUsesPersistentCache): Added.
538         * WebProcess/WebPage/WebPage.h:
539         (WebKit::WebPage::mediaShouldUsePersistentCache): Added.
540
541 2016-03-10  Nan Wang  <n_wang@apple.com>
542
543         AX: Force allow user zoom
544         https://bugs.webkit.org/show_bug.cgi?id=155056
545
546         Reviewed by Simon Fraser.
547
548         Linked libAccessibility library so that we can observe the accessibility
549         setting change for the force always user scalable feature.
550
551         * Configurations/WebKit.xcconfig:
552         * UIProcess/API/Cocoa/WKWebView.mm:
553         (shouldAllowPictureInPictureMediaPlayback):
554         (forceAlwaysUserScalableChangedCallback):
555         (-[WKWebView _initializeWithConfiguration:]):
556         (-[WKWebView dealloc]):
557         (-[WKWebView _navigationGestureDidEnd]):
558         (-[WKWebView _updateForceAlwaysUserScalable]):
559         * UIProcess/API/Cocoa/WKWebViewInternal.h:
560         * UIProcess/WebPageProxy.h:
561         * UIProcess/ios/WebPageProxyIOS.mm:
562         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
563         (WebKit::WebPageProxy::updateForceAlwaysUserScalable):
564         (WebKit::WebPageProxy::setMaximumUnobscuredSize):
565         * WebProcess/WebPage/WebPage.cpp:
566         (WebKit::WebPage::updatePreferences):
567         * WebProcess/WebPage/WebPage.h:
568         * WebProcess/WebPage/WebPage.messages.in:
569         * WebProcess/WebPage/ios/WebPageIOS.mm:
570         (WebKit::WebPage::disableInspectorNodeSearch):
571         (WebKit::WebPage::updateForceAlwaysUserScalable):
572         (WebKit::innerFrameQuad):
573
574 2016-03-10  Simon Fraser  <simon.fraser@apple.com>
575
576         Font antialiasing (smoothing) changes when elements are rendered into compositing layers
577         https://bugs.webkit.org/show_bug.cgi?id=23364
578
579         Reviewed by Tim Horton.
580
581         Send the ContentsFormat to the UI process (but nothing happens to it there yet).
582
583         Allow internal clients to turn off smoothed layer text, so that WebKitTestRunner
584         can disable it.
585
586         * Shared/WebProcessCreationParameters.cpp:
587         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
588         (WebKit::WebProcessCreationParameters::encode):
589         (WebKit::WebProcessCreationParameters::decode):
590         * Shared/WebProcessCreationParameters.h:
591         * Shared/mac/RemoteLayerTreeTransaction.h:
592         * Shared/mac/RemoteLayerTreeTransaction.mm:
593         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
594         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
595         * UIProcess/API/C/WKContext.cpp:
596         (WKContextEnableSmoothedLayerText):
597         * UIProcess/API/C/WKContextPrivate.h:
598         * UIProcess/WebProcessPool.cpp:
599         (WebKit::WebProcessPool::createNewWebProcess):
600         (WebKit::WebProcessPool::enableSmoothedLayerText):
601         (WebKit::WebProcessPool::WebProcessPool): Deleted.
602         * UIProcess/WebProcessPool.h:
603         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
604         (WebKit::PlatformCALayerRemote::setContentsFormat):
605         (WebKit::PlatformCALayerRemote::contentsFormat):
606         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
607         * WebProcess/WebProcess.cpp:
608         (WebKit::WebProcess::initializeWebProcess):
609         (WebKit::WebProcess::enableSmoothedLayerText):
610         * WebProcess/WebProcess.h:
611         * WebProcess/WebProcess.messages.in:
612
613 2016-03-10  Enrica Casucci  <enrica@apple.com>
614
615         Expose additional WKDataDetectorTypes.
616         https://bugs.webkit.org/show_bug.cgi?id=155331
617         rdar://problem/24175813
618
619         Reviewed by Tim Horton.
620
621         Adding API to enable data detection of tracking numbers,
622         flight number and spotlight suggestions.
623
624         * UIProcess/API/Cocoa/WKWebView.mm:
625         (fromWKDataDetectorTypes):
626         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
627
628 2016-03-10  Beth Dakin  <bdakin@apple.com>
629
630         defaultActions in UIDelegate method 
631         _webView:previewingViewControllerForElement:defaultActions: need to be 
632         use-able by a client
633         https://bugs.webkit.org/show_bug.cgi?id=155304
634         -and corresponding-
635         rdar://problem/24269296
636
637         Reviewed by Anders Carlsson.
638
639         This patch adds a new protocol, WKPreviewActionItem, which is a sub-protocol 
640         of UIPreviewActionItem. The new protocol adds an identifier so that clients 
641         can identify which of our default actions they want to use. In order for a 
642         client to use our default action items, they need to return those actions in 
643         their UIViewController's implementation of previewActionItems.
644
645         Change the defaultActions to NSArray <id <WKPreviewActionItem>> *
646         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
647
648         This new file defines our sub-protocol and sub-class for WKPreviewActions.
649         * UIProcess/API/Cocoa/_WKPreviewAction.h: Added.
650         * UIProcess/API/Cocoa/_WKPreviewAction.mm: Added.
651         (+[_WKPreviewAction actionWithIdentifier:title:style:handler:]):
652
653         New BOOL _uiDelegateProvidedPreviewingViewController keeps track of whether 
654         the client returned a view controller from 
655         _webView:previewingViewControllerForElement:defaultActions:. If they did 
656         return a view controller, then we should invoke 
657         _webView:commitPreviewingViewController: at commit time. If they returned 
658         nil, then they indicated that WebKit should continue with default previewing 
659         behavior, so we will not invoke the UIDelegate’s commit method.
660         * UIProcess/ios/WKContentViewInteraction.h:
661         * UIProcess/ios/WKContentViewInteraction.mm:
662         (-[WKContentView _registerPreview]):
663         (-[WKContentView _unregisterPreview]):
664         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
665
666         In order for our default actions to be useful, we have to create 
667         _WKPreviewActions.
668         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
669
670         Only invoke _webView:commitPreviewedViewController: if 
671         _uiDelegateProvidedPreviewingViewController is YES.
672         (-[WKContentView _previewItemController:commitPreview:]):
673         * WebKit2.xcodeproj/project.pbxproj:
674
675 2016-03-10  Jer Noble  <jer.noble@apple.com>
676
677         Add WebCore, WebKit, & WebKit2 preference/setting to enable Main Content heuristic.
678         https://bugs.webkit.org/show_bug.cgi?id=155326
679         <rdar://problem/25095408>
680
681         Reviewed by Beth Dakin.
682
683         Add SPI to get and set the new preference.
684
685         * Shared/WebPreferencesDefinitions.h:
686         * UIProcess/API/C/WKPreferences.cpp:
687         (WKPreferencesSetMainContentUserGestureOverrideEnabled):
688         (WKPreferencesGetMainContentUserGestureOverrideEnabled):
689         * UIProcess/API/C/WKPreferencesRefPrivate.h:
690         * UIProcess/API/Cocoa/WKWebView.mm:
691         (-[WKWebView _initializeWithConfiguration:]):
692         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
693         (-[WKWebViewConfiguration init]):
694         (-[WKWebViewConfiguration copyWithZone:]):
695         (-[WKWebViewConfiguration _mainContentUserGestureOverrideEnabled]):
696         (-[WKWebViewConfiguration _setMainContentUserGestureOverrideEnabled:]):
697         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
698         * WebProcess/WebPage/WebPage.cpp:
699         (WebKit::WebPage::updatePreferences):
700
701 2016-03-10  Alex Christensen  <achristensen@webkit.org>
702
703         Remove firing assertion after r197865.
704         https://bugs.webkit.org/show_bug.cgi?id=155137
705         rdar://problem/25096835
706
707         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
708         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
709         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
710         This assertion was firing.  I'm looking into why.
711
712 2016-03-07  Jer Noble  <jer.noble@apple.com>
713
714         Add separate WK and WK2 preferences for requiring user gestures for video media, distinct from user gestures for media generally
715         https://bugs.webkit.org/show_bug.cgi?id=155141
716
717         Reviewed by Beth Dakin.
718
719         Add a new preference, videoPlaybackRequiresUserGesture, distinct from mediaPlaybackRequiresUserGesture. Legacy clients of 
720         mediaPlaybackRequiresUserGesture will still be able to use it normally, as setting that preference to true will effectively
721         set both audioPlaybackRequiresUserGesture and videoPlaybackRequiresUserGesture to true. Make these preferences all available
722         universally, rather than just on PLATFORM(IOS). This requires adding a definition for -setRequiresUserActionForMediaPlayback:
723         and -requiresUserActionForMediaPlayback on !PLATFORM(IOS).
724
725         * Shared/WebPreferencesDefinitions.h:
726         * UIProcess/API/C/WKPreferences.cpp:
727         (WKPreferencesSetVideoPlaybackRequiresUserGesture):
728         (WKPreferencesGetVideoPlaybackRequiresUserGesture):
729         * UIProcess/API/C/WKPreferencesRefPrivate.h:
730         * UIProcess/API/Cocoa/WKWebView.mm:
731         (-[WKWebView _initializeWithConfiguration:]):
732         (-[WKWebView _setObscuredInsets:]):
733         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
734         (-[WKWebViewConfiguration init]):
735         (-[WKWebViewConfiguration encodeWithCoder:]):
736         (-[WKWebViewConfiguration initWithCoder:]):
737         (-[WKWebViewConfiguration copyWithZone:]):
738         (-[WKWebViewConfiguration requiresUserActionForMediaPlayback]):
739         (-[WKWebViewConfiguration setRequiresUserActionForMediaPlayback:]):
740         (-[WKWebViewConfiguration allowsInlineMediaPlayback]):
741         (-[WKWebViewConfiguration setAllowsInlineMediaPlayback:]):
742         (-[WKWebViewConfiguration _requiresUserActionForVideoPlayback]):
743         (-[WKWebViewConfiguration _setRequiresUserActionForVideoPlayback:]):
744         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
745         * WebProcess/WebPage/WebPage.cpp:
746         (WebKit::WebPage::updatePreferences):
747
748 2016-03-10  Commit Queue  <commit-queue@webkit.org>
749
750         Unreviewed, rolling out r197943.
751         https://bugs.webkit.org/show_bug.cgi?id=155317
752
753         This change broke Windows, WinCairo, GTK and EFL builds
754         (Requested by ryanhaddad on #webkit).
755
756         Reverted changeset:
757
758         "Add a baseURL parameter to _WKUserStyleSheet"
759         https://bugs.webkit.org/show_bug.cgi?id=155219
760         http://trac.webkit.org/changeset/197943
761
762 2016-03-10  Eric Carlson  <eric.carlson@apple.com>
763
764         [MediaStream] push media stream state to the UI process
765         https://bugs.webkit.org/show_bug.cgi?id=155281
766
767         Reviewed by Dean Jackson.
768
769         * UIProcess/WebPageProxy.cpp:
770         (WebKit::WebPageProxy::didCommitLoadForFrame): Don't clear m_mediaState, it is done in
771           WebPageProxy::resetState. This reverts a change added in r197929.
772         
773
774 2016-03-08  Sam Weinig  <sam@webkit.org>
775
776         Add a baseURL parameter to _WKUserStyleSheet
777         https://bugs.webkit.org/show_bug.cgi?id=155219
778
779         Reviewed by Tim Horton.
780
781         - Moves to a model for user content where instead of using a WebCore::UserContentController
782           object, we implement the new WebCore::UserContentProvider interface (on the existing 
783           WebUserContentController object).
784         - Uses this to maintain maps of UserStylesSheets and UserScripts along with their identifiers,
785           freeing up the URL, which had been acting as the identifier, to be used as the baseURL which
786           was what it was intended for.
787         - Adds a baseURL property to _WKUserStyleSheet.
788
789         * WebKit2.xcodeproj/project.pbxproj:
790         Add new files.
791
792         * Scripts/webkit/messages.py:
793         (headers_for_type):
794         Add support for sending WebUserContentControllerDataTypes.
795
796         * Shared/WebUserContentControllerDataTypes.cpp: Added.
797         (WebKit::WebUserScriptData::encode):
798         (WebKit::WebUserScriptData::decode):
799         (WebKit::WebUserStyleSheetData::encode):
800         (WebKit::WebUserStyleSheetData::decode):
801         * Shared/WebUserContentControllerDataTypes.h: Added.
802         Add helper types for sending user content over IPC.
803
804         * UIProcess/API/APIUserScript.cpp:
805         (API::UserScript::generateUniqueURL):
806         (API::UserScript::UserScript):
807         * UIProcess/API/APIUserScript.h:
808         * UIProcess/API/APIUserStyleSheet.cpp:
809         (API::UserStyleSheet::generateUniqueURL):
810         (API::UserStyleSheet::UserStyleSheet):
811         * UIProcess/API/APIUserStyleSheet.h:
812         Add identifiers for tracking across processes.
813
814         * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
815         * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
816         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
817         (-[_WKUserStyleSheet baseURL]):
818         Add new initializer which takes a baseURL as well as an accessor for the baseURL.
819
820         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
821         (WebKit::WebUserContentControllerProxy::addProcess):
822         (WebKit::WebUserContentControllerProxy::addUserScript):
823         (WebKit::WebUserContentControllerProxy::removeUserScript):
824         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
825         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
826         Pass identifiers as well as user content.
827
828         * WebProcess/InjectedBundle/InjectedBundle.cpp:
829         (WebKit::InjectedBundle::addUserScript):
830         (WebKit::InjectedBundle::addUserStyleSheet):
831         Move user content in via move semantics rather than using a unique_ptr.
832
833         (WebKit::InjectedBundle::removeUserScript):
834         (WebKit::InjectedBundle::removeUserStyleSheet):
835         (WebKit::InjectedBundle::removeUserScripts):
836         (WebKit::InjectedBundle::removeUserStyleSheets):
837         (WebKit::InjectedBundle::removeAllUserContent):
838         Update for new function signatures.
839
840         * WebProcess/UserContent/WebUserContentController.cpp:
841         (WebKit::WebUserContentController::WebUserContentController):
842         (WebKit::WebUserContentController::~WebUserContentController):
843         (WebKit::WebUserContentController::addUserContentWorlds):
844         (WebKit::WebUserContentController::removeUserContentWorlds):
845         (WebKit::WebUserContentController::addUserScripts):
846         (WebKit::WebUserContentController::removeUserScript):
847         (WebKit::WebUserContentController::removeAllUserScripts):
848         (WebKit::WebUserContentController::addUserStyleSheets):
849         (WebKit::WebUserContentController::removeUserStyleSheet):
850         (WebKit::WebUserContentController::removeAllUserStyleSheets):
851         (WebKit::WebUserContentController::addUserScriptMessageHandlers):
852         (WebKit::WebUserContentController::removeUserScriptMessageHandler):
853         (WebKit::WebUserContentController::addUserContentExtensions):
854         (WebKit::WebUserContentController::removeUserContentExtension):
855         (WebKit::WebUserContentController::removeAllUserContentExtensions):
856         (WebKit::WebUserContentController::addUserScriptInternal):
857         (WebKit::WebUserContentController::addUserScript):
858         (WebKit::WebUserContentController::removeUserScriptWithURL):
859         (WebKit::WebUserContentController::removeUserScriptInternal):
860         (WebKit::WebUserContentController::removeUserScripts):
861         (WebKit::WebUserContentController::addUserStyleSheetInternal):
862         (WebKit::WebUserContentController::addUserStyleSheet):
863         (WebKit::WebUserContentController::removeUserStyleSheetWithURL):
864         (WebKit::WebUserContentController::removeUserStyleSheetInternal):
865         (WebKit::WebUserContentController::removeUserStyleSheets):
866         (WebKit::WebUserContentController::removeAllUserContent):
867         (WebKit::WebUserContentController::forEachUserScript):
868         (WebKit::WebUserContentController::forEachUserStyleSheet):
869         * WebProcess/UserContent/WebUserContentController.h:
870         * WebProcess/UserContent/WebUserContentController.messages.in:
871         Convert to inheriting from UserContentProvider, rather than containing a UserContentController.
872         This means adding the storage for the user content, which has been simplified to avoid using
873         unique_ptrs.
874
875         * WebProcess/WebPage/WebPage.cpp:
876         (WebKit::WebPage::addUserScript):
877         (WebKit::WebPage::addUserStyleSheet):
878         (WebKit::WebPage::removeAllUserContent):
879         Update to call the WebUserContentController, rather than going to the UserContentController, which
880         no longer exists.
881
882         * WebProcess/WebPage/WebPageGroupProxy.cpp:
883         (WebKit::WebPageGroupProxy::userContentController):
884         * WebProcess/WebPage/WebPageGroupProxy.h:
885         Return the WebUserContentController rather than old UserContentController.
886
887 2016-03-10  Commit Queue  <commit-queue@webkit.org>
888
889         Unreviewed, rolling out r197923.
890         https://bugs.webkit.org/show_bug.cgi?id=155301
891
892         Rolling out this change due to breaking the build and
893         LayoutTests. (Requested by ryanhaddad on #webkit).
894
895         Reverted changeset:
896
897         "Font antialiasing (smoothing) changes when elements are
898         rendered into compositing layers"
899         https://bugs.webkit.org/show_bug.cgi?id=23364
900         http://trac.webkit.org/changeset/197923
901
902 2016-03-10  Chris Dumez  <cdumez@apple.com>
903
904         Speculative revalidation requests do not have their 'first party for cookies' URL set
905         https://bugs.webkit.org/show_bug.cgi?id=155284
906         <rdar://problem/25053203>
907
908         Reviewed by Antti Koivisto.
909
910         Speculative revalidation requests did not have their 'first party for cookies'
911         URL set. This means the underlying NSURLRequest has a nil mainDocumentURL.
912         Without a way to determine whether the cookie is in a third-party context,
913         CFNetwork defaults to accepting all cookies for these resources.
914
915         * NetworkProcess/cache/NetworkCacheCoders.cpp:
916         (WebKit::NetworkCache::Coder<WebCore::URL>::encode):
917         (WebKit::NetworkCache::Coder<WebCore::URL>::decode):
918         * NetworkProcess/cache/NetworkCacheCoders.h:
919         Add template specialization to support encoding / decoding WebCore::URL.
920
921         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
922         (WebKit::NetworkCache::constructRevalidationRequest):
923         Set the "first party for cookies" URL on the revalidation request.
924
925         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::registerSubresourceLoad):
926         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
927         Now keep the subresources' ResourceRequests, in addition to their key, so we can later
928         extract the 'first party for cookies' URL from the request and save it to disk.
929
930         (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad):
931         Pass the ResourceRequest in addition to the key to
932         PendingFrameLoad::registerSubresourceLoad().
933
934         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):
935         Add an extra SubresourceInfo parameter, in addition to the Entry, so we
936         have access to the first party for cookies URL. Pass this URL to
937         constructRevalidationRequest().
938
939         (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
940         Add an extra SubresourceInfo parameter, in addition to the Entry, so we
941         have access to the first party for cookies URL.
942
943         (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
944         Pass the SubresourceInfo to preloadEntry().
945
946         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
947
948         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
949         (WebKit::NetworkCache::SubresourcesEntry::SubresourceInfo::encode):
950         (WebKit::NetworkCache::SubresourcesEntry::SubresourceInfo::decode):
951         Encode / Decode new firstPartyForCookies member.
952
953         (WebKit::NetworkCache::SubresourcesEntry::SubresourcesEntry):
954         (WebKit::NetworkCache::SubresourcesEntry::updateSubresourceLoads):
955         Take SubresourceLoad objects in, instead of simple Key objects so we have
956         access to the ResourceRequest. We extract the first party for cookies URL
957         from the request and pass it to the SubresourceInfo constructor.
958
959         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
960         (WebKit::NetworkCache::SubresourcesEntry::SubresourceInfo::SubresourceInfo):
961         (WebKit::NetworkCache::SubresourcesEntry::SubresourceLoad::SubresourceLoad):
962
963 2016-02-22  Jer Noble  <jer.noble@apple.com>
964
965         Enable AVFoundationNSURLSessionEnabled by default
966         https://bugs.webkit.org/show_bug.cgi?id=154469
967
968         Reviewed by Sam Weinig.
969
970         * Shared/WebPreferencesDefinitions.h:
971
972 2016-03-10  Eric Carlson  <eric.carlson@apple.com>
973
974         Unreviewed, revert changes accidentally committed with previous patch.
975
976         * WebProcess/com.apple.WebProcess.sb.in:
977
978 2016-03-10  Eric Carlson  <eric.carlson@apple.com>
979
980         [MediaStream] push media stream state to the UI process
981         https://bugs.webkit.org/show_bug.cgi?id=155281
982
983         Reviewed by Darin Adler.
984
985         * UIProcess/API/C/WKPage.cpp:
986         (WKPageGetMediaState): New.
987         * UIProcess/API/C/WKPagePrivate.h:
988
989         * UIProcess/WebPageProxy.cpp:
990         (WebKit::WebPageProxy::didCommitLoadForFrame): Clear m_mediaState.
991         (WebKit::WebPageProxy::isPlayingMediaDidChange): Call m_pageClient.isPlayingMediaDidChange when
992           audio or video state changes, call m_uiClient->isPlayingAudioDidChange when audio, vidoe,
993           or media stream state changes.
994         * UIProcess/WebPageProxy.h:
995         (WebKit::WebPageProxy::mediaStateFlags): New.
996
997 2016-03-09  Carlos Garcia Campos  <cgarcia@igalia.com>
998
999         [GTK] Artifacts when using web view background color
1000         https://bugs.webkit.org/show_bug.cgi?id=155229
1001
1002         Reviewed by Mario Sanchez Prada.
1003
1004         This is because when using a web view color, we fill with the
1005         color every rectangle updated by the web process, but we should
1006         always fill the entire backing store before rendering the actual
1007         contents on top.
1008
1009         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1010         (WebKit::DrawingAreaImpl::display): Ensure the web process always
1011         renders the whole visible rectangle when background is rendered by
1012         the UI process.
1013
1014 2016-03-09  Simon Fraser  <simon.fraser@apple.com>
1015
1016         Font antialiasing (smoothing) changes when elements are rendered into compositing layers
1017         https://bugs.webkit.org/show_bug.cgi?id=23364
1018         rdar://problem/7288429
1019
1020         Reviewed by Tim Horton.
1021         
1022         Send the ContentsFormat to the UI process (but nothing happens to it there yet).
1023
1024         * Shared/mac/RemoteLayerTreeTransaction.h:
1025         * Shared/mac/RemoteLayerTreeTransaction.mm:
1026         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
1027         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
1028         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1029         (WebKit::PlatformCALayerRemote::setContentsFormat):
1030         (WebKit::PlatformCALayerRemote::contentsFormat):
1031         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1032
1033 2016-03-09  Ryosuke Niwa  <rniwa@webkit.org>
1034
1035         Add runtime flags for shadow DOM and custom elements
1036         https://bugs.webkit.org/show_bug.cgi?id=155213
1037
1038         Reviewed by Dean Jackson.
1039
1040         Set the runtime flag based on preferences. Enable shadow DOM and disable custom elements by default.
1041
1042         * Shared/WebPreferencesDefinitions.h:
1043         * UIProcess/API/C/WKPreferences.cpp:
1044         (WKPreferencesSetShadowDOMEnabled):
1045         (WKPreferencesGetShadowDOMEnabled):
1046         (WKPreferencesSetCustomElementsEnabled):
1047         (WKPreferencesGetCustomElementsEnabled):
1048         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1049         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1050         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1051         * WebProcess/WebPage/WebPage.cpp:
1052         (WebKit::WebPage::updatePreferences):
1053
1054 2016-03-09  Brent Fulgham  <bfulgham@apple.com>
1055
1056         Handling 'allowUniversalAccessFromFileURLs' on WKWebViewConfiguration causes test breakage
1057         https://bugs.webkit.org/show_bug.cgi?id=155265
1058         <rdar://problem/11101440>
1059
1060         Reviewed by Andy Estes.
1061
1062         We require "AllowUniversalAccessFromFileURLs" to permit file URLs from accessing
1063         localStorage. However, this setting is not available on the Cocoa WKPreference (by design).
1064         Instead, you need to set this value on the WKWebViewConfiguration.
1065         
1066         Back out the work-around landed in r197889, 
1067
1068         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1069         (-[WKWebViewConfiguration init]): Remove test workaround.
1070         * UIProcess/mac/WebInspectorProxyMac.mm:
1071         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Set the correct flag on
1072         the WKWebViewConfiguration.
1073
1074 2016-03-09  Enrica Casucci  <enrica@apple.com>
1075
1076         Retrieve additional context for some data detector link for preview and action menu.
1077         https://bugs.webkit.org/show_bug.cgi?id=155278
1078         rdar://problem/24884951
1079
1080         Reviewed by Tim Horton.
1081
1082         Data detector results for items like calendar events, can be augmented
1083         retrieving the text surrounding the link.
1084
1085         * Platform/spi/ios/DataDetectorsUISPI.h:
1086         * Shared/ios/InteractionInformationAtPosition.h:
1087         * Shared/ios/InteractionInformationAtPosition.mm:
1088         (WebKit::InteractionInformationAtPosition::encode):
1089         (WebKit::InteractionInformationAtPosition::decode):
1090         * UIProcess/ios/WKActionSheetAssistant.mm:
1091         (-[WKActionSheetAssistant showDataDetectorsSheet]):
1092         * UIProcess/ios/WKContentViewInteraction.mm:
1093         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
1094         * WebProcess/WebPage/ios/WebPageIOS.mm:
1095         (WebKit::WebPage::getPositionInformation):
1096
1097 2016-03-09  Gavin Barraclough  <barraclough@apple.com>
1098
1099         Last opened tab does not receive SetHiddenPageTimerThrottlingIncreaseLimit message
1100         https://bugs.webkit.org/show_bug.cgi?id=155126
1101
1102         Reviewed by Anders Carlson.
1103
1104         WebPageProxy will increment the hidden page throttling counter from within its constructor,
1105         which currently causes the WebProcessPool to try to synchronously message all processes.
1106         The web page triggering the increment then fails to receive the message, since it was
1107         still being constructed. Make the update of the limit async, such that the page is fully
1108         constructed before the WebProcessPool processes the update.
1109
1110         * UIProcess/WebProcessPool.cpp:
1111         (WebKit::m_hiddenPageThrottlingAutoIncreasesCounter):
1112             - This now schedules a zero-delay timer to handle the update.
1113         (WebKit::m_hiddenPageThrottlingTimer):
1114             - This is now responsible for calling updateHiddenPageThrottlingAutoIncreaseLimit.
1115         * UIProcess/WebProcessPool.h:
1116             - Added m_hiddenPageThrottlingTimer.
1117
1118 2016-03-09  David Kilzer  <ddkilzer@apple.com>
1119
1120         REGRESSION (r197149): Missing availability checks when soft-linking DataDetectors.framework
1121         <http://webkit.org/b/155258>
1122
1123         Reviewed by Andy Estes.
1124
1125         * Platform/mac/MenuUtilities.mm:
1126         (WebKit::menuItemForTelephoneNumber):
1127         (WebKit::menuForTelephoneNumber):
1128         - Add check that returns early if DataDetectors.framework is not
1129           available.
1130
1131         * Shared/mac/WebHitTestResultData.mm:
1132         (WebKit::WebHitTestResultData::platformDecode):
1133         - Add Debug assertion.  The soft-linked code should never be
1134           called if there was no actionContext passed in.
1135
1136         * UIProcess/Cocoa/WebViewImpl.mm:
1137         (WebKit::WebViewImpl::dismissContentRelativeChildWindowsFromViewOnly):
1138         - Protect calls to DDActionsManager with availability check.
1139
1140         * UIProcess/mac/WKImmediateActionController.mm:
1141         (-[WKImmediateActionController _clearImmediateActionState]):
1142         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
1143         - Protect calls to DDActionsManager with availability check.
1144         (-[WKImmediateActionController _animationControllerForDataDetectedText]):
1145         (-[WKImmediateActionController _animationControllerForDataDetectedLink]):
1146         - Add check that returns early if DataDetectors.framework is not
1147           available.
1148
1149 2016-03-09  Keith Rollin  <krollin@apple.com>
1150
1151         Add state dumping facility
1152         https://bugs.webkit.org/show_bug.cgi?id=154930
1153         <rdar://problem/24939135>
1154
1155         Reviewed by Anders Carlsson.
1156
1157         Collect the times at which pages are loaded. Dump them when an OS
1158         state dump is triggered.
1159
1160         * WebProcess/WebPage/WebPage.cpp:
1161         (WebKit::WebPage::didCommitLoad):
1162         * WebProcess/WebPage/WebPage.h:
1163         (WebKit::WebPage::lastPageLoadTime):
1164         * WebProcess/WebProcess.h:
1165         * WebProcess/cocoa/WebProcessCocoa.mm:
1166         (WebKit::WebProcess::registerWithStateDumper):
1167         (WebKit::WebProcess::platformInitializeProcess):
1168
1169 2016-03-09  Anders Carlsson  <andersca@apple.com>
1170
1171         _WKWebsiteDataSize.h should be an SPI header.
1172
1173         Rubber-stamped by Tim Horton.
1174
1175         * WebKit2.xcodeproj/project.pbxproj:
1176
1177 2016-03-09  Brent Fulgham  <bfulgham@apple.com>
1178
1179         Handling 'allowUniversalAccessFromFileURLs' on WKWebViewConfiguration causes test breakage
1180         https://bugs.webkit.org/show_bug.cgi?id=155265
1181
1182         Unreviewed work-around to allow testing to continue.
1183
1184         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1185         (-[WKWebViewConfiguration init]): Workaround build break.
1186
1187 2016-03-09  Alex Christensen  <achristensen@webkit.org>
1188
1189         Fix use-after-free when cancelling synchronous XHR when using NetworkSession
1190         https://bugs.webkit.org/show_bug.cgi?id=155253
1191
1192         Reviewed by Brady Eidson.
1193
1194         * NetworkProcess/NetworkLoad.cpp:
1195         (WebKit::NetworkLoad::continueWillSendRequest):
1196         Store the completion handler on the stack before calling didFail, which deletes the
1197         NetworkLoad, so we don't access m_redirectCompletionHandler after deleting the NetworkLoad.
1198
1199 2016-03-09  Commit Queue  <commit-queue@webkit.org>
1200
1201         Unreviewed, rolling out r197698.
1202         https://bugs.webkit.org/show_bug.cgi?id=155252
1203
1204         Caused assertions, and wasn't reviewed by a WK2 owner
1205         (Requested by andersca on #webkit).
1206
1207         Reverted changeset:
1208
1209         "Last opened tab does not receive
1210         SetHiddenPageTimerThrottlingIncreaseLimit message"
1211         https://bugs.webkit.org/show_bug.cgi?id=155126
1212         http://trac.webkit.org/changeset/197698
1213
1214 2016-03-09  Conrad Shultz  <conrad_shultz@apple.com>
1215
1216         WebsiteDataStore::Configuration::legacyWebsiteDataStoreConfiguration() should respect the passed-in configuration
1217         https://bugs.webkit.org/show_bug.cgi?id=155250
1218
1219         Reviewed by Anders Carlsson.
1220
1221         Note that the legacy directories are already set by default in ProcessPoolConfiguration::createWithLegacyOptions(),
1222         which is also where the shouldHaveLegacyDataStore flag, which will cause this code path to be reached, is set.
1223
1224         * UIProcess/WebProcessPool.cpp:
1225         (WebKit::legacyWebsiteDataStoreConfiguration):
1226         Use the passed-in configuration to set the application cache, network cache, and media keys storage directories.
1227
1228 2016-03-09  Chris Dumez  <cdumez@apple.com>
1229
1230         Speculative disk cache resource revalidations are sometimes wasted
1231         https://bugs.webkit.org/show_bug.cgi?id=155187
1232         <rdar://problem/25032905>
1233
1234         Reviewed by Antti Koivisto.
1235
1236         Speculative disk cache resource revalidations were sometimes wasted.
1237
1238         We would sometimes correctly revalidate a resource but the
1239         NetworkResourceLoader then either:
1240         1. Fail to reuse the speculatively validated entry
1241         2. Reuse the speculatively validated entry but then validate it again
1242
1243         Bug 1 was caused by the revalidated entry key sometimes being
1244         different from the cached entry key. This could happen when
1245         revalidation fails (the server did not send back a 304) in
1246         which case we call NetworkCache::store() which creates a new
1247         cache Entry, generating a cache key from our revalidation
1248         request. If the original request has a cache partition or a
1249         range, then the keys would not match because we did not set
1250         the cache partition or the range on the revalidation request.
1251         This has been addressed by setting the cache partition on the
1252         revalidation request in constructRevalidationRequest() and by
1253         not doing revalidation if the original request had a 'range'
1254         header.
1255
1256         Bug 2 was caused by us marking a speculatively revalidated entry
1257         as "not needing revalidating" only in Cache::update(). Cache::update()
1258         is only called in the case the revalidation was successful (server
1259         returned a 304). If revalidation was not successful, Cache::store()
1260         would be called instead was we would fail to update the
1261         needsRevalidation flag. NetworkResourceLoader would then validate
1262         again the resource that was already speculatively revalidated.
1263         To address the problem, we now update the 'needsRevalidation' flag
1264         as soon as the speculative revalidation completes, in
1265         SpeculativeLoad::didComplete().
1266
1267         * NetworkProcess/cache/NetworkCache.cpp:
1268         (WebKit::NetworkCache::Cache::retrieve):
1269         (WebKit::NetworkCache::makeCacheKey):
1270         (WebKit::NetworkCache::Cache::update):
1271         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1272         (WebKit::NetworkCache::Entry::setNeedsValidation):
1273         * NetworkProcess/cache/NetworkCacheEntry.h:
1274         * NetworkProcess/cache/NetworkCacheKey.cpp:
1275         (WebKit::NetworkCache::noPartitionString):
1276         (WebKit::NetworkCache::Key::Key):
1277         (WebKit::NetworkCache::Key::hasPartition):
1278         * NetworkProcess/cache/NetworkCacheKey.h:
1279         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1280         (WebKit::NetworkCache::SpeculativeLoad::didComplete):
1281         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1282         (WebKit::NetworkCache::constructRevalidationRequest):
1283         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
1284         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):
1285
1286 2016-03-09  Brent Fulgham  <bfulgham@apple.com>
1287
1288         Local HTML should be blocked from localStorage access unless "Disable Local File Restrictions" is checked
1289         https://bugs.webkit.org/show_bug.cgi?id=155185
1290
1291         Reviewed by Anders Carlsson.
1292         <rdar://problem/11101440>
1293
1294         Tested by TestWebKitAPI tests IndexedDB.IndexedDBMultiProcess and IndexedDB.IndexedDBPersistence.
1295
1296         Allow Cocoa WKWebViewConfiguration access to the 'allowUniversalAccessFromFileURLs' setting.
1297
1298         * UIProcess/API/Cocoa/WKWebView.mm:
1299         (- [WKWebView _initializeWithConfiguration]): Set 'allowUniversalAccessFromFileURLsKey' in
1300         page configuration.
1301         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1302         (-[WKWebViewConfiguration _allowUniversalAccessFromFileURLs]): Added,
1303         (-[WKWebViewConfiguration _setAllowUniversalAccessFromFileURLs:]): Added.
1304         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1305
1306 2016-03-09  Enrica Casucci  <enrica@apple.com>
1307
1308         Add two finger tap on links.
1309         https://bugs.webkit.org/show_bug.cgi?id=155205
1310         rdar://problem/22937516
1311
1312         Reviewed by Sam Weinig.
1313
1314         Adds two finger tap gesture recognizer. When performed
1315         on a link, it calls the delegate.
1316
1317         * Platform/spi/ios/UIKitSPI.h:
1318         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1319         * UIProcess/WebPageProxy.h:
1320         * UIProcess/ios/WKContentViewInteraction.h:
1321         * UIProcess/ios/WKContentViewInteraction.mm:
1322         (-[WKContentView setupInteraction]):
1323         (-[WKContentView cleanupInteraction]):
1324         (-[WKContentView _removeDefaultGestureRecognizers]):
1325         (-[WKContentView _addDefaultGestureRecognizers]):
1326         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
1327         * UIProcess/ios/WebPageProxyIOS.mm:
1328         (WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
1329         * WebProcess/WebPage/WebPage.h:
1330         * WebProcess/WebPage/WebPage.messages.in:
1331         * WebProcess/WebPage/ios/WebPageIOS.mm:
1332         (WebKit::WebPage::handleTwoFingerTapAtPoint):
1333
1334 2016-03-09  Alex Christensen  <achristensen@webkit.org>
1335
1336         Always call NSURLSession completion handlers
1337         https://bugs.webkit.org/show_bug.cgi?id=155137
1338
1339         Reviewed by Darin Adler.
1340
1341         There are some edge cases which should not be hit, but if they are they would cause the
1342         network process to hang and network resources to be leaked.  This can be avoided.
1343         There are also a few release asserts that do not need to crash release builds.
1344
1345         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1346         (WebKit::NetworkDataTask::NetworkDataTask):
1347         (WebKit::NetworkDataTask::didReceiveChallenge):
1348         (WebKit::NetworkDataTask::didCompleteWithError):
1349         (WebKit::NetworkDataTask::didReceiveResponse):
1350         (WebKit::NetworkDataTask::didReceiveData):
1351         (WebKit::NetworkDataTask::willPerformHTTPRedirection):
1352         (WebKit::NetworkDataTask::scheduleFailure):
1353         (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
1354         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1355         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1356         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1357         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
1358
1359 2016-03-08  Sam Weinig  <sam@webkit.org>
1360
1361         Roll r197632 back in now that the bots have caught up.
1362
1363         * UIProcess/ios/WKContentViewInteraction.mm:
1364         (-[WKContentView textInputTraits]):
1365
1366 2016-03-08  Oliver Hunt  <oliver@apple.com>
1367
1368         Start moving to separated writable and executable mappings in the JIT
1369         https://bugs.webkit.org/show_bug.cgi?id=155178
1370
1371         Reviewed by Fil Pizlo.
1372
1373         Update feature defines.
1374
1375         * Configurations/FeatureDefines.xcconfig:
1376
1377 2016-03-08  Brent Fulgham  <bfulgham@apple.com>
1378
1379         [WK2][Mac] Allow processes to set "fast-dev-casheable" bit in Network Process
1380         https://bugs.webkit.org/show_bug.cgi?id=155189
1381         <rdar://problem/25042678>
1382
1383         Reviewed by Alexey Proskuryakov.
1384
1385         Update the NetworkProcess sandbox profiles with a declaration that using the
1386         system-fctl to touch the "hot file" flag (to support caching operations)
1387         is allowed. I should have done this in Bug 154503, but did not.
1388
1389         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: Add sandbox permission.
1390
1391 2016-03-08  Commit Queue  <commit-queue@webkit.org>
1392
1393         Unreviewed, rolling out r197793 and r197799.
1394         https://bugs.webkit.org/show_bug.cgi?id=155195
1395
1396         something weird happened while landing this and everything
1397         broke (Requested by olliej on #webkit).
1398
1399         Reverted changesets:
1400
1401         "Start moving to separated writable and executable mappings in
1402         the JIT"
1403         https://bugs.webkit.org/show_bug.cgi?id=155178
1404         http://trac.webkit.org/changeset/197793
1405
1406         "arm64 build fix after r197793."
1407         http://trac.webkit.org/changeset/197799
1408
1409 2016-03-08  Brent Fulgham  <bfulgham@apple.com>
1410
1411         [WK2] Grant explicit read access to ManagedPreferences
1412         https://bugs.webkit.org/show_bug.cgi?id=155173
1413         <rdar://problem/24910550>
1414
1415         Reviewed by Alexey Proskuryakov.
1416
1417         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Add new
1418         read permission.
1419
1420 2016-03-08  Anders Carlsson  <andersca@apple.com>
1421
1422         Ignore deprecation warnings.
1423
1424         * Shared/mac/ChildProcessMac.mm:
1425         (WebKit::ChildProcess::stopNSAppRunLoop):
1426         * Shared/mac/WebEventFactory.mm:
1427         (WebKit::mouseButtonForEvent):
1428         (WebKit::mouseEventTypeForEvent):
1429         (WebKit::clickCountForEvent):
1430         (WebKit::globalPointForEvent):
1431         (WebKit::pointForEvent):
1432         (WebKit::textFromEvent):
1433         (WebKit::unmodifiedTextFromEvent):
1434         (WebKit::isKeypadEvent):
1435         (WebKit::isKeyUpEvent):
1436         (WebKit::modifiersForEvent):
1437         (WebKit::WebEventFactory::createWebKeyboardEvent):
1438         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1439         (toNSEventModifierFlags):
1440         * UIProcess/Cocoa/WebViewImpl.mm:
1441         (WebKit::WebViewImpl::becomeFirstResponder):
1442         (WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
1443         (WebKit::WebViewImpl::viewDidMoveToWindow):
1444         (WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent):
1445         (WebKit::WebViewImpl::createFullScreenWindow):
1446         (WebKit::WebViewImpl::sendToolTipMouseExited):
1447         (WebKit::WebViewImpl::sendToolTipMouseEntered):
1448         (WebKit::applicationFlagsForDrag):
1449         (WebKit::WebViewImpl::setLastMouseDownEvent):
1450         (WebKit::WebViewImpl::doneWithKeyEvent):
1451         (WebKit::WebViewImpl::collectKeyboardLayoutCommandsForEvent):
1452         (WebKit::WebViewImpl::performKeyEquivalent):
1453         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1454         (WebKit::PluginProcessProxy::beginModal):
1455         * UIProcess/mac/WebContextMenuProxyMac.mm:
1456         (WebKit::WebContextMenuProxyMac::showContextMenu):
1457         * UIProcess/mac/WebInspectorProxyMac.mm:
1458         (WebKit::WebInspectorProxy::platformCanAttach):
1459         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1460         (WebKit::WebPopupMenuProxyMac::populate):
1461         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
1462         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1463         (WebKit::modifierFlagsFromWebEvent):
1464         (WebKit::getEventTypeFromWebEvent):
1465         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
1466         (WebKit::cssAlignmentValueForNSTextAlignment):
1467         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1468         (WebKit::convertImageToBitmap):
1469
1470 2016-03-08  Oliver Hunt  <oliver@apple.com>
1471
1472         Start moving to separated writable and executable mappings in the JIT
1473         https://bugs.webkit.org/show_bug.cgi?id=155178
1474
1475         Reviewed by Filip Pizlo.
1476
1477         Update feature defines.
1478
1479         * Configurations/FeatureDefines.xcconfig:
1480
1481 2016-03-08  Commit Queue  <commit-queue@webkit.org>
1482
1483         Unreviewed, rolling out r197766.
1484         https://bugs.webkit.org/show_bug.cgi?id=155183
1485
1486         Has platform-specific code in non-platform files (Requested by
1487         smfr on #webkit).
1488
1489         Reverted changeset:
1490
1491         "AX: Force allow user zoom"
1492         https://bugs.webkit.org/show_bug.cgi?id=155056
1493         http://trac.webkit.org/changeset/197766
1494
1495 2016-03-04  Ada Chan  <adachan@apple.com>
1496
1497         Fix lifetime issues regarding WebVideoFullscreenInterfaceMac
1498         https://bugs.webkit.org/show_bug.cgi?id=155130
1499
1500         Reviewed by Beth Dakin.
1501
1502         Now that both fullscreen and video controls manager rely on WebVideoFullscreenInterface,
1503         we now keep track of a "client count" for each context ID so we'll only remove it
1504         from the context map after all the "clients" are done with it.
1505
1506         Before this change, every time WebVideoFullscreenManager::setUpVideoControlsManager()
1507         is called, the existing interface is cleared and a new one is created even when there's
1508         an existing interface for that. With this change, we reuse the existing interface for
1509         the video element.
1510
1511         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
1512         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1513         (WebKit::WebVideoFullscreenManagerProxy::invalidate):
1514         Also clear out m_clientCounts.
1515         (WebKit::WebVideoFullscreenManagerProxy::addClientForContext):
1516         If the context ID is not in m_clientCounts yet, add the count of 1 to
1517         that table for that ID. Otherwise, increment the count by 1.
1518         (WebKit::WebVideoFullscreenManagerProxy::removeClientForContext):
1519         Assert that we have added this context id to m_clientCounts before.
1520         Decrement the count. If it reaches 0, remove this context ID from both
1521         m_clientCounts and m_contextMap.
1522         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
1523         We have started a new fullscreen session using this interface. Call
1524         addClientForContext() to update the client count.
1525         (WebKit::WebVideoFullscreenManagerProxy::setUpVideoControlsManagerWithID):
1526         If the current controls manager set up has the same context ID as the one
1527         passed in, we don't have to do anything. Otherwise, if we have set up
1528         the video controls manager with a different ID before, call removeClientForContext()
1529         on the old ID to decrement its client count. Set m_controlsManagerContextId
1530         to the new value and call addClientForContext() with it.
1531         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen):
1532         Instead of removing the mapping from m_contextMap directly, reset the fullscreen
1533         mode on the interface and call removeClientForContext(), which removes the mapping
1534         only if there's no more client using the interface.
1535         * WebProcess/cocoa/WebVideoFullscreenManager.h:
1536         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
1537         (WebKit::WebVideoFullscreenManager::~WebVideoFullscreenManager):
1538         Clear m_clientCounts.
1539         (WebKit::WebVideoFullscreenManager::removeContext):
1540         Add a helper method for removing the context.
1541         (WebKit::WebVideoFullscreenManager::addClientForContext):
1542         If the context ID is not in m_clientCounts yet, add the count of 1 to
1543         that table for that ID. Otherwise, increment the count by 1.
1544         (WebKit::WebVideoFullscreenManager::removeClientForContext):
1545         Assert that we have added this context id to m_clientCounts before.
1546         Decrement the count. If it reaches 0, remove this context ID from
1547         m_clientCounts and call removeContext() to clean up this context.
1548         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
1549         We have started a new fullscreen session using this interface. Call
1550         addClientForContext() to update the client count. Create a layer hosting
1551         context if it's not there.
1552         (WebKit::WebVideoFullscreenManager::setUpVideoControlsManager):
1553         If we have set up a context for this video element before, see if it's
1554         the one we are currently managing video controls for. If it is, return early.
1555         Otherwise, call removeClientForContext() on the previous m_controlsManagerContextId
1556         and update m_controlsManagerContextId to the context ID of this video element.
1557         If there's no context created for this video element yet, set one up.
1558         Send a SetUpVideoControlsManagerWithID message to the proxy object in the UI process
1559         so it'll update its controls manager context ID. Also, conditionalize all of this
1560         under PLATFORM(MAC) to be consistent with WebVideoFullscreenManagerProxy.
1561         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
1562         Just reset the fullscreen mode on the interface and call removeClientForContext() which
1563         only cleans up the context if there's no more client using it.
1564
1565 2016-03-08  Timothy Hatcher  <timothy@apple.com>
1566
1567         Web Inspector: Add automation protocol methods for navigation
1568
1569         https://bugs.webkit.org/show_bug.cgi?id=155163
1570         rdar://problem/25029054
1571
1572         Reviewed by Darin Adler.
1573
1574         * UIProcess/Automation/Automation.json:
1575         * UIProcess/Automation/WebAutomationSession.cpp:
1576         (WebKit::WebAutomationSession::getBrowsingContexts): Set url.
1577         (WebKit::WebAutomationSession::getBrowsingContext): Added.
1578         (WebKit::WebAutomationSession::navigateBrowsingContext): Added.
1579         (WebKit::WebAutomationSession::goBackInBrowsingContext): Added.
1580         (WebKit::WebAutomationSession::goForwardInBrowsingContext): Added.
1581         (WebKit::WebAutomationSession::reloadBrowsingContext): Added.
1582         * UIProcess/Automation/WebAutomationSession.h:
1583
1584 2016-03-08  Nan Wang  <n_wang@apple.com>
1585
1586         AX: Force allow user zoom
1587         https://bugs.webkit.org/show_bug.cgi?id=155056
1588
1589         Reviewed by Chris Fleizach.
1590
1591         Soft linked libAccessibility library so that we can observe the accessibility
1592         setting change for the force always user scalable feature.
1593
1594         * WebProcess/WebPage/WebPage.cpp:
1595         (WebKit::forceAlwaysUserScalableChangedCallback):
1596         (WebKit::WebPage::create):
1597         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
1598         (WebKit::WebPage::~WebPage):
1599         (WebKit::WebPage::preferencesDidChange):
1600         (WebKit::WebPage::updateForceAlwaysUserScalable):
1601         (WebKit::WebPage::updatePreferences):
1602         * WebProcess/WebPage/WebPage.h:
1603
1604 2016-03-08  Csaba Osztrogonác  <ossy@webkit.org>
1605
1606         One more unreviewed speculative buildfix after r197728.
1607
1608         * NetworkProcess/NetworkResourceLoader.cpp:
1609         (WebKit::NetworkResourceLoader::didFinishLoading):
1610         (WebKit::NetworkResourceLoader::continueWillSendRequest):
1611
1612 2016-03-08  Csaba Osztrogonác  <ossy@webkit.org>
1613
1614         Unreviewed speculative buildfix after r197728.
1615
1616         * WebProcess/Network/WebLoaderStrategy.cpp:
1617         (WebKit::WebLoaderStrategy::scheduleLoad):
1618
1619 2016-03-08  Timothy Hatcher  <timothy@apple.com>
1620
1621         Web Inspector: Make WebAutomationSession::closeBrowsingContext work as expected
1622
1623         https://bugs.webkit.org/show_bug.cgi?id=155162
1624         rdar://problem/25027191
1625
1626         Reviewed by Brian Burg.
1627
1628         * UIProcess/Automation/WebAutomationSession.cpp:
1629         (WebKit::WebAutomationSession::closeBrowsingContext):
1630         Call closePage, the same method ultimately used by window.close().
1631
1632         * UIProcess/WebPageProxy.h: Make closePage public.
1633
1634 2016-03-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1635
1636         REGRESSION(r197062): [GTK] Transparent backgrounds no longer work after r197062
1637         https://bugs.webkit.org/show_bug.cgi?id=155119
1638
1639         Reviewed by Martin Robinson.
1640
1641         This is because after r197062 we are now realizing the view too
1642         early, even before the toplevel window has been realized, forcing
1643         the toplevel window to be realized. If the RGBA visual is set on
1644         the window after it has been realzied it doesn't have any
1645         effect. We should wait until the toplevel window is realized to
1646         realize the web view, giving time to the application to set RGBA
1647         visual and background color. If the toplevel window is already
1648         realized we realize the web view immediately, so that this doesn't
1649         affect the tearing problems fixed in r197062.
1650
1651         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1652         (toplevelWindowRealized):
1653         (webkitWebViewBaseSetToplevelOnScreenWindow):
1654
1655 2016-03-07  Keith Rollin  <krollin@apple.com>
1656
1657         Enhance logging: Use "always on" macros
1658         https://bugs.webkit.org/show_bug.cgi?id=154499
1659         <rdar://problem/24757730>
1660
1661         Reviewed by Chris Dumez.
1662
1663         Make use of new logging macros by reporting on frame and resource
1664         load activity.
1665
1666         Connection updated to report IPC errors, helping us identify when
1667         messaging between processes breaks down.
1668
1669         ChildProcess updated to log if it is terminating early. Some
1670         sysdiagnose logging from customers indicate that this is happening in
1671         the wild.
1672
1673         * NetworkProcess/NetworkResourceLoader.cpp:
1674         (WebKit::NetworkResourceLoader::startNetworkLoad):
1675         (WebKit::NetworkResourceLoader::didFinishLoading):
1676         (WebKit::NetworkResourceLoader::didFailLoading):
1677         (WebKit::NetworkResourceLoader::continueWillSendRequest):
1678         (WebKit::NetworkResourceLoader::isAlwaysOnLoggingAllowed):
1679         * NetworkProcess/NetworkResourceLoader.h:
1680         * Platform/IPC/Connection.cpp:
1681         (IPC::Connection::waitForSyncReply):
1682         * Shared/ChildProcess.cpp:
1683         (WebKit::didCloseOnConnectionWorkQueue):
1684         * WebProcess/Network/WebLoaderStrategy.cpp:
1685         (WebKit::WebLoaderStrategy::scheduleLoad):
1686         * WebProcess/Network/WebResourceLoader.cpp:
1687         (WebKit::WebResourceLoader::willSendRequest):
1688         (WebKit::WebResourceLoader::didReceiveResponse):
1689         (WebKit::WebResourceLoader::didReceiveData):
1690         (WebKit::WebResourceLoader::didFinishResourceLoad):
1691         (WebKit::WebResourceLoader::didFailResourceLoad):
1692         (WebKit::WebResourceLoader::didReceiveResource):
1693         (WebKit::WebResourceLoader::isAlwaysOnLoggingAllowed):
1694         * WebProcess/Network/WebResourceLoader.h:
1695
1696 2016-03-07  Brent Fulgham  <bfulgham@apple.com>
1697
1698         Reduce startup and shutdown cost of resource load statistics
1699         https://bugs.webkit.org/show_bug.cgi?id=155120
1700         <rdar://problem/25010167>
1701
1702         Reviewed by Andy Estes.
1703
1704         Use a dedicated WorkQueue to process resource load statistics data. Allow
1705         processing to load (and save) previously stored statistics asynchronously so
1706         that it does not delay startup.
1707         
1708         Now that we have a more rational storage situation, get rid of the 'writeToDisk'
1709         method since it is no longer needed in the WK2 layer.
1710
1711         Move all of the Resource Load Statistics file handling code from WebCore to this
1712         API layer.
1713
1714         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1715         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Initialize
1716         member variable with storage path, rather than passing to WebCore code.
1717         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): Revised to
1718         use the new WorkQueue code.
1719         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsEnabled): When
1720         activating the feature, purge any old statistics before loading from disk.
1721         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): Added.
1722         (WebKit::WebResourceLoadStatisticsStore::processWillOpenConnection): Added.
1723         (WebKit::WebResourceLoadStatisticsStore::processDidCloseConnection): Added.
1724         (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate): Make sure all
1725         of the WorkQueue tasks are done before terminating.
1726         (WebKit::WebResourceLoadStatisticsStore::persistentStoragePath): Moved from WebCore.
1727         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): Ditto.
1728         (WebKit::WebResourceLoadStatisticsStore::createDecoderFromDisk): Ditto.
1729         (WebKit::WebResourceLoadStatisticsStore::writeToDisk): Deleted.
1730         * UIProcess/WebResourceLoadStatisticsStore.h:
1731         (WebKit::WebResourceLoadStatisticsStore::coreStore):
1732         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1733         (WebKit::WebsiteDataStore::webProcessWillOpenConnection): Call new WebResourceLoadStatisticsStore code.
1734         (WebKit::WebsiteDataStore::webProcessDidCloseConnection): Ditto.
1735
1736 2016-03-07  Alex Christensen  <achristensen@webkit.org>
1737
1738         Fix cookies with private browsing and NetworkSession
1739         https://bugs.webkit.org/show_bug.cgi?id=155147
1740         rdar://problem/25018279
1741
1742         Reviewed by Brady Eidson.
1743
1744         In the NetworkSession constructor, we look for a NetworkStorageSession in the SessionTracker
1745         and use that NetworkStorageSession's CFHTTPCookieStorageRef in the NSURLSessionConfiguration.
1746         NetworkStorageSessions were being set in SessionTracker's storageSessionMap after NetworkSessions
1747         were created, causing the NSHTTPCookieStorage of the NSURLSession to be different from the
1748         CFHTTPCookieStorageRef used by document.cookie in newly created private browsing sessions.
1749         This fixes that problem by passing the NetworkStorageSession as a constructor parameter to the
1750         NetworkSession so it can use the correct CFHTTPCookieStorageRef in its NSURLSessionConfiguration
1751         before it is in the storageSessionMap.
1752
1753         * NetworkProcess/NetworkSession.h:
1754         (WebKit::NetworkSession::sessionID):
1755         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1756         (WebKit::NetworkSession::defaultSession):
1757         (WebKit::NetworkSession::NetworkSession):
1758         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1759         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
1760         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1761         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
1762
1763 2016-03-07  Brent Fulgham  <bfulgham@apple.com>
1764
1765         Correct bug in resource load statistics debug flag for legacy clients
1766         https://bugs.webkit.org/show_bug.cgi?id=155118
1767         <rdar://problem/25020088>
1768
1769         Reviewed by Andy Estes.
1770
1771         Some clients launch WebKit2 using the "legacy" configuration for the website data store.
1772         The Resource Load Statistics code was not added to this type of configuration, which
1773         prevents various WebKit2 clients from using this code.
1774
1775         * UIProcess/WebProcessPool.cpp:
1776         (WebKit::legacyWebsiteDataStoreConfiguration): Tell the legacy initializer where to
1777         find the resource load statistics data.
1778
1779 2016-03-07  Daniel Bates  <dabates@apple.com>
1780
1781         Cleanup: Add convenience function URL::procotolIsBlob()
1782         https://bugs.webkit.org/show_bug.cgi?id=155127
1783         <rdar://problem/25016829>
1784
1785         Reviewed by Brent Fulgham.
1786
1787         * NetworkProcess/NetworkLoad.cpp:
1788         (WebKit::NetworkLoad::NetworkLoad): Modified to use URL::protocolIsBlob().
1789         * NetworkProcess/NetworkResourceLoader.cpp:
1790         (WebKit::NetworkResourceLoader::NetworkResourceLoader): Ditto.
1791         * WebProcess/WebPage/WebPage.cpp:
1792         (WebKit::WebPage::canHandleRequest): Ditto.
1793
1794 2016-03-07  Simon Fraser  <simon.fraser@apple.com>
1795
1796         Use CGColorSpaceCopyICCData instead of CGColorSpaceCopyICCProfile
1797         https://bugs.webkit.org/show_bug.cgi?id=155123
1798         rdar://problem/24990256
1799
1800         Reviewed by Tim Horton.
1801         
1802         On newer OSes, use CGColorSpaceCopyICCData().
1803
1804         * Shared/mac/ColorSpaceData.mm:
1805         (WebKit::ColorSpaceData::encode):
1806
1807 2016-03-07  Gavin Barraclough  <barraclough@apple.com>
1808
1809         Last opened tab does not receive SetHiddenPageTimerThrottlingIncreaseLimit message
1810         https://bugs.webkit.org/show_bug.cgi?id=155126
1811
1812         Reviewed by Chris Dumez.
1813
1814         WebPageProxy will increment the hidden page throttling counter from within its constructor,
1815         which currently causes the WebProcessPool to try to synchronously message all processes.
1816         The web page triggering the increment then fails to receive the message, since it was
1817         still being constructed. Make the update of the limit async, such that the page is fully
1818         constructed before the WebProcessPool processes the update.
1819
1820         * UIProcess/WebProcessPool.cpp:
1821         (WebKit::m_hiddenPageThrottlingAutoIncreasesCounter):
1822             - This now schedules a zero-delay timer to handle the update.
1823         (WebKit::m_hiddenPageThrottlingTimer):
1824             - This is now responsible for calling updateHiddenPageThrottlingAutoIncreaseLimit.
1825         * UIProcess/WebProcessPool.h:
1826             - Added m_hiddenPageThrottlingTimer.
1827
1828 2016-03-05  Enrica Casucci  <enrica@apple.com>
1829
1830         Support preview on attachment elements.
1831         https://bugs.webkit.org/show_bug.cgi?id=155074
1832         rdar://problem/24806079
1833
1834         Reviewed by Sam Weinig.
1835
1836         Allowing preview to start on attachment elements.
1837         Adding a private UIDelegate method to provide the data for the preview.
1838
1839         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1840         * UIProcess/ios/WKContentViewInteraction.mm:
1841         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
1842         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
1843
1844 2016-03-06  Andreas Kling  <akling@apple.com>
1845
1846         Reduce page cache capacity from 3 to 2.
1847         <https://webkit.org/b/155087>
1848
1849         Reviewed by Antti Koivisto.
1850
1851         It's extremely rare that users go back more than 2 pages in the page cache,
1852         and nowadays the network cache makes even un-cached pages fast to reload.
1853
1854         Trimming the page cache from 3 to 2 entries has a very nice effect on heap
1855         fragmentation. I'm seeing a ~5% progression on the iPad PLUM test locally;
1856         average memory usage across 300 loads goes from ~121MB to ~114MB.
1857
1858         * Shared/CacheModel.cpp:
1859         (WebKit::calculateCacheSizes):
1860
1861 2016-03-05  Sam Weinig  <sam@webkit.org>
1862
1863         Revert usage of autofill field name for use with UITextInputTraits
1864         until our bots can catch up.
1865
1866         * UIProcess/ios/WKContentViewInteraction.mm:
1867         (-[WKContentView textInputTraits]):
1868
1869 2016-03-05  Chris Dumez  <cdumez@apple.com>
1870
1871         Consolidate RuntimeApplicationChecks and RuntimeApplicationChecksIOS
1872         https://bugs.webkit.org/show_bug.cgi?id=155035
1873
1874         Reviewed by Darin Adler.
1875
1876         Update runtime application checks.
1877
1878         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
1879         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
1880         * UIProcess/Cocoa/VersionChecks.mm:
1881         (WebKit::linkedOnOrAfter):
1882         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1883         (WebKit::WebProcessPool::platformInitializeWebProcess):
1884         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory):
1885         * UIProcess/ios/WKContentViewInteraction.mm:
1886         * UIProcess/mac/WebPageProxyMac.mm:
1887         (WebKit::expectsLegacyImplicitRubberBandControl):
1888         (WebKit::WebPageProxy::appleMailPaginationQuirkEnabled):
1889
1890 2016-03-05  Sam Weinig  <sam@webkit.org>
1891
1892         Add support for processing the autofill field name out of form control elements ultimately to aid input methods
1893         <rdar://problem/23041180>
1894         https://bugs.webkit.org/show_bug.cgi?id=155079
1895
1896         Reviewed by Enrica Casucci.
1897
1898         * Shared/AssistedNodeInformation.cpp:
1899         (WebKit::AssistedNodeInformation::encode):
1900         (WebKit::AssistedNodeInformation::decode):
1901         * Shared/AssistedNodeInformation.h:
1902         Add AutofillFieldName. Convert some coders to use encodeEnum/decodeEnum instead of casting.
1903
1904         * UIProcess/ios/WKContentViewInteraction.mm:
1905         (-[WKContentView textInputTraits]):
1906         Map AutofillFieldNames to the associated UITextContentTypes.
1907
1908         * WebProcess/WebPage/ios/WebPageIOS.mm:
1909         (WebKit::WebPage::getAssistedNodeInformation):
1910         Extract the AutofillFieldNames onto the AssistedNodeInformation for <input> elements 
1911         and <textarea> elements.
1912
1913 2016-03-05  Timothy Hatcher  <timothy@apple.com>
1914
1915         Implement the Automation protocol commands by tracking WebPageProxy objects
1916         that are controlled by automation and assigning them a UUID handle.
1917
1918         https://bugs.webkit.org/show_bug.cgi?id=154953
1919         rdar://problem/24947489
1920
1921         Reviewed by Brian Burg.
1922
1923         * UIProcess/API/APIAutomationSessionClient.h:
1924         (API::AutomationSessionClient::didRequestNewWindow):
1925         Return a WebPageProxy instead of void so it can be assigned a UUID handle.
1926
1927         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
1928         Return a WKPageRef from _automationSessionDidRequestNewWindow:.
1929
1930         * UIProcess/Automation/WebAutomationSession.cpp:
1931         (WebKit::WebAutomationSession::webPageProxyForHandle):
1932         (WebKit::WebAutomationSession::handleForWebPageProxy):
1933         (WebKit::WebAutomationSession::getBrowsingContexts):
1934         (WebKit::WebAutomationSession::createBrowsingContext):
1935         (WebKit::WebAutomationSession::closeBrowsingContext):
1936         (WebKit::WebAutomationSession::switchToBrowsingContext):
1937
1938         * UIProcess/Automation/WebAutomationSession.h:
1939         Added new methods and maps to track pages and handles.
1940
1941         * UIProcess/Cocoa/AutomationSessionClient.h:
1942         * UIProcess/Cocoa/AutomationSessionClient.mm:
1943         (WebKit::AutomationSessionClient::didRequestNewWindow):
1944         Return a WebPageProxy from the WKPageRef.
1945
1946         * UIProcess/WebPageProxy.h: Make setFocus public.
1947
1948         * UIProcess/WebProcessPool.cpp:
1949         (WebKit::WebProcessPool::setAutomationSession):
1950         Set the WebProcessPool on the WebAutomationSession so it can be used to find
1951         WebPageProxy objects controlled by automation.
1952
1953 2016-03-05  Timothy Hatcher  <timothy@apple.com>
1954
1955         Rename Automation protocol methods to use "BrowsingContext" instead of "Window".
1956         Also flesh out the protocol commands more by adding switchToBrowsingContext
1957         and return a BrowsingContextHandle for createBrowsingContext.
1958
1959         https://bugs.webkit.org/show_bug.cgi?id=154953
1960         rdar://problem/24947489
1961
1962         Reviewed by Brian Burg.
1963
1964         * UIProcess/Automation/Automation.json:
1965         * UIProcess/Automation/WebAutomationSession.cpp:
1966         (WebKit::WebAutomationSession::getBrowsingContexts):
1967         (WebKit::WebAutomationSession::createBrowsingContext):
1968         (WebKit::WebAutomationSession::closeBrowsingContext):
1969         (WebKit::WebAutomationSession::switchToBrowsingContext):
1970         (WebKit::WebAutomationSession::getWindows): Deleted.
1971         (WebKit::WebAutomationSession::openWindow): Deleted.
1972         (WebKit::WebAutomationSession::closeWindow): Deleted.
1973         * UIProcess/Automation/WebAutomationSession.h:
1974
1975 2016-03-05  Yusuke Suzuki  <utatane.tea@gmail.com>
1976
1977         [ES6] Support Reflect.construct
1978         https://bugs.webkit.org/show_bug.cgi?id=147330
1979
1980         Reviewed by Saam Barati.
1981
1982         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
1983         (WebKit::JSNPMethod::getCallData):
1984         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1985         (WebKit::JSNPObject::getCallData):
1986         (WebKit::JSNPObject::getConstructData):
1987         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
1988         (WebKit::NPJSObject::hasMethod):
1989         (WebKit::NPJSObject::construct):
1990         (WebKit::NPJSObject::invoke):
1991
1992 2016-03-04  Alex Christensen  <achristensen@webkit.org>
1993
1994         Fix file mime-types when using NetworkSession
1995         https://bugs.webkit.org/show_bug.cgi?id=155058
1996
1997         Reviewed by Andy Estes.
1998
1999         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2000         (WebKit::NetworkDataTask::NetworkDataTask):
2001         Call adjustMIMETypeIfNecessary like we do in connection didReceiveResponse in 
2002         WebCoreResourceHandleAsOperationQueueDelegate.mm.
2003         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2004         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
2005         Don't content sniff file urls.  This check is analogous to ResourceHandle::shouldContentSniffURL.
2006
2007 2016-03-04  Sam Weinig  <sam@webkit.org>
2008
2009         [WebKit2] Add WebKit2 equivalent of -[WebView _insertNewlineInQuotedContent]
2010         <rdar://problem/24943591>
2011         https://bugs.webkit.org/show_bug.cgi?id=155057
2012
2013         Reviewed by Tim Horton.
2014
2015         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2016         (WKBundlePageInsertNewlineInQuotedContent):
2017         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
2018         * WebProcess/WebPage/WebPage.cpp:
2019         (WebKit::WebPage::insertNewlineInQuotedContent):
2020         * WebProcess/WebPage/WebPage.h:
2021         Expose WKBundlePageInsertNewlineInQuotedContent as SPI.
2022
2023 2016-03-04  Brent Fulgham  <bfulgham@apple.com>
2024
2025         Stub API to support a debug menu option for measuring resource load statistics
2026         https://bugs.webkit.org/show_bug.cgi?id=154998
2027         <rdar://problem/24944604>
2028
2029         Reviewed by Andy Estes.
2030
2031         * UIProcess/API/APIWebsiteDataStore.cpp:
2032         (API::WebsiteDataStore::resourceLoadStatisticsEnabled): Added stub.
2033         (API::WebsiteDataStore::setResourceLoadStatisticsEnabled): Ditto.
2034         * UIProcess/API/APIWebsiteDataStore.h:
2035         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2036         (WKWebsiteDataStoreSetResourceLoadStatisticsEnabled): Added method that calls through
2037         to the underlying APIWebsiteDataStore class.
2038         (WKWebsiteDataStoreGetResourceLoadStatisticsEnabled): Ditto.
2039         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2040
2041 2016-03-03  Enrica Casucci  <enrica@apple.com>
2042
2043         Add a mechanism to customize the long press action.
2044         https://bugs.webkit.org/show_bug.cgi?id=154995
2045         rdar://problem/24823732
2046
2047         Reviewed by Tim Horton.
2048
2049         Adding a new private delegate method to allow clients to
2050         replace the action sheet displayed for images and links.
2051         The change also adds support for attachment elements.
2052
2053         * Shared/ios/InteractionInformationAtPosition.h:
2054         * Shared/ios/InteractionInformationAtPosition.mm:
2055         (WebKit::InteractionInformationAtPosition::encode):
2056         (WebKit::InteractionInformationAtPosition::decode):
2057         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2058         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
2059         * UIProcess/ios/WKActionSheetAssistant.h:
2060         * UIProcess/ios/WKActionSheetAssistant.mm:
2061         (-[WKActionSheetAssistant showImageSheet]):
2062         (-[WKActionSheetAssistant showLinkSheet]):
2063         * UIProcess/ios/WKContentViewInteraction.mm:
2064         (-[WKContentView _showImageSheet]):
2065         (-[WKContentView _showAttachmentSheet]):
2066         (-[WKContentView _showLinkSheet]):
2067         (-[WKContentView _actionForLongPress]):
2068         (-[WKContentView actionSheetAssistant:shouldIncludeAppLinkActionsForElement:]):
2069         (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
2070         (-[WKContentView actionSheetAssistant:decideActionsForElement:defaultActions:]):
2071         * WebProcess/WebPage/ios/WebPageIOS.mm:
2072         (WebKit::WebPage::getPositionInformation):
2073
2074 2016-03-04  Brent Fulgham  <bfulgham@apple.com>
2075
2076         [WK2] Gather resource load statistics
2077         https://bugs.webkit.org/show_bug.cgi?id=154278
2078         <rdar://problem/24702892>
2079
2080         Reviewed by Andy Estes.
2081
2082         Revise the WebProcess to notify the UIProcess about resource load statistics. These
2083         updates are not time-critical, and do not need to be done in concert with the actual
2084         load. As resource loads are made, each WebProcess notifies the UIProcess of the new
2085         load counts, then clears its local state. These statistics are then aggregated in
2086         the UIProcess.
2087
2088         * CMakeLists.txt: Add new ResourceLoadStatisticsState files to build.
2089         * DerivedSources.make: Ditto.
2090         * Platform/IPC/ArgumentCoders.h: Update to support HashCountedSets.
2091         * PlatformEfl.cmake: Add new ResourceLoadStatisticsState files to build.
2092         * PlatformGTK.cmake: Ditto.
2093         * PlatformMac.cmake: Ditto.
2094         * Shared/API/APIObject.h: Add new ResourceLoadStatistics type.
2095         * Shared/WebCoreArgumentCoders.cpp:
2096         (IPC::ArgumentCoder<ExceptionDetails>::decode): Support new ResourceLoadStatistics type.
2097         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode): Added.
2098         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode): Added.
2099         * Shared/WebCoreArgumentCoders.h:
2100         * Shared/WebProcessCreationParameters.cpp:
2101         (WebKit::WebProcessCreationParameters::encode): Handle 'resourceLoadStatisticsEnabled' flag.
2102         (WebKit::WebProcessCreationParameters::decode): Ditto.
2103         * Shared/WebProcessCreationParameters.h:
2104         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2105         (API::ProcessPoolConfiguration::ProcessPoolConfiguration): Add storage location for the
2106         resource load statistics.
2107         (API::ProcessPoolConfiguration::copy): Handle the new storage location and the feature flag.
2108         * UIProcess/API/APIProcessPoolConfiguration.h:
2109         * UIProcess/API/APIWebsiteDataStore.cpp:
2110         (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory): Added stub.
2111         * UIProcess/API/APIWebsiteDataStore.h:
2112         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2113         (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory): Added.
2114         (API::WebsiteDataStore::defaultDataStoreConfiguration): Added support for the new resource
2115         load statistics storage location.
2116         * UIProcess/API/Cocoa/WKWebView.mm:
2117         (-[WKWebView _initializeWithConfiguration:]): Sync Process Pool configuration parameters
2118         with the state of our websiteData object's "ResourceLoadStatisticsEnabled" flag, so that
2119         new processes are created in the right state.
2120         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2121         (-[WKWebsiteDataStore _resourceLoadStatisticsEnabled]): Added.
2122         (-[WKWebsiteDataStore _setResourceLoadStatisticsEnabled:]): Added.
2123         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2124         * UIProcess/WebProcessPool.cpp:
2125         (WebKit::WebProcessPool::createNewWebProcess): Handle new flag for enabling resource
2126         load statistics.
2127         * UIProcess/WebResourceLoadStatisticsStore.cpp: Added.
2128         (WebKit::WebResourceLoadStatisticsStore::create):
2129         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2130         (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
2131         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
2132         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsEnabled):
2133         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsEnabled):
2134         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
2135         (WebKit::WebResourceLoadStatisticsStore::writeToDisk):
2136         (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
2137         * UIProcess/WebResourceLoadStatisticsStore.h: Added.
2138         (WebKit::WebResourceLoadStatisticsStore::coreStore):
2139         * UIProcess/WebResourceLoadStatisticsStore.messages.in: Added.
2140         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2141         (WebKit::WebsiteDataStore::platformInitialize): Register a termination handler
2142         to close down the resource load statistics store.
2143         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2144         (WebKit::WebsiteDataStore::WebsiteDataStore): Initialize the new WebResourceLoadStatisticsStore
2145         member.
2146         (WebKit::WebsiteDataStore::webProcessWillOpenConnection): Register the WebResourceLoadStatisticsStore
2147         object as a work queue message receiver
2148         (WebKit::WebsiteDataStore::webProcessDidCloseConnection): Unregister WebResourceLoadStatisticsStore.
2149         (WebKit::WebsiteDataStore::resourceLoadStatisticsEnabled): Added.
2150         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled): Ditto.
2151         * UIProcess/WebsiteData/WebsiteDataStore.h:
2152         (WebKit::WebsiteDataStore::resourceLoadStatisticsStore): Added.
2153         * WebKit2.xcodeproj/project.pbxproj: Add new ResourceLoadStatisticsState files to build.
2154         * WebProcess/WebProcess.cpp:
2155         (WebKit::WebProcess::initializeWebProcess): Take into account the new parameter
2156         specifying whether resource load statistics are being captured.
2157         (WebKit::WebProcess::WebProcess): Initialized statistics changed notification timer.
2158         (WebKit::WebProcess::statisticsChangedTimerFired): Added. Send bundles of site load
2159         statistics to the UIProcess on a set interval. Clear out local cache after each send.
2160         (WebKit::WebProcess::setResourceLoadStatisticsEnabled): Added.
2161         * WebProcess/WebProcess.h:
2162         * WebProcess/WebProcess.messages.in: Add new SetResourceLoadStatisticsEnabled message.
2163
2164 2016-03-04  Daniel Bates  <dabates@apple.com>
2165
2166         Temporarily use bundle identifier as part of user directory suffix
2167         https://bugs.webkit.org/show_bug.cgi?id=155042
2168         <rdar://problem/24983174>
2169
2170         Reviewed by Brent Fulgham and Brady Eidson.
2171
2172         * Shared/mac/ChildProcessMac.mm:
2173         (WebKit::ChildProcess::initializeSandbox):
2174
2175 2016-03-04  Alex Christensen  <achristensen@webkit.org>
2176
2177         Release build fix after r197572.
2178         https://bugs.webkit.org/show_bug.cgi?id=154993
2179
2180         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2181         (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
2182
2183 2016-03-04  Alex Christensen  <achristensen@webkit.org>
2184
2185         Use NSURLSession for loading in WebKit2
2186         https://bugs.webkit.org/show_bug.cgi?id=154993
2187
2188         Reviewed by Sam Weinig.
2189
2190         * config.h:
2191
2192 2016-03-04  Alex Christensen  <achristensen@webkit.org>
2193
2194         Use NetworkSession for pings
2195         https://bugs.webkit.org/show_bug.cgi?id=154984
2196
2197         Reviewed by Antti Koivisto.
2198
2199         Before this patch, we were using NSURLConnection for pings when the rest of the loading was being 
2200         done with NSURLSession.  To fix this, I implemented PingLoad, which is the NetworkSession equivalent
2201         of PingHandle.
2202
2203         This fixes http/tests/security/contentSecurityPolicy/report-status-code-zero-when-using-https.html
2204
2205         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2206         (WebKit::NetworkConnectionToWebProcess::loadPing):
2207         (WebKit::NetworkConnectionToWebProcess::removeLoadIdentifier):
2208         * NetworkProcess/PingLoad.h: Added.
2209         (WebKit::PingLoad::PingLoad):
2210         (WebKit::PingLoad::willPerformHTTPRedirection):
2211         (WebKit::PingLoad::didReceiveChallenge):
2212         (WebKit::PingLoad::didReceiveResponseNetworkSession):
2213         (WebKit::PingLoad::didReceiveData):
2214         (WebKit::PingLoad::didCompleteWithError):
2215         (WebKit::PingLoad::didBecomeDownload):
2216         (WebKit::PingLoad::didSendData):
2217         (WebKit::PingLoad::wasBlocked):
2218         (WebKit::PingLoad::cannotShowURL):
2219         (WebKit::PingLoad::timeoutTimerFired):
2220         (WebKit::PingLoad::~PingLoad):
2221         * WebKit2.xcodeproj/project.pbxproj:
2222
2223 2016-03-04  Timothy Hatcher  <timothy@apple.com>
2224
2225         Inform WebKit and WebCore if a page is controlled by automation.
2226
2227         https://bugs.webkit.org/show_bug.cgi?id=154991
2228         rdar://problem/24965784
2229
2230         Reviewed by Joseph Pecoraro.
2231
2232         * Shared/WebPageCreationParameters.cpp:
2233         (WebKit::WebPageCreationParameters::encode):
2234         (WebKit::WebPageCreationParameters::decode):
2235         * Shared/WebPageCreationParameters.h:
2236         * UIProcess/API/C/WKPage.cpp:
2237         (WKPageGetIsControlledByAutomation):
2238         (WKPageSetControlledByAutomation):
2239         * UIProcess/API/C/WKPagePrivate.h:
2240         * UIProcess/WebPageProxy.cpp:
2241         (WebKit::WebPageProxy::setControlledByAutomation):
2242         (WebKit::WebPageProxy::creationParameters):
2243         * UIProcess/WebPageProxy.h:
2244         (WebKit::WebPageProxy::isControlledByAutomation):
2245         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2246         (WKBundlePageIsControlledByAutomation):
2247         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2248         * WebProcess/WebPage/WebPage.cpp:
2249         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
2250         (WebKit::WebPage::isControlledByAutomation):
2251         (WebKit::WebPage::setControlledByAutomation):
2252         * WebProcess/WebPage/WebPage.h:
2253         * WebProcess/WebPage/WebPage.messages.in:
2254
2255 2016-03-03  Chris Dumez  <cdumez@apple.com>
2256
2257         Regression(r196770): Unable to use HipChat Mac app
2258         https://bugs.webkit.org/show_bug.cgi?id=154999
2259         <rdar://problem/24931959>
2260
2261         Reviewed by Darin Adler.
2262
2263         Have the NetworkProcess and the WebProcess pass the UIProcess bundle
2264         identifier to WebCore so that we can do app detection of applications
2265         using a WK2 WebView (such as HipChat).
2266
2267         * NetworkProcess/NetworkProcess.cpp:
2268         (WebKit::NetworkProcess::initializeNetworkProcess):
2269         * WebProcess/WebProcess.cpp:
2270         (WebKit::WebProcess::initializeWebProcess):
2271
2272 2016-03-03  Simon Fraser  <simon.fraser@apple.com>
2273
2274         Use larger tiles when possible to reduce per-tile painting overhead
2275         https://bugs.webkit.org/show_bug.cgi?id=154985
2276         rdar://problem/23635219
2277
2278         Reviewed by Tim Horton.
2279
2280         Do a bit of #include cleanup.
2281
2282         * Shared/mac/RemoteLayerBackingStore.mm:
2283         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2284         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
2285         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
2286
2287 2016-03-03  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2288
2289         Use std::make_unique<> when creating std::unique_ptr<>
2290         https://bugs.webkit.org/show_bug.cgi?id=154574
2291
2292         Reviewed by Darin Adler.
2293
2294         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2295         (WebKit::NetworkCache::Statistics::open):
2296         * NetworkProcess/cache/NetworkCacheStatistics.h:
2297         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2298         (WebKit::WebChromeClient::createColorChooser):
2299
2300 2016-03-03  Alex Christensen  <achristensen@webkit.org>
2301
2302         Move SPI to CFNetworkSPI.h
2303         https://bugs.webkit.org/show_bug.cgi?id=154992
2304
2305         Reviewed by Andy Estes.
2306
2307         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2308         (WebKit::applyBasicAuthorizationHeader):
2309
2310 2016-03-03  Alex Christensen  <achristensen@webkit.org>
2311
2312         Use CredentialStorage with NetworkSession
2313         https://bugs.webkit.org/show_bug.cgi?id=154939
2314
2315         Reviewed by Darin Adler.
2316
2317         * config.h:
2318         Added compile-time flag to help us be able to keep track and remove this code when we can.
2319         * NetworkProcess/NetworkDataTask.h:
2320         (WebKit::NetworkDataTask::pendingDownloadLocation):
2321         * NetworkProcess/NetworkProcess.cpp:
2322         (WebKit::NetworkProcess::clearCachedCredentials):
2323         (WebKit::NetworkProcess::ensurePrivateBrowsingSession):
2324         * NetworkProcess/NetworkSession.h:
2325         (WebKit::NetworkSession::sessionID):
2326         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2327         (WebKit::applyBasicAuthorizationHeader):
2328         (WebKit::NetworkDataTask::NetworkDataTask):
2329         Use a credential storage and preemptively apply basic authentication headers if we have credentials from the storage.
2330         This is analogous to code in ResourceHandle::createNSURLConnection.
2331         
2332         (WebKit::NetworkDataTask::didReceiveChallenge):
2333         Make this look more like ResourceHandle::didReceiveAuthenticationChallenge.
2334         The call to tryPasswordBasedAuthentication was moved from the delegate callback to here.
2335         
2336         (WebKit::NetworkDataTask::willPerformHTTPRedirection):
2337         Use credentials from the credential storage if they exist.  This is analogous to code in ResourceHandle::willSendRequest.
2338         
2339         (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
2340         Use credentials from the credential storage if they exist.  This is analogous to code in ResourceHandle::tryHandlePasswordBasedAuthentication.
2341         
2342         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2343         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
2344         If we are given a credential with CredentialPersistenceForSession, put it in the credential storage and give 
2345         CFNetwork a credential with CredentialPersistenceNone so it won't automatically be used again until the credential
2346         storage says its ok to use again.  This gives us the ability to clear session credentials when logout credentials are used.
2347         This is analogous to code in ResourceHandle::receivedCredential.
2348         
2349         (WebKit::NetworkSession::defaultSession):
2350         (WebKit::NetworkSession::NetworkSession):
2351         (WebKit::NetworkSession::~NetworkSession):
2352         (WebKit::NetworkSession::dataTaskForIdentifier):
2353         (WebKit::NetworkSession::clearCredentials): Deleted.
2354         * WebProcess/WebProcess.cpp:
2355         (WebKit::WebProcess::clearCachedCredentials):
2356         (WebKit::WebProcess::focusedWebPage):
2357         We no longer need to clear credentials from the NSURLSessions because we don't store session credentials in them.
2358         Instead, calling CredentialStorage.clearCredentials is sufficient.
2359
2360 2016-03-03  Andy Estes  <aestes@apple.com>
2361
2362         Adopt CFNetwork storage partitioning SPI
2363         https://bugs.webkit.org/show_bug.cgi?id=154957
2364         rdar://problem/23614620
2365
2366         Reviewed by Darin Adler.
2367
2368         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2369         (WebKit::NetworkDataTask::NetworkDataTask): Computed the storage partition identifier for the new session task.
2370         If non-empty, set it using a NSURLSessionTask SPI.
2371
2372 2016-03-03  Alex Christensen  <achristensen@webkit.org>
2373
2374         [WK2] testRunner.setPrivateBrowsingEnabled doesn't work with NetworkProcess
2375         https://bugs.webkit.org/show_bug.cgi?id=115274
2376
2377         Reviewed by Darin Adler.
2378
2379         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2380         (WebKit::NetworkConnectionToWebProcess::blobSize):
2381         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
2382         * NetworkProcess/NetworkConnectionToWebProcess.h:
2383         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2384         * NetworkProcess/NetworkProcess.h:
2385         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2386         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
2387         * WebProcess/WebProcess.cpp:
2388         (WebKit::WebProcess::destroyPrivateBrowsingSession):
2389         (WebKit::WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess):
2390         (WebKit::WebProcess::pluginProcessConnectionManager):
2391         * WebProcess/WebProcess.h:
2392
2393 2016-03-02  Alex Christensen  <achristensen@webkit.org>
2394
2395         Properly cancel downloads when using NetworkSession
2396         https://bugs.webkit.org/show_bug.cgi?id=154893
2397
2398         Reviewed by Brady Eidson.
2399
2400         * NetworkProcess/Downloads/Download.cpp:
2401         (WebKit::Download::Download):
2402         * NetworkProcess/Downloads/Download.h:
2403         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
2404         (WebKit::Download::cancel):
2405         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2406         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
2407
2408 2016-03-01  Ada Chan  <adachan@apple.com>
2409
2410         Update the media element's presentation mode properly after going in and out of full screen via the Full Screen API
2411         https://bugs.webkit.org/show_bug.cgi?id=154834
2412
2413         Reviewed by Simon Fraser.
2414
2415         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
2416         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
2417         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
2418         (WebKit::WebVideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode):
2419         Call the new exitFullscreenWithoutAnimationToMode() method on WebVideoFullscreenInterfaceMac.
2420         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2421         (WebKit::WebChromeClient::exitVideoFullscreenToModeWithoutAnimation):
2422         * WebProcess/WebCoreSupport/WebChromeClient.h:
2423         * WebProcess/cocoa/WebVideoFullscreenManager.h:
2424         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
2425         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation):
2426
2427 2016-03-02  Beth Dakin  <bdakin@apple.com>
2428
2429         Crashes in media tests after http://trac.webkit.org/changeset/197461
2430         https://bugs.webkit.org/show_bug.cgi?id=154933
2431
2432         Reviewed by Eric Carlson.
2433
2434         Since the controlsManagerInterface is not guaranteed to exist, it doesn't 
2435         make sense to return a reference. Return a pointer instead.
2436         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
2437         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
2438         (WebKit::WebVideoFullscreenManagerProxy::isVisible):
2439         (WebKit::WebVideoFullscreenManagerProxy::controlsManagerInterface):
2440         (WebKit::WebVideoFullscreenManagerProxy::fullscreenMayReturnToInline):
2441
2442 2016-03-02  Beth Dakin  <bdakin@apple.com>
2443
2444         Add support for playbackControlsManager
2445         https://bugs.webkit.org/show_bug.cgi?id=154742
2446         -and corresponding-
2447         rdar://problem/23833753
2448
2449         Reviewed by Jer Noble.
2450
2451         WebVideoFullscreenManagerProxy ensures the model and interface for the 
2452         UIProcess side of the playbackControlsManager. It also caches the 
2453         m_controlsManagerContextId so that it can return the 
2454         controlsManagerInterface.
2455         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
2456         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
2457         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
2458         (WebKit::WebVideoFullscreenManagerProxy::setUpVideoControlsManagerWithID):
2459         (WebKit::WebVideoFullscreenManagerProxy::controlsManagerInterface):
2460
2461         Pipe isPlayingMediaDidChange() to WebViewImpl, and use that information to 
2462         update WebViewImplAdditions.
2463         * UIProcess/Cocoa/WebViewImpl.h:
2464         * UIProcess/Cocoa/WebViewImpl.mm:
2465         (WebKit::WebViewImpl::isPlayingMediaDidChange):
2466         * UIProcess/PageClient.h:
2467         * UIProcess/WebPageProxy.cpp:
2468         (WebKit::WebPageProxy::isPlayingMediaDidChange):
2469         (WebKit::WebPageProxy::isPlayingVideoWithAudio):
2470         * UIProcess/WebPageProxy.h:
2471         (WebKit::WebPageProxy::isPlayingAudio):
2472         * UIProcess/mac/PageClientImpl.h:
2473         * UIProcess/mac/PageClientImpl.mm:
2474         (WebKit::PageClientImpl::isPlayingMediaDidChange):
2475
2476         Pipe setUpVideoControlsManager to the WebVideoFullscreenManager.
2477         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2478         (WebKit::WebChromeClient::setUpVideoControlsManager):
2479         * WebProcess/WebCoreSupport/WebChromeClient.h:
2480
2481         Ensure the model an interface for the playbackControlsManager on the 
2482         WebProcess side and pass the message to the UIProcess to do the same.
2483         * WebProcess/cocoa/WebVideoFullscreenManager.h:
2484         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
2485         (WebKit::WebVideoFullscreenManager::setUpVideoControlsManager):
2486
2487 2016-03-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2488
2489         REGRESSION(r197409): [GTK] Web process always crashes on WebPage construction after r197409
2490         https://bugs.webkit.org/show_bug.cgi?id=154918
2491
2492         Reviewed by Žan Doberšek.
2493
2494         We have an incorrect check in DrawingAreaImpl constructor that has
2495         never actually worked because it uses the page settings before
2496         they were initialized. But that has been fixed in r197409 and now
2497         we are always forcing accelerated compositing mode incorrectly,
2498         because m_alwaysUseCompositing is set in the constructor and never
2499         changed again.
2500
2501         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2502         (WebKit::DrawingAreaImpl::DrawingAreaImpl): Remove code to set
2503         settings and m_alwaysUseCompositing, since that should be done in
2504         updatePreferences().
2505         (WebKit::DrawingAreaImpl::updatePreferences): Update the settings
2506         accordingly and always update m_alwaysUseCompositing when AC is
2507         enabled and forced in the settings.
2508         * WebProcess/WebPage/WebPage.cpp:
2509         (WebKit::WebPage::WebPage): WebPage::updatePreferences() calls
2510         DrawingArea::updatePreferences(), but since r197409 it happens
2511         before the drawing area has been created. So, call
2512         DrawingArea::updatePreferences() in the constructor right after
2513         the main frame has been created, since
2514         DrawingArea::updatePreferences() uses the main frame.
2515
2516 2016-02-29  Ada Chan  <adachan@apple.com>
2517
2518         Adopt the new version of AVOutputDeviceMenuController's showMenuForRect method.
2519         https://bugs.webkit.org/show_bug.cgi?id=154823
2520
2521         Reviewed by Tim Horton.
2522
2523         * UIProcess/WebPageProxy.cpp:
2524         (WebKit::WebPageProxy::showPlaybackTargetPicker):
2525         (WebKit::WebPageProxy::customPlaybackActionSelected):
2526         * UIProcess/WebPageProxy.h:
2527         * UIProcess/WebPageProxy.messages.in:
2528         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2529         (WebKit::WebChromeClient::showPlaybackTargetPicker):
2530         * WebProcess/WebCoreSupport/WebChromeClient.h:
2531         * WebProcess/WebPage/WebPage.h:
2532         * WebProcess/WebPage/WebPage.messages.in:
2533         * WebProcess/WebPage/mac/WebPageMac.mm:
2534         (WebKit::WebPage::customPlaybackActionSelected):
2535
2536 2016-02-29  Brent Fulgham  <bfulgham@apple.com>
2537
2538         [WK2] Stub support for WebsiteDataTypeResourceLoadStatistics
2539         https://bugs.webkit.org/show_bug.cgi?id=154689
2540         <rdar://problem/24702576>
2541
2542         Reviewed by Sam Weinig.
2543
2544         * Shared/WebsiteData/WebsiteDataType.h: Add new WebsiteDataTypeResourceLoadStatistics.
2545         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
2546         (dataTypesToString): Handle new type.
2547         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
2548         (WebKit::toWebsiteDataTypes): Ditto.
2549         (WebKit::toWKWebsiteDataTypes): Ditto.
2550         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h: Add new _WebsiteDataTypeResourceLoadStatistics.
2551
2552 2016-03-01  Alex Christensen  <achristensen@webkit.org>
2553
2554         Correctly keep track of NetworkDataTasks with and without credentials when using NetworkSession
2555         https://bugs.webkit.org/show_bug.cgi?id=154876
2556
2557         Reviewed by Brady Eidson.
2558
2559         I was seeing an assertion failure from ASSERT(!m_session.m_dataTaskMap.contains(taskIdentifier()))
2560         in the NetworkDataTask constructor sometimes.  This is because a task identifier is not enough information
2561         to uniquely find a NetworkDataTask in a NetworkSession since r196034 because there are two NSURLSessions
2562         in a NetworkSession, one with credentials and one without.  The assertion would fire in a case like if we
2563         made the first NetworkDataTask with credentials (taskIdentifier is 1) and the first NetworkDataTask 
2564         without credentials before the first NetworkDataTask with credentials was finished.  In that case, the 
2565         taskIdentifier would also be 1, which would conflict with the other taskIdentifier.  That taskIdentifier
2566         would uniquely identify the task in the correct NSURLSession, though, so the solution is to keep a map
2567         for each NSURLSession in the NetworkSession.
2568
2569         * NetworkProcess/NetworkDataTask.h:
2570         * NetworkProcess/NetworkSession.h:
2571         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2572         (WebKit::NetworkDataTask::NetworkDataTask):
2573         (WebKit::NetworkDataTask::~NetworkDataTask):
2574         (WebKit::NetworkDataTask::suspend):
2575         (WebKit::serverTrustCredential):
2576         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2577         (-[WKNetworkSessionDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]):
2578         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
2579         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
2580         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
2581         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
2582         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
2583         (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
2584         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
2585         (WebKit::NetworkSession::clearCredentials):
2586         (WebKit::NetworkSession::dataTaskForIdentifier):
2587         (WebKit::NetworkSession::addDownloadID):
2588
2589 2016-03-01  Andreas Kling  <akling@apple.com>
2590
2591         REGRESSION (r154616): Accelerated drawing is off during the initial load
2592         <https://webkit.org/b/123812>
2593
2594         Reviewed by Tim Horton.
2595
2596         Load preferences before instantiating the first DrawingArea. This ensures that we do the
2597         initial paint using accelerated drawing, and avoids allocating persistent data structures
2598         only needed by the software rendering path.
2599
2600         * WebProcess/WebPage/WebPage.cpp:
2601
2602 2016-03-01  Alex Christensen  <achristensen@webkit.org>
2603
2604         Fix tests when using NetworkSession
2605         https://bugs.webkit.org/show_bug.cgi?id=154866
2606
2607         Reviewed by Brady Eidson.
2608
2609         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2610         (WebKit::globalCustomProtocolManager):
2611         (WebKit::NetworkSession::setCustomProtocolManager):
2612         
2613         Use a static NeverDestroyed instead of a local NeverDestroyed.
2614         This fix was suggested by Darin after I broke the custom protocol tests in r197362.
2615         
2616         (WebKit::NetworkSession::clearCredentials):
2617         
2618         In r197223 I added code that I thought cleared the credentials of a session, but it was
2619         actually trying (and failing) to remove the credentials from the NSURLCredentialStorage that
2620         were stored with NSURLCredentialPersistencePermanent.
2621         This was causing credentials stored in an NSURLSession with NSURLCredentialPersistenceForSession
2622         to remain for the next tests, and was causing credentials from previous tests, usually from
2623         http/tests/loading/basic-credentials-sent-automatically.html, to be used in future tests.
2624         Creating a new NSURLSession is the equivalent of CredentialStorage::clearCredentials because it
2625         removes all credentials stored with NSURLCredentialPersistenceForSession.
2626
2627 2016-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2628
2629         NetworkCache: Web process leaks resource buffer when using shareable reasources
2630         https://bugs.webkit.org/show_bug.cgi?id=154852
2631
2632         Reviewed by Darin Adler.
2633
2634         ResourceLoader::didReceiveBuffer() expects a PassRefPtr, but we
2635         are passing a raw pointer making PassRefPtr to take another
2636         reference instead of transfering the ownership as expected.
2637
2638         * WebProcess/Network/WebResourceLoader.cpp:
2639         (WebKit::WebResourceLoader::didReceiveResource):
2640
2641 2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
2642
2643         ThreadedCompositor: clean up composition-specific resources before shutting down the thread
2644         https://bugs.webkit.org/show_bug.cgi?id=154793
2645
2646         Reviewed by Carlos Garcia Campos.
2647
2648         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2649         (WebKit::ThreadedCompositor::runCompositingThread): Before concluding the
2650         compositing thread run, clean up all the resources that were allocated at
2651         the start, and in the reverse order. Specifically, we now also deallocate
2652         the CoordinatedGraphicsScene and the SimpleViewportController objects. This
2653         way these are not deallocated on the main thread when the ThreadedCompositor
2654         destructor would otherwise clean them up.
2655
2656 2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
2657
2658         ThreadSafeCoordinatedSurface: remove the unused private create() static method
2659         https://bugs.webkit.org/show_bug.cgi?id=154792
2660
2661         Reviewed by Carlos Garcia Campos.
2662
2663         Remove the static ThreadSafeCoordinatedSurface::create() method that accepted
2664         a std::unique_ptr<ImageBuffer> object as its third parameter. This was not used
2665         anywhere.
2666
2667         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp:
2668         (WebKit::ThreadSafeCoordinatedSurface::create): Deleted.
2669         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.h:
2670
2671 2016-02-29  Simon Fraser  <simon.fraser@apple.com>
2672
2673         Remove the experimental feature of antialiased font dilation
2674         https://bugs.webkit.org/show_bug.cgi?id=154843
2675
2676         Reviewed by Zalan Bujtas.
2677
2678         Remove the "antialiased font dilation" code path, and related prefs.
2679
2680         * Shared/WebPreferencesDefinitions.h:
2681         * UIProcess/API/C/WKPreferences.cpp:
2682         (WKPreferencesSetAntialiasedFontDilationEnabled):
2683         (WKPreferencesGetAntialiasedFontDilationEnabled):
2684         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2685         * UIProcess/API/Cocoa/WKPreferences.mm:
2686         (-[WKPreferences _antialiasedFontDilationEnabled]): Deleted.
2687         (-[WKPreferences _setAntialiasedFontDilationEnabled:]): Deleted.
2688         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2689         * WebProcess/WebPage/WebPage.cpp:
2690         (WebKit::WebPage::updatePreferences): Deleted.
2691
2692 2016-02-29  Brady Eidson  <beidson@apple.com>
2693
2694         Modern IDB: WebKit 2 IPC layer easily confused about multiple web processes being connected.
2695         https://bugs.webkit.org/show_bug.cgi?id=154837
2696
2697         Reviewed by Alex Christensen.
2698
2699         The crux of the bug is that WebProcesses cannot assign themselves server-unique identifiers...
2700         The server must do that for them.
2701         
2702         A once-per-session-per-WebProcess sync message and a few updates to connection management fix this.
2703         
2704         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
2705         (WebKit::DatabaseToWebProcessConnection::didReceiveSyncMessage):
2706         (WebKit::generateConnectionToServerIdentifier):
2707         (WebKit::DatabaseToWebProcessConnection::establishIDBConnectionToServer):
2708         * DatabaseProcess/DatabaseToWebProcessConnection.h:
2709         * DatabaseProcess/DatabaseToWebProcessConnection.messages.in:
2710
2711         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2712         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
2713         (WebKit::generateConnectionToServerIdentifier): Deleted.
2714
2715         * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
2716         (WebKit::WebToDatabaseProcessConnection::didReceiveMessage):
2717         (WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession):
2718         * WebProcess/Databases/WebToDatabaseProcessConnection.h:
2719
2720 2016-02-29  Alex Christensen  <achristensen@webkit.org>
2721
2722         Don't call NetworkProcess::singleton from WebProcess when using NetworkSession
2723         https://bugs.webkit.org/show_bug.cgi?id=154829
2724
2725         Reviewed by Anders Carlsson.
2726
2727         We were calling NetworkProcess::singleton when making the default session in the 
2728         WebProcess, which caused bad things to happen.  We also were never clearing the 
2729         credentials in the WebProcess between tests because it used to always call
2730         NetworkProcess::singleton, which caused flaky tests.
2731
2732         This fixes repeatable crashes in http/tests/media/media-document-referer.html and 
2733         http/tests/media/media-document.html when using NetworkSession.
2734
2735         * NetworkProcess/NetworkProcess.cpp:
2736         (WebKit::NetworkProcess::NetworkProcess):
2737         (WebKit::NetworkProcess::~NetworkProcess):
2738         * NetworkProcess/NetworkSession.h:
2739         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2740         (WebKit::configurationForType):
2741         (WebKit::globalCustomProtocolManager):
2742         (WebKit::NetworkSession::setCustomProtocolManager):
2743         (WebKit::NetworkSession::defaultSession):
2744         * WebProcess/WebProcess.cpp:
2745         (WebKit::WebProcess::clearCachedCredentials):
2746
2747 2016-02-29  Gavin Barraclough  <barraclough@apple.com>
2748
2749         RefCounter<T>::Event -> RefCounterEvent
2750         https://bugs.webkit.org/show_bug.cgi?id=154767
2751
2752         Reviewed by Darin Adler.
2753
2754         RefCounter<T>::Event is kinda verbose to use, and there is no need for this
2755         to be specific to a particular typeof RefCounter. Move the enum class up to
2756         the top level & rename to RefCounterEvent.
2757
2758         Also remove UserObservablePageToken - this is vestigial & not really offering
2759         anything over just using UserObservablePageCounter::Token directly.
2760
2761         * UIProcess/Plugins/PluginProcessManager.cpp:
2762         (WebKit::PluginProcessManager::PluginProcessManager):
2763         * UIProcess/Plugins/PluginProcessManager.h:
2764         * UIProcess/Plugins/mac/PluginProcessManagerMac.mm:
2765         (WebKit::PluginProcessManager::updateProcessSuppressionDisabled):
2766         * UIProcess/ProcessThrottler.cpp:
2767         (WebKit::ProcessThrottler::ProcessThrottler):
2768         (WebKit::m_backgroundCounter):
2769         (WebKit::m_suspendMessageCount):
2770         * UIProcess/ProcessThrottler.h:
2771         * UIProcess/WebPageProxy.h:
2772         * UIProcess/WebProcessPool.cpp:
2773         (WebKit::WebProcessPool::WebProcessPool):
2774         (WebKit::m_processSuppressionDisabledForPageCounter):
2775         (WebKit::m_hiddenPageThrottlingAutoIncreasesCounter):
2776         * UIProcess/WebProcessPool.h:
2777
2778 2016-02-29  Konstantin Tokarev  <annulen@yandex.ru>
2779
2780         Fixed compilation with !ENABLE(DATABASE_PROCESS).
2781         https://bugs.webkit.org/show_bug.cgi?id=154813
2782
2783         Reviewed by Michael Catanzaro.
2784
2785         * UIProcess/WebProcessPool.cpp:
2786         (WebKit::WebProcessPool::terminateDatabaseProcess): Added missing #if
2787         guard.
2788
2789 2016-02-29  Adrien Plazas  <aplazas@igalia.com>
2790
2791         [GTK] Touch slider test fails due to assertion in webkitWebViewBaseTouchEvent()
2792         https://bugs.webkit.org/show_bug.cgi?id=153829
2793
2794         Reviewed by Carlos Garcia Campos.
2795
2796         Once a touch event sequence is identified as a gesture, remove it
2797         from the list of handled touch events.
2798
2799         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2800         (webkitWebViewBaseTouchEvent):
2801
2802 2016-02-29  Csaba Osztrogonác  <ossy@webkit.org>
2803
2804         [Mac][cmake] Unreviewed buildfix after r197177. Just for fun.
2805
2806         * PlatformMac.cmake:
2807
2808 2016-02-28  Sam Weinig  <sam@webkit.org>
2809
2810         Reimplement WKPageGroup in terms of WKUserContentController
2811         https://bugs.webkit.org/show_bug.cgi?id=154804
2812
2813         Reviewed by Dan Bernstein.
2814
2815         Instead of having both WebPageGroup and WebUserContentControllerProxy both keep track
2816         of user scripts and user stylesheets, give WebPageGroup a WebUserContentControllerProxy
2817         and let it take care of things. This allows us to remove a ton of duplicate code, and
2818         provides a convenient way for clients currently using PageGroup based user content insertion
2819         to start using UserContentController, since they can now be used at the same time.
2820
2821         When using WKPageConfigurationRef, the rule is:
2822             - If you don't set a WKUserContentControllerRef, the one from the WKPageGroupRef will be used.
2823             - If you do set a WKUserContentControllerRef, it will be used, and the one from the WKPageGroupRef
2824               will do nothing for that web view.
2825
2826         * DerivedSources.make:
2827         Remove WebPageGroupProxy. It no longer is a MessageReceiver.
2828
2829         * Shared/WebPageGroupData.cpp:
2830         (WebKit::WebPageGroupData::encode):
2831         (WebKit::WebPageGroupData::decode):
2832         * Shared/WebPageGroupData.h:
2833         Stop encoding/decoding user content, instead just encode the identifier to the UserContentController.
2834
2835         * UIProcess/API/C/WKPageGroup.cpp:
2836         (WKPageGroupGetUserContentController):
2837         * UIProcess/API/C/WKPageGroup.h:
2838         Add getter for the underlying WKUserContentControllerRef.
2839
2840         * UIProcess/API/cpp/WKRetainPtr.h:
2841         (WebKit::retainWK):
2842         Add retainWK() helper to match RetainPtr's retainPtr() helper.
2843
2844         * UIProcess/WebPageGroup.cpp:
2845         (WebKit::WebPageGroup::WebPageGroup):
2846         (WebKit::WebPageGroup::userContentController):
2847         (WebKit::WebPageGroup::addUserStyleSheet):
2848         (WebKit::WebPageGroup::addUserScript):
2849         (WebKit::WebPageGroup::removeAllUserStyleSheets):
2850         (WebKit::WebPageGroup::removeAllUserScripts):
2851         (WebKit::WebPageGroup::removeAllUserContent):
2852         (WebKit::WebPageGroup::addUserContentExtension):
2853         (WebKit::WebPageGroup::removeUserContentExtension):
2854         (WebKit::WebPageGroup::removeAllUserContentExtensions):
2855         * UIProcess/WebPageGroup.h:
2856         Pass through to the WebUserContentControllerProxy.
2857
2858         * UIProcess/WebPageProxy.cpp:
2859         (WebKit::WebPageProxy::WebPageProxy):
2860         (WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch):
2861         (WebKit::WebPageProxy::creationParameters):
2862         * UIProcess/WebPageProxy.h:
2863         WebPageProxies always have a WebUserContentControllerProxy now, so it can go in a Ref and
2864         a few branches can be removed.
2865
2866         * UIProcess/WebProcessPool.cpp:
2867         (WebKit::WebProcessPool::createWebPage):
2868         If a UserContentController is not passed in, use the one from the PageGroup.
2869
2870         * WebKit2.xcodeproj/project.pbxproj:
2871         Remove files.
2872
2873         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2874         Add some #includes that are now needed.
2875
2876         * WebProcess/UserContent/WebUserContentController.cpp:
2877         (WebKit::WebUserContentController::getOrCreate):
2878         * WebProcess/UserContent/WebUserContentController.h:
2879         Modernize WebUserContentController::getOrCreate to return a Ref.
2880
2881         * WebProcess/WebPage/WebPage.cpp:
2882         (WebKit::WebPage::WebPage):
2883         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
2884         (WebKit::WebPage::addUserScript):
2885         (WebKit::WebPage::addUserStyleSheet):
2886         (WebKit::WebPage::removeAllUserContent):
2887         * WebProcess/WebPage/WebPage.h:
2888         Store the WebUserContentController in Ref, remove unnecessary branches/asserts.
2889
2890         * WebProcess/WebPage/WebPageGroupProxy.cpp:
2891         (WebKit::WebPageGroupProxy::WebPageGroupProxy):
2892         (WebKit::WebPageGroupProxy::~WebPageGroupProxy):
2893         (WebKit::WebPageGroupProxy::userContentController):
2894         (WebKit::WebPageGroupProxy::addUserStyleSheet): Deleted.
2895         (WebKit::WebPageGroupProxy::addUserScript): Deleted.
2896         (WebKit::WebPageGroupProxy::removeAllUserStyleSheets): Deleted.
2897         (WebKit::WebPageGroupProxy::removeAllUserScripts): Deleted.
2898         (WebKit::WebPageGroupProxy::removeAllUserContent): Deleted.
2899         (WebKit::WebPageGroupProxy::addUserContentExtension): Deleted.
2900         (WebKit::WebPageGroupProxy::removeUserContentExtension): Deleted.
2901         (WebKit::WebPageGroupProxy::removeAllUserContentExtensions): Deleted.
2902         * WebProcess/WebPage/WebPageGroupProxy.h:
2903         Store a WebUserContentController in a Ref, remove now unnecessary message handling functions.
2904
2905         * WebProcess/WebPage/WebPageGroupProxy.messages.in:
2906         Removed.
2907
2908         * WebProcess/WebProcess.cpp:
2909         (WebKit::WebProcess::didReceiveMessage):
2910         Remove routing to WebPageGroupProxy, which is no longer a MessageReceiver.
2911
2912 2016-02-28  Sam Weinig  <sam@webkit.org>
2913
2914         Bind _WKUserStyleSheets to _WKUserContentWorlds to allow for grouping of user content by associating to a world
2915         https://bugs.webkit.org/show_bug.cgi?id=154798
2916
2917         Reviewed by Dan Bernstein.
2918
2919         Treat _WKUserStyleSheets like WKUserScripts and allow them to be bound to a _WKUserContentWorld.
2920         The immediate benefit of this is allowing a client to bind a set of user content (scripts and stylesheets
2921         for now) to a world and have them easily remove all user content associated with that world easily.
2922
2923         * Shared/API/APIArray.h:
2924         Add helpers removeAllMatching and removeAllOfTypeMatching.
2925
2926         * UIProcess/API/APIUserStyleSheet.h:
2927         Add API::UserContentWorld member.
2928
2929         * UIProcess/API/Cocoa/WKUserContentController.mm:
2930         (-[WKUserContentController _removeAllUserScriptsAssociatedWithUserContentWorld:]):
2931         (-[WKUserContentController _removeAllUserStyleSheetsAssociatedWithUserContentWorld:]):
2932         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
2933         Add _removeAllUserScriptsAssociatedWithUserContentWorld and _removeAllUserStyleSheetsAssociatedWithUserContentWorld.
2934
2935         * UIProcess/API/Cocoa/WKUserScript.mm:
2936         (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
2937         (toStringVector): Deleted.
2938         * UIProcess/API/Cocoa/_WKUserContentWorldInternal.h:
2939         (API::toStringVector):
2940         Move toStringVector to a location where it can be shared.
2941
2942         * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
2943         * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
2944         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
2945         Add new initializer which has a world to be bound to. While here, match WKUserScript and add support for the 
2946         legacy whitelist and blacklists.
2947
2948         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2949         (WebKit::WebUserContentControllerProxy::addProcess):
2950         (WebKit::WebUserContentControllerProxy::removeProcess):
2951         (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
2952         (WebKit::WebUserContentControllerProxy::shouldSendRemoveUserContentWorldsMessage):
2953         (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
2954         (WebKit::WebUserContentControllerProxy::addUserScript):
2955         (WebKit::WebUserContentControllerProxy::removeUserScript):
2956         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
2957         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
2958         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
2959         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
2960         * UIProcess/UserContent/WebUserContentControllerProxy.h:
2961         Refactor to share the code which decides whether to send AddUserContentWorlds/RemoveUserContentWorlds
2962         messages.
2963
2964         * WebProcess/UserContent/WebUserContentController.cpp:
2965         (WebKit::WebUserContentController::addUserContentWorlds):
2966         (WebKit::WebUserContentController::removeUserContentWorlds):
2967         (WebKit::WebUserContentController::addUserScripts):
2968         (WebKit::WebUserContentController::removeUserScript):
2969         (WebKit::WebUserContentController::removeAllUserScripts):
2970         (WebKit::WebUserContentController::addUserStyleSheets):
2971         (WebKit::WebUserContentController::removeUserStyleSheet):
2972         (WebKit::WebUserContentController::removeAllUserStyleSheets):
2973         * WebProcess/UserContent/WebUserContentController.h:
2974         * WebProcess/UserContent/WebUserContentController.messages.in:
2975         Add support for binding stylesheets to worlds and allow removing all the scripts/stylesheets from a 
2976         set of worlds at once by passing Vectors of world identifiers in the remove messages.
2977
2978 2016-02-27  Commit Queue  <commit-queue@webkit.org>
2979
2980         Unreviewed, rolling out r197204, r197207, r197211, r197217,
2981         r197218, and r197219.
2982         https://bugs.webkit.org/show_bug.cgi?id=154780
2983
2984         Caused crashes in WebVideoFullscreenManagerProxy (Requested by
2985         ap on #webkit).
2986
2987         Reverted changesets:
2988
2989         "Add support for playbackControlsManager"
2990         https://bugs.webkit.org/show_bug.cgi?id=154742
2991         http://trac.webkit.org/changeset/197204
2992
2993         "Attempted build fix."
2994         http://trac.webkit.org/changeset/197207
2995
2996         "Attempted build fix."
2997         http://trac.webkit.org/changeset/197211
2998
2999         "Attempted 32-bit build fix."
3000         http://trac.webkit.org/changeset/197217
3001
3002         "Another 32-bit build fix."
3003         http://trac.webkit.org/changeset/197218
3004
3005         "32-bit!!!"
3006         http://trac.webkit.org/changeset/197219
3007
3008 2016-02-26  Carlos Garcia Campos  <cgarcia@igalia.com>
3009
3010         Unreviewed. Fix GTK+ clean build.
3011
3012         Add missing header include.
3013
3014         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3015
3016 2016-02-26  Carlos Garcia Campos  <cgarcia@igalia.com>
3017
3018         Network cache: old pages returned by disk cache on history navigation after session is restored
3019         https://bugs.webkit.org/show_bug.cgi?id=153230
3020
3021         Reviewed by Chris Dumez.
3022
3023         Since r181734, the network cache never revalidates resources for
3024         history navigation. This is good for the memory cache, but in the
3025         case of disk cache, we might end up with outdated pages when
3026         restoring the session. When restoring the session happens because
3027         of an API request (we also restore the session when recovering
3028         from a web process crash), we should revalidate back forward list
3029         requests in the disk cache if needed. This will only happen the
3030         first time they are loaded after a session restore. After a web process
3031         crash, resources will be used uncondionally from the disk cache.
3032
3033         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3034         (WebKit::WebBackForwardListProxy::addItemFromUIProcess): Use Ref&&
3035         instead of PassRefPtr.
3036         * WebProcess/WebPage/WebBackForwardListProxy.h:
3037         * WebProcess/WebPage/WebPage.cpp:
3038         (WebKit::WePage::WebPage): Call restoreSessionInternal passing
3039         No as restoredByAPIRequest parameter.
3040         (WebKit::WebPage::restoreSessionInternal): Set restoredFromSession
3041         flag to the created HistoryItem if the item was restored from
3042         session by an API request.
3043         (WebKit::WebPage::restoreSession): Call restoreSessionInternal
3044         passing Yes as restoredByAPIRequest parameter.
3045         * WebProcess/WebPage/WebPage.h:
3046
3047 2016-02-26  Michael Catanzaro  <mcatanzaro@igalia.com>
3048
3049         Fix a typo.
3050
3051         Unreviewed. Shame I didn't notice in the previous commit.
3052
3053         * WebProcess/UserContent/WebUserContentController.cpp:
3054         (WebKit::WebUserContentController::removeUserContentWorld):
3055
3056 2016-02-26  Michael Catanzaro  <mcatanzaro@igalia.com>
3057
3058         Fix GTK and maybe EFL build after r197172.
3059
3060         Unreviewed.
3061
3062         * CMakeLists.txt:
3063         * UIProcess/API/gtk/WebKitUserContent.cpp:
3064         (_WebKitUserScript::_WebKitUserScript):
3065         * WebProcess/UserContent/WebUserContentController.cpp:
3066         (WebKit::WebUserContentController::removeUserContentWorld):
3067         (WebKit::WebUserContentController::addUserScripts):
3068         (WebKit::WebUserContentController::removeUserScript):
3069         (WebKit::WebUserContentController::removeAllUserScripts):
3070
3071 2016-02-26  Michael Catanzaro  <mcatanzaro@igalia.com>
3072
3073         [GTK] Fix order of parameters in gtkdoc for webkit_web_view_get_snapshot
3074
3075         Unreviewed.
3076
3077         * UIProcess/API/gtk/WebKitWebView.cpp:
3078
3079 2016-02-26  Brady Eidson  <beidson@apple.com>
3080
3081         Modern IDB: New database versions are never committed to SQLite.
3082         <rdar://problem/24860952> and https://bugs.webkit.org/show_bug.cgi?id=154741
3083         
3084         Modern IDB: If a database handle is not open, files are not actually deleted from disk
3085         https://bugs.webkit.org/show_bug.cgi?id=154756
3086
3087         Reviewed by Alex Christensen.
3088
3089         Add WK2 SPI to force termination of the database process.
3090
3091         * UIProcess/API/Cocoa/WKProcessPool.mm:
3092         (-[WKProcessPool _terminateDatabaseProcess]):
3093         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3094         * UIProcess/WebProcessPool.cpp:
3095         (WebKit::WebProcessPool::terminateDatabaseProcess):
3096         * UIProcess/WebProcessPool.h:
3097
3098 2016-02-26  Alex Christensen  <achristensen@webkit.org>
3099
3100         Clear credentials and prevent unauthorized credential storage when using NetworkSession
3101         https://bugs.webkit.org/show_bug.cgi?id=154755
3102
3103         Reviewed by Brady Eidson.
3104
3105         Credentials from previous tests were being used sometimes, notably in 
3106         http/tests/misc/401-alternative-content.php when running multiple credential-based
3107         tests with the same WebKitTestRunner.
3108
3109         * NetworkProcess/NetworkDataTask.h:
3110         * NetworkProcess/NetworkProcess.cpp:
3111         (WebKit::NetworkProcess::clearCachedCredentials):
3112         (WebKit::NetworkProcess::ensurePrivateBrowsingSession):
3113         * NetworkProcess/NetworkSession.h:
3114         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3115         (WebKit::NetworkDataTask::NetworkDataTask):
3116         (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
3117         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3118         (WebKit::NetworkSession::~NetworkSession):
3119         (WebKit::NetworkSession::clearCredentials):
3120         (WebKit::NetworkSession::dataTaskForIdentifier):
3121
3122 2016-02-26  Gavin Barraclough  <barraclough@apple.com>
3123
3124         Page TimerAlignmentIntervalIncrease mechanism should have upper limit
3125         https://bugs.webkit.org/show_bug.cgi?id=154744
3126
3127         Reviewed by Geoff Garen.
3128
3129         There would be diminishing returns from throttling timers in background pages infinitely.
3130         Add a heuristic to limit appropriately.
3131
3132         The flow of data here is WebPageProxy informs WebProcessPool of the number of pages
3133         participating in this mechanism, WebProcessPool computes an apropriate limit and pushes
3134         this out to the WebProcesses, which in turn update each of their pages.
3135
3136         * UIProcess/WebPageProxy.cpp:
3137         (WebKit::WebPageProxy::WebPageProxy):
3138             - Call updateHidenPageThrottingAutoIncreases on creation.
3139         (WebKit::WebPageProxy::updateHidenPageThrottingAutoIncreases):
3140             - If increasing timer throttling is enabled increment the counter on WebProcessPool.
3141         (WebKit::WebPageProxy::preferencesDidChange):
3142             - Call updateHidenPageThrottingAutoIncreases on preferences change.
3143         * UIProcess/WebPageProxy.h:
3144         * UIProcess/WebProcessPool.cpp:
3145         (WebKit::WebProcessPool::WebProcessPool):
3146             - initialize new RefCounter.
3147         (WebKit::WebProcessPool::updateHidenPageThrottingAutoIncreaseLimit):
3148             - When count of participating pages changes, update the limit.
3149         * UIProcess/WebProcessPool.h:
3150         * WebProcess/WebPage/WebPage.h:
3151         (WebKit::WebPage::setHiddenPageTimerThrottlingIncreaseLimit):
3152             - Propagate limit to WebCore::Page.
3153         * WebProcess/WebProcess.cpp:
3154         (WebKit::WebProcess::setHiddenPageTimerThrottlingIncreaseLimit):
3155             - Propagate limit to WebPages.
3156         * WebProcess/WebProcess.h:
3157         * WebProcess/WebProcess.messages.in:
3158             - Added new message.
3159
3160 2016-02-26  Beth Dakin  <bdakin@apple.com>
3161
3162         Attempted build fix.
3163
3164         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
3165         (WebKit::WebVideoFullscreenManagerProxy::setUpVideoControlsManagerWithID):
3166         (WebKit::WebVideoFullscreenManagerProxy::resetMediaState):
3167
3168 2016-02-26  Anders Carlsson  <andersca@apple.com>
3169
3170         Fix Yosemite build.
3171
3172         * UIProcess/API/Cocoa/_WKWebsiteDataSize.mm:
3173         (-[_WKWebsiteDataSize sizeOfDataTypes:]):
3174
3175 2016-02-26  Beth Dakin  <bdakin@apple.com>
3176
3177         Add support for playbackControlsManager
3178         https://bugs.webkit.org/show_bug.cgi?id=154742
3179         -and corresponding-
3180         rdar://problem/23833753
3181
3182         Reviewed by Jer Noble.
3183
3184         WebVideoFullscreenManagerProxy ensures the model and interface for the 
3185         UIProcess side of the playbackControlsManager. It also caches the 
3186         m_controlsManagerContextId so that it can return the 
3187         controlsManagerInterface.
3188         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
3189         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
3190         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
3191         (WebKit::WebVideoFullscreenManagerProxy::setUpVideoControlsManagerWithID):
3192         (WebKit::WebVideoFullscreenManagerProxy::controlsManagerInterface):
3193
3194         Pipe isPlayingMediaDidChange() to WebViewImpl, and use that information to 
3195         update WebViewImplAdditions.
3196         * UIProcess/Cocoa/WebViewImpl.h:
3197         * UIProcess/Cocoa/WebViewImpl.mm:
3198         (WebKit::WebViewImpl::isPlayingMediaDidChange):
3199         * UIProcess/PageClient.h:
3200         * UIProcess/WebPageProxy.cpp:
3201         (WebKit::WebPageProxy::isPlayingMediaDidChange):
3202         (WebKit::WebPageProxy::isPlayingVideoWithAudio):
3203         * UIProcess/WebPageProxy.h:
3204         (WebKit::WebPageProxy::isPlayingAudio):
3205         * UIProcess/mac/PageClientImpl.h:
3206         * UIProcess/mac/PageClientImpl.mm:
3207         (WebKit::PageClientImpl::isPlayingMediaDidChange):
3208
3209         Pipe setUpVideoControlsManager to the WebVideoFullscreenManager.
3210         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3211         (WebKit::WebChromeClient::setUpVideoControlsManager):
3212         * WebProcess/WebCoreSupport/WebChromeClient.h:
3213
3214         Ensure the model an interface for the playbackControlsManager on the 
3215         WebProcess side and pass the message to the UIProcess to do the same.
3216         * WebProcess/cocoa/WebVideoFullscreenManager.h:
3217         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
3218         (WebKit::WebVideoFullscreenManager::setUpVideoControlsManager):
3219
3220 2016-02-26  Anders Carlsson  <andersca@apple.com>
3221
3222         WKWebsiteDataStore/WKWebsiteDataRecord needs to provide size information about each type of data
3223         https://bugs.webkit.org/show_bug.cgi?id=154750
3224
3225         Reviewed by Tim Horton.
3226
3227         * DatabaseProcess/DatabaseProcess.cpp:
3228         (WebKit::DatabaseProcess::fetchWebsiteData):
3229         WebsiteData::Entry now takes a size.
3230
3231         * NetworkProcess/NetworkProcess.cpp:
3232         (WebKit::fetchDiskCacheEntries):
3233         If necessary, compute sizes.
3234
3235         (WebKit::NetworkProcess::fetchWebsiteData):
3236         Just pass 0 for the CF cache for now.
3237
3238         * NetworkProcess/NetworkProcess.h:
3239         * NetworkProcess/NetworkProcess.messages.in:
3240         FetchWebsiteData now takes a OptionSet<WebsiteDataFetchOption>.
3241
3242         * Shared/WebsiteData/WebsiteData.cpp:
3243         (WebKit::WebsiteData::Entry::encode):
3244         (WebKit::WebsiteData::Entry::decode):
3245         Encode and decode the size.
3246
3247         * Shared/WebsiteData/WebsiteData.h:
3248         Add size.
3249
3250         * Shared/WebsiteData/WebsiteDataFetchOption.h:
3251         Add new enum.
3252
3253         * UIProcess/API/C/WKApplicationCacheManager.cpp:
3254         (WKApplicationCacheManagerGetApplicationCacheOrigins):
3255         Pass an empty OptionSet<WebsiteDataFetchOption>.
3256
3257         * UIProcess/API/C/WKResourceCacheManager.cpp:
3258         (WKResourceCacheManagerGetCacheOrigins):
3259         Pass an empty OptionSet<WebsiteDataFetchOption>.
3260
3261         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
3262         (-[WKWebsiteDataRecord description]):
3263         If we have a size, print it out as well.
3264
3265         (-[WKWebsiteDataRecord _dataSize]):
3266         Return a size if we have one.
3267
3268         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
3269         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3270         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
3271         Call through to the SPI.
3272
3273         (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
3274         Compute the right options.
3275
3276         * UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h:
3277         Import WKWebsiteDataStorePrivate.h.
3278
3279         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3280         Add SPI.
3281
3282         * UIProcess/API/Cocoa/_WKWebsiteDataSize.h:
3283         * UIProcess/API/Cocoa/_WKWebsiteDataSize.mm:
3284         (-[_WKWebsiteDataSize initWithSize:]):
3285         (-[_WKWebsiteDataSize totalSize]):
3286         (-[_WKWebsiteDataSize sizeOfDataTypes:]):
3287         Add _WKWebsiteDataSize header.
3288
3289         * UIProcess/API/Cocoa/_WKWebsiteDataSizeInternal.h: Add IPI header.
3290
3291         * UIProcess/Network/NetworkProcessProxy.cpp:
3292         (WebKit::NetworkProcessProxy::fetchWebsiteData):
3293         This now takes a OptionSet<WebsiteDataFetchOption>.
3294
3295         * UIProcess/Network/NetworkProcessProxy.h:
3296         Update members.
3297
3298         * UIProcess/WebsiteData/WebsiteDataRecord.h:
3299         Add a hash map from types to sizes.
3300
3301         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3302         (WebKit::WebsiteDataStore::fetchData):
3303         This now takes a OptionSet<WebsiteDataFetchOption>.
3304
3305         * UIProcess/WebsiteData/WebsiteDataStore.h:
3306         Update member functions.
3307
3308         * WebKit2.xcodeproj/project.pbxproj:
3309         Add new files.
3310
3311         * WebProcess/WebProcess.cpp:
3312         (WebKit::WebProcess::fetchWebsiteData):
3313         This now takes a OptionSet<WebsiteDataFetchOption>.
3314
3315 2016-02-26  Anders Carlsson  <andersca@apple.com>
3316
3317         Add a toWebsiteDataType and reimplement toWebsiteDataTypes using it
3318         https://bugs.webkit.org/show_bug.cgi?id=154746
3319
3320         Reviewed by Sam Weinig.
3321
3322         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
3323         (WebKit::toWebsiteDataType):
3324         (WebKit::toWebsiteDataTypes):
3325         (WebKit::toWKWebsiteDataTypes):
3326
3327 2016-02-26  Anders Carlsson  <andersca@apple.com>
3328
3329         Add WTF::OptionSet and use it for the website data types enum
3330         https://bugs.webkit.org/show_bug.cgi?id=154733
3331
3332         Reviewed by Geoffrey Garen.
3333
3334         This is a pretty mechanical change:
3335         
3336         Convert all uses of the WebsiteDataTypes enum to WTF::OptionSet. Rename the WebsiteDataTypes enum to
3337         WebsiteDataType (since it only represents a single data type), and rename headers. Encode and decode WTF::OptionSet properly.
3338
3339         * DatabaseProcess/DatabaseProcess.cpp:
3340         (WebKit::DatabaseProcess::fetchWebsiteData):
3341         (WebKit::DatabaseProcess::deleteWebsiteData):
3342         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
3343         * DatabaseProcess/DatabaseProcess.h:
3344         * DatabaseProcess/DatabaseProcess.messages.in:
3345         * NetworkProcess/NetworkProcess.cpp:
3346         (WebKit::fetchDiskCacheEntries):
3347         (WebKit::NetworkProcess::fetchWebsiteData):
3348         (WebKit::NetworkProcess::deleteWebsiteData):
3349         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
3350         * NetworkProcess/NetworkProcess.h:
3351         * NetworkProcess/NetworkProcess.messages.in:
3352         * Platform/IPC/ArgumentCoders.h:
3353         (IPC::ArgumentCoder<OptionSet<T>>::encode):
3354         (IPC::ArgumentCoder<OptionSet<T>>::decode):
3355         * Scripts/webkit/messages.py:
3356         (class_template_headers):
3357         * Shared/WebsiteData/WebsiteData.h:
3358         * Shared/WebsiteData/WebsiteDataType.h: Renamed from Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h.
3359         * UIProcess/API/C/WKApplicationCacheManager.cpp:
3360         (WKApplicationCacheManagerGetApplicationCacheOrigins):
3361         (WKApplicationCacheManagerDeleteEntriesForOrigin):
3362         (WKApplicationCacheManagerDeleteAllEntries):
3363         * UIProcess/API/C/WKResourceCacheManager.cpp:
3364         (toWebsiteDataTypes):
3365         (WKResourceCacheManagerClearCacheForOrigin):
3366         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
3367         (WebKit::toWebsiteDataTypes):
3368         (WebKit::toWKWebsiteDataTypes):
3369         * UIProcess/Databases/DatabaseProcessProxy.cpp:
3370         (WebKit::DatabaseProcessProxy::fetchWebsiteData):
3371         (WebKit::DatabaseProcessProxy::deleteWebsiteData):
3372         (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins):
3373         * UIProcess/Databases/DatabaseProcessProxy.h:
3374         * UIProcess/Network/NetworkProcessProxy.cpp:
3375         (WebKit::NetworkProcessProxy::fetchWebsiteData):
3376         (WebKit::NetworkProcessProxy::deleteWebsiteData):
3377         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
3378         * UIProcess/Network/NetworkProcessProxy.h:
3379         * UIProcess/WebProcessProxy.cpp:
3380         (WebKit::WebProcessProxy::fetchWebsiteData):
3381         (WebKit::WebProcessProxy::deleteWebsiteData):
3382         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
3383         * UIProcess/WebProcessProxy.h:
3384         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
3385         (WebKit::WebsiteDataRecord::add):
3386         (WebKit::WebsiteDataRecord::addCookieHostName):
3387         (WebKit::WebsiteDataRecord::addPluginDataHostName):
3388         * UIProcess/WebsiteData/WebsiteDataRecord.h:
3389         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3390         (WebKit::computeNetworkProcessAccessTypeForDataFetch):
3391         (WebKit::computeWebProcessAccessTypeForDataFetch):
3392         (WebKit::WebsiteDataStore::fetchData):
3393         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
3394         (WebKit::computeWebProcessAccessTypeForDataRemoval):
3395         (WebKit::WebsiteDataStore::removeData):
3396         * UIProcess/WebsiteData/WebsiteDataStore.h:
3397         * WebKit2.xcodeproj/project.pbxproj:
3398         * WebProcess/WebProcess.cpp:
3399         (WebKit::WebProcess::fetchWebsiteData):
3400         (WebKit::WebProcess::deleteWebsiteData):
3401         (WebKit::WebProcess::deleteWebsiteDataForOrigins):
3402         * WebProcess/WebProcess.h:
3403         * WebProcess/WebProcess.messages.in:
3404
3405 2016-02-26  Sam Weinig  <sam@webkit.org>
3406
3407         Try to fix the Yosemite build again.
3408
3409         * UIProcess/API/Cocoa/WKUserScript.mm:
3410         (toStringVector):
3411         (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
3412
3413 2016-02-26  Sam Weinig  <sam@webkit.org>
3414
3415         Try to fix the Yosemite build.
3416
3417         * UIProcess/API/Cocoa/WKUserScriptPrivate.h:
3418
3419 2016-02-25  Anders Carlsson  <andersca@apple.com>
3420
3421         Cache::traverse should pass the record info to its traversal handler
3422         https://bugs.webkit.org/show_bug.cgi?id=154695
3423
3424         Reviewed by Antti Koivisto.
3425
3426         * NetworkProcess/NetworkProcess.cpp:
3427         (WebKit::fetchDiskCacheEntries):
3428         (WebKit::clearDiskCacheEntries):
3429         * NetworkProcess/cache/NetworkCache.cpp:
3430         (WebKit::NetworkCache::Cache::traverse):
3431         * NetworkProcess/cache/NetworkCache.h:
3432
3433 2016-02-25  Gavin Barraclough  <barraclough@apple.com>
3434
3435         RefCounter value changed callback should be called on all changes (not just zero edge).
3436         https://bugs.webkit.org/show_bug.cgi?id=154699
3437
3438         Reviewed by Anders Carlsson.
3439
3440         RefCounter currently only triggers a callback when the count goes from zero
3441         to non-zero and vice-versa. Change that, to be useful to more clients.
3442
3443         * UIProcess/Plugins/PluginProcessManager.cpp:
3444         (WebKit::PluginProcessManager::PluginProcessManager):
3445             - Updated for change in RefCounter callback siganture.
3446        &nb