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