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