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