File Upload: Photo upload name is always generic (image.jpg)
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-05-03  Jiewen Tan  <jiewen_tan@apple.com>
2
3         File Upload: Photo upload name is always generic (image.jpg)
4         https://bugs.webkit.org/show_bug.cgi?id=157291
5         <rdar://problem/12353008>
6
7         Reviewed by Darin Adler.
8
9         Use the original filename as the name of an uploaded image instead of
10         a generic name, i.e. image.jpg.
11
12         * Platform/spi/ios/PhotosSPI.h: Added.
13         * UIProcess/ios/forms/WKFileUploadPanel.mm:
14         (-[WKFileUploadPanel _uploadItemForImage:withAssetURL:successBlock:failureBlock:]):
15         * WebKit2.xcodeproj/project.pbxproj:
16
17 2016-05-03  Chris Dumez  <cdumez@apple.com>
18
19         [WK2][DiskCache] Store common HTTP header names as strings
20         https://bugs.webkit.org/show_bug.cgi?id=157326
21         <rdar://problem/26073498>
22
23         Reviewed by Antti Koivisto.
24
25         Store common HTTP header names as strings in the disk cache instead of
26         using their value in the HTTPHeaderName enumeration. Having the disk
27         cache rely in the HTTPHeaderName enumeration is risky becomes it means
28         the cached data would become invalid every time someone updates
29         HTTPHeaderNames.in in WebCore. If someone were to update
30         HTTPHeaderNames.in without bumping the disk cache version, we would end
31         up with wrongly recognized HTTP header names after loading responses
32         from the cache.
33
34         * NetworkProcess/cache/NetworkCacheCoders.cpp:
35         (WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::encode):
36         (WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::decode):
37         * NetworkProcess/cache/NetworkCacheCoders.h:
38         * NetworkProcess/cache/NetworkCacheStorage.h:
39
40 2016-05-03  Daniel Bates  <dabates@apple.com>
41
42         Temporary workaround for Apple Internal builds
43         <rdar://problem/25992976>
44
45         For Apple Internal builds treat error code errSecCSGuestInvalid as if it were error code errSecCSUnsigned.
46         We will look to remove this workaround in the fix for <rdar://problem/26075714>.
47
48         * Shared/mac/CodeSigning.mm:
49         (WebKit::secCodeSigningIdentifier):
50
51 2016-05-03  Chris Dumez  <cdumez@apple.com>
52
53         Unreviewed, rolling out r199259 and r200161.
54
55         Seems to have caused a ~1.2% PLT regression on iOS
56
57         Reverted changesets:
58
59         "[iOS WK2] WKWebViews should consult ancestor UIScrollViews to
60         determine tiling area"
61         https://bugs.webkit.org/show_bug.cgi?id=156429
62         http://trac.webkit.org/changeset/199259
63
64         "[iOS WK2] When determining tile size, check whether ancestor
65         UIScrollViews are actually scrollable"
66         https://bugs.webkit.org/show_bug.cgi?id=157107
67         http://trac.webkit.org/changeset/200161
68
69 2016-05-03  Dean Jackson  <dino@apple.com>
70
71         CSS Grid should be an experimental feature flag
72         https://bugs.webkit.org/show_bug.cgi?id=157327
73         <rdar://problem/26075147>
74
75         Reviewed by Anders Carlsson.
76
77         The CSS Grid Layout runtime flag was exposed by
78         a WebKit preference. It was in the experimental
79         section but was missing the "Experimental" prefix.
80
81         It was also missing the human readable description.
82
83         Lastly, there is no need for the C API for experimental
84         features.
85
86         * Shared/WebPreferencesDefinitions.h:
87         * UIProcess/API/C/WKPreferences.cpp:
88         (WKPreferencesSetCSSGridLayoutEnabled): Deleted.
89         (WKPreferencesGetCSSGridLayoutEnabled): Deleted.
90         * UIProcess/API/C/WKPreferencesRefPrivate.h:
91         * WebProcess/InjectedBundle/InjectedBundle.cpp:
92         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
93         * WebProcess/WebPage/WebPage.cpp:
94         (WebKit::WebPage::updatePreferences):
95
96 2016-05-03  Alex Christensen  <achristensen@webkit.org>
97
98         Remove firing assertion when redirecting
99         https://bugs.webkit.org/show_bug.cgi?id=155800
100         rdar://25299194
101
102         Reviewed by Sam Weinig.
103
104         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
105         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
106         (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]):
107         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
108         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
109         With NSURLConnection, we stopped getting delegate callbacks once the delegate is destroyed, and everything was cancelled.
110         With NSURLSession we continue getting delegate callbacks because the session's delegate is not destroyed after each load.
111         As documented in NSURLSession.h: "In some cases, the task may signal other work before it acknowledges the cancelation."
112         In the cases where we cancel a load, delete the NetworkLoad and corresponding NetworkDataTask, we want to call all
113         completion handlers indicating that we really want to cancel instead of asserting.
114
115 2016-05-02  Darin Adler  <darin@apple.com>
116
117         Change IDL enumerations to be nested in their C++ class instead of at WebCore namespace level
118         https://bugs.webkit.org/show_bug.cgi?id=157257
119
120         Reviewed by Chris Dumez.
121
122         * WebProcess/Network/WebLoaderStrategy.cpp:
123         (WebKit::WebLoaderStrategy::loadResource): Updated since we changed
124         ReferrerHeaderPolicy back to ReferrerPolicy.
125         (WebKit::WebLoaderStrategy::schedulePluginStreamLoad): Ditto.
126
127 2016-05-02  Brady Eidson  <beidson@apple.com>
128
129         Const-ify some IDB code.
130         https://bugs.webkit.org/show_bug.cgi?id=157287
131
132         Reviewed by Alex Christensen.
133
134         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
135         (WebKit::WebIDBConnectionToServer::deleteDatabase):
136         (WebKit::WebIDBConnectionToServer::openDatabase):
137         (WebKit::WebIDBConnectionToServer::abortTransaction):
138         (WebKit::WebIDBConnectionToServer::commitTransaction):
139         (WebKit::WebIDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
140         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
141
142 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
143
144         Sort the project file.
145
146         * WebKit2.xcodeproj/project.pbxproj:
147
148 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
149
150         Fix shouldUpdateScrollLayerPositionSynchronously() for non-main frames. Remove updatesScrollLayerPositionOnMainThread()
151         https://bugs.webkit.org/show_bug.cgi?id=157277
152
153         Reviewed by Dean Jackson, Tim Horton.
154
155         Remove updatesScrollLayerPositionOnMainThread() which is unused by all ports.
156
157         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
158
159 2016-05-02  Alex Christensen  <achristensen@webkit.org>
160
161         Crash if a certificate chain has null certificates
162         https://bugs.webkit.org/show_bug.cgi?id=157206
163
164         Reviewed by Alexey Proskuryakov.
165
166         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
167         (WebKit::certificatesMatch):
168         SecTrustGetCertificateAtIndex can return null.
169         If this ever happens, something has gone horribly wrong in the security code and we should crash.
170         See rdar://problem/21723172
171
172 2016-05-02  Myles C. Maxfield  <mmaxfield@apple.com>
173
174         Addressing post-review comments after r200116
175         https://bugs.webkit.org/show_bug.cgi?id=157228
176
177         Reviewed by Anders Carlsson.
178
179         * Shared/WebPreferencesDefinitions.h:
180         * UIProcess/API/Cocoa/WKWebView.mm:
181         (-[WKWebView _initializeWithConfiguration:]):
182         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
183         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
184         (-[WKWebViewConfiguration encodeWithCoder:]):
185         (-[WKWebViewConfiguration initWithCoder:]):
186         (-[WKWebViewConfiguration copyWithZone:]):
187         * UIProcess/WebPageProxy.cpp:
188         * WebProcess/WebPage/WebPage.cpp:
189         (WebKit::WebPage::updatePreferences):
190
191 2016-05-02  Daniel Bates  <dabates@apple.com>
192
193         DatabaseTracker::closeAllDatabases calls Database::close from the wrong thread
194         https://bugs.webkit.org/show_bug.cgi?id=147672
195         <rdar://problem/22357464>
196
197         Reviewed by Brady Eidson.
198
199         Call DatabaseTracker::closeAllDatabases() with CurrentQueryBehavior::Interrupt so that we abort
200         a long running query and close the database immediately to avoid holding a locked file when the
201         process is suspended.
202
203         * WebProcess/WebProcess.cpp:
204         (WebKit::WebProcess::processWillSuspendImminently):
205
206 2016-05-01  Darin Adler  <darin@apple.com>
207
208         Update Fetch to use enum class instead of string for enumerations
209         https://bugs.webkit.org/show_bug.cgi?id=157241
210
211         Reviewed by Chris Dumez.
212
213         * WebProcess/Network/WebLoaderStrategy.cpp:
214         (WebKit::WebLoaderStrategy::loadResource): Updated for the change where I
215         renamed ReferrerPolicy to ReferrerHeaderPolicy, at least for now.
216         (WebKit::WebLoaderStrategy::schedulePluginStreamLoad): Ditto.
217
218 2016-05-01  Konstantin Tokarev  <annulen@yandex.ru>
219
220         Fixed build with !ENABLED(DATABASE_PROCESS).
221
222         Unreviewed build fix.
223
224         * UIProcess/Network/NetworkProcessProxy.cpp:
225         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs):
226
227 2016-04-29  Chris Dumez  <cdumez@apple.com>
228
229         Drop useless check in SpeculativeLoadManager::registerLoad()
230         https://bugs.webkit.org/show_bug.cgi?id=157204
231
232         Reviewed by Antti Koivisto.
233
234         Drop useless check in SpeculativeLoadManager::registerLoad(). There is
235         no way to end up this code path with a non-HTTP family request.
236
237         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
238         (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad):
239
240 2016-04-29  Brian Burg  <bburg@apple.com>
241
242         Web Automation: add SPI to mark an existing NSEvent as synthesized for automation
243         https://bugs.webkit.org/show_bug.cgi?id=157221
244         <rdar://problem/26019356>
245
246         Reviewed by Timothy Hatcher.
247
248         In cases where an NSEvent is duplicated, clients need to re-mark an NSEvent
249         as synthesized for automation if the original NSEvent was marked as such.
250
251         * UIProcess/API/Cocoa/_WKAutomationSession.h:
252         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
253         (-[_WKAutomationSession markEventAsSynthesizedForAutomation:]):
254         * UIProcess/Automation/WebAutomationSession.h:
255         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
256         (WebKit::WebAutomationSession::sendSynthesizedEventsToPage):
257         (WebKit::WebAutomationSession::markEventAsSynthesizedForAutomation):
258
259 2016-04-29  Brian Burg  <bburg@apple.com>
260
261         Web Automation: use a magic eventNumber as a fallback for detecting NSEvents synthesized for automation
262         https://bugs.webkit.org/show_bug.cgi?id=157222
263
264         Reviewed by Timothy Hatcher.
265
266         Sometimes events are copied and redelivered in a way that can't be reliably intercepted,
267         so use eventNumber as an alternate means of detecting synthesized mouse NSEvents.
268
269         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
270         (WebKit::WebAutomationSession::wasEventSynthesizedForAutomation):
271         If it's a mouse-related event, check the eventNumber if the associated object was missing.
272
273         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
274         Most real events from input devices fill in eventNumber with a non-zero value.
275         In my testing, using zero did not seem to adversely affect event delivery.
276
277 2016-04-29  Joseph Pecoraro  <pecoraro@apple.com>
278
279         Web Inspector: Issues inspecting the inspector, pausing on breakpoints causes content to not load
280         https://bugs.webkit.org/show_bug.cgi?id=157198
281         <rdar://problem/26011049>
282
283         Reviewed by Timothy Hatcher.
284
285         * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.h:
286         * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp:
287         (WebKit::WebInspectorFrontendAPIDispatcher::reset):
288         (WebKit::WebInspectorFrontendAPIDispatcher::frontendLoaded):
289         (WebKit::WebInspectorFrontendAPIDispatcher::suspend):
290         (WebKit::WebInspectorFrontendAPIDispatcher::unsuspend):
291         (WebKit::WebInspectorFrontendAPIDispatcher::dispatchCommand):
292         (WebKit::WebInspectorFrontendAPIDispatcher::dispatchMessageAsync):
293         (WebKit::WebInspectorFrontendAPIDispatcher::evaluateOrQueueExpression):
294         (WebKit::WebInspectorFrontendAPIDispatcher::evaluateQueuedExpressions):
295         Avoid evaluating expressions when the page is paused. Generalize the
296         message queueing and dispatching for pause/suspend that we already
297         had for waiting for the frontend page to be loaded.
298
299         * WebProcess/WebPage/WebInspectorUI.h:
300         * WebProcess/WebPage/WebInspectorUI.cpp:
301         (WebKit::WebInspectorUI::pagePaused):
302         (WebKit::WebInspectorUI::pageUnpaused):
303         When the frontend page pauses/unpauses, suspend/resume the dispatcher.
304
305 2016-04-29  Chris Dumez  <cdumez@apple.com>
306
307         Remove unnecessary isolated String copying from one of NetworkCache::Key's constructor
308         https://bugs.webkit.org/show_bug.cgi?id=157207
309
310         Reviewed by Antti Koivisto.
311
312         Remove unnecessary isolated String copying from one of NetworkCache::Key's
313         constructor. We are anyway going to create isolated copies if the Key ends
314         up getting copied.
315
316         * NetworkProcess/cache/NetworkCacheKey.cpp:
317         (WebKit::NetworkCache::Key::Key):
318
319 2016-04-29  Brian Burg  <bburg@apple.com>
320
321         Web Automation: performMouseInteraction command computes mouse event coordinates incorrectly
322         https://bugs.webkit.org/show_bug.cgi?id=157218
323         <rdar://problem/26018230>
324
325         Reviewed by Timothy Hatcher.
326
327         This patch fixes two issues: the min/max clamp was in the wrong order,
328         and the y-value did not account for the window's top content inset.
329
330         * UIProcess/Automation/WebAutomationSession.cpp:
331         (WebKit::WebAutomationSession::performMouseInteraction):
332
333 2016-04-29  Dean Jackson  <dino@apple.com>
334
335         RTL <select> popup menu is in the wrong location
336         https://bugs.webkit.org/show_bug.cgi?id=157159
337         <rdar://problem/25894451>
338
339         Reapply http://trac.webkit.org/changeset/200217
340         but with changes that will allow it to build on Yosemite.
341
342         * UIProcess/mac/WebPopupMenuProxyMac.mm:
343         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
344
345 2016-04-28  Ada Chan  <adachan@apple.com>
346
347         Indicate we are processing user gesture when handling messages from WebPlaybackSessionManagerProxy to WebPlaybackSessionManager
348         https://bugs.webkit.org/show_bug.cgi?id=157151
349
350         Reviewed by Jer Noble.
351
352         Messages from WebPlaybackSessionManagerProxy to WebPlaybackSessionManager are triggered by
353         user actions, so add a UserGestureIndicator in the methods that handle those messages.
354
355         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
356         (WebKit::WebPlaybackSessionManager::play):
357         (WebKit::WebPlaybackSessionManager::pause):
358         (WebKit::WebPlaybackSessionManager::togglePlayState):
359         (WebKit::WebPlaybackSessionManager::beginScrubbing):
360         (WebKit::WebPlaybackSessionManager::endScrubbing):
361         (WebKit::WebPlaybackSessionManager::seekToTime):
362         (WebKit::WebPlaybackSessionManager::fastSeek):
363         (WebKit::WebPlaybackSessionManager::beginScanningForward):
364         (WebKit::WebPlaybackSessionManager::beginScanningBackward):
365         (WebKit::WebPlaybackSessionManager::endScanning):
366         (WebKit::WebPlaybackSessionManager::selectAudioMediaOption):
367         (WebKit::WebPlaybackSessionManager::selectLegibleMediaOption):
368
369 2016-04-29  Brady Eidson  <beidson@apple.com>
370
371         Add a default ".isolatedCopy()" specialization to CrossThreadCopier, and other small cleanup.
372         https://bugs.webkit.org/show_bug.cgi?id=157185
373
374         Reviewed by Anders Carlsson.
375
376         * Shared/WebCrossThreadCopier.cpp:
377         (WebCore::Vector<char>>::copy): reserveInitialCapacity() before creating the copy.
378         (WebCore::Vector<int64_t>>::copy): Ditto.
379         (WebCore::Vector<uint8_t>>::copy): Ditto.
380         (WebCore::Vector<Vector<IDBKeyData>>>::copy): Deleted dead code.
381         * Shared/WebCrossThreadCopier.h:
382
383 2016-04-29  Commit Queue  <commit-queue@webkit.org>
384
385         Unreviewed, rolling out r200217.
386         https://bugs.webkit.org/show_bug.cgi?id=157183
387
388         This change broke the Yosemite build. (Requested by ryanhaddad
389         on #webkit).
390
391         Reverted changeset:
392
393         "RTL <select> popup menu is in the wrong location"
394         https://bugs.webkit.org/show_bug.cgi?id=157159
395         http://trac.webkit.org/changeset/200217
396
397 2016-04-29  Claudio Saavedra  <csaavedra@igalia.com>
398
399         [GTK] Move WK2 shareable code out from gtk directories
400         https://bugs.webkit.org/show_bug.cgi?id=157135
401
402         Reviewed by Darin Adler.
403
404         Both NetworkProcessMain and InjectedBundle can go out from their respective gtk directories.
405
406         * NetworkProcess/gtk/NetworkProcessMainGtk.cpp:
407         (WebKit::NetworkProcessMainUnix): Deleted.
408         * NetworkProcess/soup/NetworkProcessMainSoup.cpp: Renamed from Source/WebKit2/NetworkProcess/gtk/NetworkProcessMainGtk.cpp.
409         (WebKit::NetworkProcessMainUnix):
410         * PlatformGTK.cmake: Update.
411         * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp.
412         (WebKit::InjectedBundle::initialize):
413         (WebKit::InjectedBundle::setBundleParameter):
414         (WebKit::InjectedBundle::setBundleParameters):
415         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
416         (WebKit::InjectedBundle::initialize): Deleted.
417         (WebKit::InjectedBundle::setBundleParameter): Deleted.
418         (WebKit::InjectedBundle::setBundleParameters): Deleted.
419
420 2016-04-28  Dean Jackson  <dino@apple.com>
421
422         RTL <select> popup menu is in the wrong location
423         https://bugs.webkit.org/show_bug.cgi?id=157159
424         <rdar://problem/25894451>
425
426         Reviewed by Simon Fraser.
427
428         Make sure the NSPopupMenu takes the text direction
429         into account, and offset the position
430         of the menu slightly if we're in RTL mode.
431
432         Unfortunately our test infrastructure is unable to exercise
433         this because it runs without a window, and the popup menu
434         is not captured in the screenshot.
435
436         * UIProcess/mac/WebPopupMenuProxyMac.mm:
437         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
438
439 2016-04-28  Manuel Rego Casasnovas  <rego@igalia.com>
440
441         [css-grid] Add CSS Grid Layout runtime flag
442         https://bugs.webkit.org/show_bug.cgi?id=157134
443
444         Reviewed by Simon Fraser.
445
446         Add CSS Grid Layout runtime flag based on preferences,
447         enabled by default.
448
449         * Shared/WebPreferencesDefinitions.h:
450         * UIProcess/API/C/WKPreferences.cpp:
451         (WKPreferencesSetCSSGridLayoutEnabled):
452         (WKPreferencesGetCSSGridLayoutEnabled):
453         * UIProcess/API/C/WKPreferencesRefPrivate.h:
454         * WebProcess/InjectedBundle/InjectedBundle.cpp:
455         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
456         * WebProcess/WebPage/WebPage.cpp:
457         (WebKit::WebPage::updatePreferences):
458
459 2016-04-28  Daniel Bates  <dabates@apple.com>
460
461         Fix the Apple Internal OS X build
462
463         * UIProcess/mac/WKPrintingView.mm:
464         (-[WKPrintingView _drawPDFDocument:page:atPoint:]): Ignore deprecation warning for -[PDFPage drawWithBox:].
465         * WebProcess/WebPage/mac/WebPageMac.mm:
466         (WebKit::drawPDFPage): Ditto.
467
468 2016-04-28  Manuel Rego Casasnovas  <rego@igalia.com>
469
470         Fix mistake in custom elements runtime flag
471         https://bugs.webkit.org/show_bug.cgi?id=157130
472
473         Reviewed by Chris Dumez.
474
475         The methods for the custom elements runtime flag were using
476         the Shadow DOM flag instead.
477         These methods were introduced in r197921,
478         it seems it was just a copy&paste mistake.
479
480         * UIProcess/API/C/WKPreferences.cpp:
481         (WKPreferencesSetCustomElementsEnabled):
482         (WKPreferencesGetCustomElementsEnabled):
483
484 2016-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
485
486         Unreviewed. Add missing files to the compilation of GTK+ inspector.
487
488         * PlatformGTK.cmake:
489
490 2016-04-27  Dan Bernstein  <mitz@apple.com>
491
492         <rdar://problem/25915253> REGRESSION (r199628): Netflix playback fails in Safari Technology Preview with error code S7363-1260-FFFF58D8
493
494         Rubber-stamped by Tim Horton.
495
496         Reverted r199628.
497
498         * Configurations/WebContentService.xcconfig:
499
500 2016-04-27  Brady Eidson  <beidson@apple.com>
501
502         Modern IDB: Implement native IDBFactory.getAllDatabaseNames for WebInspector.
503         https://bugs.webkit.org/show_bug.cgi?id=157072
504
505         Reviewed by Alex Christensen.
506
507         Handle the process hop for the new getAllDatabaseNames call.
508         
509         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
510         (WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames):
511         (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
512         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
513         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
514
515         * Shared/WebCrossThreadCopier.cpp:
516         (WebCore::SecurityOriginData>::copy): Deleted, as its in WebCore now.
517         * Shared/WebCrossThreadCopier.h:
518
519         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
520         (WebKit::WebIDBConnectionToServer::getAllDatabaseNames):
521         (WebKit::WebIDBConnectionToServer::didGetAllDatabaseNames):
522         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
523         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
524
525 2016-04-27  Simon Fraser  <simon.fraser@apple.com>
526
527         [iOS WK2] When determining tile size, check whether ancestor UIScrollViews are actually scrollable
528         https://bugs.webkit.org/show_bug.cgi?id=157107
529         rdar://problem/25943577
530
531         Reviewed by Tim Horton.
532         
533         We should only fall back to 512x512 tiles if the WKWebView has a UIScrollView ancestor,
534         and that UIScrollView actually scrolls. This avoids falling back to small tiles in
535         MobileSafari.
536
537         Rename "enclosedInScrollView" to "enclosedInScrollableAncestorView" everywhere.
538
539         * Shared/VisibleContentRectUpdateInfo.cpp:
540         (WebKit::VisibleContentRectUpdateInfo::encode):
541         (WebKit::VisibleContentRectUpdateInfo::decode):
542         * Shared/VisibleContentRectUpdateInfo.h:
543         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
544         (WebKit::VisibleContentRectUpdateInfo::enclosedInScrollableAncestorView):
545         (WebKit::operator==):
546         (WebKit::VisibleContentRectUpdateInfo::enclosedInScrollView): Deleted.
547         * UIProcess/API/Cocoa/WKWebView.mm:
548         (scrollViewCanScroll):
549         (-[WKWebView _updateContentRectsWithState:]):
550         * UIProcess/ios/WKContentView.h:
551         * UIProcess/ios/WKContentView.mm:
552         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
553         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollView:]): Deleted.
554         * WebProcess/WebPage/ios/WebPageIOS.mm:
555         (WebKit::WebPage::updateVisibleContentRects):
556
557 2016-04-26  Ada Chan  <adachan@apple.com>
558
559         Set WebVideoFullscreenInterfaceMac up as a client of WebPlaybackSessionInterfaceMac to listen for playback state changes
560         https://bugs.webkit.org/show_bug.cgi?id=157008
561
562         Reviewed by Jer Noble.
563
564         Since WebVideoFullscreenInterfaceMac holds onto WebPlaybackSessionInterfaceMac, we can't let
565         WebPlaybackSessionManagerProxy unregister the context for that media element while
566         WebVideoFullscreenInterfaceMac is still using it. WebVideoFullscreenInterfaceMac should add
567         to the client count for that WebPlaybackSession context.
568
569         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
570         (WebKit::WebVideoFullscreenManagerProxy::createModelAndInterface):
571         When the context for the media element is created with the WebVideoFullscreenManagerProxy, it should
572         add one to the client count for the media element context in WebPlaybackSessionManagerProxy.
573         (WebKit::WebVideoFullscreenManagerProxy::removeClientForContext):
574         When WebVideoFullscreenManagerProxy unregisters the context for this media element, it should
575         subtract one from the client count for the media element context in WebPlaybackSessionManagerProxy.
576
577         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
578         (WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):
579         Bail early if m_controlsManagerContextId is zero. Otherwise, we'd end up sending a
580         ClearPlaybackControlsManager message to the UI process inadvertently.
581         (WebKit::WebPlaybackSessionManager::contextIdForMediaElement):
582         Make sure the model element for the context ID is set to the media element.
583
584         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
585         (WebKit::WebVideoFullscreenManager::createModelAndInterface):
586         When the context for the media element is created with the WebVideoFullscreenManager, it should
587         add one to the client count for the media element context in WebPlaybackSessionManager.
588         (WebKit::WebVideoFullscreenManager::removeContext):
589         When WebVideoFullscreenManager unregisters the context for this media element, it should
590         subtract one from the client count for the media element context in WebPlaybackSessionManager.
591
592 2016-04-27  Alex Christensen  <achristensen@webkit.org>
593
594         Remove download message receiver when NetworkProcess crashes
595         https://bugs.webkit.org/show_bug.cgi?id=157102
596         <rdar://problem/25550106>
597
598         Reviewed by Anders Carlsson.
599
600         * UIProcess/Downloads/DownloadProxyMap.cpp:
601         (WebKit::DownloadProxyMap::processDidClose):
602         When the NetworkProcess crashes during a download, we want to remove the message receiver from the map
603         so we don't get an assertion in ~MessageReceiver in the UIProcess so we do not have a freed
604         message receiver in the map.
605
606 2016-04-27  Alex Christensen  <achristensen@webkit.org>
607
608         Fix client certificate authentication with NSURLSession on iOS
609         https://bugs.webkit.org/show_bug.cgi?id=157094
610         <rdar://problem/25946859>
611
612         Reviewed by Darin Adler.
613
614         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
615         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
616         We only want to create a non-persistent credential with the given user and password 
617         and store the user and password in the CredentialStorage if there is a user and password.
618         We previously only skipped this if we were doing server trust evaluation, in which case 
619         we will have a credential from serverTrustCredential which has no user or password.
620         When doing client certificate authentication on iOS, this completion handler is called with
621         a credential with session persistence and also no user or password, so we need to do the same thing.
622         The reason this was never hit on Mac was because the credential came from tryUseCertificateInfoForChallenge,
623         which always had persistence none.
624
625 2016-04-27  Claudio Saavedra  <csaavedra@igalia.com>
626
627         [GTK][EFL] Move WK2 platform code to a common place
628         https://bugs.webkit.org/show_bug.cgi?id=157069
629
630         Reviewed by Carlos Garcia Campos.
631
632         Logging implementation can be shared between EFL and GTK, so move it to unix.
633         The GTK Module implementation doesn't depend on GTK anyhow so move it to glib.
634
635         * Platform/efl/LoggingEfl.cpp: Removed.
636         (WebKit::logLevelString): Deleted.
637         * Platform/glib/ModuleGlib.cpp: Renamed from Source/WebKit2/Platform/gtk/ModuleGtk.cpp.
638         (WebKit::Module::load):
639         (WebKit::Module::unload):
640         (WebKit::Module::platformFunctionPointer):
641         * Platform/gtk/LoggingGtk.cpp:
642         (WebKit::logLevelString): Deleted.
643         * Platform/gtk/ModuleGtk.cpp:
644         (WebKit::Module::load): Deleted.
645         (WebKit::Module::unload): Deleted.
646         (WebKit::Module::platformFunctionPointer): Deleted.
647         * Platform/unix/LoggingUnix.cpp: Renamed from Source/WebKit2/Platform/gtk/LoggingGtk.cpp.
648         (WebKit::logLevelString):
649         * PlatformEfl.cmake: Update.
650         * PlatformGTK.cmake: Update
651
652 2016-04-27  Alex Christensen  <achristensen@webkit.org>
653
654         Fix assertion when downloading with NSURLSession after r198955
655         https://bugs.webkit.org/show_bug.cgi?id=157051
656
657         Reviewed by Brady Eidson.
658
659         * NetworkProcess/NetworkProcess.cpp:
660         (WebKit::NetworkProcess::continueDecidePendingDownloadDestination):
661
662 2016-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>
663
664         REGRESSION(r200094): [FreeType] Vertical text is broken after r200094
665         https://bugs.webkit.org/show_bug.cgi?id=157066
666
667         Reviewed by Martin Robinson.
668
669         Add Source/WebCore/platform/graphics/freetype to the list of include dirs, because now FontPlatformData.h
670         includes FcUniquePtr.h.
671
672         * PlatformEfl.cmake:
673         * PlatformGTK.cmake:
674
675 2016-04-26  Joseph Pecoraro  <pecoraro@apple.com>
676
677         Uncaught Exception: SecurityError: DOM Exception 18: An attempt was made to break through the security policy of the user agent.
678         https://bugs.webkit.org/show_bug.cgi?id=156991
679         <rdar://problem/25913475>
680
681         Reviewed by Timothy Hatcher.
682
683         * UIProcess/mac/WebInspectorProxyMac.mm:
684         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
685         Explicitly always allow access to storage for Web Inspector content just
686         in case, as we already allow universal file access.
687
688 2016-04-26  Myles C. Maxfield  <mmaxfield@apple.com>
689
690         [WK2] [OS X] Create API for switching RTL scrollbar policy
691         https://bugs.webkit.org/show_bug.cgi?id=156948
692         <rdar://problem/25707757>
693
694         Reviewed by Darin Adler.
695
696         Add the new API.
697
698         * Shared/WebPreferencesDefinitions.h:
699         * UIProcess/API/Cocoa/WKWebView.mm:
700         (-[WKWebView _initializeWithConfiguration:]):
701         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
702         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
703         (-[WKWebViewConfiguration init]):
704         (-[WKWebViewConfiguration encodeWithCoder:]):
705         (-[WKWebViewConfiguration initWithCoder:]):
706         (-[WKWebViewConfiguration copyWithZone:]):
707         * UIProcess/WebPageProxy.cpp:
708         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
709         * WebProcess/WebPage/WebPage.cpp:
710         (WebKit::WebPage::updatePreferences):
711
712 2016-04-26  Beth Dakin  <bdakin@apple.com>
713
714         Check to make sure shouldRequestCandidates() before requesting candidates
715         https://bugs.webkit.org/show_bug.cgi?id=157038
716         -and corresponding-
717         rdar://problem/25910418
718
719         Reviewed by Tim Horton.
720
721         This patch limits requesting and showing candidates to cases where 
722         shouldRequestCandidates() is true. This patch also caches the sequence number 
723         returned by [NSSpellChecker requestCandidatesForSelectedRange:] to make sure 
724         it is equal to the sequence number sent to the callback handler so that we do 
725         not show candidates for old requests.
726
727         * UIProcess/Cocoa/WebViewImpl.h:
728         * UIProcess/Cocoa/WebViewImpl.mm:
729         (WebKit::WebViewImpl::updateWebViewImplAdditions):
730         (WebKit::WebViewImpl::shouldRequestCandidates):
731         (WebKit::WebViewImpl::showCandidates):
732         (WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
733         (WebKit::WebViewImpl::handleRequestedCandidates):
734
735 2016-04-26  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
736
737         [EFL] Update expectation result in ewk_context_preferred_languages API test
738         https://bugs.webkit.org/show_bug.cgi?id=157027
739
740         Reviewed by Carlos Garcia Campos.
741
742         platformLanguage() has been returning lower case value since r199815. Thus existing expected result
743         needs to be updated together.
744
745         * UIProcess/API/efl/tests/test_ewk2_context.cpp: Change en-US with en-us.
746         (TEST_F):
747
748 2016-04-26  Zan Dobersek  <zdobersek@igalia.com>
749
750         Mark two methods in the CoordinatedGraphicsScene and the
751         ThreadedCoordinatedLayerTreeHost classes as overrides, fixing
752         the compiler warnings.
753
754         Rubber-stamped by Carlos Garcia Campos.
755
756         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
757         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
758
759 2016-04-25  Ryosuke Niwa  <rniwa@webkit.org>
760
761         Remove the build flag for template elements
762         https://bugs.webkit.org/show_bug.cgi?id=157022
763
764         Reviewed by Daniel Bates.
765
766         * Configurations/FeatureDefines.xcconfig:
767
768 2016-04-25  Chris Dumez  <cdumez@apple.com>
769
770         Crash under -[WKWebView _mayAutomaticallyShowVideoPictureInPicture] + 32 (WKWebView.mm:309)
771         https://bugs.webkit.org/show_bug.cgi?id=156990
772         <rdar://problem/25904376>
773
774         Reviewed by Jer Noble.
775
776         In case of WebProcess crash, WebPageProxy::processDidCrash() will call resetState() which
777         will nullify WebPageProxy::m_videoFullscreenManager. In WebPageProxy::reattachToWebProcess(),
778         we then call updateViewState() before re-initializing m_videoFullscreenManager, and
779         updateViewState() ends up calling [WKWebView _mayAutomaticallyShowVideoPictureInPicture]
780         which dereferences WebPageProxy::m_videoFullscreenManager without null check. This patch
781         adds a null check for m_videoFullscreenManager in _mayAutomaticallyShowVideoPictureInPicture.
782
783         * UIProcess/API/Cocoa/WKWebView.mm:
784         (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]):
785
786 2016-04-25  Dan Bernstein  <mitz@apple.com>
787
788         Fix a couple of mistakes from r199700.
789
790         Rubber-stamped by Anders Carlsson.
791
792         * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Added availability attributes to new properties.
793         * WebKit2.xcodeproj/project.pbxproj: Demoted _WKExperimentalFeatureInternal.h from Private to Project.
794
795 2016-04-24  Hunseop Jeong  <hs85.jeong@samsung.com>
796
797         [EFL] Update the ewk_settings_offline_web_application_cache_enabled_get() expected value after r199854.
798         https://bugs.webkit.org/show_bug.cgi?id=156968
799
800         Reviewed by Gyuyoung Kim.
801
802         * UIProcess/API/C/WKPreferencesRef.h: Update the comment.
803         * UIProcess/API/efl/tests/test_ewk2_settings.cpp: 
804         (TEST_F):
805
806 2016-04-23  Andy Estes  <aestes@apple.com>
807
808         Fix issues found by the clang static analyzer
809         https://bugs.webkit.org/show_bug.cgi?id=156956
810
811         Reviewed by Alexey Proskuryakov.
812
813         * UIProcess/API/Cocoa/WKPreviewActionItem.mm:
814         (-[WKPreviewAction dealloc]): Added to release _identifier.
815         * UIProcess/_WKWebViewPrintFormatter.mm:
816         (-[_WKWebViewPrintFormatter dealloc]): Released _frameToPrint.
817         * UIProcess/ios/WKContentViewInteraction.mm:
818         (-[WKContentView inputView]): -createPeripheralWithView: returned a retained object, but the method name did not
819         match Cocoa conventions. Called -initWithView: instead.
820         (-[WKContentView _showAttachmentSheet]): Stored the _WKActivatedElementInfo in a RetainPtr.
821         (-[WKContentView _dataForPreviewItemController:atPosition:type:]): Ditto.
822         (+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]):
823         The properties contextBeforeSelection, selectedText, markedText, and contextAfterSelection have the 'copy'
824         annotation in UIWKAutocorrectionContext, so the additional copy made here would be leaked. Removed the extra copy.
825         (-[WKAutocorrectionContext dealloc]): Deleted.
826         * UIProcess/ios/forms/WKFormInputControl.h: Removed -createPeripheralWithView: and declared -initWithView:.
827         * UIProcess/ios/forms/WKFormInputControl.mm:
828         (-[WKFormInputControl initWithView:]): Changed to return instancetype.
829         (+[WKFormInputControl createPeripheralWithView:]): Deleted.
830         * UIProcess/ios/forms/WKFormSelectControl.h: Removed -createPeripheralWithView: and declared -initWithView:.
831         * UIProcess/ios/forms/WKFormSelectControl.mm:
832         (+[WKFormSelectControl createPeripheralWithView:]): Deleted.
833         * UIProcess/mac/LegacySessionStateCoding.cpp:
834         (WebKit::decodeLegacySessionState): If dynamic_cf_cast returned nullptr, the result of
835         CFPropertyListCreateWithData would leak. Stored the CFPropertyListRef in a RetainPtr before calling dynamic_cf_cast.
836         * UIProcess/mac/ServicesController.mm:
837         (WebKit::ServicesController::refreshExistingServices): Used a RetainPtr for attachment and cell.
838         * UIProcess/mac/WebContextMenuProxyMac.mm:
839         (WebKit::WebContextMenuProxyMac::setupServicesMenu): Used a RetainPtr for groupEntry.
840
841 2016-04-23  Chris Dumez  <cdumez@apple.com>
842
843         Tie the DiagnosticLoggingClient's lifetime to the Page
844         https://bugs.webkit.org/show_bug.cgi?id=156938
845         <rdar://problem/25851499>
846
847         Reviewed by Antti Koivisto.
848
849         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
850         (WebKit::WebDiagnosticLoggingClient::pageDestroyed):
851         (WebKit::WebDiagnosticLoggingClient::mainFrameDestroyed): Deleted.
852         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
853         * WebProcess/WebPage/ios/WebPageIOS.mm:
854         (WebKit::WebPage::willStartUserTriggeredZooming):
855
856 2016-04-23  Dan Bernstein  <mitz@apple.com>
857
858         <rdar://problem/25893246> WebKit2 has failed to build: error: use of undeclared identifier 'm_playbackSessionManager'
859
860         Fixed the non-AVKit build.
861
862         * UIProcess/API/Cocoa/WKWebView.mm:
863         (-[WKWebView _isShowingVideoPictureInPicture]):
864         (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]):
865         * UIProcess/WebPageProxy.cpp:
866         (WebKit::WebPageProxy::fullScreenManager):
867         (WebKit::WebPageProxy::playbackSessionManager):
868         * UIProcess/WebPageProxy.h:
869         * UIProcess/ios/WebPageProxyIOS.mm:
870         (WebKit::WebPageProxy::applicationDidBecomeActive):
871         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
872         (WebKit::WebChromeClient::createScrollingCoordinator):
873         (WebKit::WebChromeClient::supportsVideoFullscreen):
874         * WebProcess/WebCoreSupport/WebChromeClient.h:
875         * WebProcess/WebPage/WebPage.cpp:
876         (WebKit::WebPage::inspectorUI):
877         (WebKit::WebPage::playbackSessionManager):
878         * WebProcess/WebPage/WebPage.h:
879         * WebProcess/cocoa/WebVideoFullscreenManager.h:
880         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
881
882 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
883
884         Fixing a typo in my last commit.
885
886         Unreviewed build fix.
887
888         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
889         * WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
890
891 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
892
893         Missed some macros to fix builds that do not support AVKit.
894
895         Unreviewed build fix.
896
897         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
898         * WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
899
900 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
901
902         Fix builds that do not support AVKit
903
904         Unreviewed build fix.
905
906         * UIProcess/WebPageProxy.h:
907
908 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
909
910         Take 2 for fixing builds that do not support AVKit
911
912         Unreviewed build fix.
913
914         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
915         * UIProcess/WebPageProxy.cpp:
916         (WebKit::WebPageProxy::resetState):
917
918 2016-04-22  Anders Carlsson  <andersca@apple.com>
919
920         WKWebView WebSQL is not enabled
921         https://bugs.webkit.org/show_bug.cgi?id=156928
922         rdar://problem/19029603
923
924         Reviewed by Beth Dakin.
925
926         Give databases a default quota of 50 MB, matching what we have in UIWebView.
927
928         * UIProcess/Cocoa/UIDelegate.mm:
929         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota):
930
931 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
932
933         Fix builds that do not support AVKit
934
935         Unreviewed build fix.
936
937         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
938         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
939         * UIProcess/WebPageProxy.cpp:
940         (WebKit::WebPageProxy::WebPageProxy):
941         (WebKit::WebPageProxy::reattachToWebProcess):
942         (WebKit::WebPageProxy::viewDidLeaveWindow):
943         * UIProcess/ios/WebPageProxyIOS.mm:
944
945 2016-04-22  Brady Eidson  <beidson@apple.com>
946
947         Modern IDB: Rework the ownership/RefCounting model of IDBConnectionToServer and IDBConnectionProxy.
948         https://bugs.webkit.org/show_bug.cgi?id=156916
949
950         Reviewed by Tim Horton.
951
952         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
953         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
954
955 2016-04-22  Zan Dobersek  <zdobersek@igalia.com>
956
957         NetworkCacheIOChannelSoup: detach the newly-created IOChannel::readSync thread
958         https://bugs.webkit.org/show_bug.cgi?id=156907
959
960         Reviewed by Carlos Garcia Campos.
961
962         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
963         (WebKit::NetworkCache::IOChannel::readSyncInThread): Detach the new thread,
964         ensuring the resources are released after the thread exits. Next step is
965         to set up a thread pool and use that, avoiding thread re-creation.
966
967 2016-04-21  Dean Jackson  <dino@apple.com>
968
969         Backdrop Filter should not be visible if element has visibility:hidden
970         https://bugs.webkit.org/show_bug.cgi?id=149318
971         <rdar://problem/22749780>
972
973         Reviewed by Simon Fraser.
974
975         Add the isHidden method to PlatformCALayerRemote.
976
977         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
978         (WebKit::PlatformCALayerRemote::isHidden):
979         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
980
981 2016-04-21  Anders Carlsson  <andersca@apple.com>
982
983         WKWebView HTML5 AppCache not working
984         https://bugs.webkit.org/show_bug.cgi?id=156887
985         rdar://problem/17944162
986
987         Reviewed by Tim Horton.
988
989         * Shared/WebPreferencesDefinitions.h:
990         Set the offlineWebApplicationCacheEnabled property to true by default.
991
992         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
993         (API::WebsiteDataStore::defaultDataStoreConfiguration):
994         Set the default applicationCacheFlatFileSubdirectoryName to "Files".
995
996 2016-04-21  Anders Carlsson  <andersca@apple.com>
997
998         Get rid of the last uses of ApplicationCacheStorage::singleton() from WebKit2
999         https://bugs.webkit.org/show_bug.cgi?id=156876
1000
1001         Reviewed by Tim Horton.
1002
1003         * Shared/WebProcessCreationParameters.cpp:
1004         (WebKit::WebProcessCreationParameters::encode):
1005         (WebKit::WebProcessCreationParameters::decode):
1006         * Shared/WebProcessCreationParameters.h:
1007         Add and encode and decode a applicationCacheFlatFileSubdirectoryName.
1008
1009         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1010         (API::ProcessPoolConfiguration::createWithLegacyOptions):
1011         Set m_applicationCacheFlatFileSubdirectoryName to "ApplicationCache".
1012
1013         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
1014         Set m_applicationCacheFlatFileSubdirectoryName to "Files".
1015
1016         (API::ProcessPoolConfiguration::copy):
1017         Copy m_applicationCacheFlatFileSubdirectoryName.
1018
1019         * UIProcess/API/APIProcessPoolConfiguration.h:
1020         Add getter for applicationCacheFlatFileSubdirectoryName.
1021
1022         * UIProcess/WebProcessPool.cpp:
1023         (WebKit::legacyWebsiteDataStoreConfiguration):
1024         Initialize applicationCacheFlatFileSubdirectoryName from the process pool configuration.
1025
1026         (WebKit::WebProcessPool::createNewWebProcess):
1027         Initialize parameters.applicationCacheFlatFileSubdirectoryName. Remove a call to 
1028         ApplicationCacheStorage::singleton().setDefaultOriginQuota since it had no effect (it was called in the UI process).
1029
1030         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1031         (WebKit::WebsiteDataStore::WebsiteDataStore):
1032         Initialize m_applicationCacheFlatFileSubdirectoryName.
1033
1034         (WebKit::WebsiteDataStore::fetchData):
1035         (WebKit::WebsiteDataStore::removeData):
1036         Pass m_applicationCacheFlatFileSubdirectoryName when creating the application cache storage.
1037
1038         * UIProcess/WebsiteData/WebsiteDataStore.h:
1039         Add new members.
1040
1041         * WebProcess/WebPage/WebPage.cpp:
1042         (WebKit::WebPage::WebPage):
1043         Set the application cache storage.
1044
1045         * WebProcess/WebProcess.cpp:
1046         (WebKit::WebProcess::initializeWebProcess):
1047         Initialize the application cache storage.
1048
1049         * WebProcess/WebProcess.h:
1050         (WebKit::WebProcess::applicationCacheStorage):
1051         Add new getter.
1052
1053 2016-04-21  Anders Carlsson  <andersca@apple.com>
1054
1055         Remove two uses of ApplicationCacheStorage::singleton() from WebKit2
1056         https://bugs.webkit.org/show_bug.cgi?id=156873
1057
1058         Reviewed by Beth Dakin.
1059
1060         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1061         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
1062         * WebProcess/WebProcess.cpp:
1063         (WebKit::WebProcess::clearApplicationCache): Deleted.
1064         * WebProcess/WebProcess.h:
1065
1066 2016-04-21  Beth Dakin  <bdakin@apple.com>
1067
1068         showCandidates() should take a range and the string should be the whole 
1069         paragraph
1070         https://bugs.webkit.org/show_bug.cgi?id=156813
1071         -and corresponding-
1072         rdar://problem/25760533
1073
1074         Reviewed by Tim Horton.
1075
1076         * UIProcess/Cocoa/WebViewImpl.h:
1077         * UIProcess/Cocoa/WebViewImpl.mm:
1078         (WebKit::WebViewImpl::updateWebViewImplAdditions):
1079         (WebKit::WebViewImpl::showCandidates):
1080         (WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
1081         (WebKit::WebViewImpl::handleRequestedCandidates):
1082
1083 2016-04-21  Chelsea Pugh  <cpugh@apple.com>
1084
1085         [iOS] Allow clients to hide the accessory view on a form input session
1086         https://bugs.webkit.org/show_bug.cgi?id=155574
1087
1088         Reviewed by Dan Bernstein.
1089
1090         * UIProcess/API/Cocoa/_WKFormInputSession.h:
1091         * UIProcess/ios/WKContentViewInteraction.mm:
1092         (-[WKFormInputSession accessoryViewShouldNotShow]): Getter for accessoryViewShouldNotShow.
1093         (-[WKFormInputSession setAccessoryViewShouldNotShow:]): Set accessoryViewShouldNotShow and reload input views.
1094         (-[WKContentView requiresAccessoryView]): If the accessory view should be not be shown, do not require
1095         the accessory view.
1096
1097 2016-04-21  Chris Dumez  <cdumez@apple.com>
1098
1099         Drop [UsePointersEvenForNonNullableObjectArguments] from Range
1100         https://bugs.webkit.org/show_bug.cgi?id=156805
1101
1102         Reviewed by Youenn Fablet.
1103
1104         * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
1105         (-[WKDOMRange setStart:offset:]):
1106         (-[WKDOMRange setEnd:offset:]):
1107         (-[WKDOMRange selectNode:]):
1108         (-[WKDOMRange selectNodeContents:]):
1109         * WebProcess/WebPage/WebFrame.cpp:
1110         (WebKit::WebFrame::contentsAsString):
1111
1112 2016-04-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1113
1114         [GTK] WebKitWebView should claim the contents size as its natural size
1115         https://bugs.webkit.org/show_bug.cgi?id=156835
1116
1117         Reviewed by Žan Doberšek.
1118
1119         And keep claiming 0 as its minimum size since it's scrollable.
1120
1121         * UIProcess/API/gtk/PageClientImpl.cpp:
1122         (WebKit::PageClientImpl::didChangeContentSize): Call webkitWebViewBaseSetContentsSize().
1123         * UIProcess/API/gtk/PageClientImpl.h:
1124         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1125         (webkitWebViewBaseGetPreferredWidth): Return the contents width as natural width.
1126         (webkitWebViewBaseGetPreferredHeight): Return the contents height as natural height.
1127         (webkit_web_view_base_class_init): Add implementations of get_preferred_width/height.
1128         (webkitWebViewBaseSetContentsSize): Save the contents size.
1129         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
1130
1131 2016-04-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1132
1133         [GTK] WebKitWebView should propagate wheel events not handled by the web process
1134         https://bugs.webkit.org/show_bug.cgi?id=156834
1135
1136         Reviewed by Žan Doberšek.
1137
1138         We are currently swallowing all wheel events unconditionally, not allowing applications to handle wheel events
1139         when not handled by us. Since the GTK+ event propagation system is synchronous, and our events are handled
1140         asynchronously, we need to do something similar to what we do for key events, not propagate the event the first
1141         time and if not handled by the web process, re-inject it in the event loop and then just propagate it.
1142
1143         * Shared/NativeWebWheelEvent.h:
1144         (WebKit::NativeWebWheelEvent::nativeEvent): Remove useless const.
1145         * UIProcess/API/gtk/PageClientImpl.cpp:
1146         (WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore): Tell the web view to propagate the next wheel event,
1147         and re-inject the event not handled by the web process in the event loop.
1148         * UIProcess/API/gtk/PageClientImpl.h:
1149         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1150         (webkitWebViewBaseScrollEvent): Propagate the event if shouldForwardNextWheelEvent is true.
1151         (webkitWebViewBaseForwardNextWheelEvent): Set shouldForwardNextWheelEvent to true.
1152         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
1153         * UIProcess/PageClient.h:
1154         * UIProcess/WebPageProxy.cpp:
1155         (WebKit::WebPageProxy::didReceiveEvent): Remove ifdef.
1156         * UIProcess/efl/WebView.h:
1157
1158 2016-04-20  Dustin Falgout  <dustin@falgout.us>
1159
1160         [GTK] Expose AllowUniversalAccessFromFileURLs preference now that calling localStorage.getItem() results in SecurityError: DOM Exception 18
1161         
1162         Reviewed by Michael Catanzaro.
1163                 
1164         As of r197858 JavaScript loaded in the context of a file scheme url cannot access local storage. That is a major 
1165         breaking change as many applications that serve files locally rely on having access to local storage. The point  
1166         of that security fix is to avoid cases of downloaded HTML content (such as e-mail attachments or JS injected
1167         into local contexts) from having access to your local file system and arbitrary local storage. If you are serving 
1168         local files in your applications, you can use the WebKitAllowUniversalAccessFromFileURLs preference key to tell 
1169         Webkit that you are approve of these kinds of interactions.
1170                                               
1171         https://bugs.webkit.org/show_bug.cgi?id=156651
1172
1173         * UIProcess/API/gtk/WebKitSettings.cpp:
1174         (webKitSettingsSetProperty):
1175         (webKitSettingsGetProperty):
1176         (webkit_settings_class_init):
1177         (webkit_settings_get_allow_universal_access_from_file_urls):
1178         (webkit_settings_set_allow_universal_access_from_file_urls):
1179         * UIProcess/API/gtk/WebKitSettings.h:
1180         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1181
1182 2016-04-20  Brady Eidson  <beidson@apple.com>
1183
1184         Modern IDB (Workers): Enable INDEXED_DATABASE_IN_WORKERS compile time flag, but disabled in RuntimeEnabledFeatures.
1185         https://bugs.webkit.org/show_bug.cgi?id=156782
1186
1187         Reviewed by Alex Christensen.
1188
1189         * Configurations/FeatureDefines.xcconfig:
1190
1191 2016-04-20  Brent Fulgham  <bfulgham@apple.com>
1192
1193         [WK2][Mac][iOS] WebContent crash when using special file:// URI scheme @ WebKit::resolveSymlinksInPath(WTF::CString const&) + 159
1194         https://bugs.webkit.org/show_bug.cgi?id=156747
1195         <rdar://problem/24648176>
1196
1197         Reviewed by Alexey Proskuryakov.
1198
1199         FileSystemCF::fileSystemRepresentation return a null string when presented with a file URL that contains embedded nulls. When
1200         this happens, SandboxExtension::createHandle attempts to pass a null string to 'resolveSymlinksInPath', which attemps to call
1201         'strrchr' on the null pointer, causing a crash.
1202
1203         Test: fast/url/file-uri-with-embedded-null-no-crash.html
1204
1205         * Shared/mac/SandboxExtensionMac.mm:
1206         (WebKit::SandboxExtension::createHandle): If 'fileSystemRepresentation' is null, return early with an error.
1207
1208 2016-04-19  Alex Christensen  <achristensen@webkit.org>
1209
1210         Fix CMake build.
1211
1212         * CMakeLists.txt:
1213         Don't compile a file that doesn't exist.
1214         * PlatformMac.cmake:
1215         Put the XPCServices in the right place.
1216
1217 2016-04-19  Chris Dumez  <cdumez@apple.com>
1218
1219         Crash under WebKit::PluginView::pluginSnapshotTimerFired
1220         https://bugs.webkit.org/show_bug.cgi?id=156754
1221         <rdar://problem/22566764>
1222
1223         Reviewed by Beth Dakin.
1224
1225         Add null check for frame() before trying to access the frame settings,
1226         similarly to what is done earlier in this function. This fixes a top
1227         crasher.
1228
1229         * WebProcess/Plugins/PluginView.cpp:
1230         (WebKit::PluginView::pluginSnapshotTimerFired):
1231
1232 2016-04-19  Dean Jackson  <dino@apple.com>
1233
1234         New SPI to export a dictionary of runtime features
1235         https://bugs.webkit.org/show_bug.cgi?id=156645
1236         <rdar://problem/23621666>
1237
1238         Reviewed by Anders Carlsson.
1239
1240         Mark the new SPI as WK_MAC_TBA, WK_IOS_TBA.
1241
1242         * UIProcess/API/Cocoa/_WKExperimentalFeature.h:
1243
1244 2016-04-19  Dean Jackson  <dino@apple.com>
1245
1246         New SPI to export a dictionary of runtime features
1247         https://bugs.webkit.org/show_bug.cgi?id=156645
1248         <rdar://problem/23621666>
1249
1250         Post commit follow-up. Darin gave review comments that
1251         I didn't address in my original commit - I was waiting
1252         on some advice.
1253
1254         * UIProcess/WebPreferences.cpp:
1255         (WebKit::WebPreferences::isEnabledForFeature): Change the macro
1256         to generate a static list of function pointers, rather than
1257         a lot of conditional statements.
1258         (WebKit::WebPreferences::setEnabledForFeature): Ditto.
1259
1260 2016-04-19  Chris Dumez  <cdumez@apple.com>
1261
1262         Mark more classes as WTF_MAKE_FAST_ALLOCATED
1263         https://bugs.webkit.org/show_bug.cgi?id=156732
1264
1265         Reviewed by Darin Adler.
1266
1267         * NetworkProcess/Downloads/Download.h:
1268         * NetworkProcess/Downloads/PendingDownload.h:
1269         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
1270         * Shared/API/Cocoa/RemoteObjectInvocation.h:
1271
1272 2016-04-19  Alex Christensen  <achristensen@webkit.org>
1273
1274         Build fix.
1275
1276         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1277         (WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob):
1278         result is unused.
1279
1280 2016-04-19  Brady Eidson  <beidson@apple.com>
1281
1282         Modern IDB: ObjectStore Blob Support.
1283         https://bugs.webkit.org/show_bug.cgi?id=143193
1284
1285         Reviewed by Alex Christensen.
1286
1287         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1288         (WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob): Don't ASSERT that
1289           this is the first we've heard of this path - The Connection now remembers all extensions.
1290         (WebKit::NetworkConnectionToWebProcess::getBlobDataFileReferenceForPath): Don't take - Just get.
1291
1292 2016-04-19  Antti Koivisto  <antti@apple.com>
1293
1294         Try to fix iOS build.
1295
1296         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1297
1298 2016-04-19  Commit Queue  <commit-queue@webkit.org>
1299
1300         Unreviewed, rolling out r199658.
1301         https://bugs.webkit.org/show_bug.cgi?id=156736
1302
1303         It broke all EFL layout tests (Requested by KaL on #webkit).
1304
1305         Reverted changeset:
1306
1307         "[UNIX] Initialize WebKit before the platform initializations"
1308         https://bugs.webkit.org/show_bug.cgi?id=156622
1309         http://trac.webkit.org/changeset/199658
1310
1311 2016-04-18  Alex Christensen  <achristensen@webkit.org>
1312
1313         Build fix after r199700
1314
1315         * PlatformMac.cmake:
1316
1317 2016-04-18  Brady Eidson  <beidson@apple.com>
1318
1319         Modern IDB (Blob support): When reading Blobs from the database, grant the Networking process sandbox access to the files.
1320         https://bugs.webkit.org/show_bug.cgi?id=156640
1321
1322         Reviewed by Alex Christensen.
1323
1324         * DatabaseProcess/DatabaseProcess.cpp:
1325         (WebKit::DatabaseProcess::getSandboxExtensionsForBlobFiles): Utility function to ask the UI process for
1326           SandboxExtensions for a list of files.
1327         (WebKit::DatabaseProcess::didGetSandboxExtensionsForBlobFiles): Take the SandboxExtensions from the UI process
1328           and pass them along to the completion handler.
1329         * DatabaseProcess/DatabaseProcess.h:
1330         * DatabaseProcess/DatabaseProcess.messages.in:
1331
1332         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1333         (WebKit::WebIDBConnectionToClient::didGetRecord): If the value returned from the database doesn't have Blob files,
1334           pass the result directly on to WebCore. If it does, ask the UI process for SandboxExtensions first.
1335
1336         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1337         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked): Grab the BlobDataFileReference from the 
1338           NetworkConnectionToWebProcess to pass along to the BlobRegistry.
1339
1340         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1341         (WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob): Add this message
1342           so the WebProcess can preflight the creation of some blob URLs by passing along the SandboxExtensions for their files.
1343         (WebKit::NetworkConnectionToWebProcess::takeBlobDataFileReferenceForPath):
1344         * NetworkProcess/NetworkConnectionToWebProcess.h:
1345         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1346
1347         * UIProcess/Databases/DatabaseProcessProxy.cpp:
1348         (WebKit::DatabaseProcessProxy::getSandboxExtensionsForBlobFiles): Create SandboxExtensions for the passed in files and
1349           return them to the DatabaseProcess.
1350         * UIProcess/Databases/DatabaseProcessProxy.h:
1351         * UIProcess/Databases/DatabaseProcessProxy.messages.in:
1352
1353         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1354         (WebKit::WebIDBConnectionToServer::didGetRecordWithSandboxExtensions): New form of "didGetRecord" that handles passing
1355           the SandboxExtensions to the Networking process before they are needed.
1356         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1357         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
1358
1359         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
1360         (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
1361         * WebProcess/FileAPI/BlobRegistryProxy.h:
1362
1363 2016-04-18  Dean Jackson  <dino@apple.com>
1364
1365         New SPI to export a dictionary of runtime features
1366         https://bugs.webkit.org/show_bug.cgi?id=156645
1367         <rdar://problem/23621666>
1368
1369         Trying to fix GTK and EFL builds. I forgot to add files
1370         to CMake.
1371
1372         * CMakeLists.txt:
1373         * PlatformMac.cmake:
1374
1375 2016-04-18  Dean Jackson  <dino@apple.com>
1376
1377         New SPI to export a dictionary of runtime features
1378         https://bugs.webkit.org/show_bug.cgi?id=156645
1379         <rdar://problem/23621666>
1380
1381         Reviewed by Darin Adler.
1382
1383         Add a new type of Preference for experimental features so that we
1384         can dynamically toggle them from a WebKit2 host. These are special
1385         keys that are tied to runtime flags. The host process can ask WebKit
1386         for the list of keys, each with a small description, in order to
1387         display UI.
1388
1389         - Add HumanReadableName and HumanReadableDescription parameters to our
1390           macros, which are used when building a ExperimentalFeature.
1391           These are both empty strings for the existing preferences. At some
1392           point we should probably move all this to code generation rather
1393           than macros, so that we don't have to carry around unused parameters.
1394
1395         - I've included two sample experimental features: WebGL2 and ShadowDOM.
1396           They are not actually hooked up to the runtime settings yet, but its
1397           pretty clear how that will happen. Note that these are new preferences
1398           that have an "Experimental" prefix. This is so toggling an experimental
1399           feature to off won't cause the feature to not work once it becomes
1400           stable enough to enable by default. In other words, when it moves
1401           out of the experimental stage, the experimental feature flag will be
1402           removed, and you'll no longer check for values with that key.
1403
1404         - The ExperimentalFeature object is what the host process
1405           will read in order to show some UI. It contains the human readable info,
1406           as well as the actual key that can be used to query and toggle the
1407           experimental feature.
1408
1409         * Shared/API/APIObject.h: Add the ExperimentalFeature.
1410
1411         * Shared/Cocoa/APIObject.mm:
1412         (API::Object::newObject): Exposes a wrapper around a _WKExperimentalFeature ObjC type.
1413
1414         * Shared/WebPreferencesDefinitions.h: Change all the existing macros to take the new
1415         parameters, and add the initial experimental keys.
1416
1417         * Shared/WebPreferencesKeys.cpp: Add new parameters to existing macros.
1418         * Shared/WebPreferencesKeys.h: Ditto.
1419         * Shared/WebPreferencesStore.cpp: Ditto.
1420         (WebKit::defaults):
1421
1422         * UIProcess/API/APIExperimentalFeature.cpp: The API side of the ExperimentalFeature.
1423         (API::ExperimentalFeature::create):
1424         (API::ExperimentalFeature::ExperimentalFeature):
1425         (API::ExperimentalFeature::~ExperimentalFeature):
1426         * UIProcess/API/APIExperimentalFeature.h:
1427
1428         * UIProcess/API/Cocoa/WKPreferences.mm: The actual implementation of the SPI.
1429         (+[WKPreferences _experimentalFeatures]): Create and return a list of feature descriptors.
1430         (-[WKPreferences _isEnabledForFeature:]): Get the value.
1431         (-[WKPreferences _setEnabled:forFeature:]): Set the value.
1432         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1433
1434         * UIProcess/API/Cocoa/_WKExperimentalFeature.h: The ObjC version.
1435         * UIProcess/API/Cocoa/_WKExperimentalFeature.mm:
1436         (-[_WKExperimentalFeature dealloc]):
1437         (-[_WKExperimentalFeature description]):
1438         (-[_WKExperimentalFeature name]):
1439         (-[_WKExperimentalFeature key]):
1440         (-[_WKExperimentalFeature details]):
1441         (-[_WKExperimentalFeature _apiObject]):
1442         * UIProcess/API/Cocoa/_WKExperimentalFeatureInternal.h: Implementation of the wrapper.
1443         (WebKit::wrapper):
1444
1445         * UIProcess/WebPreferences.cpp: The C++ implementation that provides the data for the ObjC API.
1446         (WebKit::globalExperimentalFeatures):
1447         (WebKit::WebPreferences::ExperimentalFeatures):
1448         (WebKit::WebPreferences::isEnabledForFeature):
1449         (WebKit::WebPreferences::setEnabledForFeature):
1450         * UIProcess/WebPreferences.h:
1451
1452         * UIProcess/mac/WebPreferencesMac.mm: Update some macros.
1453         (WebKit::WebPreferences::platformInitializeStore):
1454         * WebProcess/WebPage/WebPage.cpp: Ditto
1455         (WebKit::WebPage::updatePreferences):
1456
1457         * WebKit2.xcodeproj/project.pbxproj: Add the new files.
1458
1459 2016-04-18  Tim Horton  <timothy_horton@apple.com>
1460
1461         Swipe view gesture should be reversed in right-to-left contexts
1462         https://bugs.webkit.org/show_bug.cgi?id=156714
1463
1464         Reviewed by Anders Carlsson.
1465
1466         * UIProcess/API/gtk/PageClientImpl.h:
1467         * UIProcess/PageClient.h:
1468         * UIProcess/UserInterfaceLayoutDirection.h: Added.
1469         * UIProcess/WebPageProxy.cpp:
1470         (WebKit::WebPageProxy::userInterfaceLayoutDirection):
1471         * UIProcess/WebPageProxy.h:
1472         * UIProcess/ios/PageClientImplIOS.h:
1473         * UIProcess/ios/PageClientImplIOS.mm:
1474         (WebKit::PageClientImpl::userInterfaceLayoutDirection):
1475         * UIProcess/mac/PageClientImpl.h:
1476         * UIProcess/mac/PageClientImpl.mm:
1477         (WebKit::PageClientImpl::userInterfaceLayoutDirection):
1478         Plumb RTL-ness through to WebPageProxy.
1479         We look at the WK(Web)View's UI layout direction.
1480         For other platforms, we just assume LTR.
1481
1482         * UIProcess/mac/ViewGestureController.h:
1483         * UIProcess/mac/ViewGestureControllerMac.mm:
1484         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
1485         Decide which way to swipe (and which way to look for back-forward items)
1486         based on the WebPageProxy's reported RTLness.
1487
1488         (WebKit::ViewGestureController::isPhysicallySwipingLeft):
1489         "Back" means "swiping left" in LTR and "swiping right" in RTL.
1490
1491         (WebKit::ViewGestureController::trackSwipeGesture):
1492         (WebKit::ViewGestureController::determineLayerAdjacentToSnapshotForParent):
1493         (WebKit::ViewGestureController::beginSwipeGesture):
1494         (WebKit::ViewGestureController::handleSwipeGesture):
1495         Make things that were equating "back" with "left" instead check isPhysicallySwipingLeft.
1496
1497 2016-04-18  Anders Carlsson  <andersca@apple.com>
1498
1499         Fix build with newer versions of clang.
1500         rdar://problem/25749769
1501
1502         * UIProcess/Cocoa/WebViewImpl.mm:
1503         * UIProcess/mac/WebPageProxyMac.mm:
1504         Forward declare some AppKit IPI.
1505
1506 2016-04-18  Tina Liu  <iting_liu@apple.com>
1507
1508         Implement functions to set plug-in load policies for private browsing mode
1509         https://bugs.webkit.org/show_bug.cgi?id=156540
1510
1511         Reviewed by Anders Carlsson.
1512
1513         This patch implements API and wrappers for clients to set policies to use when using
1514         private browsing. WebPlatformStrategies would return which policies to use depending
1515         on whether the page is in private browsing mode.
1516
1517         * Shared/WebProcessCreationParameters.h:
1518         Add a hash map for plug-in load policies for private browsing.
1519         * Shared/WebProcessCreationParameters.cpp:
1520         (WebKit::WebProcessCreationParameters::encode):
1521         (WebKit::WebProcessCreationParameters::decode):
1522
1523         * UIProcess/API/C/mac/WKContextPrivateMac.h:
1524         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
1525         (WKContextSetPrivateBrowsingPluginLoadClientPolicy):
1526         Add a wrapper.
1527
1528         * UIProcess/WebProcessPool.h:
1529         * UIProcess/WebProcessPool.cpp:
1530         (WebKit::WebProcessPool::createNewWebProcess):
1531         Set the WebProcessCreationParameters's pluginLoadClientPoliciesForPrivateBrowsing.
1532         (WebKit::WebProcessPool::setPluginLoadClientPolicyForBrowsingMode):
1533         A helper function that sets plug-in policies to the corresponding instance variable:
1534         m_pluginLoadClientPolicies for general browsing and m_pluginLoadClientPoliciesForPrivateBrowsing
1535         for private browsing. The logic is extracted from the original setPluginLoadClientPolicy.
1536         While we are here, get rid of the .contains() lookup as .get() will just return a
1537         constructed object if the key is not found.
1538         (WebKit::WebProcessPool::setPluginLoadClientPolicy):
1539         Switch to use the helper function to set policies.
1540         (WebKit::WebProcessPool::setPrivateBrowsingPluginLoadClientPolicy):
1541         Ditto. Also send a message to the WebProcess for setting policies for private browsing.
1542         (WebKit::WebProcessPool::clearPluginClientPolicies):
1543         Clear plug-ins' private browsing policies.
1544
1545         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1546         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1547         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicyForBrowsingMode):
1548         Ditto as WebProcessPool::setPluginLoadClientPolicyForBrowsingMode.
1549         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
1550         Switch to use setPluginLoadClientPolicyForBrowsingMode to set policies.
1551         (WebKit::WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy):
1552         Use setPluginLoadClientPolicyForBrowsingMode to set policies for private browsing.
1553         (WebKit::WebPlatformStrategies::clearPluginClientPolicies):
1554         Clear plug-ins' private browsing policies.
1555         (WebKit::WebPlatformStrategies::longestMatchedWildcardHostForHost):
1556         Add an argument for private browsing. Read from the corresponding ivar.
1557         (WebKit::WebPlatformStrategies::replaceHostWithMatchedWildcardHost):
1558         Ditto.
1559         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost): Deleted.
1560         Renamed this function as pluginLoadClientPolicyForHostForBrowsingMode.
1561         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHostForBrowsingMode):
1562         Ditto.
1563         (WebKit::WebPlatformStrategies::populatePluginCache):
1564         Get the plug-in load policies for a specific host based on the page's session status. If the page
1565         is using ephemeral session, use the private browsing policies.
1566
1567         * WebProcess/WebProcess.h:
1568         * WebProcess/WebProcess.cpp:
1569         (WebKit::WebProcess::initializeWebProcess):
1570         Switch to call the helper function setPluginLoadClientPolicyFromCreationParameters.
1571         (WebKit::WebProcess::setPluginLoadClientPolicies):
1572         Logic moved from initializeWebProcess. Call PluginStrategy::setPluginLoadClientPolicy or
1573         PluginStrategy::setPrivateBrowsingPluginLoadClientPolicy depending on the input argument.
1574         (WebKit::WebProcess::setPrivateBrowsingPluginLoadClientPolicy):
1575         Add a wrapper to call PluginStrategy::setPrivateBrowsingPluginLoadClientPolicy.
1576
1577         * WebProcess/WebProcess.messages.in:
1578         Declare an entry for setPrivateBrowsingPluginLoadClientPolicy.
1579
1580 2016-04-18  Chris Dumez  <cdumez@apple.com>
1581
1582         [WK2][iOS] Only adjust network responses' MIME type for QuickLook in the context of a main resource load
1583         https://bugs.webkit.org/show_bug.cgi?id=156639
1584         <rdar://problem/25765848>
1585
1586         Reviewed by Alex Christensen.
1587
1588         * NetworkProcess/NetworkDataTask.h:
1589         (WebKit::NetworkDataTask::firstRequest):
1590         Add getter to return the first request.
1591
1592         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1593         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
1594         Pass flag to adjustMIMETypeIfNecessary() indicated if this is a main resource load.
1595
1596 2016-04-18  Brian Burg  <bburg@apple.com>
1597
1598         Web Automation: provide detailed error messages when an automation command fails
1599         https://bugs.webkit.org/show_bug.cgi?id=156635
1600         <rdar://problem/25754051>
1601
1602         Reviewed by Darin Adler and Timothy Hatcher.
1603
1604         Fill in lots of missing error message details now that the remote end knows
1605         how to parse error strings with predefined error names and details.
1606
1607         * UIProcess/Automation/WebAutomationSession.cpp:
1608         Rearrange the error message macros. Make it possible to pass a ErrorMessage
1609         variable or just the enum value name and get out an encoded error message
1610         that optionally includes a free-form details string. The predefined error
1611         name and the details string are joined together with a semicolon.
1612
1613         (WebKit::WebAutomationSession::getBrowsingContext):
1614         (WebKit::WebAutomationSession::createBrowsingContext):
1615         (WebKit::WebAutomationSession::closeBrowsingContext):
1616         (WebKit::WebAutomationSession::switchToBrowsingContext):
1617         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
1618         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
1619         (WebKit::WebAutomationSession::navigateBrowsingContext):
1620         (WebKit::WebAutomationSession::goBackInBrowsingContext):
1621         (WebKit::WebAutomationSession::goForwardInBrowsingContext):
1622         (WebKit::WebAutomationSession::reloadBrowsingContext):
1623         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
1624         (WebKit::WebAutomationSession::didEvaluateJavaScriptFunction):
1625         (WebKit::WebAutomationSession::resolveChildFrameHandle):
1626         (WebKit::WebAutomationSession::didResolveChildFrame):
1627         (WebKit::WebAutomationSession::resolveParentFrameHandle):
1628         (WebKit::WebAutomationSession::didResolveParentFrame):
1629         (WebKit::WebAutomationSession::computeElementLayout):
1630         (WebKit::WebAutomationSession::didComputeElementLayout):
1631         (WebKit::WebAutomationSession::isShowingJavaScriptDialog):
1632         (WebKit::WebAutomationSession::dismissCurrentJavaScriptDialog):
1633         (WebKit::WebAutomationSession::acceptCurrentJavaScriptDialog):
1634         (WebKit::WebAutomationSession::messageOfCurrentJavaScriptDialog):
1635         (WebKit::WebAutomationSession::setUserInputForCurrentJavaScriptPrompt):
1636         (WebKit::WebAutomationSession::getAllCookies):
1637         (WebKit::WebAutomationSession::didGetCookiesForFrame):
1638         (WebKit::WebAutomationSession::deleteSingleCookie):
1639         (WebKit::WebAutomationSession::didDeleteCookie):
1640         (WebKit::WebAutomationSession::addSingleCookie):
1641         (WebKit::WebAutomationSession::deleteAllCookies):
1642         (WebKit::WebAutomationSession::performMouseInteraction):
1643         (WebKit::WebAutomationSession::performKeyboardInteractions):
1644         (WebKit::WebAutomationSession::takeScreenshot):
1645         (WebKit::WebAutomationSession::didTakeScreenshot):
1646         Audit almost all early exits and provide a relevant error details message
1647         if the error itself is ambiguous. Make sure to format asynchronous errors.
1648
1649 2016-04-18  Brent Fulgham  <bfulgham@apple.com>
1650
1651         CSP: Remove stubs for dynamically-added favicons (via link rel="icon")
1652         https://bugs.webkit.org/show_bug.cgi?id=153151
1653         <rdar://problem/24383176>
1654
1655         Reviewed by Darin Adler.
1656
1657         Remove the unused dynamic favicon code and tests.
1658
1659         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1660         (WebKit::WebFrameLoaderClient::dispatchDidChangeIcons): Deleted.
1661         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1662
1663 2016-04-18  Jer Noble  <jer.noble@apple.com>
1664
1665         REGRESSION( r199603): Pandora crashes WebKit in WebPlaybackSessionManager::removeClientForContext
1666         https://bugs.webkit.org/show_bug.cgi?id=156648
1667
1668         Reviewed by Darin Adler.
1669
1670         Follow up patch to r199615; avoid a double hash lookup by using a .find() pattern instead of
1671         .contains() & .get().
1672
1673         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
1674         (WebKit::WebPlaybackSessionManager::setUpPlaybackControlsManager):
1675         (WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):
1676
1677 2016-04-18  Chris Dumez  <cdumez@apple.com>
1678
1679         Unreviewed, rolling out r199644.
1680
1681         Seems to have caused a 1-2% regression on warm PLT
1682
1683         Reverted changeset:
1684
1685         "[WK2][iOS] Do not dlopen() QuickLook in the NetworkProcess"
1686         https://bugs.webkit.org/show_bug.cgi?id=156639
1687         http://trac.webkit.org/changeset/199644
1688
1689 2016-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>
1690
1691         Pending API Request URL is wrong after reloading
1692         https://bugs.webkit.org/show_bug.cgi?id=139342
1693
1694         Reviewed by Darin Adler.
1695
1696         It happens when reloading a web view loaded with anything but a
1697         URL, because the bf list is not updated for those cases and
1698         WebPageProxy::reload() is setting the current bf list item URL as
1699         pending API request URL. This also causes that progress is
1700         reported wrongly, because
1701         WebPageProxy::decidePolicyForNavigationAction() resets the pending
1702         API request URL when it's different than the requested URL. The
1703         page load transaction causes the progress to be changed, reporting
1704         1.0 (the previous one), but later something < 1.0 is reported
1705         again by the progress tracker.
1706
1707         * UIProcess/WebPageProxy.cpp:
1708         (WebKit::WebPageProxy::reload): Use the current active URL as
1709         pending API request URL, falling back to the current bf list item
1710         URL when empty.
1711
1712 2016-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>
1713
1714         Pending API request URL no set when loading Data, Alternate HTML or plain text
1715         https://bugs.webkit.org/show_bug.cgi?id=136916
1716
1717         Reviewed by Darin Adler.
1718
1719         Set pending API request URL for all load methods in
1720         WebPageProxy. This ensures that right after calling those methods,
1721         the active URL is the requested one and that
1722         PageLoadState::isLoading() returns true.
1723
1724         * UIProcess/WebPageProxy.cpp:
1725         (WebKit::WebPageProxy::loadAlternateHTMLString):
1726         (WebKit::WebPageProxy::loadPlainTextString):
1727         (WebKit::WebPageProxy::loadWebArchiveData):
1728
1729 2016-04-18  Commit Queue  <commit-queue@webkit.org>
1730
1731         Unreviewed, rolling out r199660.
1732         https://bugs.webkit.org/show_bug.cgi?id=156691
1733
1734         It broke the iOS build (Requested by KaL on #webkit).
1735
1736         Reverted changeset:
1737
1738         "Pending API request URL no set when loading Data, Alternate
1739         HTML or plain text"
1740         https://bugs.webkit.org/show_bug.cgi?id=136916
1741         http://trac.webkit.org/changeset/199660
1742
1743 2016-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>
1744
1745         Pending API request URL no set when loading Data, Alternate HTML or plain text
1746         https://bugs.webkit.org/show_bug.cgi?id=136916
1747
1748         Reviewed by Darin Adler.
1749
1750         Set pending API request URL for all load methods in
1751         WebPageProxy. This ensures that right after calling those methods,
1752         the active URL is the requested one and that
1753         PageLoadState::isLoading() returns true.
1754
1755         * UIProcess/WebPageProxy.cpp:
1756         (WebKit::WebPageProxy::loadAlternateHTMLString):
1757         (WebKit::WebPageProxy::loadPlainTextString):
1758         (WebKit::WebPageProxy::loadWebArchiveData):
1759
1760 2016-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>
1761
1762         [UNIX] Initialize WebKit before the platform initializations
1763         https://bugs.webkit.org/show_bug.cgi?id=156622
1764
1765         Reviewed by Michael Catanzaro.
1766
1767         The platform specific initialization might use something that would require WebKit2 to be initialized. For
1768         example, in debug mode, the GTK+ port uses WTF::sleep that requires the threading to be initialized.
1769
1770         * Shared/unix/ChildProcessMain.h:
1771         (WebKit::ChildProcessMain): Move InitializeWebKit2() before platformInitialize().
1772
1773 2016-04-18  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
1774
1775         Fix incorrect assumption that APPLE implies Mac.
1776         https://bugs.webkit.org/show_bug.cgi?id=156679
1777
1778         Addresses build failure introduced in r198947
1779
1780         Reviewed by Alex Christensen.
1781
1782         * CMakeLists.txt:
1783
1784 2016-04-17  Yoav Weiss  <yoav@yoav.ws>
1785
1786         Initial Link preload support
1787         https://bugs.webkit.org/show_bug.cgi?id=156334
1788
1789         Reviewed by Darin Adler.
1790
1791         * WebProcess/Network/WebLoaderStrategy.cpp:
1792         (WebKit::maximumBufferingTime): Added LinkPreload as a possible CachedResource::type.
1793
1794 2016-04-17  Chris Dumez  <cdumez@apple.com>
1795
1796         [WK2][iOS] Do not dlopen() QuickLook in the NetworkProcess
1797         https://bugs.webkit.org/show_bug.cgi?id=156639
1798
1799         Reviewed by Darin Adler.
1800
1801         * WebProcess/Network/WebResourceLoader.cpp:
1802         (WebKit::WebResourceLoader::didReceiveResponse):
1803         Move checks for main resource load and for MIME type inside of
1804         QuickLookHandle::createIfNecessary(), for consistency with the
1805         other QuickLookHandle factory functions.
1806
1807 2016-04-16  Dan Bernstein  <mitz@apple.com>
1808
1809         [Mac] Web Content service with a restricted entitlement may load arbitrary dylibs
1810         https://bugs.webkit.org/show_bug.cgi?id=156668
1811         <rdar://problem/25429784>
1812
1813         Reviewed by Anders Carlsson.
1814
1815         * Configurations/WebContentService.xcconfig: Enable library validation when the Web Content
1816           service is given the XPC domain extension entitlement.
1817
1818 2016-04-15  Dan Bernstein  <mitz@apple.com>
1819
1820         [Mac] WebContent, Networking and Databases services have i386 slices that are never used
1821         https://bugs.webkit.org/show_bug.cgi?id=156654
1822
1823         Reviewed by Alexey Proskuryakov.
1824
1825         * Configurations/BaseXPCService.xcconfig: Set VALID_ARCHS to ARCHS_STANDARD when not building only
1826           for the active architecture.
1827         * Configurations/PluginService.32.xcconfig: Removed now-redundant definitions.
1828         * Configurations/PluginService.64.xcconfig: Ditto.
1829
1830 2016-04-15  Sam Weinig  <sam@webkit.org>
1831
1832         Need a way to specify a script name to show in the inspector for scripts injected via WKUserScript
1833         <rdar://problem/25626662>
1834         https://bugs.webkit.org/show_bug.cgi?id=156653
1835
1836         Reviewed by Tim Horton.
1837
1838         * UIProcess/API/Cocoa/WKUserScript.mm:
1839         (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:userContentWorld:]):
1840         * UIProcess/API/Cocoa/WKUserScriptPrivate.h:
1841         Add a new initializer that takes an associate URL that is used to represent the user script.
1842
1843 2016-04-15  Darin Adler  <darin@apple.com>
1844
1845         Reduce use of Deprecated::ScriptXXX classes
1846         https://bugs.webkit.org/show_bug.cgi?id=156632
1847
1848         Reviewed by Alex Christensen.
1849
1850         * WebProcess/Plugins/PluginView.cpp:
1851         (WebKit::PluginView::performJavaScriptURLRequest): Use JSValue.
1852         * WebProcess/WebPage/WebInspectorUI.cpp:
1853         (WebKit::WebInspectorUI::windowObjectCleared): Use references.
1854         * WebProcess/WebPage/WebPage.cpp:
1855         (WebKit::WebPage::runJavaScriptInMainFrame): Use JSValue.
1856
1857 2016-04-15  Jer Noble  <jer.noble@apple.com>
1858
1859         REGRESSION( r199603): Pandora crashes WebKit in WebPlaybackSessionManager::removeClientForContext
1860         https://bugs.webkit.org/show_bug.cgi?id=156648
1861         <rdar://problem/25758117>
1862
1863         Reviewed by Beth Dakin.
1864
1865         Mistakenly checked in a reversed condition check, which causes a subsequent assert and crash.
1866
1867         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
1868         (WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):
1869
1870 2016-04-15  Chris Dumez  <cdumez@apple.com>
1871
1872         Mark NetworkLoad as FastAllocated
1873         https://bugs.webkit.org/show_bug.cgi?id=156628
1874
1875         Reviewed by Alex Christensen.
1876
1877         Mark NetworkLoad as FastAllocated for performance.
1878
1879         * NetworkProcess/NetworkLoad.h:
1880
1881 2016-04-14  Jer Noble  <jer.noble@apple.com>
1882
1883         Allow WebVideoFullscreenManager and Proxy to be used by audio elements.
1884         https://bugs.webkit.org/show_bug.cgi?id=156564
1885
1886         Reviewed by Beth Dakin.
1887
1888         Tease apart WebVideoFullscreenManager and …Proxy into WebPlaybackSessionManager and …Proxy
1889         classes dealing exclusively with playback state and commands, leaving fullscreen state and
1890         commands in the WebVideoFullscreenManager… classes.
1891
1892         WebVideoFullscreenManager and …Proxy will now require an associated
1893         WebPlaybackSessionManager and …Proxy class. The WebPlaybackSessionManager classes can be
1894         used separately and without the WebVideoFullscreenManager classes.
1895
1896         * DerivedSources.make:
1897         * UIProcess/API/Cocoa/WKWebView.mm:
1898         (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]):
1899         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: Copied from Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h.
1900         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: Copied from Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in.
1901         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: Added.
1902         (WebKit::WebPlaybackSessionModelContext::play):
1903         (WebKit::WebPlaybackSessionModelContext::pause):
1904         (WebKit::WebPlaybackSessionModelContext::togglePlayState):
1905         (WebKit::WebPlaybackSessionModelContext::beginScrubbing):
1906         (WebKit::WebPlaybackSessionModelContext::endScrubbing):
1907         (WebKit::WebPlaybackSessionModelContext::seekToTime):
1908         (WebKit::WebPlaybackSessionModelContext::fastSeek):
1909         (WebKit::WebPlaybackSessionModelContext::beginScanningForward):
1910         (WebKit::WebPlaybackSessionModelContext::beginScanningBackward):
1911         (WebKit::WebPlaybackSessionModelContext::endScanning):
1912         (WebKit::WebPlaybackSessionModelContext::selectAudioMediaOption):
1913         (WebKit::WebPlaybackSessionModelContext::selectLegibleMediaOption):
1914         (WebKit::WebPlaybackSessionManagerProxy::create):
1915         (WebKit::WebPlaybackSessionManagerProxy::WebPlaybackSessionManagerProxy):
1916         (WebKit::WebPlaybackSessionManagerProxy::~WebPlaybackSessionManagerProxy):
1917         (WebKit::WebPlaybackSessionManagerProxy::invalidate):
1918         (WebKit::WebPlaybackSessionManagerProxy::createModelAndInterface):
1919         (WebKit::WebPlaybackSessionManagerProxy::ensureModelAndInterface):
1920         (WebKit::WebPlaybackSessionManagerProxy::ensureModel):
1921         (WebKit::WebPlaybackSessionManagerProxy::ensureInterface):
1922         (WebKit::WebPlaybackSessionManagerProxy::addClientForContext):
1923         (WebKit::WebPlaybackSessionManagerProxy::removeClientForContext):
1924         (WebKit::WebPlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
1925         (WebKit::WebPlaybackSessionManagerProxy::clearPlaybackControlsManager):
1926         (WebKit::WebPlaybackSessionManagerProxy::resetMediaState):
1927         (WebKit::WebPlaybackSessionManagerProxy::setCurrentTime):
1928         (WebKit::WebPlaybackSessionManagerProxy::setBufferedTime):
1929         (WebKit::WebPlaybackSessionManagerProxy::setSeekableRangesVector):
1930         (WebKit::WebPlaybackSessionManagerProxy::setCanPlayFastReverse):
1931         (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions):
1932         (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions):
1933         (WebKit::WebPlaybackSessionManagerProxy::setExternalPlaybackProperties):
1934         (WebKit::WebPlaybackSessionManagerProxy::setWirelessVideoPlaybackDisabled):
1935         (WebKit::WebPlaybackSessionManagerProxy::setDuration):
1936         (WebKit::WebPlaybackSessionManagerProxy::setRate):
1937         (WebKit::WebPlaybackSessionManagerProxy::play):
1938         (WebKit::WebPlaybackSessionManagerProxy::pause):
1939         (WebKit::WebPlaybackSessionManagerProxy::togglePlayState):
1940         (WebKit::WebPlaybackSessionManagerProxy::beginScrubbing):
1941         (WebKit::WebPlaybackSessionManagerProxy::endScrubbing):
1942         (WebKit::WebPlaybackSessionManagerProxy::seekToTime):
1943         (WebKit::WebPlaybackSessionManagerProxy::fastSeek):
1944         (WebKit::WebPlaybackSessionManagerProxy::beginScanningForward):
1945         (WebKit::WebPlaybackSessionManagerProxy::beginScanningBackward):
1946         (WebKit::WebPlaybackSessionManagerProxy::endScanning):
1947         (WebKit::WebPlaybackSessionManagerProxy::selectAudioMediaOption):
1948         (WebKit::WebPlaybackSessionManagerProxy::selectLegibleMediaOption):
1949         (WebKit::WebPlaybackSessionManagerProxy::controlsManagerInterface):
1950         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
1951         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
1952         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1953         (WebKit::WebVideoFullscreenModelContext::WebVideoFullscreenModelContext):
1954         (WebKit::WebVideoFullscreenModelContext::~WebVideoFullscreenModelContext):
1955         (WebKit::WebVideoFullscreenModelContext::play):
1956         (WebKit::WebVideoFullscreenModelContext::pause):
1957         (WebKit::WebVideoFullscreenModelContext::togglePlayState):
1958         (WebKit::WebVideoFullscreenModelContext::beginScrubbing):
1959         (WebKit::WebVideoFullscreenModelContext::endScrubbing):
1960         (WebKit::WebVideoFullscreenModelContext::seekToTime):
1961         (WebKit::WebVideoFullscreenModelContext::fastSeek):
1962         (WebKit::WebVideoFullscreenModelContext::beginScanningForward):
1963         (WebKit::WebVideoFullscreenModelContext::beginScanningBackward):
1964         (WebKit::WebVideoFullscreenModelContext::endScanning):
1965         (WebKit::WebVideoFullscreenModelContext::selectAudioMediaOption):
1966         (WebKit::WebVideoFullscreenModelContext::selectLegibleMediaOption):
1967         (WebKit::WebVideoFullscreenManagerProxy::create):
1968         (WebKit::WebVideoFullscreenManagerProxy::WebVideoFullscreenManagerProxy):
1969         (WebKit::WebVideoFullscreenManagerProxy::createModelAndInterface):
1970         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Deleted.
1971         (WebKit::WebVideoFullscreenManagerProxy::setVideoDimensions): Deleted.
1972         (WebKit::WebVideoFullscreenManagerProxy::enterFullscreen): Deleted.
1973         (WebKit::WebVideoFullscreenManagerProxy::exitFullscreen): Deleted.
1974         (WebKit::WebVideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode): Deleted.
1975         (WebKit::WebVideoFullscreenManagerProxy::cleanupFullscreen): Deleted.
1976         (WebKit::WebVideoFullscreenManagerProxy::preparedToReturnToInline): Deleted.
1977         (WebKit::WebVideoFullscreenManagerProxy::requestFullscreenMode): Deleted.
1978         (WebKit::WebVideoFullscreenManagerProxy::didSetupFullscreen): Deleted.
1979         (WebKit::WebVideoFullscreenManagerProxy::didExitFullscreen): Deleted.
1980         (WebKit::WebVideoFullscreenManagerProxy::didEnterFullscreen): Deleted.
1981         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): Deleted.
1982         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame): Deleted.
1983         * UIProcess/WebPageProxy.cpp:
1984         (WebKit::WebPageProxy::WebPageProxy):
1985         (WebKit::WebPageProxy::reattachToWebProcess):
1986         (WebKit::WebPageProxy::playbackSessionManager):
1987         (WebKit::WebPageProxy::videoFullscreenManager):
1988         (WebKit::WebPageProxy::resetState):
1989         (WebKit::WebPageProxy::hasActiveVideoForControlsManager):
1990         (WebKit::WebPageProxy::isPlayingMediaDidChange): Deleted.
1991         * UIProcess/WebPageProxy.h:
1992         * WebKit2.xcodeproj/project.pbxproj:
1993         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1994         (WebKit::WebChromeClient::supportsVideoFullscreen):
1995         (WebKit::WebChromeClient::setUpPlaybackControlsManager):
1996         (WebKit::WebChromeClient::clearPlaybackControlsManager):
1997         (WebKit::WebChromeClient::enterVideoFullscreenForVideoElement):
1998         (WebKit::WebChromeClient::exitVideoFullscreenForVideoElement):
1999         (WebKit::WebChromeClient::exitVideoFullscreenToModeWithoutAnimation):
2000         * WebProcess/WebCoreSupport/WebChromeClient.h:
2001         * WebProcess/WebPage/WebPage.cpp:
2002         (WebKit::WebPage::playbackSessionManager):
2003         (WebKit::WebPage::videoFullscreenManager):
2004         * WebProcess/WebPage/WebPage.h:
2005         * WebProcess/cocoa/WebPlaybackSessionManager.h: Copied from Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.h.
2006         (WebKit::WebPlaybackSessionInterfaceContext::create):
2007         (WebKit::WebPlaybackSessionInterfaceContext::invalidate):
2008         * WebProcess/cocoa/WebPlaybackSessionManager.messages.in: Added.
2009         * WebProcess/cocoa/WebPlaybackSessionManager.mm: Added.
2010         (WebKit::nextContextId):
2011         (WebKit::WebPlaybackSessionInterfaceContext::WebPlaybackSessionInterfaceContext):
2012         (WebKit::WebPlaybackSessionInterfaceContext::~WebPlaybackSessionInterfaceContext):
2013         (WebKit::WebPlaybackSessionInterfaceContext::resetMediaState):
2014         (WebKit::WebPlaybackSessionInterfaceContext::setDuration):
2015         (WebKit::WebPlaybackSessionInterfaceContext::setCurrentTime):
2016         (WebKit::WebPlaybackSessionInterfaceContext::setBufferedTime):
2017         (WebKit::WebPlaybackSessionInterfaceContext::setRate):
2018         (WebKit::WebPlaybackSessionInterfaceContext::setSeekableRanges):
2019         (WebKit::WebPlaybackSessionInterfaceContext::setCanPlayFastReverse):
2020         (WebKit::WebPlaybackSessionInterfaceContext::setAudioMediaSelectionOptions):
2021         (WebKit::WebPlaybackSessionInterfaceContext::setLegibleMediaSelectionOptions):
2022         (WebKit::WebPlaybackSessionInterfaceContext::setExternalPlayback):
2023         (WebKit::WebPlaybackSessionInterfaceContext::setWirelessVideoPlaybackDisabled):
2024         (WebKit::WebPlaybackSessionManager::create):
2025         (WebKit::WebPlaybackSessionManager::WebPlaybackSessionManager):
2026         (WebKit::WebPlaybackSessionManager::~WebPlaybackSessionManager):
2027         (WebKit::WebPlaybackSessionManager::createModelAndInterface):
2028         (WebKit::WebPlaybackSessionManager::ensureModelAndInterface):
2029         (WebKit::WebPlaybackSessionManager::ensureModel):
2030         (WebKit::WebPlaybackSessionManager::ensureInterface):
2031         (WebKit::WebPlaybackSessionManager::removeContext):
2032         (WebKit::WebPlaybackSessionManager::addClientForContext):
2033         (WebKit::WebPlaybackSessionManager::removeClientForContext):
2034         (WebKit::WebPlaybackSessionManager::setUpPlaybackControlsManager):
2035         (WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):
2036         (WebKit::WebPlaybackSessionManager::contextIdForMediaElement):
2037         (WebKit::WebPlaybackSessionManager::resetMediaState):
2038         (WebKit::WebPlaybackSessionManager::setDuration):
2039         (WebKit::WebPlaybackSessionManager::setCurrentTime):
2040         (WebKit::WebPlaybackSessionManager::setBufferedTime):
2041         (WebKit::WebPlaybackSessionManager::setRate):
2042         (WebKit::WebPlaybackSessionManager::setSeekableRanges):
2043         (WebKit::WebPlaybackSessionManager::setCanPlayFastReverse):
2044         (WebKit::WebPlaybackSessionManager::setAudioMediaSelectionOptions):
2045         (WebKit::WebPlaybackSessionManager::setLegibleMediaSelectionOptions):
2046         (WebKit::WebPlaybackSessionManager::setExternalPlayback):
2047         (WebKit::WebPlaybackSessionManager::setWirelessVideoPlaybackDisabled):
2048         (WebKit::WebPlaybackSessionManager::play):
2049         (WebKit::WebPlaybackSessionManager::pause):
2050         (WebKit::WebPlaybackSessionManager::togglePlayState):
2051         (WebKit::WebPlaybackSessionManager::beginScrubbing):
2052         (WebKit::WebPlaybackSessionManager::endScrubbing):
2053         (WebKit::WebPlaybackSessionManager::seekToTime):
2054         (WebKit::WebPlaybackSessionManager::fastSeek):
2055         (WebKit::WebPlaybackSessionManager::beginScanningForward):
2056         (WebKit::WebPlaybackSessionManager::beginScanningBackward):
2057         (WebKit::WebPlaybackSessionManager::endScanning):
2058         (WebKit::WebPlaybackSessionManager::selectAudioMediaOption):
2059         (WebKit::WebPlaybackSessionManager::selectLegibleMediaOption):
2060         * WebProcess/cocoa/WebVideoFullscreenManager.h:
2061         (WebKit::WebVideoFullscreenInterfaceContext::create):
2062         * WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
2063         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
2064         (WebKit::WebVideoFullscreenInterfaceContext::WebVideoFullscreenInterfaceContext):
2065         (WebKit::WebVideoFullscreenInterfaceContext::resetMediaState):
2066         (WebKit::WebVideoFullscreenInterfaceContext::setDuration):
2067         (WebKit::WebVideoFullscreenInterfaceContext::setCurrentTime):
2068         (WebKit::WebVideoFullscreenInterfaceContext::setBufferedTime):
2069         (WebKit::WebVideoFullscreenInterfaceContext::setRate):
2070         (WebKit::WebVideoFullscreenInterfaceContext::setSeekableRanges):
2071         (WebKit::WebVideoFullscreenInterfaceContext::setCanPlayFastReverse):
2072         (WebKit::WebVideoFullscreenInterfaceContext::setAudioMediaSelectionOptions):
2073         (WebKit::WebVideoFullscreenInterfaceContext::setLegibleMediaSelectionOptions):
2074         (WebKit::WebVideoFullscreenInterfaceContext::setExternalPlayback):
2075         (WebKit::WebVideoFullscreenInterfaceContext::setWirelessVideoPlaybackDisabled):
2076         (WebKit::WebVideoFullscreenManager::create):
2077         (WebKit::WebVideoFullscreenManager::WebVideoFullscreenManager):
2078         (WebKit::WebVideoFullscreenManager::createModelAndInterface):
2079         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
2080         (WebKit::WebVideoFullscreenInterfaceContext::setVideoDimensions): Deleted.
2081         (WebKit::WebVideoFullscreenManager::~WebVideoFullscreenManager): Deleted.
2082         (WebKit::WebVideoFullscreenManager::ensureModelAndInterface): Deleted.
2083         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation): Deleted.
2084         (WebKit::WebVideoFullscreenManager::setVideoDimensions): Deleted.
2085         (WebKit::WebVideoFullscreenManager::requestFullscreenMode): Deleted.
2086         (WebKit::WebVideoFullscreenManager::fullscreenModeChanged): Deleted.
2087         (WebKit::WebVideoFullscreenManager::didSetupFullscreen): Deleted.
2088         (WebKit::WebVideoFullscreenManager::didEnterFullscreen): Deleted.
2089         (WebKit::WebVideoFullscreenManager::didExitFullscreen): Deleted.
2090         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): Deleted.
2091         (WebKit::WebVideoFullscreenManager::setVideoLayerGravityEnum): Deleted.
2092         (WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline): Deleted.
2093         (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced): Deleted.
2094
2095 2016-04-15  John Wilander  <wilander@apple.com>
2096
2097         Refactor WebSockets handshake to use StringView instead of String for header validation.
2098         https://bugs.webkit.org/show_bug.cgi?id=155602
2099
2100         Reviewed by Darin Adler.
2101
2102         * UIProcess/InspectorServer/HTTPRequest.cpp:
2103         (WebKit::HTTPRequest::parseHeaders):
2104             Now declares the HTTP header name as a StringView to match the change in WebCore::parseHTTPHeader.
2105
2106 2016-04-15  Alex Christensen  <achristensen@webkit.org>
2107
2108         Don't copy entire NSURLSessionConfiguration just to test for credentials
2109         https://bugs.webkit.org/show_bug.cgi?id=156598
2110
2111         Reviewed by Brady Eidson.
2112
2113         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2114         (-[WKNetworkSessionDelegate initWithNetworkSession:withCredentials:]):
2115         (-[WKNetworkSessionDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]):
2116         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
2117         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
2118         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
2119         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
2120         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
2121         (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
2122         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
2123         (WebKit::NetworkSession::NetworkSession):
2124         (-[WKNetworkSessionDelegate initWithNetworkSession:]): Deleted.
2125
2126 2016-04-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2127
2128         Unreviewed. Fix GTK+ build after r199558.
2129
2130         * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
2131         (webkitFileChooserRequestCreate):
2132         (webkit_file_chooser_request_select_files):
2133         * UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h:
2134         * UIProcess/API/gtk/WebKitUIClient.cpp:
2135
2136 2016-04-14  Brent Fulgham  <bfulgham@apple.com>
2137
2138         Make <a download> a runtime enabled option
2139         https://bugs.webkit.org/show_bug.cgi?id=156583
2140         <rdar://problem/25733449>
2141
2142         Reviewed by Alex Christensen.
2143
2144         Add a download attribute runtime flag based on preferences.
2145         Disable the download attribute by default.
2146
2147         * Shared/WebPreferencesDefinitions.h:
2148         * UIProcess/API/C/WKPreferences.cpp:
2149         (WKPreferencesGetFetchAPIEnabled):
2150         (WKPreferencesSetDownloadAttributeEnabled):
2151         (WKPreferencesGetDownloadAttributeEnabled):
2152         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2153         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2154         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2155         * WebProcess/WebPage/WebPage.cpp:
2156         (WebKit::WebPage::updatePreferences):
2157
2158 2016-04-14  Alex Christensen  <achristensen@webkit.org>
2159
2160         Build fix after r199554.
2161
2162         * CMakeLists.txt:
2163         * PlatformMac.cmake:
2164
2165 2016-04-14  Brian Burg  <bburg@apple.com>
2166
2167         Web Automation: suppress automatic text correction in pages controlled by automation
2168         https://bugs.webkit.org/show_bug.cgi?id=156599
2169         <rdar://problem/25712646>
2170
2171         Reviewed by Timothy Hatcher.
2172
2173         If the page is controlled by automation, then automatic text corrections will
2174         cause unexpected behaviors by nondeterministically modifying text inserted by
2175         a test. Just pretend these behaviors are disabled if controlled by automation.
2176
2177         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
2178         (WebKit::WebEditorClient::isAutomaticQuoteSubstitutionEnabled):
2179         (WebKit::WebEditorClient::isAutomaticDashSubstitutionEnabled):
2180         (WebKit::WebEditorClient::isAutomaticTextReplacementEnabled):
2181         (WebKit::WebEditorClient::isAutomaticSpellingCorrectionEnabled):
2182
2183 2016-04-14  Anders Carlsson  <andersca@apple.com>
2184
2185         Try to fix the Yosemite build.
2186
2187         * UIProcess/Cocoa/UIDelegate.mm:
2188         (WebKit::UIDelegate::UIClient::runOpenPanel):
2189
2190 2016-04-14  Anders Carlsson  <andersca@apple.com>
2191
2192         [Mac] Add API for open panel handling to WKWebView
2193         https://bugs.webkit.org/show_bug.cgi?id=137759
2194         rdar://problem/23278623
2195
2196         Reviewed by Tim Horton.
2197
2198         Based on a patch by Brian Michel.
2199
2200         * Shared/API/Cocoa/WebKit.h:
2201         Import WKOpenPanelParameters.h.
2202
2203         * Shared/Cocoa/APIObject.mm:
2204         (API::Object::newObject):
2205         Create a WKOpenPanelParameters for Type::OpenPanelParameters.
2206
2207         * UIProcess/API/APIOpenPanelParameters.cpp: Renamed from Source/WebKit2/Shared/WebOpenPanelParameters.cpp.
2208         * UIProcess/API/APIOpenPanelParameters.h: Renamed from Source/WebKit2/Shared/WebOpenPanelParameters.h.
2209         Rename WebKit::WebOpenPanelParameters to API::OpenPanelParameters.
2210
2211         * UIProcess/API/APIUIClient.h:
2212         (API::UIClient::runOpenPanel):
2213         Change this to take a SecurityOriginData.
2214
2215         * UIProcess/API/C/WKAPICast.h:
2216         * UIProcess/API/C/WKOpenPanelParametersRef.cpp:
2217         (WKOpenPanelParametersGetTypeID):
2218         Rename WebKit::WebOpenPanelParameters to API::OpenPanelParameters.
2219
2220         * UIProcess/API/C/WKOpenPanelResultListener.cpp:
2221         (filePathsFromFileURLs):
2222         (WKOpenPanelResultListenerChooseFiles):
2223         * UIProcess/API/C/WKPage.cpp:
2224         (WKPageSetPageUIClient):
2225         Change chooseFiles to take a Vector<String> instead of an API::Array of URLs.
2226
2227         * UIProcess/API/Cocoa/WKOpenPanelParameters.h: Added.
2228         * UIProcess/API/Cocoa/WKOpenPanelParameters.mm: Added.
2229         (-[WKOpenPanelParameters allowsMultipleSelection]):
2230         (-[WKOpenPanelParameters _apiObject]):
2231         * UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h:
2232         Add a WKOpenPanelParameters class which contains information about a file upload control.
2233
2234         * UIProcess/API/Cocoa/WKUIDelegate.h:
2235         Add new delegate method.
2236
2237         * UIProcess/Cocoa/UIDelegate.h:
2238         * UIProcess/Cocoa/UIDelegate.mm:
2239         (WebKit::UIDelegate::setDelegate):
2240         Record whether the UI delegate implements the new delegate method.
2241
2242         (WebKit::UIDelegate::UIClient::runOpenPanel):
2243         Invoke the new delegate method.
2244
2245         * UIProcess/PageClient.h:
2246         (WebKit::PageClient::handleRunOpenPanel):
2247         Rename WebKit::WebOpenPanelParameters to API::OpenPanelParameters.
2248
2249         * UIProcess/WebOpenPanelResultListenerProxy.cpp:
2250         (WebKit::WebOpenPanelResultListenerProxy::chooseFiles):
2251         * UIProcess/WebOpenPanelResultListenerProxy.h:
2252         Change chooseFiles to take a Vector<String> instead of an API::Array of URLs.
2253
2254         * UIProcess/WebPageProxy.cpp:
2255         (WebKit::WebPageProxy::runOpenPanel):
2256         * UIProcess/WebPageProxy.h:
2257         Change this to take a SecurityOriginData.
2258
2259         * UIProcess/WebPageProxy.messages.in:
2260         Change RunOpenPanel to take a SecurityOriginData.
2261
2262         * UIProcess/ios/PageClientImplIOS.h:
2263         * UIProcess/ios/PageClientImplIOS.mm:
2264         (WebKit::PageClientImpl::handleRunOpenPanel):
2265         Rename WebKit::WebOpenPanelParameters to API::OpenPanelParameters.
2266
2267         * UIProcess/ios/WKContentViewInteraction.h:
2268         * UIProcess/ios/WKContentViewInteraction.mm:
2269         (-[WKContentView _showRunOpenPanel:resultListener:]):
2270         Change chooseFiles to take a Vector<String> instead of an API::Array of URLs.
2271
2272         * UIProcess/ios/forms/WKFileUploadPanel.h:
2273         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2274         (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]):
2275         Change chooseFiles to take a Vector<String> instead of an API::Array of URLs.
2276
2277         (-[WKFileUploadPanel presentWithParameters:resultListener:]):
2278         Rename WebKit::WebOpenPanelParameters to API::OpenPanelParameters.
2279
2280         * WebKit2.xcodeproj/project.pbxproj:
2281         Add new file.
2282
2283         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2284         (WebKit::WebChromeClient::runOpenPanel):
2285         Pass the security origin of the frame along.
2286
2287 2016-04-14  Jiewen Tan  <jiewen_tan@apple.com>
2288
2289         Unreviewed, rolling out r199554.
2290
2291         The change breaks Yosemite Release/Debug build
2292
2293         Reverted changeset:
2294
2295         "[Mac] Add API for open panel handling to WKWebView"
2296         https://bugs.webkit.org/show_bug.cgi?id=137759
2297         http://trac.webkit.org/changeset/199554
2298
2299 2016-04-14  Anders Carlsson  <andersca@apple.com>
2300
2301         [Mac] Add API for open panel handling to WKWebView
2302         https://bugs.webkit.org/show_bug.cgi?id=137759
2303         rdar://problem/23278623
2304
2305         Reviewed by Tim Horton.
2306
2307         Based on a patch by Brian Michel.
2308
2309         * Shared/API/Cocoa/WebKit.h:
2310         Import WKOpenPanelParameters.h.
2311
2312         * Shared/Cocoa/APIObject.mm:
2313         (API::Object::newObject):
2314         Create a WKOpenPanelParameters for Type::OpenPanelParameters.
2315
2316         * UIProcess/API/APIOpenPanelParameters.cpp: Renamed from Source/WebKit2/Shared/WebOpenPanelParameters.cpp.
2317         * UIProcess/API/APIOpenPanelParameters.h: Renamed from Source/WebKit2/Shared/WebOpenPanelParameters.h.
2318         Rename WebKit::WebOpenPanelParameters to API::OpenPanelParameters.
2319
2320         * UIProcess/API/APIUIClient.h:
2321         (API::UIClient::runOpenPanel):
2322         Change this to take a SecurityOriginData.
2323
2324         * UIProcess/API/C/WKAPICast.h:
2325         * UIProcess/API/C/WKOpenPanelParametersRef.cpp:
2326         (WKOpenPanelParametersGetTypeID):
2327         Rename WebKit::WebOpenPanelParameters to API::OpenPanelParameters.
2328
2329         * UIProcess/API/C/WKOpenPanelResultListener.cpp:
2330         (filePathsFromFileURLs):
2331         (WKOpenPanelResultListenerChooseFiles):
2332         * UIProcess/API/C/WKPage.cpp:
2333         (WKPageSetPageUIClient):
2334         Change chooseFiles to take a Vector<String> instead of an API::Array of URLs.
2335
2336         * UIProcess/API/Cocoa/WKOpenPanelParameters.h: Added.
2337         * UIProcess/API/Cocoa/WKOpenPanelParameters.mm: Added.
2338         (-[WKOpenPanelParameters allowsMultipleSelection]):
2339         (-[WKOpenPanelParameters _apiObject]):
2340         * UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h:
2341         Add a WKOpenPanelParameters class which contains information about a file upload control.
2342
2343         * UIProcess/API/Cocoa/WKUIDelegate.h:
2344         Add new delegate method.
2345
2346         * UIProcess/Cocoa/UIDelegate.h:
2347         * UIProcess/Cocoa/UIDelegate.mm:
2348         (WebKit::UIDelegate::setDelegate):
2349         Record whether the UI delegate implements the new delegate method.
2350
2351         (WebKit::UIDelegate::UIClient::runOpenPanel):
2352         Invoke the new delegate method.
2353
2354         * UIProcess/PageClient.h:
2355         (WebKit::PageClient::handleRunOpenPanel):
2356         Rename WebKit::WebOpenPanelParameters to API::OpenPanelParameters.
2357
2358         * UIProcess/WebOpenPanelResultListenerProxy.cpp:
2359         (WebKit::WebOpenPanelResultListenerProxy::chooseFiles):
2360         * UIProcess/WebOpenPanelResultListenerProxy.h:
2361         Change chooseFiles to take a Vector<String> instead of an API::Array of URLs.
2362
2363         * UIProcess/WebPageProxy.cpp:
2364         (WebKit::WebPageProxy::runOpenPanel):
2365         * UIProcess/WebPageProxy.h:
2366         Change this to take a SecurityOriginData.
2367
2368         * UIProcess/WebPageProxy.messages.in:
2369         Change RunOpenPanel to take a SecurityOriginData.
2370
2371         * UIProcess/ios/PageClientImplIOS.h:
2372         * UIProcess/ios/PageClientImplIOS.mm:
2373         (WebKit::PageClientImpl::handleRunOpenPanel):
2374         Rename WebKit::WebOpenPanelParameters to API::OpenPanelParameters.
2375
2376         * UIProcess/ios/WKContentViewInteraction.h:
2377         * UIProcess/ios/WKContentViewInteraction.mm:
2378         (-[WKContentView _showRunOpenPanel:resultListener:]):
2379         Change chooseFiles to take a Vector<String> instead of an API::Array of URLs.
2380
2381         * UIProcess/ios/forms/WKFileUploadPanel.h:
2382         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2383         (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]):
2384         Change chooseFiles to take a Vector<String> instead of an API::Array of URLs.
2385
2386         (-[WKFileUploadPanel presentWithParameters:resultListener:]):
2387         Rename WebKit::WebOpenPanelParameters to API::OpenPanelParameters.
2388
2389         * WebKit2.xcodeproj/project.pbxproj:
2390         Add new file.
2391
2392         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2393         (WebKit::WebChromeClient::runOpenPanel):
2394         Pass the security origin of the frame along.
2395
2396 2016-04-14  Alex Christensen  <achristensen@webkit.org>
2397
2398         Fix build without IndexedDB.
2399
2400         * DatabaseProcess/DatabaseProcess.cpp:
2401         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
2402         (WebKit::DatabaseProcess::grantSandboxExtensionsForBlobs):
2403         (WebKit::DatabaseProcess::prepareForAccessToTemporaryFile):
2404         * DatabaseProcess/DatabaseProcess.h:
2405         * DatabaseProcess/DatabaseProcess.messages.in:
2406
2407 2016-04-13  Daniel Bates  <dabates@apple.com>
2408
2409         REGRESSION (r199401): Internal builds of Safari hang on launch
2410         https://bugs.webkit.org/show_bug.cgi?id=156545
2411         <rdar://problem/25697779>
2412
2413         As pointed out by Darin Adler, remove RELEASE_ASSERT() that I inadvertently left in
2414         WebCore::secCodeForProcess() as part of r199504. For now, we handle
2415         SecCodeCopyGuestWithAttributes() returning an error. In a subsequent commit we will
2416         look to re-introduce the use of a RELEASE_ASSERT() to enforce the invariant that
2417         SecCodeCopyGuestWithAttributes() returns a success status.
2418
2419         * Shared/mac/CodeSigning.mm:
2420         (WebKit::secCodeForProcess):
2421
2422 2016-04-13  Brady Eidson  <beidson@apple.com>
2423
2424         Modern IDB (Blob support): Support retrieving Blobs from IDB.
2425         https://bugs.webkit.org/show_bug.cgi?id=156367
2426
2427         Reviewed by Alex Christensen.
2428
2429         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2430         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
2431         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
2432         
2433         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2434         (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
2435         * NetworkProcess/NetworkConnectionToWebProcess.h:
2436         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2437         
2438         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
2439         (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
2440         * WebProcess/FileAPI/BlobRegistryProxy.h:
2441
2442 2016-04-13  Chris Dumez  <cdumez@apple.com>
2443
2444         We should not speculatively revalidate cached redirects
2445         https://bugs.webkit.org/show_bug.cgi?id=156548
2446         <rdar://problem/25583886>
2447
2448         Reviewed by Darin Adler.
2449
2450         Stop speculatively revalidating cached redirects. This matches matches
2451         the behavior in NetworkCache's makeUseDecision() which reuses cached
2452         redirects only if they do not need revalidation.
2453
2454         This was breaking fonts.css loading on stripe.com because the
2455         SpeculativeLoadManager would wrongly speculatively revalidate the
2456         redirect and then serve a 302 response the NetworkResourceLoader
2457         when the actual request came in. This would cause us to not follow
2458         the redirect.
2459
2460         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2461         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
2462         Abort the speculative load if it hits a redirect. This is the safe thing
2463         to do in this case, as we are supposed to do a hand-shake with WebCore
2464         in such case.
2465
2466         (WebKit::NetworkCache::SpeculativeLoad::didReceiveResponse):
2467         Let successful validations fall through instead of calling didComplete()
2468         early. This matches what is not in NetworkResourceLoader. This way,
2469         didFinishLoading() ends up getting called for both successful and
2470         unsuccessful (i.e. did not return a 302 status code) network validation.
2471
2472         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
2473         - Stop dealing with redirects as we abort the load as soon as we hit a
2474           redirect now.
2475         - Stop asserting that m_cacheEntryForValidation is null now that this
2476           is called for successful validations as well.
2477
2478         (WebKit::NetworkCache::SpeculativeLoad::abort):
2479         New method that aborts the network loads, calls the completion handler
2480         and clean up. It is called in the case we hit a redirect while
2481         revalidating.
2482
2483         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
2484         Drop m_redirectChainCacheStatus member as we no longer deal with
2485         redirects.
2486
2487         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2488         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
2489         If the resource needs revalidation AND is a cached redirect, then do not
2490         use it. This matches what is done in NetworkCache's makeUseDecision().
2491
2492 2016-04-13  Brady Eidson  <beidson@apple.com>
2493
2494         Modern IDB: NetworkProcessConnection::didClose needs to have a self ref.
2495         <rdar://problem/25700864> and https://bugs.webkit.org/show_bug.cgi?id=156559
2496
2497         Reviewed by Alex Christensen.
2498
2499         * WebProcess/Network/NetworkProcessConnection.cpp:
2500         (WebKit::NetworkProcessConnection::didClose): Self ref to protect this.
2501
2502 2016-04-13  Daniel Bates  <dabates@apple.com>
2503
2504         REGRESSION (r199401): Internal builds of Safari hang on launch
2505         https://bugs.webkit.org/show_bug.cgi?id=156545
2506         <rdar://problem/25697779>
2507
2508         Reviewed by Anders Carlsson.
2509
2510         For some reason SecCodeCopyGuestWithAttributes() is failing with an error in Apple Internal
2511         Safari builds. For now, temporarily allow the failure while I investigate the cause in
2512         <rdar://problem/25706517>.
2513
2514         * Shared/mac/CodeSigning.mm:
2515         (WebKit::secCodeForProcess): Log the failure with OSStatus code and return nullptr;
2516         (WebKit::codeSigningIdentifierForProcess): Return a null string if secCodeForProcess() returns a nullptr.
2517         This will cause us to treat affected Apple Internal Safari builds the same as we would treat
2518         an unsigned or third-party signed app.
2519
2520 2016-04-13  Alex Christensen  <achristensen@webkit.org>
2521
2522         Fix client certificate authentication with NetworkSession
2523         https://bugs.webkit.org/show_bug.cgi?id=156527
2524         <rdar://problem/25489156>
2525
2526         Reviewed by Darin Adler.
2527
2528         * NetworkProcess/NetworkLoad.cpp:
2529         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
2530         We only want to use serverTrustCredential for ServerTrustEvaluation authentication challenges, not 
2531         * Shared/Authentication/AuthenticationManager.cpp:
2532         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
2533         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
2534         * Shared/Authentication/AuthenticationManager.h:
2535         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
2536         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
2537         Don't use challenge.sender with NSURLSession, which requires callbacks instead.
2538
2539 2016-04-12  Daniel Bates  <dabates@apple.com>
2540
2541         REGRESSION (r198933): Unable to login to Google account from Internet Accounts preference pane
2542         https://bugs.webkit.org/show_bug.cgi?id=156447
2543         <rdar://problem/25628133>
2544
2545         Reviewed by Darin Adler.
2546
2547         Reverts the workaround landed in r199301 and teaches ProcessLauncherMac to use the code
2548         signing identifier of the UI process as the client-identifier if it is signed. Otherwise,
2549         we fall back to using the main bundle identifier or _NSGetProgname() depending on whether
2550         the UI process has an associated app bundle.
2551
2552         * PlatformMac.cmake: Add file Shared/mac/CodeSigning.mm.
2553         * Shared/mac/ChildProcessMac.mm:
2554         (WebKit::ChildProcess::initializeSandbox):
2555         (WebKit::codeSigningIdentifierForProcess): Deleted; moved from here to file Shared/mac/CodeSigning.mm.
2556         * Shared/mac/CodeSigning.h: Added.
2557         * Shared/mac/CodeSigning.mm: Added.
2558         (WebKit::secCodeForCurrentProcess): Added.
2559         (WebKit::secCodeForProcess): Added.
2560         (WebKit::secCodeSigningInformation): Added.
2561         (WebKit::appleSignedOrMacAppStoreSignedOrAppleDeveloperSignedRequirement): Added.
2562         (WebKit::secCodeSigningIdentifier): Added.
2563         (WebKit::codeSigningIdentifier): Returns the code signing identifier for the current process.
2564         (WebKit::codeSigningIdentifierForProcess): Moved from file Shared/mac/ChildProcessMac.mm. Extracted logic
2565         into various helper functions (above) so that it can be shared with WebKit::codeSigningIdentifier() as
2566         well as to improve the readability of the code. Removed the OSStatus out argument that was used by callers
2567         for logging purposes and moved such logging responsibility into WebKit::secCodeSigningIdentifier() as
2568         a release assertion message since we always want to log this error when code signing validation fails. We
2569         use a release assertion to cause a noticeable crash because we such failures should not occur and if they
2570         do then we want to see crash reports so that we can handle such failures. Using a release assertion for
2571         validation failures also simplifies the possible return values of this function as such failures represented
2572         the only case where this function would return an empty string. We now return either a null string or a non-
2573         empty string. We return a null string when the specified process is either unsigned or signed by a third-party;
2574         otherwise, we return a non-empty string that represents the code signing identifier.
2575         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2576         (WebKit::connectToService): Use the code signing identifier for the client-identifier if we have one (e.g.
2577         we are signed app). If we do not have a code signing identifier then take client-identifier to be the
2578         bundle identifier of our main bundle. Failing that we take client-identifier to be _NSGetProgname().
2579         * WebKit2.xcodeproj/project.pbxproj: Add files Shared/mac/CodeSigning.{h, mm}.
2580
2581 2016-04-12  Enrica Casucci  <enrica@apple.com>
2582
2583         Should retrieve text surrounding the selection when performing lookup.
2584         https://bugs.webkit.org/show_bug.cgi?id=156525
2585         rdar://problem/25043678
2586
2587         Reviewed by Tim Horton.
2588
2589         The lookup functionality requires the surrounding text to improve
2590         the quality of the results. This patch changes the implementation of
2591         _lookup to retrieve the text before and the text after the selection.
2592         It also renames DictationContextCallback to SelectionContextCallback so
2593         that it can be used for both dictation and lookup, since they both need
2594         the surrounding text.
2595
2596         * UIProcess/AutoCorrectionCallback.h:
2597         * UIProcess/WebPageProxy.h:
2598         * UIProcess/WebPageProxy.messages.in:
2599         * UIProcess/ios/WKContentViewInteraction.mm:
2600         (-[WKContentView _lookup:]):
2601         * UIProcess/ios/WebPageProxyIOS.mm:
2602         (WebKit::WebPageProxy::autocorrectionDataCallback):
2603         (WebKit::WebPageProxy::selectionContextCallback):
2604         (WebKit::WebPageProxy::getAutocorrectionContext):
2605         (WebKit::WebPageProxy::getSelectionContext):
2606         (WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
2607         (WebKit::WebPageProxy::dictationContextCallback): Deleted.
2608         (WebKit::WebPageProxy::getLookupContextAtPoint): Deleted.
2609         * WebProcess/WebPage/WebPage.h:
2610         * WebProcess/WebPage/WebPage.messages.in:
2611         * WebProcess/WebPage/ios/WebPageIOS.mm:
2612         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
2613         (WebKit::WebPage::getSelectionContext):
2614         (WebKit::WebPage::accessibilityObjectForMainFramePlugin):
2615         (WebKit::WebPage::requestDictationContext):
2616         (WebKit::WebPage::replaceSelectedText):
2617         (WebKit::WebPage::getLookupContextAtPoint): Deleted.
2618
2619 2016-04-12  Joseph Pecoraro  <pecoraro@apple.com>
2620
2621         Web Inspector: Dock controls are not available in toolbar if Web Inspector window leaves fullscreen
2622         https://bugs.webkit.org/show_bug.cgi?id=156520
2623         <rdar://problem/22101106>
2624
2625         Reviewed by Timothy Hatcher.
2626
2627         * UIProcess/mac/WebInspectorProxyMac.mm:
2628         (WebKit::WebInspectorProxy::platformCanAttach):
2629         Be more explicit about the attachment view check. Its intent
2630         was to prevent allowing a 2nd level inspector from attaching
2631         to a 1st level inspector. We can use a stronger check. Also,
2632         remove deprecated pragmas by switching to new value.
2633
2634 2016-04-12  Joseph Pecoraro  <pecoraro@apple.com>
2635
2636         Web Inspector: Keyboard shortcut for "Inspect Element" only works when Web Inspector is open.
2637         https://bugs.webkit.org/show_bug.cgi?id=111193
2638         <rdar://problem/13325889>
2639
2640         Reviewed by Timothy Hatcher.
2641
2642         * UIProcess/API/C/WKInspector.cpp:
2643         (WKInspectorIsElementSelectionActive):
2644         (WKInspectorToggleElementSelection):
2645         * UIProcess/API/C/WKInspector.h:
2646         API for WebKit clients to toggle element selection.
2647
2648         * UIProcess/WebInspectorProxy.cpp:
2649         (WebKit::WebInspectorProxy::toggleElementSelection):
2650         (WebKit::WebInspectorProxy::elementSelectionChanged):
2651         * UIProcess/WebInspectorProxy.h:
2652         (WebKit::WebInspectorProxy::isElementSelectionActive):
2653         * UIProcess/WebInspectorProxy.messages.in:
2654         UIProcess update according to the state of the page
2655         and action to tell the page to toggle.
2656         When starting, pre-connect the inspector. When the
2657         state changes, if we were stopping and nothing was
2658         selected, then disconnect. Otherwise, we will bring
2659         the inspector to the front.
2660
2661         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2662         (WebKit::WebInspectorClient::elementSelectionChanged):
2663         * WebProcess/WebCoreSupport/WebInspectorClient.h:
2664         Let the UIProcess update its cached state of whether or
2665         not element selection is enabled or disabled.
2666
2667         * WebProcess/WebPage/WebInspector.cpp:
2668         (WebKit::WebInspector::startElementSelection):
2669         (WebKit::WebInspector::stopElementSelection):
2670         (WebKit::WebInspector::elementSelectionChanged):
2671         * WebProcess/WebPage/WebInspector.h:
2672         * WebProcess/WebPage/WebInspector.messages.in:
2673         Messages in both directions.
2674         UIProcess -> InspectorProcess enable/disable.
2675         WebProcess -> UIProcess updated element selection state.
2676
2677         * WebProcess/WebPage/WebInspectorUI.cpp:
2678         (WebKit::WebInspectorUI::startElementSelection):
2679         (WebKit::WebInspectorUI::stopElementSelection):
2680         * WebProcess/WebPage/WebInspectorUI.h:
2681         * WebProcess/WebPage/WebInspectorUI.messages.in:
2682         Open the inspector and enable element selection.
2683
2684 2016-04-11  Alex Christensen  <achristensen@webkit.org>
2685
2686         Build MiniBrowser with CMake on Mac
2687         https://bugs.webkit.org/show_bug.cgi?id=156471
2688
2689         Reviewed by Daniel Bates.
2690
2691         * DatabaseProcess/DatabaseProcess.messages.in:
2692
2693 2016-04-11  Ryuan Choi  <ryuan.choi@navercorp.com>
2694
2695         [EFL] Do not pass context to EwkViewCreate
2696         https://bugs.webkit.org/show_bug.cgi?id=156461
2697
2698         Reviewed by Darin Adler.
2699
2700         EWKViewCreate already has pageConfiguration which contains context.
2701         So, this patch removes context argument from EWKViewCreate.
2702
2703         * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
2704         (WKViewCreate):
2705         * UIProcess/API/C/CoordinatedGraphics/WKView.h:
2706         * UIProcess/API/efl/ewk_view.cpp:
2707         (EWKViewCreate): Call WebView::Create instead of WKViewCreate not to use WK API.
2708         (ewk_view_smart_add):
2709         (ewk_view_add_with_configuration):
2710         (ewk_view_add_with_context):
2711         * UIProcess/API/efl/ewk_view_private.h:
2712         * UIProcess/efl/WebInspectorProxyEfl.cpp:
2713         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2714         * UIProcess/efl/WebView.cpp:
2715         (WebKit::WebView::create):
2716         (WebKit::WebView::WebView):
2717         * UIProcess/efl/WebView.h:
2718
2719 2016-04-11  Darin Adler  <darin@apple.com>
2720
2721         Remove UsePointersEvenForNonNullableObjectArguments from HTMLSelectElement
2722         https://bugs.webkit.org/show_bug.cgi?id=156458
2723
2724         Reviewed by Chris Dumez.
2725
2726         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: Updated includes.
2727
2728 2016-04-11  Jeremy Jones  <jeremyj@apple.com>
2729
2730         When clearing cache, also clear AVFoundation cache.
2731         https://bugs.webkit.org/show_bug.cgi?id=155783
2732         rdar://problem/25252541
2733
2734         Reviewed by Darin Adler.
2735
2736         Include the HTMLMediaElement media cache when doing disk cache operations.
2737         Add a sandbox extension for media cache directory. This allows the UI process and the web process
2738         to access the same cache.
2739
2740         * Shared/WebProcessCreationParameters.cpp:
2741         (WebKit::WebProcessCreationParameters::encode): Add media cache directory.
2742         (WebKit::WebProcessCreationParameters::decode): Add media cache directory.
2743         * Shared/WebProcessCreationParameters.h:
2744         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2745         (API::ProcessPoolConfiguration::createWithLegacyOptions):
2746         (API::ProcessPoolConfiguration::ProcessPoolConfiguration): Add media cache directory.
2747         (API::ProcessPoolConfiguration::copy): Add media cache directory.
2748         * UIProcess/API/APIProcessPoolConfiguration.h:
2749         * UIProcess/API/APIWebsiteDataStore.cpp:
2750         (API::WebsiteDataStore::defaultMediaCacheDirectory): Default implementation.
2751         * UIProcess/API/APIWebsiteDataStore.h:
2752         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2753         (API::WebsiteDataStore::defaultMediaCacheDirectory): Media cache is in temporary directory.
2754         (API::WebsiteDataStore::tempDirectoryFileSystemRepresentation): For resources in temporary directory.
2755         (API::WebsiteDataStore::defaultDataStoreConfiguration): Init media cache directory.
2756         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2757         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory):
2758         * UIProcess/WebProcessPool.cpp:
2759         (WebKit::legacyWebsiteDataStoreConfiguration): Add mediaCacheDirectory.
2760         (WebKit::WebProcessPool::createNewWebProcess): Add mediaCacheDirectory.
2761         * UIProcess/WebProcessPool.h:
2762         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2763         (WebKit::WebsiteDataStore::WebsiteDataStore):
2764         (WebKit::WebsiteDataStore::fetchData): Implement for mediaCacheDirectory.
2765         (WebKit::WebsiteDataStore::removeData): Implement for mediaCacheDirectory.
2766         * UIProcess/WebsiteData/WebsiteDataStore.h:
2767         * UIProcess/efl/WebProcessPoolEfl.cpp:
2768         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Added.
2769         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2770         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Added.
2771         * WebProcess/WebProcess.cpp:
2772         (WebKit::WebProcess::initializeWebProcess): Initialize media cache directory.
2773         * WebProcess/cocoa/WebProcessCocoa.mm:
2774         (WebKit::WebProcess::platformInitializeWebProcess): Consume sandbox extension.
2775
2776 2016-04-11  Commit Queue  <commit-queue@webkit.org>
2777
2778         Unreviewed, rolling out r199315.
2779         https://bugs.webkit.org/show_bug.cgi?id=156482
2780
2781         This change broke the OS X Yosemite build. (Requested by jwtan
2782         on #webkit).
2783
2784         Reverted changeset:
2785
2786         "When clearing cache, also clear AVFoundation cache."
2787         https://bugs.webkit.org/show_bug.cgi?id=155783
2788         http://trac.webkit.org/changeset/199315
2789
2790 2016-04-11  Jeremy Jones  <jeremyj@apple.com>
2791
2792         When clearing cache, also clear AVFoundation cache.
2793         https://bugs.webkit.org/show_bug.cgi?id=155783
2794         rdar://problem/25252541
2795
2796         Reviewed by Darin Adler.
2797
2798         Include the HTMLMediaElement media cache when doing disk cache operations.
2799         Add a sandbox extension for media cache directory. This allows the UI process and the web process
2800         to access the same cache.
2801
2802         * Shared/WebProcessCreationParameters.cpp:
2803         (WebKit::WebProcessCreationParameters::encode): Add media cache directory.
2804         (WebKit::WebProcessCreationParameters::decode): Add media cache directory.
2805         * Shared/WebProcessCreationParameters.h:
2806         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2807         (API::ProcessPoolConfiguration::createWithLegacyOptions):
2808         (API::ProcessPoolConfiguration::ProcessPoolConfiguration): Add media cache directory.
2809         (API::ProcessPoolConfiguration::copy): Add media cache directory.
2810         * UIProcess/API/APIProcessPoolConfiguration.h:
2811         * UIProcess/API/APIWebsiteDataStore.cpp:
2812         (API::WebsiteDataStore::defaultMediaCacheDirectory): Default implementation.
2813         * UIProcess/API/APIWebsiteDataStore.h:
2814         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2815         (API::WebsiteDataStore::defaultMediaCacheDirectory): Media cache is in temporary directory.
2816         (API::WebsiteDataStore::tempDirectoryFileSystemRepresentation): For resources in temporary directory.
2817         (API::WebsiteDataStore::defaultDataStoreConfiguration): Init media cache directory.
2818         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2819         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory):
2820         * UIProcess/WebProcessPool.cpp:
2821         (WebKit::legacyWebsiteDataStoreConfiguration): Add mediaCacheDirectory.
2822         (WebKit::WebProcessPool::createNewWebProcess): Add mediaCacheDirectory.
2823         * UIProcess/WebProcessPool.h:
2824         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2825         (WebKit::WebsiteDataStore::WebsiteDataStore):
2826         (WebKit::WebsiteDataStore::fetchData): Implement for mediaCacheDirectory.
2827         (WebKit::WebsiteDataStore::removeData): Implement for mediaCacheDirectory.
2828         * UIProcess/WebsiteData/WebsiteDataStore.h:
2829         * UIProcess/efl/WebProcessPoolEfl.cpp:
2830         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Added.
2831         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2832         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Added.
2833         * WebProcess/WebProcess.cpp:
2834         (WebKit::WebProcess::initializeWebProcess): Initialize media cache directory.
2835         * WebProcess/cocoa/WebProcessCocoa.mm:
2836         (WebKit::WebProcess::platformInitializeWebProcess): Consume sandbox extension.
2837
2838 2016-04-11  Said Abou-Hallawa  <sabouhallawa@apple,com>
2839
2840         Merge CG ImageSource and non CG ImageSource implementation in one file
2841         https://bugs.webkit.org/show_bug.cgi?id=155456
2842
2843         Reviewed by Darin Adler.
2844
2845         * UIProcess/API/efl/EwkView.cpp:
2846         (EwkView::setCursor):
2847         Replace the call to Image::getHotSpot() by Image::hotSpot().
2848
2849 2016-04-11  Anders Carlsson  <andersca@apple.com>
2850
2851         Rename WKOpenPanelParameters files to WKOpenPanelParametersRef
2852         https://bugs.webkit.org/show_bug.cgi?id=156473
2853
2854         Reviewed by Alex Christensen.
2855
2856         * UIProcess/API/C/WKOpenPanelParameters.cpp:
2857         (WKOpenPanelParametersGetTypeID): Deleted.
2858         (WKOpenPanelParametersGetAllowsMultipleFiles): Deleted.
2859         (WKOpenPanelParametersCopyAcceptedMIMETypes): Deleted.
2860         (WKOpenPanelParametersCopyCapture): Deleted.
2861         (WKOpenPanelParametersGetCaptureEnabled): Deleted.
2862         (WKOpenPanelParametersCopySelectedFileNames): Deleted.
2863         * UIProcess/API/C/WKOpenPanelParametersRef.cpp: Renamed from Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp.
2864         (WKOpenPanelParametersGetTypeID):
2865         (WKOpenPanelParametersGetAllowsMultipleFiles):
2866         (WKOpenPanelParametersCopyAcceptedMIMETypes):
2867         (WKOpenPanelParametersCopyCapture):
2868         (WKOpenPanelParametersGetCaptureEnabled):
2869         (WKOpenPanelParametersCopySelectedFileNames):
2870         * UIProcess/API/C/WKOpenPanelParametersRef.h: Renamed from Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h.
2871         * UIProcess/API/C/WebKit2_C.h:
2872         * UIProcess/API/efl/ewk_file_chooser_request.cpp:
2873         * UIProcess/mac/WebInspectorProxyMac.mm:
2874         * WebKit2.xcodeproj/project.pbxproj:
2875
2876 2016-04-09  Gavin Barraclough  <barraclough@apple.com>
2877
2878         WebKit should adopt journal_mode=wal for all SQLite databases.
2879         https://bugs.webkit.org/show_bug.cgi?id=133496
2880
2881         Reviewed by Darin Adler.
2882
2883         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2884         (WKBundleClearAllDatabases):
2885             - renamed deleteAllDatabases -> deleteAllDatabasesImmediately.
2886
2887 2016-04-11  Daniel Bates  <dabates@apple.com>
2888
2889         REGRESSION (r198933): Unable to login to Google account from Internet Accounts preference pane
2890         https://bugs.webkit.org/show_bug.cgi?id=156447
2891         <rdar://problem/25628133>
2892
2893         Reviewed by Anders Carlsson.
2894
2895         Temporarily perform code signing verification only for Mac App Store- and Apple Developer- signed apps.
2896
2897         * Shared/mac/ChildProcessMac.mm:
2898         (WebKit::codeSigningIdentifierForProcess):
2899
2900 2016-04-05  Oliver Hunt  <oliver@apple.com>
2901
2902         Remove compile time define for SEPARATED_HEAP
2903         https://bugs.webkit.org/show_bug.cgi?id=155508
2904
2905         Reviewed by Mark Lam.
2906
2907         * Configurations/FeatureDefines.xcconfig:
2908
2909 2016-04-11  Commit Queue  <commit-queue@webkit.org>
2910
2911         Unreviewed, rolling out r199290.
2912         https://bugs.webkit.org/show_bug.cgi?id=156465
2913
2914         broke 300 tests (Requested by mcatanzaro on #webkit).
2915
2916         Reverted changeset:
2917
2918         "Merge CG ImageSource and non CG ImageSource implementation in
2919         one file"
2920         https://bugs.webkit.org/show_bug.cgi?id=155456
2921         http://trac.webkit.org/changeset/199290
2922
2923 2016-04-11  Said Abou-Hallawa  <sabouhallawa@apple,com>
2924
2925         Merge CG ImageSource and non CG ImageSource implementation in one file
2926         https://bugs.webkit.org/show_bug.cgi?id=155456
2927
2928         Reviewed by Darin Adler.
2929
2930         * UIProcess/API/efl/EwkView.cpp:
2931         (EwkView::setCursor):
2932         Replace the call to Image::getHotSpot() by Image::hotSpot().
2933
2934 2016-04-11  Fujii Hironori  <Hironori.Fujii@jp.sony.com>
2935
2936         [CMake] Make FOLDER property INHERITED
2937         https://bugs.webkit.org/show_bug.cgi?id=156460
2938
2939         Reviewed by Brent Fulgham.
2940
2941         * CMakeLists.txt:
2942         Set FOLDER property as a directory property not a target property
2943
2944 2016-04-08  Sam Weinig  <sam@webkit.org>
2945
2946         Remove support for custom target picker actions
2947         <rdar://problem/24987783>
2948         https://bugs.webkit.org/show_bug.cgi?id=156434
2949
2950         Reviewed by Eric Carlson.
2951
2952         This mostly entailed rolling out r197429 and r197569.
2953
2954         * UIProcess/WebPageProxy.cpp:
2955         (WebKit::WebPageProxy::removePlaybackTargetPickerClient):
2956         (WebKit::WebPageProxy::showPlaybackTargetPicker):
2957         (WebKit::WebPageProxy::playbackTargetPickerClientStateDidChange):
2958         (WebKit::WebPageProxy::setShouldPlayToPlaybackTarget):
2959         (WebKit::WebPageProxy::didChangeBackgroundColor):
2960         (WebKit::WebPageProxy::customPlaybackActionSelected): Deleted.
2961         * UIProcess/WebPageProxy.h:
2962         * UIProcess/WebPageProxy.messages.in:
2963         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2964         (WebKit::WebChromeClient::removePlaybackTargetPickerClient):
2965         (WebKit::WebChromeClient::showPlaybackTargetPicker):
2966         (WebKit::WebChromeClient::playbackTargetPickerClientStateDidChange):
2967         * WebProcess/WebCoreSupport/WebChromeClient.h:
2968         * WebProcess/WebPage/WebPage.h:
2969         * WebProcess/WebPage/WebPage.messages.in:
2970         * WebProcess/WebPage/mac/WebPageMac.mm:
2971         (WebKit::WebPage::setShouldPlayToPlaybackTarget):
2972         (WebKit::WebPage::customPlaybackActionSelected): Deleted.
2973
2974 2016-04-08  Simon Fraser  <simon.fraser@apple.com>
2975
2976         [iOS WK2] WKWebViews should consult ancestor UIScrollViews to determine tiling area
2977         https://bugs.webkit.org/show_bug.cgi?id=156429
2978         rdar://problem/25455111
2979
2980         Reviewed by Tim Horton.
2981
2982         When a WKWebView is expanded to full size, then embedded in UIScrollView, it would
2983         create huge tiles that cover the entire view area (since it considered itself non-scrollable).
2984
2985         Fix to always use 512x512 tiles in this configuration, and to adjust the tile coverage
2986         for the area exposed through the enclosing UIScrollView.
2987
2988         * Shared/VisibleContentRectUpdateInfo.cpp: Add enclosedInScrollView(), which is used to
2989         trigger normal-sized tiles.
2990         (WebKit::VisibleContentRectUpdateInfo::encode):
2991         (WebKit::VisibleContentRectUpdateInfo::decode):
2992         * Shared/VisibleContentRectUpdateInfo.h:
2993         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
2994         (WebKit::VisibleContentRectUpdateInfo::enclosedInScrollView):
2995         (WebKit::operator==):
2996         * UIProcess/API/Cocoa/WKWebView.mm:
2997         (-[WKWebView _didInvokeUIScrollViewDelegateCallback]): Pass our scrollView.
2998         (-[WKWebView _didFinishScrolling]):
2999         (-[WKWebView scrollViewDidScroll:]):
3000         (-[WKWebView scrollViewDidZoom:]):
3001         (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
3002         (-[WKWebView _scrollViewDidInterruptDecelerating:]):
3003         (-[WKWebView _visibleRectInEnclosingScrollView:]):
3004         (-[WKWebView _visibleContentRect]): Compute the exposed part of the content relative
3005         to the WKWebView, then intersect with the exposed part via any ancestor UIScrollView.
3006         (-[WKWebView _didScroll]): This is called by UIKit when some ancestor UIScrollView scrolls.
3007         However, we don't get all the UIScrollView delegate callbacks, so have to use a timer to
3008         trigger a call to -_updateVisibleContentRects when we're in a stable state.
3009         (-[WKWebView _enclosingScrollerScrollingEnded:]):
3010         (-[WKWebView _frameOrBoundsChanged]):
3011         (-[WKWebView _updateVisibleContentRects]):
3012         (-[WKWebView _updateVisibleContentRectAfterScrollInView:]): Get the stable state from the
3013         scroll view that the user is interacting with.
3014         (-[WKWebView _updateContentRectsWithState:]):
3015         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3016         * UIProcess/WebPageProxy.h: Rather than pass a bazillion arguments through updateVisibleContentRects(), just
3017         pass the VisibleContentRectUpdateInfo struct.
3018         * UIProcess/ios/WKContentView.h:
3019         * UIProcess/ios/WKContentView.mm:
3020         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollView:]):
3021         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): Deleted.
3022         * UIProcess/ios/WebPageProxyIOS.mm:
3023         (WebKit::WebPageProxy::updateVisibleContentRects):
3024         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3025         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
3026         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
3027         * WebProcess/WebPage/WebPage.cpp:
3028         (WebKit::WebPage::updatePreferences):
3029         * WebProcess/WebPage/ios/WebPageIOS.mm:
3030         (WebKit::WebPage::updateVisibleContentRects):
3031
3032 2016-04-08  Joseph Pecoraro  <pecoraro@apple.com>
3033
3034         [iOS Simulator] Build failure (property 'contentsFormat' not found on object of type 'LegacyTileLayer *')
3035         https://bugs.webkit.org/show_bug.cgi?id=156415
3036
3037         Reviewed by Simon Fraser.
3038
3039         * UIProcess/API/Cocoa/_WKElementAction.mm:
3040         (-[_WKElementAction runActionWithElementInfo:]):
3041         Use WeakObjCPtr instead of __weak to avoid build errors when not under ARC.
3042
3043 2016-04-08  Alex Christensen  <achristensen@webkit.org>
3044
3045         Progress towards running CMake WebKit2 on Mac
3046         https://bugs.webkit.org/show_bug.cgi?id=156426
3047
3048         Reviewed by Tim Horton.
3049
3050         * CMakeLists.txt:
3051         * PlatformMac.cmake:
3052         Put the xpc service binaries in the right place.
3053
3054 2016-04-08  Alex Christensen  <achristensen@webkit.org>
3055
3056         Build fix with IndexedDB disabled but DatabaseProcess enabled after r199230
3057         https://bugs.webkit.org/show_bug.cgi?id=156321
3058
3059         Rubber-stamped by Brady Eidson.
3060
3061         * DatabaseProcess/DatabaseProcess.cpp:
3062         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
3063         (WebKit::DatabaseProcess::grantSandboxExtensionsForBlobs):
3064         (WebKit::DatabaseProcess::accessToTemporaryFileComplete):
3065         (WebKit::DatabaseProcess::indexedDatabaseOrigins):
3066         * DatabaseProcess/DatabaseProcess.h:
3067         Add some more guards.
3068
3069 2016-04-07  Simon Fraser  <simon.fraser@apple.com>
3070
3071         [iOS WK2] Stop using exposedContentRect for history scroll state restoration
3072         https://bugs.webkit.org/show_bug.cgi?id=156392
3073
3074         Reviewed by Tim Horton.
3075
3076         A future commit will alter the meaning of exposedContentRect on iOS to take into
3077         account clipped out parts of the WKWebView. To achieve this, wean history restoration
3078         off of using exposedContentRect for scroll state restoration. It did this to restore
3079         the page to the same position relative to the view's top-left (to avoid jiggles caused
3080         by changing obscured insets).
3081
3082         Do this by pushing the left/top obscured insets down with visible content rects updates,
3083         storing them on ScrollView, and adding them to HistoryItem. Those insets are then used
3084         for scroll state restoration in WKWebView.
3085
3086         * Shared/VisibleContentRectUpdateInfo.cpp: Add FloatSize for obscuredInset.
3087         (WebKit::VisibleContentRectUpdateInfo::encode):
3088         (WebKit::VisibleContentRectUpdateInfo::decode):
3089         * Shared/VisibleContentRectUpdateInfo.h:
3090         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
3091         (WebKit::VisibleContentRectUpdateInfo::obscuredInset):
3092         (WebKit::operator==):
3093         * UIProcess/API/Cocoa/WKWebView.mm:
3094         (-[WKWebView _processDidExit]): Rename _needsToRestoreExposedRect to _needsToRestoreScrollPosition
3095         (-[WKWebView _didCommitLayerTree:]): Restore the scroll position using the scaled scrollOffset minus
3096         the old obscuredInset.
3097         (-[WKWebView _layerTreeCommitComplete]):
3098         (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]):
3099         (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
3100         (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
3101         (-[WKWebView _updateVisibleContentRects]):
3102         (-[WKWebView _restorePageStateToExposedRect:scrollOrigin:scale:]): Deleted.
3103         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3104         * UIProcess/PageClient.h:
3105         * UIProcess/WebPageProxy.h:
3106         * UIProcess/WebPageProxy.messages.in:
3107         * UIProcess/ios/PageClientImplIOS.h:
3108         * UIProcess/ios/PageClientImplIOS.mm:
3109         (WebKit::PageClientImpl::restorePageState):
3110         * UIProcess/ios/WKContentView.h:
3111         * UIProcess/ios/WKContentView.mm:
3112         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
3113         Make the VisibleContentRectUpdateInfo here and pass it down.
3114         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): Deleted.
3115         * UIProcess/ios/WebPageProxyIOS.mm:
3116         (WebKit::WebPageProxy::updateVisibleContentRects):
3117         (WebKit::WebPageProxy::restorePageState):
3118         * WebProcess/WebPage/ios/WebPageIOS.mm:
3119         (WebKit::WebPage::restorePageState):
3120         (WebKit::WebPage::updateVisibleContentRects): setObscuredInset() moved from FrameView to Page.
3121         Also call setEnclosedInScrollView() on Page.
3122
3123 2016-04-08  Brady Eidson  <beidson@apple.com>
3124
3125         Modern IDB (Blob support): Write blobs to temporary files and move them to the correct location when storing them.
3126         https://bugs.webkit.org/show_bug.cgi?id=156321
3127
3128         Reviewed by Alex Christensen, Andy Estes, and Darin Adler.
3129
3130         The NetworkProcess writes a blob to a temporary file, then tells the UIProcess to grant the DatabaseProcess
3131         a Sandbox Extension to that path.
3132         
3133         It then tells the WebProcess the paths for the temporary files, which then tells the DatabaseProcess to store
3134         the contents of those files as blob references in the database.
3135         
3136         Since the UIProcess had already granted it a Sandbox Extension, it is able to do so.
3137
3138         * DatabaseProcess/DatabaseProcess.cpp:
3139         (WebKit::DatabaseProcess::idbServer):
3140         (WebKit::DatabaseProcess::grantSandboxExtensionsForBlobs):
3141         (WebKit::DatabaseProcess::prepareForAccessToTemporaryFile):
3142         (WebKit::DatabaseProcess::accessToTemporaryFileComplete):
3143         * DatabaseProcess/DatabaseProcess.h:
3144         * DatabaseProcess/DatabaseProcess.messages.in:
3145
3146         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3147         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
3148
3149         * NetworkProcess/NetworkProcess.cpp:
3150         (WebKit::NetworkProcess::grantSandboxExtensionsToDatabaseProcessForBlobs):
3151         (WebKit::NetworkProcess::didGrantSandboxExtensionsToDatabaseProcessForBlobs):
3152         * NetworkProcess/NetworkProcess.h:
3153         * NetworkProcess/NetworkProcess.messages.in:
3154
3155         * UIProcess/Network/NetworkProcessProxy.cpp:
3156         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs):
3157         * UIProcess/Network/NetworkProcessProxy.h:
3158         * UIProcess/Network/NetworkProcessProxy.messages.in:
3159
3160 2016-04-07  Joseph Pecoraro  <pecoraro@apple.com>
3161
3162         Remove ENABLE(ENABLE_ES6_CLASS_SYNTAX) guards
3163         https://bugs.webkit.org/show_bug.cgi?id=156384
3164
3165         Reviewed by Ryosuke Niwa.
3166
3167         * Configurations/FeatureDefines.xcconfig:
3168
3169 2016-04-07  Dean Jackson  <dino@apple.com>
3170
3171         [iOS] Play button on video is too dark
3172         https://bugs.webkit.org/show_bug.cgi?id=156383
3173         <rdar://problem/23540816>
3174
3175         Reviewed by Simon Fraser.
3176
3177         Elements that are backed by a layer with either LightBackdropAppearance
3178         or DarkBackdropAppearance are actually a combination of a
3179         few layers (inside a special view). If we apply a mask to one
3180         of those layers, it needs to be attached to the correct
3181         child layer.
3182
3183         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
3184         (WebKit::RemoteLayerTreePropertyApplier::applyProperties): If we have
3185         one of the special appearance flags, apply the mask layer to
3186         a particular child, rather than the layer itself.
3187
3188 2016-04-07  Jeremy Jones  <jeremyj@apple.com>
3189
3190         Clearing the application cache doesn't work.
3191         https://bugs.webkit.org/show_bug.cgi?id=156354
3192         rdar://problem/22369239
3193
3194         Reviewed by Brady Eidson.
3195
3196         Use the correct "ApplicationCache" directory.
3197         Delete the caches, not just the entries.
3198
3199         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3200         (WebKit::WebsiteDataStore::fetchData):
3201         (WebKit::WebsiteDataStore::removeData):
3202
3203 2016-04-07  Brian Burg  <bburg@apple.com>
3204
3205         Web Automation: implement Automation.addSingleCookie
3206         https://bugs.webkit.org/show_bug.cgi?id=156319
3207         <rdar://problem/25589605>
3208
3209         Reviewed by Timothy Hatcher.
3210
3211         Implement this command by converting the protocol cookie to
3212         WebCore::Cookie, then sending the cookie to NetworkProcess to
3213         be added to the storage session using CookieJar::addCookie.
3214
3215         * UIProcess/Automation/Automation.json:
3216         Clarify the units used in the 'expires' field and how the default value
3217         for the domain field should be computed.
3218
3219         * UIProcess/Automation/WebAutomationSession.cpp:
3220         (WebKit::WebAutomationSession::addSingleCookie):
3221         Parse the cookie and send it out via WebCookieManagerProxy.
3222
3223         * UIProcess/WebCookieManagerProxy.cpp:
3224         (WebKit::WebCookieManagerProxy::addCookie): Added.
3225         * UIProcess/WebCookieManagerProxy.h:
3226         * WebProcess/Cookies/WebCookieManager.cpp:
3227         (WebKit::WebCookieManager::addCookie):
3228         * WebProcess/Cookies/WebCookieManager.h:
3229         * WebProcess/Cookies/WebCookieManager.messages.in:
3230         Forward the message to WebCore::addCookie.
3231
3232 2016-04-06  Ada Chan  <adachan@apple.com>
3233
3234         Add WebKitAdditions extension points around preferences
3235         https://bugs.webkit.org/show_bug.cgi?id=156303
3236
3237         Reviewed by Beth Dakin.
3238
3239         * Shared/WebPreferencesStore.cpp:
3240         (WebKit::defaults):
3241         * UIProcess/API/C/WKPreferences.cpp:
3242
3243 2016-04-07  Brian Burg  <bburg@apple.com>
3244
3245         CookieJar should support adding synthetic cookies for developer tools
3246         https://bugs.webkit.org/show_bug.cgi?id=156091
3247         <rdar://problem/25581340>
3248
3249         Reviewed by Timothy Hatcher.
3250
3251         Plumb the new method through the strategy and out to the network process.
3252
3253         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3254         (WebKit::NetworkConnectionToWebProcess::addCookie):
3255         * NetworkProcess/NetworkConnectionToWebProcess.h:
3256         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3257         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3258         (WebKit::WebPlatformStrategies::addCookie):
3259         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3260
3261 2016-04-06  Alex Christensen  <achristensen@webkit.org>
3262
3263         Compile WebKitTestRunner with CMake on Mac
3264         https://bugs.webkit.org/show_bug.cgi?id=156310
3265
3266         Reviewed by Daniel Bates.
3267
3268         * PlatformMac.cmake:
3269
3270 2016-04-05  Simon Fraser  <simon.fraser@apple.com>
3271
3272         Rename exposedRect to viewExposedRect and propagate it as Optional<> through WK2
3273         https://bugs.webkit.org/show_bug.cgi?id=156274
3274
3275         Reviewed by Tim Horton.
3276
3277         DrawingArea and FrameView have an "exposedRect" property that is used by applications
3278         on Mac, like Mail, that embed web views inside scroll views. However, this name is very
3279         similar to the "exposedContentRect" that is used on iOS to denote the part of the view
3280         whose pixels are visible, including through blurring overlaid UI.
3281         
3282         To disambiguate these two, rename the Mac "exposedRect" to "viewExposedRect" to
3283         emphasize that it's a rect that takes into account clipping in the native view
3284         hierarchy.
3285         
3286         Also make this rect Optional<> through the DrawingArea, removing comparisons against
3287         FloatRect::infiniteRect().
3288         
3289         Do some other minor renaming in VisibleContentRectUpdateInfo.
3290
3291         * Shared/VisibleContentRectUpdateInfo.cpp: Rename "exposedRect" and "unobscuredRect" to
3292         have "Content" in the names.
3293         (WebKit::VisibleContentRectUpdateInfo::encode):
3294         (WebKit::VisibleContentRectUpdateInfo::decode):
3295         * Shared/VisibleContentRectUpdateInfo.h:
3296         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
3297         (WebKit::VisibleContentRectUpdateInfo::exposedContentRect):
3298         (WebKit::VisibleContentRectUpdateInfo::unobscuredContentRect):
3299         (WebKit::operator==):
3300         (WebKit::VisibleContentRectUpdateInfo::exposedRect): Deleted.
3301         (WebKit::VisibleContentRectUpdateInfo::unobscuredRect): Deleted.
3302         * UIProcess/Cocoa/WebViewImpl.mm:
3303         (WebKit::WebViewImpl::updateViewExposedRect):
3304         * UIProcess/DrawingAreaProxy.cpp:
3305         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
3306         (WebKit::DrawingAreaProxy::setViewExposedRect):
3307         (WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
3308         (WebKit::DrawingAreaProxy::setExposedRect): Deleted.
3309         (WebKit::DrawingAreaProxy::exposedRectChangedTimerFired): Deleted.
3310         * UIProcess/DrawingAreaProxy.h:
3311         (WebKit::DrawingAreaProxy::viewExposedRect):
3312         (WebKit::DrawingAreaProxy::exposedRect): Deleted.
3313         * UIProcess/WebPageProxy.h:
3314         (WebKit::WebPageProxy::exposedContentRect):
3315         (WebKit::WebPageProxy::unobscuredContentRect):
3316         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
3317         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3318         (WebKit::RemoteLayerTreeDrawingAreaProxy::setViewExposedRect):
3319         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
3320         (WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
3321         (WebKit::RemoteLayerTreeDrawingAreaProxy::scaledExposedRect): Deleted.
3322         (WebKit::RemoteLayerTreeDrawingAreaProxy::setExposedRect): Deleted. This was only used
3323         to position the indicator, and confusingly used either exposedContentRect() or viewExposedRect()
3324         depending on platform.
3325         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3326         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
3327         * WebProcess/WebPage/DrawingArea.h:
3328         * WebProcess/WebPage/DrawingArea.messages.in:
3329         * WebProcess/WebPage/ios/WebPageIOS.mm:
3330         (WebKit::WebPage::updateVisibleContentRects):
3331         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
3332         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3333         (WebKit::RemoteLayerTreeDrawingArea::setViewExposedRect):
3334         (WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
3335         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3336         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea): Deleted.
3337         (WebKit::RemoteLayerTreeDrawingArea::setExposedRect): Deleted.
3338         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3339         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3340         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
3341         (WebKit::TiledCoreAnimationDrawingArea::setViewExposedRect):
3342         (WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
3343         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea): Deleted.
3344         (WebKit::TiledCoreAnimationDrawingArea::setExposedRect): Deleted.
3345
3346 2016-04-05  Alex Christensen  <achristensen@webkit.org>
3347
3348         Make CMake-generated binaries on Mac able to run
3349         https://bugs.webkit.org/show_bug.cgi?id=156268
3350
3351         Reviewed by Daniel Bates.
3352
3353         * CMakeLists.txt:
3354         * PlatformMac.cmake:
3355
3356 2016-04-05  Brian Burg  <bburg@apple.com>
3357
3358         Web Automation: add support for getting, deleting, and adding cookies
3359         https://bugs.webkit.org/show_bug.cgi?id=156090
3360         <rdar://problem/25477678>
3361
3362         Reviewed by Timothy Hatcher.
3363
3364         Add protocol commands for manipulating cookies with respect to a given page.
3365         Implement all but the addSingleCookie command, which needs a new WebCore API.
3366
3367         * UIProcess/Automation/Automation.json:
3368         Copy the Page domain Cookie object. Add new commands.
3369
3370         * UIProcess/Automation/WebAutomationSession.cpp:
3371         (WebKit::WebAutomationSession::getAllCookies):
3372         (WebKit::buildObjectForCookie): Copied from InspectorPageAgent.
3373         (WebKit::buildArrayForCookies): Copied from InspectorPageAgent.
3374         (WebKit::WebAutomationSession::didGetCookiesForFrame):
3375         (WebKit::WebAutomationSession::deleteSingleCookie):
3376         (WebKit::WebAutomationSession::didDeleteCookie):
3377         (WebKit::WebAutomationSession::addSingleCookie): Added a stub for now.
3378         (WebKit::WebAutomationSession::deleteAllCookies):
3379         This command can use the WebCookieManager supplement directly instead of
3380         proxying through AutomationSession. It doesn't block until the delete is
3381         performed like the other methods do, but this shouldn't be a problem.
3382
3383         * UIProcess/Automation/WebAutomationSession.h:
3384         * UIProcess/Automation/WebAutomationSession.messages.in:
3385         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
3386         (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
3387         (WebKit::WebAutomationSessionProxy::deleteCookie):
3388         * WebProcess/Automation/WebAutomationSessionProxy.h:
3389         * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
3390
3391 2016-04-05  Alex Christensen  <achristensen@webkit.org>
3392
3393         Fix Range requests when not using the NetworkCache with NetworkSession
3394         https://bugs.webkit.org/show_bug.cgi?id=156036
3395         rdar://problem/25334939
3396  
3397         Reviewed by Sam Weinig.
3398
3399         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3400         (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]):
3401         Don't cache any responses with Content-Range headers to work around rdar://problem/20001985.
3402         This is similar to the workaround in shouldCacheResponse in WebCoreNSURLSession.mm
3403         (WebKit::NetworkSession::NetworkSession):
3404         If we are using the NetworkCache, then don't use CFNetwork's cache.
3405
3406 2016-04-05  Brent Fulgham  <bfulgham@apple.com>
3407
3408         Correct applicationWillTerminate logic for ResourceLoadStatistics
3409         https://bugs.webkit.org/show_bug.cgi?id=156249
3410         <rdar://problem/25179611>
3411
3412         Reviewed by Andy Estes.
3413
3414         The applicationWillTerminate handling for ResourceLoadStatistics incorrectly
3415         assumes that a ResourceLoadStatistics object will always be present.
3416         1. The termination handling for 'dataStoresWithStorageManagers' should be
3417            calling 'applicationWillTerminate' on any ResourceLoadStatistics
3418            objects attached to the dataStore.
3419         2. platformInitialize should null-check before attempting to dispatch.
3420         3. platformDestroy should null check before attempting to dispatch.
3421
3422         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3423         (WebKit::WebsiteDataStore::platformInitialize): 
3424         (WebKit::WebsiteDataStore::platformDestroy): Invoke 'applicationWillTerminate' on
3425         m_resourceLoadStatistics if present.
3426
3427 2016-04-05  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3428
3429         [Fetch API] Add a runtime flag to fetch API and related constructs
3430         https://bugs.webkit.org/show_bug.cgi?id=156113
3431  
3432         Reviewed by Alex Christensen.
3433
3434         Add a fetch API runtime flag based on preferences.
3435         Disable fetch API by default.
3436  
3437         * Shared/WebPreferencesDefinitions.h:
3438         * UIProcess/API/C/WKPreferences.cpp:
3439         (WKPreferencesGetCustomElementsEnabled):
3440         (WKPreferencesSetFetchAPIEnabled):
3441         (WKPreferencesGetFetchAPIEnabled):
3442