Remove LegacyIDB.
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-02-25  Brady Eidson  <beidson@apple.com>
2
3         Remove LegacyIDB.
4         https://bugs.webkit.org/show_bug.cgi?id=150854
5
6         Reviewed by Alex Christensen.
7
8         * CMakeLists.txt:
9         * DatabaseProcess/DatabaseProcess.cpp:
10         (WebKit::DatabaseProcess::getOrCreateLegacyUniqueIDBDatabase): Deleted.
11         (WebKit::DatabaseProcess::removeLegacyUniqueIDBDatabase): Deleted.
12         * DatabaseProcess/DatabaseProcess.h:
13         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
14         (WebKit::DatabaseToWebProcessConnection::didClose):
15         (WebKit::DatabaseToWebProcessConnection::didReceiveMessage): Deleted.
16         (WebKit::DatabaseToWebProcessConnection::didReceiveSyncMessage): Deleted.
17         (WebKit::DatabaseToWebProcessConnection::establishIDBConnection): Deleted.
18         (WebKit::DatabaseToWebProcessConnection::removeDatabaseProcessIDBConnection): Deleted.
19         * DatabaseProcess/DatabaseToWebProcessConnection.h:
20         * DatabaseProcess/DatabaseToWebProcessConnection.messages.in:
21         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: Removed.
22         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h: Removed.
23         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in: Removed.
24         * DatabaseProcess/IndexedDB/IDBIdentifier.h: Removed.
25         * DatabaseProcess/IndexedDB/IDBSerialization.cpp: Removed.
26         * DatabaseProcess/IndexedDB/IDBSerialization.h: Removed.
27         * DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabase.cpp: Removed.
28         * DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabase.h: Removed.
29         * DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabaseIdentifier.cpp: Removed.
30         * DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabaseIdentifier.h: Removed.
31         * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: Removed.
32         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
33         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp: Removed.
34         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.h: Removed.
35         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.cpp: Removed.
36         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.h: Removed.
37         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: Removed.
38         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: Removed.
39         * DerivedSources.make:
40         * Shared/WebCrossThreadCopier.cpp:
41         (WebCore::LegacyUniqueIDBDatabaseIdentifier>::copy): Deleted.
42         (WebCore::IDBIdentifier>::copy): Deleted.
43         * Shared/WebCrossThreadCopier.h:
44         * WebKit2.xcodeproj/project.pbxproj:
45         * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp: Removed.
46         * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.h: Removed.
47         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp: Removed.
48         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h: Removed.
49         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in: Removed.
50         * WebProcess/Databases/WebDatabaseProvider.cpp:
51         (WebKit::WebDatabaseProvider::createIDBFactoryBackend): Deleted.
52         * WebProcess/Databases/WebDatabaseProvider.h:
53         * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
54         (WebKit::WebToDatabaseProcessConnection::didReceiveMessage): Deleted.
55         (WebKit::WebToDatabaseProcessConnection::registerWebIDBServerConnection): Deleted.
56         (WebKit::WebToDatabaseProcessConnection::removeWebIDBServerConnection): Deleted.
57         * WebProcess/Databases/WebToDatabaseProcessConnection.h:
58         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
59
60 2016-02-25  Brady Eidson  <beidson@apple.com>
61
62         Modern IDB: WebKit 2 IPC layer.
63         https://bugs.webkit.org/show_bug.cgi?id=153808
64
65         Reviewed by Alex Christensen.
66
67         * NetworkProcess/NetworkLoad.cpp:
68         (WebKit::NetworkLoad::NetworkLoad): This ASSERT fires on most WK2 tests. Alex said remove it.
69         
70         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
71         (WebKit::WebIDBConnectionToServer::putOrAdd): Properly encode the overwrite flag.
72         
73         * WebProcess/Databases/WebDatabaseProvider.h: Enable Modern IDB.
74
75 2016-02-25  Eric Carlson  <eric.carlson@apple.com>
76
77         [MediaStream] MediaDeviceInfo deviceId and groupId must be unique to the page's origin
78         https://bugs.webkit.org/show_bug.cgi?id=153163
79         <rdar://problem/24334526>
80
81         Reviewed by Tim Horton.
82
83         * CMakeLists.txt: Add WKFrameHandleRef.cpp.
84
85         * Shared/API/c/WKBase.h: Add WKFrameHandleRef.
86         * UIProcess/API/APIUIClient.h:
87         (API::UIClient::decidePolicyForUserMediaPermissionRequest): Add parameter top level document
88           security context.
89         (API::UIClient::checkUserMediaPermissionForOrigin): Ditto.
90
91         * UIProcess/API/C/WKAPICast.h: Add FrameHandle.
92
93         * UIProcess/API/C/WKFrameHandleRef.cpp: Added.
94         * UIProcess/API/C/WKFrameHandleRef.h: Added.
95
96         * UIProcess/API/C/WKFrameInfoRef.cpp:
97         (WKFrameInfoGetFrameHandleRef): Added.
98         * UIProcess/API/C/WKFrameInfoRef.h:
99
100         * UIProcess/API/C/WKPage.cpp:
101         (WKPageSetPageUIClient): Add parameters to decidePolicyForUserMediaPermissionRequest and
102           checkUserMediaPermissionForOrigin for top level document security context.
103
104         * UIProcess/API/C/WKPageUIClient.h: Ditto.
105
106         * UIProcess/API/C/WKUserMediaPermissionCheck.cpp:
107         (WKUserMediaPermissionCheckSetUserMediaAccessInfo): Renamed from WKUserMediaPermissionCheckSetHasPersistentPermission,
108           add parameter for top level document security context.
109         (WKUserMediaPermissionCheckSetHasPersistentPermission): Deleted.
110         * UIProcess/API/C/WKUserMediaPermissionCheck.h:
111
112         * UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp:
113         (webkitUserMediaPermissionRequestCreate): Add top level document origin.
114
115         * UIProcess/UserMediaPermissionCheckProxy.cpp:
116         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): Renamed from setHasPersistentPermission.
117         (WebKit::UserMediaPermissionCheckProxy::setHasPersistentPermission): Deleted.
118         * UIProcess/UserMediaPermissionCheckProxy.h:
119
120         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
121         (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Add parameter
122          for device id hash salt.
123         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
124
125         * UIProcess/UserMediaPermissionRequestProxy.h:
126         (WebKit::UserMediaPermissionRequestProxy::requiresAudio): Deleted, unused.
127         (WebKit::UserMediaPermissionRequestProxy::requiresVideo): Ditto.
128         (WebKit::UserMediaPermissionRequestProxy::firstVideoDeviceUID): Ditto.
129         (WebKit::UserMediaPermissionRequestProxy::firstAudioDeviceUID): Ditto.
130
131         * UIProcess/WebPageProxy.cpp:
132         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame): Pass through parameter for top
133           level document security context.
134         (WebKit::WebPageProxy::checkUserMediaPermissionForFrame): Ditto.
135         * UIProcess/WebPageProxy.h:
136         * UIProcess/WebPageProxy.messages.in:
137
138         * WebKit2.xcodeproj/project.pbxproj: Add WKFrameHandleRef.cpp|.h.
139
140         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
141         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): Pass through parameter for top
142           level document security context.
143         (WebKit::UserMediaPermissionRequestManager::startUserMediaPermissionCheck): Ditto.
144         (WebKit::UserMediaPermissionRequestManager::didCompleteUserMediaPermissionCheck): Pass through
145           device id hash salt.
146         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
147
148         * WebProcess/WebPage/WebPage.cpp:
149         (WebKit::WebPage::didCompleteUserMediaPermissionCheck): Ditto.
150         * WebProcess/WebPage/WebPage.h:
151         * WebProcess/WebPage/WebPage.messages.in:
152
153 2016-02-24  Carlos Garcia Campos  <cgarcia@igalia.com>
154
155         [GTK] Tearing when entering AC mode
156         https://bugs.webkit.org/show_bug.cgi?id=150955
157
158         Reviewed by Michael Catanzaro.
159
160         When entering accelerated compositing mode, we keep rendering the
161         non accelerated contents until we have the first frame of
162         accelerated compositing contents. When the view is created hidden,
163         for example when the browser opens a link in a new tab, the view
164         is not realized until it is mapped. The native surface handle for
165         compositing, needed by the web process to render accelerated
166         compositing contents, is not available until the view is realized,
167         because it depends on the properties of the parent. When a web
168         view is mapped for the first time, and then realized, we send the
169         native surface handle for compositing to the web process, and keep
170         rendering the non composited contents until we get the first
171         frame, but in this case we never had non composited contents and
172         we end up rendering an untinitalized surface. This sometimes just
173         produces flickering and sometimes rendering artifacts.
174         We can prevent this from happening by realizing the web view as
175         soon as possible. A GtkWidget can't be realized until it has been
176         added to a toplevel, so we can realize our view right after it is
177         added to a toplevel window, and wait until the view is actually
178         mapped to notify the web process that it has been added to a
179         window. This way can we enter accelerated compositing mode before
180         the web view is mapped, so that when mapped we don't try to paint
181         the previous contents and don't need to wait for the first frame.
182
183         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
184         (toplevelWindowFocusInEvent): Handle the case of the window being
185         hidden when receiving focus in. According to
186         gtk_window_focus_in_event, this can happen.
187         (webkitWebViewBaseSetToplevelOnScreenWindow): When the web view is
188         removed from its toplevel parent, update the IsInWindow and
189         WindowIsActive flags accordingly. When the view is added to a
190         toplevel, realize it and don't update the window flags, they will be
191         updated when the view is mapped the first time.
192         (webkitWebViewBaseMap): Also update IsInWindow and WindowIsActive
193         flags if needed. This way, if for example you open a youtube video
194         in a new tab, the video won't start playing until you visit the
195         tab, like we did when the view was realized on map.
196         (webkitWebViewBaseHierarchyChanged): Use hierarchy-changed signal
197         instead of parent-set to be notified when the view is added to or
198         removed from a toplevel.
199         (webkit_web_view_base_class_init): Implement hierarchy-changed
200         instead of parent-set.
201         (webkitWebViewBaseRealize): Do not call
202         webkitWebViewBaseSetToplevelOnScreenWindow on realize, it's now
203         webkitWebViewBaseSetToplevelOnScreenWindow the one realizing the view.
204         * UIProcess/cairo/BackingStoreCairo.cpp:
205         (WebKit::BackingStore::createBackend): Do not realize the view
206         here, it should be realized already at this point. If it's not
207         realized at this point is because it hasn't been added to a
208         toplevel and gtk_widget_realize will not work anyway.
209         (WebKit::BackingStore::paint): This is changing the cairo source
210         operator, so save/restore the cairo context to ensure it doesn't
211         affect other drawing done after this.
212
213 2016-02-24  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
214
215         [web-animations] Add AnimationTimeline, DocumentTimeline and add extensions to Document interface
216         https://bugs.webkit.org/show_bug.cgi?id=151688
217
218         Reviewed by Dean Jackson.
219
220         Enables the WEB_ANIMATIONS compiler switch.
221
222         * Configurations/FeatureDefines.xcconfig:
223
224 2016-02-24  Gavin Barraclough  <barraclough@apple.com>
225
226         Add WKPreference for HiddenPageDOMTimerThrottlingAutoIncreases
227         https://bugs.webkit.org/show_bug.cgi?id=154655
228
229         Reviewed by Geoff Garen.
230
231         Just plumbing WebCore.settings.setHiddenPageDOMTimerThrottlingAutoIncreases through as
232         WKPreferencesSetHiddenPageDOMTimerThrottlingAutoIncreases.
233
234         * Shared/WebPreferencesDefinitions.h:
235         * UIProcess/API/C/WKPreferences.cpp:
236         (WKPreferencesSetHiddenPageDOMTimerThrottlingAutoIncreases):
237         (WKPreferencesGetHiddenPageDOMTimerThrottlingAutoIncreases):
238         * UIProcess/API/C/WKPreferencesRefPrivate.h:
239         * UIProcess/API/Cocoa/WKPreferences.mm:
240         (-[WKPreferences _hiddenPageDOMTimerThrottlingAutoIncreases]):
241         (-[WKPreferences _setHiddenPageDOMTimerThrottlingAutoIncreases:]):
242         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
243         * WebProcess/WebPage/WebPage.cpp:
244         (WebKit::WebPage::updatePreferences):
245
246 2016-02-24  Alex Christensen  <achristensen@webkit.org>
247
248         Fix downloads when using NetworkSession
249         https://bugs.webkit.org/show_bug.cgi?id=154620
250
251         Reviewed by Brady Eidson.
252
253         This fixes all the _WKDownload API tests when using NetworkSession.
254
255         * NetworkProcess/Downloads/DownloadManager.cpp:
256         (WebKit::DownloadManager::willDecidePendingDownloadDestination):
257         When we store the NetworkDataTask in m_downloadsWaitingForDestination, we want to remove its owner
258         from m_pendingDownloads to prevent memory leaks.
259         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
260         If a file exists and the UIProcess has told us to overwrite the file, delete the file
261         before starting a new download in its place.  This used to be done by CFNetwork in
262         NSURLDownload's setDestination:allowOverwrite:, but the NSURLSession equivalent (setting
263         NSURLSessionDataTask's _pathToDownloadTaskFile attribute) does not overwrite the file for us.
264         (WebKit::DownloadManager::cancelDownload):
265         If a download is canceled while it is waiting for its destination from the UIProcess, the Download
266         object does not exist yet.  Instead, we have a completion handler stored in m_downloadsWaitingForDestination.
267         In this case, we want to send the UIProcess a DownloadProxy::DidCancel message, which I did through
268         NetworkProcess::pendingDownloadCanceled because the DownloadManager is not a MessageSender, and then
269         call the completion handler with PolicyIgnore to cancel the download.
270         (WebKit::DownloadManager::downloadFinished):
271         * NetworkProcess/Downloads/DownloadManager.h:
272         * NetworkProcess/Downloads/PendingDownload.cpp:
273         (WebKit::PendingDownload::continueCanAuthenticateAgainstProtectionSpace):
274         (WebKit::PendingDownload::didBecomeDownload):
275         (WebKit::PendingDownload::didFailLoading):
276         (WebKit::PendingDownload::messageSenderConnection):
277         (WebKit::PendingDownload::didConvertToDownload): Deleted.
278         * NetworkProcess/Downloads/PendingDownload.h:
279         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
280         (WebKit::Download::cancel):
281         Send a didCancel message to the UIProcess when a download was cancelled.
282         Use cancelByProducingResumeData so we can resume canceled downloads.
283         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
284         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
285         didConvertToDownload is needed when using NetworkSession to tell the NetworkResourceLoader
286         not to call cancel on the NetworkLoad after converting it to a download.
287         * NetworkProcess/NetworkDataTask.h:
288         (WebKit::NetworkDataTask::setPendingDownload):
289         (WebKit::NetworkDataTask::pendingDownloadLocation):
290         * NetworkProcess/NetworkLoad.cpp:
291         (WebKit::NetworkLoad::convertTaskToDownload):
292         (WebKit::NetworkLoad::setPendingDownloadID):
293         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
294         Don't call findPendingDownloadLocation as a method on the NetworkDataTask to avoid memory leaks
295         in DownloadManager.m_pendingDownloads.
296         (WebKit::NetworkLoad::didBecomeDownload):
297         Call m_client.didBecomeDownload which is being separated from didConvertToDownload.  The former is
298         called after the NetworkDataTask becomes a Download, the latter is called as soon as 
299         convertMainResourceLoadToDownload is called.
300         * NetworkProcess/NetworkLoadClient.h:
301         * NetworkProcess/NetworkProcess.cpp:
302         (WebKit::NetworkProcess::continueWillSendRequest):
303         (WebKit::NetworkProcess::pendingDownloadCanceled):
304         Send a DownloadProxy::DidCancel message when a pending download is canceled.
305         (WebKit::NetworkProcess::findPendingDownloadLocation):
306         (WebKit::NetworkProcess::continueDecidePendingDownloadDestination):
307         * NetworkProcess/NetworkProcess.h:
308         * NetworkProcess/NetworkProcess.messages.in:
309         * NetworkProcess/NetworkResourceLoader.cpp:
310         (WebKit::NetworkResourceLoader::didConvertToDownload):
311         (WebKit::NetworkResourceLoader::didBecomeDownload):
312         Separate setting m_didConvertToDownload, which needs to happen before the didReceiveResponse completion
313         handler is called to tell the NetworkResourceLoader not to call cancel in NetworkResourceLoader::abort,
314         from deleting the NetworkLoad, which can be done after the NSURLSessionDataTask has been converted to a
315         NSURLSessionDownloadTask.
316         * NetworkProcess/NetworkResourceLoader.h:
317         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
318         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
319         (WebKit::NetworkDataTask::failureTimerFired):
320         (WebKit::NetworkDataTask::setPendingDownloadLocation):
321         (WebKit::NetworkDataTask::transferSandboxExtensionToDownload):
322         (WebKit::NetworkDataTask::suggestedFilename):
323         (WebKit::NetworkDataTask::currentRequest):
324         (WebKit::NetworkDataTask::findPendingDownloadLocation): Deleted.
325         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
326         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
327         Take the downloadID if it failed because we will report that download as failed and not use it again.
328         (WebKit::NetworkSession::takeDownloadID):
329         * UIProcess/Downloads/DownloadProxy.cpp:
330         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
331         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
332
333 2016-02-24  Anders Carlsson  <andersca@apple.com>
334
335         Add more WebKitAdditions extension points
336         https://bugs.webkit.org/show_bug.cgi?id=154648
337         rdar://problem/24820040
338
339         Reviewed by Beth Dakin.
340
341         * Shared/WebPreferencesDefinitions.h:
342         * UIProcess/API/Cocoa/WKWebView.mm:
343         (-[WKWebView _initializeWithConfiguration:]):
344         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
345         (-[WKWebViewConfiguration copyWithZone:]):
346         * WebProcess/WebPage/WebPage.cpp:
347         (WebKit::WebPage::updatePreferences):
348
349 2016-02-24  Ryosuke Niwa  <rniwa@webkit.org>
350
351         Move FocusNavigationScope into FocusController.cpp
352         https://bugs.webkit.org/show_bug.cgi?id=154630
353
354         Reviewed by Darin Adler.
355
356         * WebProcess/WebPage/ios/WebPageIOS.mm:
357         (WebKit::nextAssistableElement):
358
359 2016-02-23  Brian Burg  <bburg@apple.com>
360
361         Web Inspector: don't run the protocol generator once per output file
362         https://bugs.webkit.org/show_bug.cgi?id=154635
363
364         Reviewed by Myles C. Maxfield.
365
366         * DerivedSources.make: Use $(firstword, ...) to take just one file as
367         the target to be built so that the generator runs only once. Make isn't
368         really designed to coalesce multiple file outputs to one production rule.
369
370 2016-02-23  Dan Bernstein  <mitz@apple.com>
371
372         [Xcode] Linker errors display mangled names, but no longer should
373         https://bugs.webkit.org/show_bug.cgi?id=154632
374
375         Reviewed by Sam Weinig.
376
377         * Configurations/Base.xcconfig: Stop setting LINKER_DISPLAYS_MANGLED_NAMES to YES.
378
379 2016-02-23  Gavin Barraclough  <barraclough@apple.com>
380
381         Remove HIDDEN_PAGE_DOM_TIMER_THROTTLING feature define
382         https://bugs.webkit.org/show_bug.cgi?id=112323
383
384         Reviewed by Chris Dumez.
385
386         This feature is controlled by a runtime switch, and defaults off.
387
388         * Configurations/FeatureDefines.xcconfig:
389         * WebProcess/InjectedBundle/InjectedBundle.cpp:
390         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
391         * WebProcess/WebPage/WebPage.cpp:
392         (WebKit::WebPage::updatePreferences):
393
394 2016-02-23  Anders Carlsson  <andersca@apple.com>
395
396         WKWebView should implement NSCoding
397         https://bugs.webkit.org/show_bug.cgi?id=137160
398         rdar://problem/17380562
399
400         Reviewed by Dan Bernstein.
401
402         * UIProcess/API/Cocoa/WKUserContentController.mm:
403         (-[WKUserContentController initWithCoder:]):
404         We need to call [self init] here, so that the wrapper will be initialized.
405
406         * UIProcess/API/Cocoa/WKWebView.h:
407         -initWithCoder: shouldn't be unavailable, it should be a designated initializer.
408
409         * UIProcess/API/Cocoa/WKWebView.mm:
410         (-[WKWebView _initializeWithConfiguration:]):
411         Move initialization out into a common method.
412
413         (-[WKWebView initWithFrame:configuration:]):
414         Call -initializeWithConfiguration: here.
415
416         (-[WKWebView initWithCoder:]):
417         Decode everything.
418
419         (-[WKWebView encodeWithCoder:]):
420         Encode everything.
421
422 2016-02-23  Anders Carlsson  <andersca@apple.com>
423
424         Fix an API test.
425
426         * UIProcess/API/APIWebsiteDataStore.cpp:
427         (API::WebsiteDataStore::defaultDataStore):
428         Make sure to initialize WebKit2.
429
430 2016-02-23  Anders Carlsson  <andersca@apple.com>
431
432         WKWebViewConfiguration should encode more of its properties
433         https://bugs.webkit.org/show_bug.cgi?id=154611
434
435         Reviewed by Sam Weinig.
436
437         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
438         (-[WKWebViewConfiguration encodeWithCoder:]):
439         (-[WKWebViewConfiguration initWithCoder:]):
440
441 2016-02-23  Anders Carlsson  <andersca@apple.com>
442
443         WKUserContentController should conform to NSCoding
444         https://bugs.webkit.org/show_bug.cgi?id=154609
445
446         Reviewed by Sam Weinig.
447
448         Since we just want to be able to encode WKUserContentController from WKWebViewConfiguration,
449         we don't encode anything inside WKUserContentController.
450
451         * UIProcess/API/Cocoa/WKUserContentController.h:
452         * UIProcess/API/Cocoa/WKUserContentController.mm:
453         (-[WKUserContentController encodeWithCoder:]):
454         (-[WKUserContentController initWithCoder:]):
455
456 2016-02-23  Anders Carlsson  <andersca@apple.com>
457
458         WKProcessPool should conform to NSCoding
459         https://bugs.webkit.org/show_bug.cgi?id=154608
460
461         Reviewed by Sam Weinig.
462
463         Add +[WKProcessPool _sharedProcessPool] and encode/decode whether the process pool is shared.
464
465         * UIProcess/API/Cocoa/WKProcessPool.h:
466         * UIProcess/API/Cocoa/WKProcessPool.mm:
467         (-[WKProcessPool encodeWithCoder:]):
468         (-[WKProcessPool initWithCoder:]):
469         (+[WKProcessPool _sharedProcessPool]):
470         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
471
472 2016-02-23  Anders Carlsson  <andersca@apple.com>
473
474         WKWebsiteDataStore should conform to NSCoding
475         https://bugs.webkit.org/show_bug.cgi?id=154605
476
477         Reviewed by Dan Bernstein.
478
479         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
480         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
481         (-[WKWebsiteDataStore initWithCoder:]):
482         (-[WKWebsiteDataStore encodeWithCoder:]):
483
484 2016-02-23  Anders Carlsson  <andersca@apple.com>
485
486         Fix iOS build.
487
488         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
489         (-[WKWebViewConfiguration initWithCoder:]):
490
491 2016-02-23  Anders Carlsson  <andersca@apple.com>
492
493         WKWebViewConfiguration should conform to NSCoding
494         https://bugs.webkit.org/show_bug.cgi?id=154602
495
496         Reviewed by Beth Dakin.
497
498         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
499         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
500         (-[WKWebViewConfiguration encodeWithCoder:]):
501         (-[WKWebViewConfiguration initWithCoder:]):
502
503 2016-02-23  Anders Carlsson  <andersca@apple.com>
504
505         WKPreferences should conform to NSCoding
506         https://bugs.webkit.org/show_bug.cgi?id=154597
507
508         Reviewed by Sam Weinig.
509
510         Add NSCoding implementation.
511
512         * UIProcess/API/Cocoa/WKPreferences.h:
513         * UIProcess/API/Cocoa/WKPreferences.mm:
514         (-[WKPreferences encodeWithCoder:]):
515         (-[WKPreferences initWithCoder:]):
516
517 2016-02-23  Alex Christensen  <achristensen@webkit.org>
518
519         Implement downloads with NetworkSession
520         https://bugs.webkit.org/show_bug.cgi?id=154473
521
522         Reviewed by Brady Eidson.
523
524         * NetworkProcess/Downloads/Download.cpp:
525         (WebKit::Download::~Download):
526         (WebKit::Download::didStart):
527         (WebKit::Download::shouldDecodeSourceDataOfMIMEType):
528         (WebKit::Download::decideDestinationWithSuggestedFilename):
529         (WebKit::Download::didCreateDestination):
530         * NetworkProcess/Downloads/Download.h:
531         (WebKit::Download::downloadID):
532         (WebKit::Download::setSandboxExtension):
533         * NetworkProcess/Downloads/DownloadManager.cpp:
534         (WebKit::DownloadManager::startDownload):
535         (WebKit::DownloadManager::dataTaskBecameDownloadTask):
536         (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace):
537         (WebKit::DownloadManager::continueWillSendRequest):
538         (WebKit::DownloadManager::willDecidePendingDownloadDestination):
539         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
540         (WebKit::DownloadManager::convertHandleToDownload):
541         * NetworkProcess/Downloads/DownloadManager.h:
542         * NetworkProcess/NetworkDataTask.h:
543         (WebKit::NetworkDataTask::clearClient):
544
545         NetworkDataTasks can now outlive their client, so we need to make client a pointer
546         with the ability to be nulled from the client's destructor.
547
548         (WebKit::NetworkDataTask::pendingDownloadID):
549         (WebKit::NetworkDataTask::pendingDownload):
550         (WebKit::NetworkDataTask::setPendingDownload):
551         (WebKit::NetworkDataTask::pendingDownloadLocation):
552         (WebKit::NetworkDataTask::client): Deleted.
553         * NetworkProcess/NetworkLoad.cpp:
554         (WebKit::NetworkLoad::~NetworkLoad):
555         (WebKit::NetworkLoad::convertTaskToDownload):
556         (WebKit::NetworkLoad::setPendingDownloadID):
557         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
558
559         Don't call the didReceiveResponse completion handler immediately when we know we are
560         going to turn the load into a download.  Instead, save the completion handler until
561         after we have determined the download destination and set it in the NetworkDataTask.
562
563         * NetworkProcess/NetworkProcess.cpp:
564         (WebKit::NetworkProcess::continueWillSendRequest):
565         (WebKit::NetworkProcess::findPendingDownloadLocation):
566         (WebKit::NetworkProcess::continueDecidePendingDownloadDestination):
567         (WebKit::NetworkProcess::setCacheModel):
568         * NetworkProcess/NetworkProcess.h:
569         * NetworkProcess/NetworkProcess.messages.in:
570         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
571         (WebKit::NetworkDataTask::NetworkDataTask):
572         (WebKit::NetworkDataTask::~NetworkDataTask):
573         (WebKit::NetworkDataTask::didSendData):
574         (WebKit::NetworkDataTask::didReceiveChallenge):
575         (WebKit::NetworkDataTask::didCompleteWithError):
576         (WebKit::NetworkDataTask::didReceiveResponse):
577         (WebKit::NetworkDataTask::didReceiveData):
578         (WebKit::NetworkDataTask::didBecomeDownload):
579         (WebKit::NetworkDataTask::willPerformHTTPRedirection):
580         (WebKit::NetworkDataTask::scheduleFailure):
581         (WebKit::NetworkDataTask::failureTimerFired):
582         (WebKit::NetworkDataTask::findPendingDownloadLocation):
583         (WebKit::NetworkDataTask::setPendingDownloadLocation):
584         (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
585         (WebKit::NetworkDataTask::transferSandboxExtensionToDownload):
586         (WebKit::NetworkDataTask::currentRequest):
587         (WebKit::NetworkDataTask::cancel):
588         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
589         (-[WKNetworkSessionDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]):
590         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
591         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
592         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
593         
594         This delegate callback is used for downloads, too.
595
596         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
597         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
598         (-[WKNetworkSessionDelegate URLSession:downloadTask:didFinishDownloadingToURL:]):
599         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
600         
601         Call didCreateDestination now, which is after the file has been opened on the disk.
602         A DownloadProxy::DidStart message is now sent from NetworkProcess::findPendingDownloadLocation before
603         we ask the UIProcess where the download should end up on disk.
604         Null check the NetworkDataTask's client before using it because it is now a pointer that could be null. 
605         
606         * UIProcess/Downloads/DownloadProxy.cpp:
607         (WebKit::DownloadProxy::shouldDecodeSourceDataOfMIMEType):
608         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
609         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
610         (WebKit::DownloadProxy::didCreateDestination):
611         * UIProcess/Downloads/DownloadProxy.h:
612         * UIProcess/Downloads/DownloadProxy.messages.in:
613
614 2016-02-23  Brian Burg  <bburg@apple.com>
615
616         Connect WebAutomationSession to its backend dispatcher as if it were an agent and add stub implementations
617         https://bugs.webkit.org/show_bug.cgi?id=154518
618         <rdar://problem/24761096>
619
620         Reviewed by Timothy Hatcher.
621
622         Add a domain dispatcher for the 'Automation' domain, and register the
623         WebAutomationSession itself as the handler for Automation commands.
624         Stub out these command implementations so the code will compile.
625
626         * UIProcess/Automation/Automation.json:
627         Fix the createWindow command's parameters and description.
628         Add an ErrorMessage string enumeration and document how it can be used
629         to signal well-known errors to the frontend.
630
631         * UIProcess/Automation/WebAutomationSession.cpp:
632         (WebKit::WebAutomationSession::WebAutomationSession):
633         Add the domain backend dispatcher. It further parses commands that were deemed
634         valid by the generic dispatcher and match the 'Automation' domain prefix.
635
636         (WebKit::WebAutomationSession::getWindows):
637         (WebKit::WebAutomationSession::openWindow):
638         (WebKit::WebAutomationSession::closeWindow):
639         Stub these out with our new ErrorMessage enumeration and a macro to
640         make this code pattern more readable.
641
642         * UIProcess/Automation/WebAutomationSession.h:
643         Add new declarations and members.
644
645 2016-02-23  Antti Koivisto  <antti@apple.com>
646
647         Remove tab suspension code
648         https://bugs.webkit.org/show_bug.cgi?id=154585
649
650         Reviewed by Andreas Kling.
651
652         * Shared/WebProcessCreationParameters.cpp:
653         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
654         (WebKit::WebProcessCreationParameters::encode):
655         (WebKit::WebProcessCreationParameters::decode):
656         * Shared/WebProcessCreationParameters.h:
657         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
658         (WebKit::registerUserDefaultsIfNeeded):
659         (WebKit::WebProcessPool::platformInitializeWebProcess):
660         * WebProcess/cocoa/WebProcessCocoa.mm:
661         (WebKit::WebProcess::platformInitializeWebProcess):
662
663 2016-02-22  Ryuan Choi  <ryuan.choi@navercorp.com>
664
665         [EFL] Merge WebView and WebViewEfl
666         https://bugs.webkit.org/show_bug.cgi?id=154445
667
668         Reviewed by Gyuyoung Kim.
669
670         * PlatformEfl.cmake: Removed WebViewEfl.cpp from source list.
671         * UIProcess/API/C/efl/WKViewEfl.cpp: Removed type cast for WebViewEfl.
672         * UIProcess/API/efl/EwkView.cpp: Ditto.
673         * UIProcess/API/efl/EwkView.h:
674         * UIProcess/API/efl/GestureRecognizer.cpp: Removed type cast for WebViewEfl.
675         * UIProcess/API/efl/WebAccessibility.cpp: Removed unnecessary includes.
676         * UIProcess/API/efl/ewk_view.cpp: Ditto.
677         * UIProcess/efl/ViewClientEfl.cpp: Ditto.
678         * UIProcess/efl/WebColorPickerClient.cpp: Ditto.
679         * UIProcess/efl/WebColorPickerClient.h:
680         * UIProcess/efl/WebColorPickerEfl.cpp:
681         (WebKit::WebColorPickerEfl::WebColorPickerEfl):
682         * UIProcess/efl/WebColorPickerEfl.h:
683         (WebKit::WebColorPickerEfl::create):
684         * UIProcess/efl/WebView.cpp:
685         * UIProcess/efl/WebView.h:
686         * UIProcess/efl/WebViewEfl.cpp: Removed.
687         * UIProcess/efl/WebViewEfl.h: Ditto.
688
689 2016-02-22  Brian Burg  <bburg@apple.com>
690
691         Web Inspector: add 'Automation' protocol domain and generate its backend classes separately in WebKit2
692         https://bugs.webkit.org/show_bug.cgi?id=154509
693         <rdar://problem/24759098>
694
695         Reviewed by Timothy Hatcher.
696
697         Add a new 'Automation' domain which presents an RPC interface
698         for sending automation commands to an active WebAutomationSession
699         in the UIProcess via RemoteInspector. This is similar to how the
700         Inspector backend communicates bidirectionally with a remote
701         Inspector frontend.
702
703         Add build system logic to generate JSON-RPC protocol bindings
704         for the 'Automation' domain using the inspector code generators.
705
706         Move automation-related files that are not API or SPI into their
707         own directory.
708
709         * Configurations/BaseTarget.xcconfig: Tell where JavaScriptCore's
710         private headers are, since that's where the code generators live.
711
712         * CMakeLists.txt: Look in UIProcess/Automation directory.
713         * PlatformMac.cmake:
714         * DerivedSources.make: Generate protocol bindings for a single domain.
715         The names of the generated files will be improved in a follow-up patch
716         so that they do not clash with generated files in JavaScriptCore.
717
718         * UIProcess/Automation/Automation.json: Added.
719         * UIProcess/Automation/WebAutomationSession.cpp: Renamed from Source/WebKit2/UIProcess/WebAutomationSession.cpp.
720         (WebKit::WebAutomationSession::WebAutomationSession):
721         (WebKit::WebAutomationSession::~WebAutomationSession):
722         Set up a backend dispatcher and frontend router. They will be used later.
723
724         (WebKit::WebAutomationSession::dispatchMessageFromRemote):
725         Forward messages from the remote to the backend dispatcher. When
726         an agent / command handler is registered, it will receive the message.
727
728         (WebKit::WebAutomationSession::connect):
729         (WebKit::WebAutomationSession::disconnect):
730         Connenct and disconnect the frontend router to the remote channel.
731
732         * UIProcess/Automation/WebAutomationSession.h: Renamed from Source/WebKit2/UIProcess/WebAutomationSession.h.
733         * WebKit2.xcodeproj/project.pbxproj: Add and move files.
734
735 2016-02-16  Ada Chan  <adachan@apple.com>
736
737         Implement basic functionality in WebVideoFullscreenInterfaceMac.
738         https://bugs.webkit.org/show_bug.cgi?id=153241
739
740         Reviewed by Beth Dakin.
741
742         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
743         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
744         (WebKit::WebVideoFullscreenManagerProxy::exitFullscreen):
745         (WebKit::WebVideoFullscreenManagerProxy::preparedToReturnToInline):
746         * UIProcess/PageClient.h:
747         * UIProcess/WebPageProxy.h:
748         * UIProcess/mac/PageClientImpl.h:
749         * UIProcess/mac/PageClientImpl.mm:
750         (WebKit::PageClientImpl::rootViewToWindow):
751         * UIProcess/mac/WebPageProxyMac.mm:
752         (WebKit::WebPageProxy::rootViewToWindow):
753         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
754         (WebKit::WebChromeClient::supportsVideoFullscreen):
755         * WebProcess/cocoa/WebVideoFullscreenManager.h:
756         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
757         (WebKit::WebVideoFullscreenManager::supportsVideoFullscreen):
758
759 2016-02-22  Commit Queue  <commit-queue@webkit.org>
760
761         Unreviewed, rolling out r196935.
762         https://bugs.webkit.org/show_bug.cgi?id=154557
763
764         This change causes timeouts and crashes in LayoutTests
765         (Requested by ryanhaddad on #webkit).
766
767         Reverted changeset:
768
769         "Enable AVFoundationNSURLSessionEnabled by default"
770         https://bugs.webkit.org/show_bug.cgi?id=154469
771         http://trac.webkit.org/changeset/196935
772
773 2016-02-22  Anders Carlsson  <andersca@apple.com>
774
775         Remove _mockCaptureDevicesEnabled getter and setter
776         https://bugs.webkit.org/show_bug.cgi?id=154550
777
778         Reviewed by Beth Dakin.
779
780         The _mockCaptureDevicesEnabled property isn't declared anywhere, and this
781         should be a WKWebViewConfiguration parameter if we ever want to expose it in the modern API.
782
783         * UIProcess/API/Cocoa/WKPreferences.mm:
784         (-[WKPreferences _mockCaptureDevicesEnabled]): Deleted.
785         (-[WKPreferences _setMockCaptureDevicesEnabled:]): Deleted.
786
787 2016-02-22  Konstantin Tokarev  <annulen@yandex.ru>
788
789         [cmake] Moved library setup code to WEBKIT_FRAMEWORK macro.
790         https://bugs.webkit.org/show_bug.cgi?id=154450
791
792         Reviewed by Alex Christensen.
793
794         * CMakeLists.txt: Used WebKit2_SOURCES variable instead of separate
795         WebKit2_DERIVED_SOURCES for compatibility with WEBKIT_FRAMEWORK macro.
796         There is no real need to separate derived sources from others.
797         * PlatformGTK.cmake: Ditto.
798
799 2016-02-22  Carlos Alberto Lopez Perez  <clopez@igalia.com>
800
801         [CMake] Unreviewed build fix after r196942.
802
803         * CMakeLists.txt: WKPluginSiteDataManager.cpp is gone.
804
805 2016-02-22  Keith Rollin  <krollin@apple.com>
806
807         Add mechanism to disable memory pressure handling
808         https://bugs.webkit.org/show_bug.cgi?id=154254
809         <rdar://problem/24662616>
810
811         Reviewed by Chris Dumez.
812
813         Add a mechanism to disable WebKit's response to memory pressure
814         triggers. This was asked for by another group for testing purposes.
815
816         In order to disable WebKit's memory pressure handling, execute the
817         following from the command line:
818
819             defaults write com.apple.Safari WebKitSuppressMemoryPressureHandler -bool true
820
821         To revert to standard behavior, delete the key or set it to False.
822
823         This flag is used when a new sub-process is being spawned. The value
824         is read and stored in an initialization parameter block, which is then
825         sent to the new sub-process.
826
827         In actuality, only the UI, WebContent, and Network processes heed the
828         flag. The Plugin process isn't instrumented to heed this flag for
829         three reasons. First, the Plugin process installs its memory pressure
830         handler in initializeProcess, not initializePluginProcess. This is
831         contrary to when the other processes install their handlers, which is
832         in initialize<PluginType>Process, not initializeProcess. So in order
833         to accomodate the Plugin process, we'd need to modify
834         ChildProcessInitializationParameters. Doing this is awkward at best,
835         but also seems to be opposed to what's supposed to be done in
836         initializeProcess and conveyed in
837         ChildProcessInitializationParameters. And even if we did add a boolean
838         to this structure and added support for conveying it through the XPC
839         port, it would end up being a Plugin process-only boolean in a general
840         parameter block, which seems asymmetric with the other processes.
841         Second, there's no convenient Cocoa function called in the flow that
842         spawns the Plugin process, meaning that there's no convenient place to
843         call NSUserDefaults to get the flag's value. And third, the Plugin
844         process doesn't elegantly respond to the memory pressure trigger
845         anyway. It might terminate itself, but that's it. As for the Database
846         process, it doesn't seem to support responding to memory pressure at
847         all, so we don't send it a flag telling it to ignore it.
848
849         Internally, the memory pressure handler is suppressed by not calling
850         MemoryPressureHandler::install() if the flag is set. In the case of
851         the Network process, the flag is saved so that it can be checked later
852         in other places that manually kick off the memory pressure handling
853         procedure.
854
855         * NetworkProcess/NetworkProcess.cpp:
856         (WebKit::NetworkProcess::lowMemoryHandler):
857         (WebKit::NetworkProcess::initializeNetworkProcess):
858         * NetworkProcess/NetworkProcess.h:
859         * NetworkProcess/NetworkProcessCreationParameters.cpp:
860         (WebKit::NetworkProcessCreationParameters::encode):
861         (WebKit::NetworkProcessCreationParameters::decode):
862         * NetworkProcess/NetworkProcessCreationParameters.h:
863         * Shared/WebProcessCreationParameters.cpp:
864         (WebKit::WebProcessCreationParameters::encode):
865         (WebKit::WebProcessCreationParameters::decode):
866         * Shared/WebProcessCreationParameters.h:
867         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
868         (WebKit::WebProcessPool::platformInitializeWebProcess):
869         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
870         * WebProcess/WebProcess.cpp:
871         (WebKit::WebProcess::initializeWebProcess):
872
873 2016-02-22  Anders Carlsson  <andersca@apple.com>
874
875         Get rid of WKPluginSiteDataManager
876         https://bugs.webkit.org/show_bug.cgi?id=154470
877
878         Reviewed by Tim Horton.
879
880         * Shared/API/c/WKBase.h:
881         * UIProcess/API/C/WKContext.cpp:
882         (WKContextGetPluginSiteDataManager): Deleted.
883         * UIProcess/API/C/WKContext.h:
884         * UIProcess/API/C/WKPluginSiteDataManager.cpp: Removed.
885         (WKPluginSiteDataManagerGetTypeID): Deleted.
886         (WKPluginSiteDataManagerGetSitesWithData): Deleted.
887         (WKPluginSiteDataManagerClearSiteData): Deleted.
888         (WKPluginSiteDataManagerClearAllSiteData): Deleted.
889         * UIProcess/API/C/WKPluginSiteDataManager.h: Removed.
890         * WebKit2.xcodeproj/project.pbxproj:
891
892 2016-02-21  Brent Fulgham  <bfulgham@apple.com>
893
894         [WK2][Mac] Allow processes to set "fast-dev-casheable" bit
895         https://bugs.webkit.org/show_bug.cgi?id=154503
896         <rdar://problem/22920815>
897
898         Reviewed by Alexey Proskuryakov.
899
900         Update the various sandbox profiles with a declaration that using the
901         system-fctl to touch the "hot file" flag (to support caching operations)
902         is allowed.
903
904         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in: Add sandbox permission.
905         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: Ditto.
906         * WebProcess/com.apple.WebProcess.sb.in: Ditto.
907
908 2016-02-22  Commit Queue  <commit-queue@webkit.org>
909
910         Unreviewed, rolling out r196891.
911         https://bugs.webkit.org/show_bug.cgi?id=154539
912
913         it broke Production builds (Requested by brrian on #webkit).
914
915         Reverted changeset:
916
917         "Web Inspector: add 'Automation' protocol domain and generate
918         its backend classes separately in WebKit2"
919         https://bugs.webkit.org/show_bug.cgi?id=154509
920         http://trac.webkit.org/changeset/196891
921
922 2016-02-22  Jer Noble  <jer.noble@apple.com>
923
924         Enable AVFoundationNSURLSessionEnabled by default
925         https://bugs.webkit.org/show_bug.cgi?id=154469
926
927         Reviewed by Sam Weinig.
928
929         * Shared/WebPreferencesDefinitions.h:
930
931 2016-02-21  Brian Burg  <bburg@apple.com>
932
933         Web Inspector: add 'Automation' protocol domain and generate its backend classes separately in WebKit2
934         https://bugs.webkit.org/show_bug.cgi?id=154509
935         <rdar://problem/24759098>
936
937         Reviewed by Timothy Hatcher.
938
939         Add a new 'Automation' domain which presents an RPC interface
940         for sending automation commands to an active WebAutomationSession
941         in the UIProcess via RemoteInspector. This is similar to how the
942         Inspector backend communicates bidirectionally with a remote
943         Inspector frontend.
944
945         Add build system logic to generate JSON-RPC protocol bindings
946         for the 'Automation' domain using the inspector code generators.
947
948         Move automation-related files that are not API or SPI into their
949         own directory.
950
951         * Configurations/BaseTarget.xcconfig: Tell where JavaScriptCore's
952         private headers are, since that's where the code generators live.
953
954         * CMakeLists.txt: Look in UIProcess/Automation directory.
955         * PlatformMac.cmake:
956         * DerivedSources.make: Generate protocol bindings for a single domain.
957         The names of the generated files will be improved in a follow-up patch
958         so that they do not clash with generated files in JavaScriptCore.
959
960         * UIProcess/Automation/Automation.json: Added.
961         * UIProcess/Automation/WebAutomationSession.cpp: Renamed from Source/WebKit2/UIProcess/WebAutomationSession.cpp.
962         (WebKit::WebAutomationSession::WebAutomationSession):
963         (WebKit::WebAutomationSession::~WebAutomationSession):
964         Set up a backend dispatcher and frontend router. They will be used later.
965
966         (WebKit::WebAutomationSession::dispatchMessageFromRemote):
967         Forward messages from the remote to the backend dispatcher. When
968         an agent / command handler is registered, it will receive the message.
969
970         (WebKit::WebAutomationSession::connect):
971         (WebKit::WebAutomationSession::disconnect):
972         Connenct and disconnect the frontend router to the remote channel.
973
974         * UIProcess/Automation/WebAutomationSession.h: Renamed from Source/WebKit2/UIProcess/WebAutomationSession.h.
975         * WebKit2.xcodeproj/project.pbxproj: Add and move files.
976
977 2016-02-20  Olivier Blin  <olivier.blin@softathome.com>
978
979         [cmake] Use ICU include dirs in WebKit2 and WebKitTestRunner
980         https://bugs.webkit.org/show_bug.cgi?id=154479
981
982         Reviewed by Michael Catanzaro.
983
984         * CMakeLists.txt:
985
986 2016-02-19  Brian Burg  <bburg@apple.com>
987
988         WebAutomationSession should tell its delegate when its remote end disconnects
989         https://bugs.webkit.org/show_bug.cgi?id=154426
990         <rdar://problem/24732382>
991
992         Reviewed by Timothy Hatcher.
993
994         The client might want to free up resources or close spawned windows
995         if the remote end has disconnected from the automation session.
996
997         * UIProcess/API/APIAutomationSessionClient.h:
998         (API::AutomationSessionClient::didDisconnectFromRemote): Added.
999         (API::AutomationSessionClient::didRequestNewWindow):
1000         Remove WebProcessPool* argument as it is never used.
1001
1002         * UIProcess/API/Cocoa/_WKAutomationSession.h:
1003         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
1004         (-[_WKAutomationSession isPaired]):
1005         Expose whether the session is paired with a remote end.
1006
1007         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: Add method.
1008         * UIProcess/Cocoa/AutomationSessionClient.h: Add method.
1009         Remove WebProcessPool* argument as it is never used.
1010
1011         * UIProcess/Cocoa/AutomationSessionClient.mm:
1012         (WebKit::AutomationSessionClient::AutomationSessionClient):
1013         (WebKit::AutomationSessionClient::didRequestNewWindow):
1014         (WebKit::AutomationSessionClient::didDisconnectFromRemote):
1015         Add necessary forwarding boilerplate.
1016
1017         * UIProcess/WebAutomationSession.cpp:
1018         (WebKit::WebAutomationSession::disconnect): Inform the client.
1019
1020 2016-02-19  Beth Dakin  <bdakin@apple.com>
1021
1022         Enhance EditorState to include TypingAttributes, alignment, and color
1023         https://bugs.webkit.org/show_bug.cgi?id=154424
1024
1025         Reviewed by Dean Jackson and Sam Weinig.
1026
1027         TypingAttributes is already available for iOS and GTK. This patch hooks 
1028         that up on Mac as well, and it moves the calculation of that to the shared 
1029         file since there is no reason for this to be written in an iOS-only way. This 
1030         patch also adds textColor and textAlignment to EditorState, and since those 
1031         are not technically platform-specific either, they are also calculated in the 
1032         shared editorState() function.
1033
1034         * Shared/EditorState.cpp:
1035         (WebKit::EditorState::PostLayoutData::encode):
1036         (WebKit::EditorState::PostLayoutData::decode):
1037         * Shared/EditorState.h:
1038         * WebProcess/WebPage/WebPage.cpp:
1039         (WebKit::WebPage::editorState):
1040         * WebProcess/WebPage/ios/WebPageIOS.mm:
1041         (WebKit::WebPage::platformEditorState):
1042
1043 2016-02-19  Anders Carlsson  <andersca@apple.com>
1044
1045         Purge as much as we can from WKDeprecatedFunctions.cpp
1046         https://bugs.webkit.org/show_bug.cgi?id=154459
1047
1048         Reviewed by Sam Weinig.
1049
1050         * Shared/API/c/WKDeprecatedFunctions.cpp:
1051         (WKArrayIsMutable): Deleted.
1052         (WKPageSetVisibilityState): Deleted.
1053         (WKDictionaryIsMutable): Deleted.
1054         (WKDictionaryAddItem): Deleted.
1055         (WKDictionaryRemoveItem): Deleted.
1056         (WKPreferencesSetRegionBasedColumnsEnabled): Deleted.
1057         (WKPreferencesGetRegionBasedColumnsEnabled): Deleted.
1058         (WKPreferencesSetMultithreadedWebGLEnabled): Deleted.
1059         (WKPreferencesGetMultithreadedWebGLEnabled): Deleted.
1060         (WKPreferencesSetScreenFontSubstitutionEnabled): Deleted.
1061         (WKPreferencesGetScreenFontSubstitutionEnabled): Deleted.
1062         (WKInspectorIsDebuggingJavaScript): Deleted.
1063         (WKInspectorToggleJavaScriptDebugging): Deleted.
1064         (WKInspectorIsProfilingJavaScript): Deleted.
1065         (WKInspectorToggleJavaScriptProfiling): Deleted.
1066         (WKContextGetProcessModel): Deleted.
1067         (WKGraphicsContextGetCGContext): Deleted.
1068         (WKContextGetProcessSuppressionEnabled): Deleted.
1069         (WKContextSetProcessSuppressionEnabled): Deleted.
1070
1071 2016-02-19  Brady Eidson  <beidson@apple.com>
1072
1073         Add "databaseProcessDidCrash" to the WKContextClient; Adopt it in WKTR.
1074         https://bugs.webkit.org/show_bug.cgi?id=154428
1075
1076         Reviewed by Jer Noble.
1077
1078         * UIProcess/API/C/WKContext.h:
1079         * UIProcess/API/C/mac/WKContextPrivateMac.h:
1080         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
1081         (WKContextGetDatabaseProcessIdentifier):
1082
1083         * UIProcess/WebContextClient.cpp:
1084         (WebKit::WebContextClient::databaseProcessDidCrash):
1085         * UIProcess/WebContextClient.h:
1086
1087         * UIProcess/WebProcessPool.cpp:
1088         (WebKit::WebProcessPool::databaseProcessCrashed):
1089         (WebKit::WebProcessPool::databaseProcessIdentifier):
1090         * UIProcess/WebProcessPool.h:
1091
1092 2016-02-18  Gwang Yoon Hwang  <yoon@igalia.com>
1093
1094         [GTK] Limit the number of tiles according to the visible area
1095         https://bugs.webkit.org/show_bug.cgi?id=126122
1096
1097         Reviewed by Carlos Garcia Campos.
1098
1099         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
1100         (WebKit::LayerTreeHostGtk::initialize): Because we creates
1101         nonCompositingLayer with a size of current view, we should not apply
1102         the currently visible rect when creating / deleting tiles.
1103         (WebKit::LayerTreeHostGtk::flushPendingLayerChanges): Passes the current
1104         visible rect to the GraphicsLayers.
1105
1106 2016-02-18  Brady Eidson  <beidson@apple.com>
1107
1108         Modern IDB: Fix IDBGetResult encoder/decoder.
1109         https://bugs.webkit.org/show_bug.cgi?id=154421
1110
1111         Reviewed by Alex Christensen.
1112
1113         No new tests, as Modern IDB is still disabled for WK2.
1114         
1115         But if you manually enable it, "Basic IndexedDB Seems To Work"
1116
1117         * Shared/WebCoreArgumentCoders.cpp:
1118         (IPC::ArgumentCoder<IDBGetResult>::encode): Deleted.
1119         (IPC::ArgumentCoder<IDBGetResult>::decode): Deleted.
1120         * Shared/WebCoreArgumentCoders.h:
1121
1122 2016-02-18  Brady Eidson  <beidson@apple.com>
1123
1124         Modern IDB: Implement server->client operations in WK2.
1125         https://bugs.webkit.org/show_bug.cgi?id=154411
1126
1127         Reviewed by Alex Christensen.
1128
1129         No change in behavior yet; Just laying the groundwork.
1130
1131         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1132         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
1133         (WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
1134
1135         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1136         (WebKit::WebIDBConnectionToServer::didDeleteDatabase):
1137         (WebKit::WebIDBConnectionToServer::didOpenDatabase):
1138         (WebKit::WebIDBConnectionToServer::didAbortTransaction):
1139         (WebKit::WebIDBConnectionToServer::didCommitTransaction):
1140         (WebKit::WebIDBConnectionToServer::didCreateObjectStore):
1141         (WebKit::WebIDBConnectionToServer::didDeleteObjectStore):
1142         (WebKit::WebIDBConnectionToServer::didClearObjectStore):
1143         (WebKit::WebIDBConnectionToServer::didCreateIndex):
1144         (WebKit::WebIDBConnectionToServer::didDeleteIndex):
1145         (WebKit::WebIDBConnectionToServer::didPutOrAdd):
1146         (WebKit::WebIDBConnectionToServer::didGetRecord):
1147         (WebKit::WebIDBConnectionToServer::didGetCount):
1148         (WebKit::WebIDBConnectionToServer::didDeleteRecord):
1149         (WebKit::WebIDBConnectionToServer::didOpenCursor):
1150         (WebKit::WebIDBConnectionToServer::didIterateCursor):
1151         (WebKit::WebIDBConnectionToServer::fireVersionChangeEvent):
1152         (WebKit::WebIDBConnectionToServer::didStartTransaction):
1153         (WebKit::WebIDBConnectionToServer::notifyOpenDBRequestBlocked):
1154         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1155         
1156         * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
1157         (WebKit::WebToDatabaseProcessConnection::didReceiveMessage):
1158
1159 2016-02-18  Brian Burg  <bburg@apple.com>
1160
1161         RemoteInspector deadlocks if _WKAutomationDelegate creates/registers a target synchronously
1162         https://bugs.webkit.org/show_bug.cgi?id=154359
1163         <rdar://problem/24708897>
1164
1165         Reviewed by Joseph Pecoraro.
1166
1167         * UIProcess/Cocoa/AutomationClient.mm:
1168         (WebKit::AutomationClient::requestAutomationSession):
1169         Make an NSString out of the String reference so it gets captured correctly.
1170
1171 2016-02-18  Brady Eidson  <beidson@apple.com>
1172
1173         Modern IDB: Implement client->server operations in WK2.
1174         https://bugs.webkit.org/show_bug.cgi?id=154400
1175
1176         Reviewed by Alex Christensen.
1177
1178         No change in behavior yet; Just laying the groundwork.
1179
1180         * DatabaseProcess/DatabaseProcess.cpp:
1181         (WebKit::DatabaseProcess::idbServer):
1182         * DatabaseProcess/DatabaseProcess.h:
1183
1184         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
1185         (WebKit::DatabaseToWebProcessConnection::didReceiveMessage):
1186         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
1187
1188         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1189         (WebKit::WebIDBConnectionToClient::deleteDatabase):
1190         (WebKit::WebIDBConnectionToClient::openDatabase):
1191         (WebKit::WebIDBConnectionToClient::abortTransaction):
1192         (WebKit::WebIDBConnectionToClient::commitTransaction):
1193         (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
1194         (WebKit::WebIDBConnectionToClient::createObjectStore):
1195         (WebKit::WebIDBConnectionToClient::deleteObjectStore):
1196         (WebKit::WebIDBConnectionToClient::clearObjectStore):
1197         (WebKit::WebIDBConnectionToClient::createIndex):
1198         (WebKit::WebIDBConnectionToClient::deleteIndex):
1199         (WebKit::WebIDBConnectionToClient::putOrAdd):
1200         (WebKit::WebIDBConnectionToClient::getRecord):
1201         (WebKit::WebIDBConnectionToClient::getCount):
1202         (WebKit::WebIDBConnectionToClient::deleteRecord):
1203         (WebKit::WebIDBConnectionToClient::openCursor):
1204         (WebKit::WebIDBConnectionToClient::iterateCursor):
1205         (WebKit::WebIDBConnectionToClient::establishTransaction):
1206         (WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
1207         (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
1208         (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
1209         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
1210         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
1211
1212 2016-02-18  ChangSeok Oh  <changseok.oh@collabora.com>
1213
1214         [GTK][Threaded Compositor] The web inspector doesn't work when using the threaded compositor
1215         https://bugs.webkit.org/show_bug.cgi?id=154067
1216
1217         Reviewed by Carlos Garcia Campos.
1218
1219         The forceCompositingMode should be true for threaded compositor. We set it true for a normal webView
1220         in _WebKitSettingsPrivate() but we do not for inspector anywhere. So DrawingArea is not
1221         properly created for the inspector. Let's move the setting to WebPreferences::platformInitializeStore
1222         which is a common place for the webView and the inspector.
1223
1224         * UIProcess/API/gtk/WebKitSettings.cpp:
1225         (_WebKitSettingsPrivate::_WebKitSettingsPrivate): Deleted.
1226         * UIProcess/gtk/WebPreferencesGtk.cpp:
1227         (WebKit::WebPreferences::platformInitializeStore):
1228
1229 2016-02-18  Commit Queue  <commit-queue@webkit.org>
1230
1231         Unreviewed, rolling out r196765.
1232         https://bugs.webkit.org/show_bug.cgi?id=154402
1233
1234         Broke Safari (Requested by andersca on #webkit).
1235
1236         Reverted changeset:
1237
1238         "Remove two unused functions"
1239         https://bugs.webkit.org/show_bug.cgi?id=154397
1240         http://trac.webkit.org/changeset/196765
1241
1242 2016-02-18  Anders Carlsson  <andersca@apple.com>
1243
1244         Remove two unused functions
1245         https://bugs.webkit.org/show_bug.cgi?id=154397
1246
1247         Reviewed by Tim Horton.
1248
1249         * UIProcess/API/C/WKContext.cpp:
1250         (WKContextGetPluginSiteDataManager): Deleted.
1251         (WKContextGetResourceCacheManager): Deleted.
1252         * UIProcess/API/C/WKContext.h:
1253
1254 2016-02-18  Carlos Garcia Campos  <cgarcia@igalia.com>
1255
1256         [GTK] Use G_TYPE_ERROR instead of G_TYPE_POINTER for GError parameters of signals
1257         https://bugs.webkit.org/show_bug.cgi?id=153786
1258
1259         Reviewed by Michael Catanzaro.
1260
1261         It's binary compatible and it's needed by binding generator to
1262         properly identify those parameters as GError.
1263
1264         * UIProcess/API/gtk/WebKitDownload.cpp:
1265         (webkit_download_class_init):
1266         * UIProcess/API/gtk/WebKitPrintOperation.cpp:
1267         (webkit_print_operation_class_init):
1268         * UIProcess/API/gtk/WebKitWebResource.cpp:
1269         (webkit_web_resource_class_init):
1270         * UIProcess/API/gtk/WebKitWebView.cpp:
1271         (webkit_web_view_class_init):
1272         * UIProcess/API/gtk/webkit2marshal.list:
1273
1274 2016-02-18  Ryuan Choi  <ryuan.choi@navercorp.com>
1275
1276         [EFL] Move WebView from CoordinatedGraphics to efl
1277         https://bugs.webkit.org/show_bug.cgi?id=154332
1278
1279         Reviewed by Csaba Osztrogonác.
1280
1281         * PlatformEfl.cmake:
1282         * UIProcess/efl/WebView.cpp: Renamed from Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp.
1283         * UIProcess/efl/WebView.h: Renamed from Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h.
1284         * UIProcess/efl/WebViewClient.cpp: Renamed from Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.cpp.
1285         * UIProcess/efl/WebViewClient.h: Renamed from Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.h.
1286
1287 2016-02-17  Brady Eidson  <beidson@apple.com>
1288
1289         Modern IDB: Rename some "UniqueIDBDatabase" classes that conflict with new classes in WebCore.
1290         https://bugs.webkit.org/show_bug.cgi?id=154363.
1291
1292         Reviewed by Alex Christensen.
1293
1294         Adding "Legacy" to the front of the name fixes problems for now.
1295         
1296         And all of this gunk will go away after Modern IDB is done, anyways.
1297         
1298         * CMakeLists.txt:
1299         * DatabaseProcess/DatabaseProcess.cpp:
1300         (WebKit::DatabaseProcess::getOrCreateLegacyUniqueIDBDatabase):
1301         (WebKit::DatabaseProcess::removeLegacyUniqueIDBDatabase):
1302         (WebKit::DatabaseProcess::getOrCreateUniqueIDBDatabase): Deleted.
1303         (WebKit::DatabaseProcess::removeUniqueIDBDatabase): Deleted.
1304         * DatabaseProcess/DatabaseProcess.h:
1305         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
1306         (WebKit::DatabaseProcessIDBConnection::establishConnection):
1307         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
1308         * DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabase.cpp: Renamed from Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp.
1309         (WebKit::LegacyUniqueIDBDatabase::calculateAbsoluteDatabaseFilename):
1310         (WebKit::LegacyUniqueIDBDatabase::LegacyUniqueIDBDatabase):
1311         (WebKit::LegacyUniqueIDBDatabase::~LegacyUniqueIDBDatabase):
1312         (WebKit::LegacyUniqueIDBDatabase::filenameForDatabaseName):
1313         (WebKit::LegacyUniqueIDBDatabase::databaseFilenameIdentifier):
1314         (WebKit::LegacyUniqueIDBDatabase::canShareDatabases):
1315         (WebKit::LegacyUniqueIDBDatabase::registerConnection):
1316         (WebKit::LegacyUniqueIDBDatabase::unregisterConnection):
1317         (WebKit::LegacyUniqueIDBDatabase::shutdown):
1318         (WebKit::LegacyUniqueIDBDatabase::shutdownBackingStore):
1319         (WebKit::LegacyUniqueIDBDatabase::didShutdownBackingStore):
1320         (WebKit::LegacyUniqueIDBDatabase::deleteDatabase):
1321         (WebKit::LegacyUniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata):
1322         (WebKit::LegacyUniqueIDBDatabase::openBackingStoreAndReadMetadata):
1323         (WebKit::LegacyUniqueIDBDatabase::didOpenBackingStoreAndReadMetadata):
1324         (WebKit::LegacyUniqueIDBDatabase::openTransaction):
1325         (WebKit::LegacyUniqueIDBDatabase::beginTransaction):
1326         (WebKit::LegacyUniqueIDBDatabase::commitTransaction):
1327         (WebKit::LegacyUniqueIDBDatabase::resetTransaction):
1328         (WebKit::LegacyUniqueIDBDatabase::rollbackTransaction):
1329         (WebKit::LegacyUniqueIDBDatabase::postTransactionOperation):
1330         (WebKit::LegacyUniqueIDBDatabase::didCompleteTransactionOperation):
1331         (WebKit::LegacyUniqueIDBDatabase::changeDatabaseVersion):
1332         (WebKit::LegacyUniqueIDBDatabase::didChangeDatabaseVersion):
1333         (WebKit::LegacyUniqueIDBDatabase::didCreateObjectStore):
1334         (WebKit::LegacyUniqueIDBDatabase::didDeleteObjectStore):
1335         (WebKit::LegacyUniqueIDBDatabase::didClearObjectStore):
1336         (WebKit::LegacyUniqueIDBDatabase::didCreateIndex):
1337         (WebKit::LegacyUniqueIDBDatabase::didDeleteIndex):
1338         (WebKit::LegacyUniqueIDBDatabase::didCompleteBoolRequest):
1339         (WebKit::LegacyUniqueIDBDatabase::createObjectStore):
1340         (WebKit::LegacyUniqueIDBDatabase::deleteObjectStore):
1341         (WebKit::LegacyUniqueIDBDatabase::clearObjectStore):
1342         (WebKit::LegacyUniqueIDBDatabase::createIndex):
1343         (WebKit::LegacyUniqueIDBDatabase::deleteIndex):
1344         (WebKit::LegacyUniqueIDBDatabase::putRecord):
1345         (WebKit::LegacyUniqueIDBDatabase::getRecord):
1346         (WebKit::LegacyUniqueIDBDatabase::openCursor):
1347         (WebKit::LegacyUniqueIDBDatabase::cursorAdvance):
1348         (WebKit::LegacyUniqueIDBDatabase::cursorIterate):
1349         (WebKit::LegacyUniqueIDBDatabase::count):
1350         (WebKit::LegacyUniqueIDBDatabase::deleteRange):
1351         (WebKit::LegacyUniqueIDBDatabase::openBackingStoreTransaction):
1352         (WebKit::LegacyUniqueIDBDatabase::beginBackingStoreTransaction):
1353         (WebKit::LegacyUniqueIDBDatabase::commitBackingStoreTransaction):
1354         (WebKit::LegacyUniqueIDBDatabase::resetBackingStoreTransaction):
1355         (WebKit::LegacyUniqueIDBDatabase::rollbackBackingStoreTransaction):
1356         (WebKit::LegacyUniqueIDBDatabase::changeDatabaseVersionInBackingStore):
1357         (WebKit::LegacyUniqueIDBDatabase::createObjectStoreInBackingStore):
1358         (WebKit::LegacyUniqueIDBDatabase::deleteObjectStoreInBackingStore):
1359         (WebKit::LegacyUniqueIDBDatabase::clearObjectStoreInBackingStore):
1360         (WebKit::LegacyUniqueIDBDatabase::createIndexInBackingStore):
1361         (WebKit::LegacyUniqueIDBDatabase::deleteIndexInBackingStore):
1362         (WebKit::LegacyUniqueIDBDatabase::putRecordInBackingStore):
1363         (WebKit::LegacyUniqueIDBDatabase::didPutRecordInBackingStore):
1364         (WebKit::LegacyUniqueIDBDatabase::getRecordFromBackingStore):
1365         (WebKit::LegacyUniqueIDBDatabase::didGetRecordFromBackingStore):
1366         (WebKit::LegacyUniqueIDBDatabase::openCursorInBackingStore):
1367         (WebKit::LegacyUniqueIDBDatabase::didOpenCursorInBackingStore):
1368         (WebKit::LegacyUniqueIDBDatabase::advanceCursorInBackingStore):
1369         (WebKit::LegacyUniqueIDBDatabase::didAdvanceCursorInBackingStore):
1370         (WebKit::LegacyUniqueIDBDatabase::iterateCursorInBackingStore):
1371         (WebKit::LegacyUniqueIDBDatabase::didIterateCursorInBackingStore):
1372         (WebKit::LegacyUniqueIDBDatabase::countInBackingStore):
1373         (WebKit::LegacyUniqueIDBDatabase::didCountInBackingStore):
1374         (WebKit::LegacyUniqueIDBDatabase::deleteRangeInBackingStore):
1375         (WebKit::LegacyUniqueIDBDatabase::didDeleteRangeInBackingStore):
1376         (WebKit::LegacyUniqueIDBDatabase::didEstablishTransaction):
1377         (WebKit::LegacyUniqueIDBDatabase::didResetTransaction):
1378         (WebKit::LegacyUniqueIDBDatabase::resetAllTransactions):
1379         (WebKit::LegacyUniqueIDBDatabase::finalizeRollback):
1380         (WebKit::LegacyUniqueIDBDatabase::absoluteDatabaseDirectory):
1381         (WebKit::LegacyUniqueIDBDatabase::postMainThreadTask):
1382         (WebKit::LegacyUniqueIDBDatabase::performNextMainThreadTask):
1383         (WebKit::LegacyUniqueIDBDatabase::postDatabaseTask):
1384         (WebKit::LegacyUniqueIDBDatabase::performNextDatabaseTask):
1385         * DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabase.h: Renamed from Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h.
1386         (WebKit::LegacyUniqueIDBDatabase::create):
1387         (WebKit::LegacyUniqueIDBDatabase::identifier):
1388         * DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabaseIdentifier.cpp: Renamed from Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.cpp.
1389         (WebKit::LegacyUniqueIDBDatabaseIdentifier::LegacyUniqueIDBDatabaseIdentifier):
1390         (WebKit::LegacyUniqueIDBDatabaseIdentifier::isHashTableDeletedValue):
1391         (WebKit::LegacyUniqueIDBDatabaseIdentifier::hash):
1392         (WebKit::LegacyUniqueIDBDatabaseIdentifier::isNull):
1393         (WebKit::LegacyUniqueIDBDatabaseIdentifier::isolatedCopy):
1394         (WebKit::operator==):
1395         * DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabaseIdentifier.h: Renamed from Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.h.
1396         (WebKit::LegacyUniqueIDBDatabaseIdentifier::databaseName):
1397         (WebKit::LegacyUniqueIDBDatabaseIdentifier::openingOrigin):
1398         (WebKit::LegacyUniqueIDBDatabaseIdentifier::mainFrameOrigin):
1399         (WebKit::LegacyUniqueIDBDatabaseIdentifierHash::hash):
1400         (WebKit::LegacyUniqueIDBDatabaseIdentifierHash::equal):
1401         (WebKit::LegacyUniqueIDBDatabaseIdentifierHashTraits::isEmptyValue):
1402         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
1403         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::UniqueIDBDatabaseBackingStoreSQLite):
1404         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata):
1405         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
1406         * Shared/WebCrossThreadCopier.cpp:
1407         (WebCore::LegacyUniqueIDBDatabaseIdentifier>::copy):
1408         (WebCore::UniqueIDBDatabaseIdentifier>::copy): Deleted.
1409         * Shared/WebCrossThreadCopier.h:
1410         * WebKit2.xcodeproj/project.pbxproj:
1411
1412 2016-02-17  Anders Carlsson  <andersca@apple.com>
1413
1414         Remove WebContextSupplement::shouldTerminate, it's no longer used
1415         https://bugs.webkit.org/show_bug.cgi?id=154367
1416
1417         Reviewed by Sam Weinig.
1418
1419         * UIProcess/WebContextSupplement.h:
1420         (WebKit::WebContextSupplement::shouldTerminate): Deleted.
1421         * UIProcess/WebCookieManagerProxy.cpp:
1422         (WebKit::WebCookieManagerProxy::shouldTerminate): Deleted.
1423         * UIProcess/WebCookieManagerProxy.h:
1424         * UIProcess/WebProcessPool.cpp:
1425         (WebKit::WebProcessPool::shouldTerminate): Deleted.
1426
1427 2016-02-17  Brian Burg  <bburg@apple.com>
1428
1429         RemoteInspector deadlocks if _WKAutomationDelegate creates/registers a target synchronously
1430         https://bugs.webkit.org/show_bug.cgi?id=154359
1431         <rdar://problem/24708897>
1432
1433         Reviewed by Joseph Pecoraro.
1434
1435         RemoteInspector always grabs a lock whenever receiving or sending XPC messages. If it
1436         forwards a new session request via _WKAutomationDelegate, and the client synchronously
1437         creates and registers a session, then RemoteInspector will try to grab the lock again
1438         while adding the session to its registry, causing a deadlock.
1439
1440         * UIProcess/Cocoa/AutomationClient.mm:
1441         (WebKit::AutomationClient::requestAutomationSession): Add a dispatch_async() to
1442         protect clients from accidentally deadlocking. They shouldn't have to care about
1443         RemoteInspector's locking mechanisms.
1444
1445 2016-02-17  Anders Carlsson  <andersca@apple.com>
1446
1447         Remove an unused function
1448         https://bugs.webkit.org/show_bug.cgi?id=154358
1449
1450         Reviewed by Sam Weinig.
1451
1452         * Platform/cg/CGUtilities.cpp:
1453         (WebKit::paintBitmapContext): Deleted.
1454         * Platform/cg/CGUtilities.h:
1455
1456 2016-02-17  Brady Eidson  <beidson@apple.com>
1457
1458         Modern IDB: More Encoder/Decoder/Messaging scaffolding for WK2 IPC.
1459         https://bugs.webkit.org/show_bug.cgi?id=154356
1460
1461         Reviewed by Alex Christensen.
1462
1463         No change in behavior yet; Just laying the groundwork.
1464
1465         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1466         (WebKit::WebIDBConnectionToClient::didDeleteDatabase):
1467         (WebKit::WebIDBConnectionToClient::didOpenDatabase):
1468         (WebKit::WebIDBConnectionToClient::didAbortTransaction):
1469         (WebKit::WebIDBConnectionToClient::didCommitTransaction):
1470         (WebKit::WebIDBConnectionToClient::didCreateObjectStore):
1471         (WebKit::WebIDBConnectionToClient::didDeleteObjectStore):
1472         (WebKit::WebIDBConnectionToClient::didClearObjectStore):
1473         (WebKit::WebIDBConnectionToClient::didCreateIndex):
1474         (WebKit::WebIDBConnectionToClient::didDeleteIndex):
1475         (WebKit::WebIDBConnectionToClient::didPutOrAdd):
1476         (WebKit::WebIDBConnectionToClient::didGetRecord):
1477         (WebKit::WebIDBConnectionToClient::didGetCount):
1478         (WebKit::WebIDBConnectionToClient::didDeleteRecord):
1479         (WebKit::WebIDBConnectionToClient::didOpenCursor):
1480         (WebKit::WebIDBConnectionToClient::didIterateCursor):
1481         (WebKit::WebIDBConnectionToClient::fireVersionChangeEvent):
1482         (WebKit::WebIDBConnectionToClient::didStartTransaction):
1483         (WebKit::WebIDBConnectionToClient::notifyOpenDBRequestBlocked):
1484         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1485         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
1486
1487 2016-02-17  Alex Christensen  <achristensen@webkit.org>
1488
1489         Fix GTK build after r196720.
1490
1491         * UIProcess/API/gtk/WebKitUIClient.cpp:
1492
1493 2016-02-17  Anders Carlsson  <andersca@apple.com>
1494
1495         Need listener-based version of runBeforeUnloadConfirmPanel
1496         https://bugs.webkit.org/show_bug.cgi?id=154354
1497         rdar://problem/23736691
1498
1499         Reviewed by Sam Weinig.
1500
1501         * Shared/API/APIObject.h:
1502         * Shared/API/c/WKBase.h:
1503         * UIProcess/API/APIUIClient.h:
1504         (API::UIClient::runBeforeUnloadConfirmPanel):
1505         * UIProcess/API/C/WKPage.cpp:
1506         (fixUpBotchedPageUIClient):
1507         (WebKit::RunBeforeUnloadConfirmPanelResultListener::create):
1508         (WebKit::RunBeforeUnloadConfirmPanelResultListener::~RunBeforeUnloadConfirmPanelResultListener):
1509         (WebKit::RunBeforeUnloadConfirmPanelResultListener::call):
1510         (WKPageRunBeforeUnloadConfirmPanelResultListenerGetTypeID):
1511         (WKPageRunBeforeUnloadConfirmPanelResultListenerCall):
1512         (WKPageSetPageUIClient):
1513         * UIProcess/API/C/WKPageUIClient.h:
1514         * UIProcess/WebPageProxy.cpp:
1515         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
1516         * UIProcess/WebPageProxy.h:
1517         * UIProcess/WebPageProxy.messages.in:
1518
1519 2016-02-17  Simon Fraser  <simon.fraser@apple.com>
1520
1521         PDFPlugin's scrollableArea container is not properly unregistered when page is going into the PageCache
1522         https://bugs.webkit.org/show_bug.cgi?id=148182
1523
1524         Reviewed by Brent Fulgham.
1525         
1526         When handling Command-arrow key while showing a scrollable PDF, the timing of PDFPlugin
1527         teardown and navigation could result in PDFPlugin::destroy() getting the wrong FrameView,
1528         so the old FrameView was left with a stale pointer in its scrollableAreaSet.
1529
1530         Fix this by adding an explicit willDetatchRenderer() which is called on the plugin
1531         before the Frame gets a new FrameView.
1532
1533         Also narrow the scope of the RefPtr<Widget> in HTMLPlugInElement::defaultEventHandler()
1534         so that the Widget is not kept alive over a possible navigation.
1535
1536         I was unable to make an automated test, because reproducing the bug requires handling
1537         a Command-arrow key event in a way that the last ref to a Widget is held over the event
1538         handling, and this wasn't possible in an iframe.
1539
1540         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
1541         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1542         (WebKit::PDFPlugin::willDetatchRenderer):
1543         * WebProcess/Plugins/Plugin.h:
1544         (WebKit::Plugin::willDetatchRenderer):
1545         * WebProcess/Plugins/PluginView.cpp:
1546         (WebKit::PluginView::willDetatchRenderer):
1547         * WebProcess/Plugins/PluginView.h:
1548
1549 2016-02-17  Brady Eidson  <beidson@apple.com>
1550
1551         Modern IDB: Encoder/Decoder/Messaging scaffolding for WK2 IPC.
1552         https://bugs.webkit.org/show_bug.cgi?id=154351
1553
1554         Reviewed by Alex Christensen.
1555
1556         No change in behavior yet; Just laying the groundwork.
1557
1558         Implement in all of the client->server message sends, requiring many Encoder/Decoders for
1559         IDB objects to also be implemented:
1560         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1561         (WebKit::WebIDBConnectionToServer::deleteDatabase):
1562         (WebKit::WebIDBConnectionToServer::openDatabase):
1563         (WebKit::WebIDBConnectionToServer::abortTransaction):
1564         (WebKit::WebIDBConnectionToServer::commitTransaction):
1565         (WebKit::WebIDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
1566         (WebKit::WebIDBConnectionToServer::createObjectStore):
1567         (WebKit::WebIDBConnectionToServer::deleteObjectStore):
1568         (WebKit::WebIDBConnectionToServer::clearObjectStore):
1569         (WebKit::WebIDBConnectionToServer::createIndex):
1570         (WebKit::WebIDBConnectionToServer::deleteIndex):
1571         (WebKit::WebIDBConnectionToServer::putOrAdd):
1572         (WebKit::WebIDBConnectionToServer::getRecord):
1573         (WebKit::WebIDBConnectionToServer::getCount):
1574         (WebKit::WebIDBConnectionToServer::deleteRecord):
1575         (WebKit::WebIDBConnectionToServer::openCursor):
1576         (WebKit::WebIDBConnectionToServer::iterateCursor):
1577         (WebKit::WebIDBConnectionToServer::establishTransaction):
1578         (WebKit::WebIDBConnectionToServer::databaseConnectionClosed):
1579         (WebKit::WebIDBConnectionToServer::abortOpenAndUpgradeNeeded):
1580         (WebKit::WebIDBConnectionToServer::didFireVersionChangeEvent):
1581
1582 2016-02-17  Alex Christensen  <achristensen@webkit.org>
1583
1584         Copy http body when being redirected with 308 with NetworkSession
1585         https://bugs.webkit.org/show_bug.cgi?id=154348
1586
1587         Reviewed by Brady Eidson.
1588         
1589         This fixes http/tests/security/cors-post-redirect-308.html
1590         which used to assert in ResourceRequest::doUpdateResourceHTTPBody
1591
1592         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1593         (WebKit::NetworkDataTask::willPerformHTTPRedirection):
1594
1595 2016-02-17  Brady Eidson  <beidson@apple.com>
1596
1597         Modern IDB: More WK2 IPC Scaffolding.
1598         https://bugs.webkit.org/show_bug.cgi?id=154317
1599
1600         Reviewed by Alex Christensen.
1601
1602         No change in behavior yet; Just laying the groundwork.
1603
1604         * CMakeLists.txt:
1605         * DerivedSources.make:
1606         * WebKit2.xcodeproj/project.pbxproj:
1607
1608         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1609         (WebKit::WebIDBConnectionToClient::deleteDatabase):
1610         (WebKit::WebIDBConnectionToClient::openDatabase):
1611         (WebKit::WebIDBConnectionToClient::abortTransaction):
1612         (WebKit::WebIDBConnectionToClient::commitTransaction):
1613         (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
1614         (WebKit::WebIDBConnectionToClient::createObjectStore):
1615         (WebKit::WebIDBConnectionToClient::deleteObjectStore):
1616         (WebKit::WebIDBConnectionToClient::clearObjectStore):
1617         (WebKit::WebIDBConnectionToClient::createIndex):
1618         (WebKit::WebIDBConnectionToClient::deleteIndex):
1619         (WebKit::WebIDBConnectionToClient::putOrAdd):
1620         (WebKit::WebIDBConnectionToClient::getRecord):
1621         (WebKit::WebIDBConnectionToClient::getCount):
1622         (WebKit::WebIDBConnectionToClient::deleteRecord):
1623         (WebKit::WebIDBConnectionToClient::openCursor):
1624         (WebKit::WebIDBConnectionToClient::iterateCursor):
1625         (WebKit::WebIDBConnectionToClient::establishTransaction):
1626         (WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
1627         (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
1628         (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
1629         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
1630         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Added.
1631
1632         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1633         (WebKit::WebIDBConnectionToServer::didDeleteDatabase):
1634         (WebKit::WebIDBConnectionToServer::didOpenDatabase):
1635         (WebKit::WebIDBConnectionToServer::didAbortTransaction):
1636         (WebKit::WebIDBConnectionToServer::didCommitTransaction):
1637         (WebKit::WebIDBConnectionToServer::didCreateObjectStore):
1638         (WebKit::WebIDBConnectionToServer::didDeleteObjectStore):
1639         (WebKit::WebIDBConnectionToServer::didClearObjectStore):
1640         (WebKit::WebIDBConnectionToServer::didCreateIndex):
1641         (WebKit::WebIDBConnectionToServer::didDeleteIndex):
1642         (WebKit::WebIDBConnectionToServer::didPutOrAdd):
1643         (WebKit::WebIDBConnectionToServer::didGetRecord):
1644         (WebKit::WebIDBConnectionToServer::didGetCount):
1645         (WebKit::WebIDBConnectionToServer::didDeleteRecord):
1646         (WebKit::WebIDBConnectionToServer::didOpenCursor):
1647         (WebKit::WebIDBConnectionToServer::didIterateCursor):
1648         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1649         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in: Added.
1650
1651 2016-02-17  Alex Christensen  <achristensen@webkit.org>
1652
1653         CMake build fix after r196698.
1654
1655         * PlatformMac.cmake:
1656
1657 2016-02-17  Alex Christensen  <achristensen@webkit.org>
1658
1659         CMake build fix after r196698.
1660
1661         * CMakeLists.txt:
1662
1663 2016-02-17  Anders Carlsson  <andersca@apple.com>
1664
1665         Remove unused media cache manager code
1666         https://bugs.webkit.org/show_bug.cgi?id=154339
1667
1668         Reviewed by Tim Horton.
1669
1670         * DerivedSources.make:
1671         * Shared/API/c/WKBase.h:
1672         * UIProcess/API/C/WKAPICast.h:
1673         * UIProcess/API/C/WKContext.cpp:
1674         (WKContextGetMediaCacheManager): Deleted.
1675         * UIProcess/API/C/WKContext.h:
1676         * UIProcess/API/C/WKMediaCacheManager.cpp: Removed.
1677         (WKMediaCacheManagerGetTypeID): Deleted.
1678         (WKMediaCacheManagerGetHostnamesWithMediaCache): Deleted.
1679         (WKMediaCacheManagerClearCacheForHostname): Deleted.
1680         (WKMediaCacheManagerClearCacheForAllHostnames): Deleted.
1681         * UIProcess/API/C/WKMediaCacheManager.h: Removed.
1682         * UIProcess/WebMediaCacheManagerProxy.cpp: Removed.
1683         (WebKit::WebMediaCacheManagerProxy::supplementName): Deleted.
1684         (WebKit::WebMediaCacheManagerProxy::create): Deleted.
1685         (WebKit::WebMediaCacheManagerProxy::WebMediaCacheManagerProxy): Deleted.
1686         (WebKit::WebMediaCacheManagerProxy::~WebMediaCacheManagerProxy): Deleted.
1687         (WebKit::WebMediaCacheManagerProxy::processPoolDestroyed): Deleted.
1688         (WebKit::WebMediaCacheManagerProxy::processDidClose): Deleted.
1689         (WebKit::WebMediaCacheManagerProxy::shouldTerminate): Deleted.
1690         (WebKit::WebMediaCacheManagerProxy::refWebContextSupplement): Deleted.
1691         (WebKit::WebMediaCacheManagerProxy::derefWebContextSupplement): Deleted.
1692         (WebKit::WebMediaCacheManagerProxy::getHostnamesWithMediaCache): Deleted.
1693         (WebKit::WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache): Deleted.
1694         (WebKit::WebMediaCacheManagerProxy::clearCacheForHostname): Deleted.
1695         (WebKit::WebMediaCacheManagerProxy::clearCacheForAllHostnames): Deleted.
1696         * UIProcess/WebMediaCacheManagerProxy.h: Removed.
1697         * UIProcess/WebMediaCacheManagerProxy.messages.in: Removed.
1698         * UIProcess/WebProcessPool.cpp:
1699         * WebKit2.xcodeproj/project.pbxproj:
1700         * WebProcess/MediaCache/WebMediaCacheManager.cpp: Removed.
1701         (WebKit::WebMediaCacheManager::supplementName): Deleted.
1702         (WebKit::WebMediaCacheManager::WebMediaCacheManager): Deleted.
1703         (WebKit::WebMediaCacheManager::getHostnamesWithMediaCache): Deleted.
1704         (WebKit::WebMediaCacheManager::clearCacheForHostname): Deleted.
1705         (WebKit::WebMediaCacheManager::clearCacheForAllHostnames): Deleted.
1706         * WebProcess/MediaCache/WebMediaCacheManager.h: Removed.
1707         * WebProcess/MediaCache/WebMediaCacheManager.messages.in: Removed.
1708         * WebProcess/WebProcess.cpp:
1709         (WebKit::m_webSQLiteDatabaseTracker): Deleted.
1710
1711 2016-02-16  Dean Jackson  <dino@apple.com>
1712
1713         Allow double tap to zoom in fast-click pages
1714         https://bugs.webkit.org/show_bug.cgi?id=154318
1715         <rdar://problem/24223767>
1716
1717         Reviewed by Simon Fraser and Benjamin Poulain.
1718         
1719         Most of the patch comes from Jon Lee.
1720
1721         Our fast-click algorithm exposed a number of cases where
1722         people missed the double-tap-to-zoom behaviour. In particular,
1723         when you double tap on a large body of text, typical in
1724         blogs and articles.
1725
1726         This patch enhances the algorithm to have a parallel
1727         double-tap gesture recognizer in the situations where
1728         fast-click is enabled. This new gesture recongizer does
1729         not cause the single tap to block for 350ms, so clicks
1730         are still dispatched fast. If it fires, we already have
1731         some information about whether we have a pending double
1732         tap, based on the first tap.
1733
1734         * UIProcess/ios/PageClientImplIOS.mm:
1735         (WebKit::PageClientImpl::disableDoubleTapGesturesDuringTapIfNecessary): Remove the optimization
1736         that only told the content view to disable on pages that allowed double taps. We now allow
1737         them even on fast click pages.
1738
1739         * UIProcess/ios/WKContentViewInteraction.h: Add the new UITapGestureRecognizer for double taps
1740         in fast click pages. This is called nonBlockingDoubleTapGestureRecognizer because, unlike
1741         the existing DoubleTapGestureRecognizer, this one does not force the singleTapRecognizer
1742         to wait.
1743         * UIProcess/ios/WKContentViewInteraction.mm:
1744         (-[WKContentView setupInteraction]): Set up the new UITapGestureRecognizer.
1745         (-[WKContentView cleanupInteraction]): And remove it when we're done.
1746         (-[WKContentView _removeDefaultGestureRecognizers]): Ditto.
1747         (-[WKContentView _addDefaultGestureRecognizers]):
1748         (-[WKContentView _inspectorNodeSearchRecognized:]): Something happened, we are no longer in
1749         a potential double tap situation.
1750         (-[WKContentView _disableDoubleTapGesturesDuringTapIfNecessary:]): Remove the check
1751         for potential tap in progress.
1752         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
1753         (-[WKContentView gestureRecognizerShouldBegin:]):
1754         (-[WKContentView _highlightLongPressRecognized:]): Again, something happened, so we are
1755         no longer in a double tap situation.
1756         (-[WKContentView _longPressRecognized:]): Ditto.
1757         (-[WKContentView _singleTapRecognized:]): Ditto.
1758         (-[WKContentView _doubleTapRecognized:]): Ditto.
1759         (-[WKContentView _resetIsDoubleTapPending]):
1760         (-[WKContentView _fastDoubleTapRecognized:]): We're now pending a double tap.
1761         (-[WKContentView _twoFingerDoubleTapRecognized:]):
1762         (-[WKContentView _didNotHandleTapAsClick:]): If we get here and we have a pending
1763         double tap, then trigger a zoom operation.
1764         (-[WKContentView _setDoubleTapGesturesEnabled:]):
1765
1766 2016-02-16  Alex Christensen  <achristensen@webkit.org>
1767
1768         CMake build fix.
1769
1770         * PlatformMac.cmake:
1771
1772 2016-02-16  Alex Christensen  <achristensen@webkit.org>
1773
1774         Use NSURLCredential from serverTrust when evaluating server trust AuthenticationChallenges with NetworkSession
1775         https://bugs.webkit.org/show_bug.cgi?id=154316
1776
1777         Reviewed by Brady Eidson.
1778         
1779         This fixes http/tests/security/mixedContent/redirect-https-to-http-iframe-in-main-frame.html
1780         and many other layout tests that use https because it allows https connections with servers
1781         with self-signed certificates when TestController::canAuthenticateAgainstProtectionSpace in
1782         WebKitTestRunner says it's OK, or when any other WKPageNavigationClient says it's ok. 
1783
1784         * NetworkProcess/NetworkDataTask.h:
1785         * NetworkProcess/NetworkLoad.cpp:
1786         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
1787         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1788         (WebKit::serverTrustCredential):
1789
1790 2016-02-16  Anders Carlsson  <andersca@apple.com>
1791
1792         Use pid_t everywhere, instead of PlatformProcessIdentifier
1793         https://bugs.webkit.org/show_bug.cgi?id=154306
1794
1795         Reviewed by Sam Weinig.
1796
1797         * Platform/IPC/Connection.h:
1798         * Platform/PlatformProcessIdentifier.h: Removed.
1799         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
1800         (TEST_F):
1801         * UIProcess/ChildProcessProxy.h:
1802         (WebKit::ChildProcessProxy::processIdentifier):
1803         * UIProcess/Launcher/ProcessLauncher.cpp:
1804         (WebKit::ProcessLauncher::didFinishLaunchingProcess):
1805         * UIProcess/Launcher/ProcessLauncher.h:
1806         (WebKit::ProcessLauncher::processIdentifier):
1807         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1808         * UIProcess/WebPageProxy.cpp:
1809         (WebKit::WebPageProxy::processIdentifier):
1810         * UIProcess/WebPageProxy.h:
1811         * UIProcess/WebProcessPool.cpp:
1812         (WebKit::WebProcessPool::networkProcessIdentifier):
1813         * UIProcess/WebProcessPool.h:
1814         * UIProcess/WebProcessProxy.h:
1815         * WebKit2.xcodeproj/project.pbxproj:
1816
1817 2016-02-16  Anders Carlsson  <andersca@apple.com>
1818
1819         Remove WebKit2 header cruft
1820         https://bugs.webkit.org/show_bug.cgi?id=154309
1821
1822         Reviewed by Sam Weinig.
1823
1824         * WebKit2.xcodeproj/project.pbxproj:
1825         * mac/WKError.h: Removed.
1826         * mac/WKPreferences.h: Removed.
1827
1828 2016-02-16  Anders Carlsson  <andersca@apple.com>
1829
1830         Remove unused environment variable classes
1831         https://bugs.webkit.org/show_bug.cgi?id=154308
1832
1833         Reviewed by Tim Horton.
1834
1835         * UIProcess/Launcher/mac/DynamicLinkerEnvironmentExtractor.h: Removed.
1836         * UIProcess/Launcher/mac/DynamicLinkerEnvironmentExtractor.mm: Removed.
1837         (WebKit::DynamicLinkerEnvironmentExtractor::DynamicLinkerEnvironmentExtractor): Deleted.
1838         (WebKit::DynamicLinkerEnvironmentExtractor::processEnvironmentVariable): Deleted.
1839         (WebKit::DynamicLinkerEnvironmentExtractor::processLoadCommand): Deleted.
1840         (WebKit::DynamicLinkerEnvironmentExtractor::processLoadCommands): Deleted.
1841         (WebKit::DynamicLinkerEnvironmentExtractor::processSingleArchitecture): Deleted.
1842         (WebKit::DynamicLinkerEnvironmentExtractor::processFatFile): Deleted.
1843         (WebKit::DynamicLinkerEnvironmentExtractor::getExtractedEnvironmentVariables): Deleted.
1844         * UIProcess/Launcher/mac/EnvironmentVariables.cpp: Removed.
1845         (WebKit::EnvironmentVariables::EnvironmentVariables): Deleted.
1846         (WebKit::EnvironmentVariables::~EnvironmentVariables): Deleted.
1847         (WebKit::EnvironmentVariables::set): Deleted.
1848         (WebKit::EnvironmentVariables::get): Deleted.
1849         (WebKit::EnvironmentVariables::appendValue): Deleted.
1850         (WebKit::EnvironmentVariables::valueIfVariableHasName): Deleted.
1851         (WebKit::EnvironmentVariables::createStringForVariable): Deleted.
1852         (WebKit::EnvironmentVariables::copyEnvironmentVariables): Deleted.
1853         (WebKit::EnvironmentVariables::dump): Deleted.
1854         * UIProcess/Launcher/mac/EnvironmentVariables.h: Removed.
1855         (WebKit::EnvironmentVariables::environmentPointer): Deleted.
1856         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1857         * WebKit2.xcodeproj/project.pbxproj:
1858
1859 2016-02-16  Alex Christensen  <achristensen@webkit.org>
1860
1861         Add checks before redirecting with NetworkSession
1862         https://bugs.webkit.org/show_bug.cgi?id=154298
1863
1864         Reviewed by Andy Estes.
1865
1866         * NetworkProcess/NetworkDataTask.h:
1867         (WebKit::NetworkDataTask::create):
1868         (WebKit::NetworkDataTask::setPendingDownload):
1869         * NetworkProcess/NetworkLoad.cpp:
1870         (WebKit::NetworkLoad::NetworkLoad):
1871         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1872         (WebKit::NetworkDataTask::NetworkDataTask):
1873         (WebKit::NetworkDataTask::~NetworkDataTask):
1874         (WebKit::NetworkDataTask::willPerformHTTPRedirection):
1875         Implemented based on ResourceHandle::willSendRequest but with two notable exceptions:
1876         1. When using NSURLConnection, the last http method and the current http method are not always equal, and this
1877         check needs to change the current http method to match the last http method when being redirected with an http
1878         status code 307.  When using NSURLSession, the current http method is already updated properly.
1879         2. I did not copy the part of ResourceHandle::willSendRequest that uses a CredentialStorage.  I'm trying to avoid
1880         using CredentialStorages with NSURLSession.
1881         (WebKit::NetworkDataTask::scheduleFailure):
1882         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1883         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1884
1885 2016-02-16  Brady Eidson  <beidson@apple.com>
1886
1887         Modern IDB: WK2 IPC Scaffolding.
1888         https://bugs.webkit.org/show_bug.cgi?id=154296
1889
1890         Reviewed by Alex Christensen.
1891         
1892         No change in behavior yet; Just laying the groundwork.
1893
1894         * CMakeLists.txt:
1895         * WebKit2.xcodeproj/project.pbxproj:
1896
1897         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
1898         (WebKit::DatabaseToWebProcessConnection::establishIDBConnectionToServer):
1899         (WebKit::DatabaseToWebProcessConnection::removeIDBConnectionToServer):
1900         * DatabaseProcess/DatabaseToWebProcessConnection.h:
1901         * DatabaseProcess/DatabaseToWebProcessConnection.messages.in:
1902         
1903         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp: Added.
1904         (WebKit::WebIDBConnectionToClient::create):
1905         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
1906         (WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
1907         (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
1908         (WebKit::WebIDBConnectionToClient::messageSenderConnection):
1909         (WebKit::WebIDBConnectionToClient::connectionToClient):
1910         (WebKit::WebIDBConnectionToClient::didDeleteDatabase):
1911         (WebKit::WebIDBConnectionToClient::didOpenDatabase):
1912         (WebKit::WebIDBConnectionToClient::didAbortTransaction):
1913         (WebKit::WebIDBConnectionToClient::didCommitTransaction):
1914         (WebKit::WebIDBConnectionToClient::didCreateObjectStore):
1915         (WebKit::WebIDBConnectionToClient::didDeleteObjectStore):
1916         (WebKit::WebIDBConnectionToClient::didClearObjectStore):
1917         (WebKit::WebIDBConnectionToClient::didCreateIndex):
1918         (WebKit::WebIDBConnectionToClient::didDeleteIndex):
1919         (WebKit::WebIDBConnectionToClient::didPutOrAdd):
1920         (WebKit::WebIDBConnectionToClient::didGetRecord):
1921         (WebKit::WebIDBConnectionToClient::didGetCount):
1922         (WebKit::WebIDBConnectionToClient::didDeleteRecord):
1923         (WebKit::WebIDBConnectionToClient::didOpenCursor):
1924         (WebKit::WebIDBConnectionToClient::didIterateCursor):
1925         (WebKit::WebIDBConnectionToClient::fireVersionChangeEvent):
1926         (WebKit::WebIDBConnectionToClient::didStartTransaction):
1927         (WebKit::WebIDBConnectionToClient::notifyOpenDBRequestBlocked):
1928         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h: Added.
1929         
1930         * Platform/Logging.h:
1931                 
1932         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: Added.
1933         (WebKit::generateConnectionToServerIdentifier):
1934         (WebKit::WebIDBConnectionToServer::create):
1935         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
1936         (WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
1937         (WebKit::WebIDBConnectionToServer::messageSenderConnection):
1938         (WebKit::WebIDBConnectionToServer::coreConnectionToServer):
1939         (WebKit::WebIDBConnectionToServer::deleteDatabase):
1940         (WebKit::WebIDBConnectionToServer::openDatabase):
1941         (WebKit::WebIDBConnectionToServer::abortTransaction):
1942         (WebKit::WebIDBConnectionToServer::commitTransaction):
1943         (WebKit::WebIDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
1944         (WebKit::WebIDBConnectionToServer::createObjectStore):
1945         (WebKit::WebIDBConnectionToServer::deleteObjectStore):
1946         (WebKit::WebIDBConnectionToServer::clearObjectStore):
1947         (WebKit::WebIDBConnectionToServer::createIndex):
1948         (WebKit::WebIDBConnectionToServer::deleteIndex):
1949         (WebKit::WebIDBConnectionToServer::putOrAdd):
1950         (WebKit::WebIDBConnectionToServer::getRecord):
1951         (WebKit::WebIDBConnectionToServer::getCount):
1952         (WebKit::WebIDBConnectionToServer::deleteRecord):
1953         (WebKit::WebIDBConnectionToServer::openCursor):
1954         (WebKit::WebIDBConnectionToServer::iterateCursor):
1955         (WebKit::WebIDBConnectionToServer::establishTransaction):
1956         (WebKit::WebIDBConnectionToServer::databaseConnectionClosed):
1957         (WebKit::WebIDBConnectionToServer::abortOpenAndUpgradeNeeded):
1958         (WebKit::WebIDBConnectionToServer::didFireVersionChangeEvent):
1959         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: Added.
1960
1961         * WebProcess/Databases/WebDatabaseProvider.cpp:
1962         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
1963         * WebProcess/Databases/WebDatabaseProvider.h:
1964
1965         * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
1966         (WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession):
1967         * WebProcess/Databases/WebToDatabaseProcessConnection.h:
1968
1969 2016-02-16  Sam Weinig  <sam@webkit.org>
1970
1971         Revert r195826.
1972
1973         * Platform/spi/ios/UIKitSPI.h:
1974         * UIProcess/ios/WKContentViewInteraction.mm:
1975         (-[WKContentView _createAndConfigureDoubleTapGestureRecognizer]):
1976         (-[WKContentView _singleTapCommited:]):
1977
1978 2016-02-16  Csaba Osztrogonác  <ossy@webkit.org>
1979
1980         [Mac][cmake] Unreviewed buildfix after r196488. Just for fun.
1981
1982         * PlatformMac.cmake:
1983
1984 2016-02-15  Dan Bernstein  <mitz@apple.com>
1985
1986         Removed unused files after r196478.
1987
1988         * Configurations/DatabaseProcess.xcconfig: Removed.
1989         * Configurations/NetworkProcess.xcconfig: Removed.
1990         * Configurations/PluginProcess.xcconfig: Removed.
1991         * Configurations/WebContentProcess.xcconfig: Removed.
1992         * WebKit2.xcodeproj/project.pbxproj:
1993
1994 2016-02-15  ChangSeok Oh  <changseok.oh@collabora.com>
1995
1996         [ThreadedCompositor] position:fixed elements do not have their own layers when threaded compositor is enabled.
1997         https://bugs.webkit.org/show_bug.cgi?id=154100
1998
1999         Reviewed by Carlos Garcia Campos.
2000
2001         Currently, fixed elements are redrawn to a backing store every time layout or scroll happens.
2002         It results in the bad effect on performance-wise. Letting fixed element have separate layers is
2003         necessary when threaded compositor is enabled at least. Because async scrolling requires it.
2004
2005         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2006         (WebKit::DrawingAreaImpl::updatePreferences):
2007
2008 2016-02-15  Alex Christensen  <achristensen@webkit.org>
2009
2010         Implement content sniffing check with NetworkSession
2011         https://bugs.webkit.org/show_bug.cgi?id=154261
2012
2013         Reviewed by Andy Estes.
2014
2015         This fixes http/tests/xmlhttprequest/small-chunks-response-text.html when using NetworkSession.
2016
2017         * NetworkProcess/NetworkDataTask.h:
2018         (WebKit::NetworkDataTask::create):
2019         * NetworkProcess/NetworkLoad.cpp:
2020         (WebKit::NetworkLoad::NetworkLoad):
2021         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2022         (WebKit::NetworkDataTask::NetworkDataTask):
2023         Content sniffing is enabled by default.  Disable it if the NetworkLoadParameters say not to.
2024         This is analogous to behavior in ResourceHandle::createNSURLConnection.
2025
2026 2016-02-15  Alex Christensen  <achristensen@webkit.org>
2027
2028         Move Download authentication code to AuthenticationManager
2029         https://bugs.webkit.org/show_bug.cgi?id=154132
2030
2031         Reviewed by Sam Weinig.
2032
2033         When a video element makes a request that receives an authentication challenge, the
2034         AuthenticationManager receives an AuthenticationChallenge without an AuthenticationClient.
2035         As a result, Download::receivedCredential and other functions were being called, which
2036         sent a message to the challenge's sender.  This functionality is not specific to downloads,
2037         so I moved it from Download to AuthenticationManager.
2038
2039         This fixes http/tests/media/video-auth.html when using NetworkSession 
2040         because I use AuthenticationManager::receivedCredential if there is no AuthenticationClient
2041         instead of improperly asserting that there is always an AuthenticationClient if there is no
2042         completionHandler.
2043
2044         * NetworkProcess/Downloads/Download.h:
2045         * NetworkProcess/Downloads/ios/DownloadIOS.mm:
2046         (WebKit::Download::platformDidFinish):
2047         (WebKit::Download::receivedCredential): Deleted.
2048         (WebKit::Download::receivedRequestToContinueWithoutCredential): Deleted.
2049         (WebKit::Download::receivedCancellation): Deleted.
2050         (WebKit::Download::receivedRequestToPerformDefaultHandling): Deleted.
2051         (WebKit::Download::receivedChallengeRejection): Deleted.
2052         * NetworkProcess/Downloads/mac/DownloadMac.mm:
2053         (WebKit::Download::platformDidFinish):
2054         (WebKit::Download::receivedCredential): Deleted.
2055         (WebKit::Download::receivedRequestToContinueWithoutCredential): Deleted.
2056         (WebKit::Download::receivedCancellation): Deleted.
2057         (WebKit::Download::receivedRequestToPerformDefaultHandling): Deleted.
2058         (WebKit::Download::receivedChallengeRejection): Deleted.
2059         * NetworkProcess/Downloads/soup/DownloadSoup.cpp:
2060         (WebKit::Download::platformDidFinish):
2061         (WebKit::Download::receivedCredential): Deleted.
2062         (WebKit::Download::receivedRequestToContinueWithoutCredential): Deleted.
2063         (WebKit::Download::receivedCancellation): Deleted.
2064         (WebKit::Download::continueWithoutCredential): Deleted.
2065         (WebKit::Download::useCredential): Deleted.
2066         (WebKit::Download::cancelAuthenticationChallenge): Deleted.
2067         (WebKit::Download::receivedRequestToPerformDefaultHandling): Deleted.
2068         (WebKit::Download::receivedChallengeRejection): Deleted.
2069         * PlatformEfl.cmake:
2070         * PlatformGTK.cmake:
2071         * PlatformMac.cmake:
2072         * Shared/Authentication/AuthenticationManager.cpp:
2073         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
2074         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
2075         (WebKit::AuthenticationManager::continueWithoutCredentialForChallenge):
2076         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
2077         (WebKit::AuthenticationManager::cancelChallenge):
2078         (WebKit::AuthenticationManager::cancelSingleChallenge):
2079         (WebKit::AuthenticationManager::performDefaultHandling):
2080         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
2081         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinue):
2082         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
2083         * Shared/Authentication/AuthenticationManager.h:
2084         (WebKit::AuthenticationManager::outstandingAuthenticationChallengeCount):
2085         * Shared/Authentication/cocoa: Added.
2086         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm: Added.
2087         (WebKit::AuthenticationManager::receivedCredential):
2088         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
2089         (WebKit::AuthenticationManager::receivedCancellation):
2090         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
2091         (WebKit::AuthenticationManager::receivedChallengeRejection):
2092         * Shared/Authentication/soup: Added.
2093         * Shared/Authentication/soup/AuthenticationManagerSoup.cpp: Added.
2094         (WebKit::AuthenticationManager::receivedCredential):
2095         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
2096         (WebKit::AuthenticationManager::receivedCancellation):
2097         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
2098         (WebKit::AuthenticationManager::receivedChallengeRejection):
2099         * WebKit2.xcodeproj/project.pbxproj:
2100
2101 2016-02-15  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2102
2103         [CMake][Mac] Remove WKNPAPIPlugInContainer.mm in WebKit2/PlatformMac.cmake
2104         https://bugs.webkit.org/show_bug.cgi?id=154234
2105
2106         Reviewed by Csaba Osztrogonác.
2107
2108         * PlatformMac.cmake: Remove WKNPAPIPlugInContainer.mm.
2109
2110 2016-02-14  Chris Dumez  <cdumez@apple.com>
2111
2112         Unreviewed, land an additional Mac CMake build fix.
2113
2114         * PlatformMac.cmake:
2115
2116 2016-02-14  Brian Burg  <bburg@apple.com>
2117
2118         WKAutomationDelegate's requestAutomationSession should take a suggested session identifier
2119         https://bugs.webkit.org/show_bug.cgi?id=154012
2120         <rdar://problem/24557697>
2121
2122         Reviewed by Darin Adler.
2123
2124         Add a string parameter to the delegate method for requesting a new session.
2125
2126         * UIProcess/API/APIAutomationClient.h:
2127         (API::AutomationClient::didRequestAutomationSession):
2128         (API::AutomationClient::requestAutomationSession): Deleted.
2129         Rename the client method to better match the delegate method's name.
2130
2131         * UIProcess/API/Cocoa/_WKAutomationDelegate.h:
2132         * UIProcess/Cocoa/AutomationClient.h:
2133         * UIProcess/Cocoa/AutomationClient.mm:
2134         (WebKit::AutomationClient::AutomationClient):
2135         (WebKit::AutomationClient::requestAutomationSession):
2136
2137 2016-02-13  Carlos Garcia Campos  <cgarcia@igalia.com>
2138
2139         Unreviewed. Fix GTK+ and hopefully EFL build after r196499.
2140
2141         * UIProcess/Launcher/efl/ProcessLauncherEfl.cpp:
2142         (WebKit::ProcessLauncher::launchProcess):
2143         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
2144         (WebKit::ProcessLauncher::launchProcess):
2145         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
2146         (WebKit::PluginProcessProxy::platformGetLaunchOptions):
2147
2148 2016-02-12  Beth Dakin  <bdakin@apple.com>
2149
2150         REGRESSION: Link preview is slow and unreliable
2151         https://bugs.webkit.org/show_bug.cgi?id=154197
2152         -and corresponding-
2153         rdar://problem/24428064
2154
2155         Reviewed by Tim Horton.
2156
2157         This patch rolls http://trac.webkit.org/changeset/187471 back in. That was 
2158         how we fixed this problem ages ago. We rolled it out because it very 
2159         mysteriously seemed to cause a memory regression, but we want to track that 
2160         separately and not leave this performance regression in its place in the 
2161         meantime.
2162         * UIProcess/WebPageProxy.cpp:
2163         (WebKit::WebPageProxy::updateViewState):
2164         (WebKit::WebPageProxy::dispatchViewStateChange):
2165         (WebKit::WebPageProxy::updateActivityToken):
2166
2167 2016-02-12  Anders Carlsson  <andersca@apple.com>
2168
2169         Get rid of a 6 year old compiler workaround
2170         https://bugs.webkit.org/show_bug.cgi?id=154198
2171
2172         Reviewed by Sam Weinig.
2173
2174         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2175         (WebKit::connectToService):
2176         (WebKit::createService):
2177
2178 2016-02-12  Anders Carlsson  <andersca@apple.com>
2179
2180         Fix ASan build.
2181
2182         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2183         (WebKit::copyASanDynamicLibraryPath): Deleted.
2184
2185 2016-02-12  Anders Carlsson  <andersca@apple.com>
2186
2187         Remove NPAPI for showing preference panes
2188         https://bugs.webkit.org/show_bug.cgi?id=154193
2189
2190         Reviewed by Dan Bernstein.
2191
2192         No plug-ins ended up adopting this API, so there's no point in keeping it around.
2193
2194         * PluginProcess/PluginControllerProxy.h:
2195         * PluginProcess/mac/PluginControllerProxyMac.mm:
2196         (WebKit::PluginControllerProxy::openPluginPreferencePane): Deleted.
2197         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2198         (WebKit::NetscapePluginModule::getPluginInfo): Deleted.
2199         * Shared/Plugins/PluginModuleInfo.h:
2200         * UIProcess/Plugins/PluginProcessProxy.h:
2201         * UIProcess/Plugins/PluginProcessProxy.messages.in:
2202         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2203         (WebKit::PluginProcessProxy::openPluginPreferencePane): Deleted.
2204         * WebKit2.xcodeproj/project.pbxproj:
2205         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2206         (WebKit::NPN_GetValue): Deleted.
2207         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2208         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2209         (WebKit::NetscapePlugin::openPluginPreferencePane): Deleted.
2210         (WebKit::NetscapePlugin::plugInContainer): Deleted.
2211         (WebKit::NetscapePlugin::platformDestroy): Deleted.
2212         * WebProcess/Plugins/Netscape/mac/WKNPAPIPlugInContainer.h: Removed.
2213         * WebProcess/Plugins/Netscape/mac/WKNPAPIPlugInContainer.mm: Removed.
2214         (-[WKNPAPIPlugInContainer dealloc]): Deleted.
2215         (-[WKNPAPIPlugInContainer _invalidate]): Deleted.
2216         (-[WKNPAPIPlugInContainer openPlugInPreferencePane]): Deleted.
2217         * WebProcess/Plugins/Netscape/mac/WKNPAPIPlugInContainerInternal.h: Removed.
2218         * WebProcess/Plugins/PluginController.h:
2219         * WebProcess/Plugins/PluginView.cpp:
2220         (WebKit::PluginView::openPluginPreferencePane): Deleted.
2221         * WebProcess/Plugins/PluginView.h:
2222
2223 2016-02-12  Anders Carlsson  <andersca@apple.com>
2224
2225         Remove PowerPC cruft
2226         https://bugs.webkit.org/show_bug.cgi?id=154191
2227
2228         Reviewed by Dan Bernstein.
2229
2230         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2231         (WebKit::getPluginArchitecture): Deleted.
2232
2233 2016-02-12  Anders Carlsson  <andersca@apple.com>
2234
2235         Remove more unneeded process launching code
2236         https://bugs.webkit.org/show_bug.cgi?id=154190
2237
2238         Reviewed by Tim Horton.
2239
2240         * UIProcess/Databases/DatabaseProcessProxy.cpp:
2241         (WebKit::DatabaseProcessProxy::getLaunchOptions): Deleted.
2242         * UIProcess/Databases/mac/DatabaseProcessProxyMac.mm: Removed.
2243         (WebKit::DatabaseProcessProxy::platformGetLaunchOptions): Deleted.
2244         * UIProcess/Launcher/ProcessLauncher.h:
2245         * UIProcess/Network/NetworkProcessProxy.cpp:
2246         (WebKit::NetworkProcessProxy::getLaunchOptions): Deleted.
2247         * UIProcess/Network/mac/NetworkProcessProxyMac.mm:
2248         (WebKit::NetworkProcessProxy::platformGetLaunchOptions): Deleted.
2249         * UIProcess/Plugins/PluginProcessProxy.h:
2250         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2251         (WebKit::PluginProcessProxy::pluginNeedsExecutableHeap): Deleted.
2252         (WebKit::PluginProcessProxy::platformGetLaunchOptions): Deleted.
2253         * UIProcess/WebProcessProxy.cpp:
2254         (WebKit::WebProcessProxy::getLaunchOptions): Deleted.
2255         * UIProcess/mac/WebProcessProxyMac.mm:
2256         (WebKit::WebProcessProxy::platformGetLaunchOptions): Deleted.
2257         * WebKit2.xcodeproj/project.pbxproj:
2258
2259 2016-02-12  Anders Carlsson  <andersca@apple.com>
2260
2261         Use different process types for 32-bit and 64-bit plug-ins
2262         https://bugs.webkit.org/show_bug.cgi?id=154186
2263
2264         Reviewed by Tim Horton.
2265
2266         * UIProcess/Databases/DatabaseProcessProxy.cpp:
2267         (WebKit::DatabaseProcessProxy::getLaunchOptions):
2268         * UIProcess/Launcher/ProcessLauncher.h:
2269         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2270         (WebKit::serviceName):
2271         (WebKit::shouldLeakBoost):
2272         * UIProcess/Network/NetworkProcessProxy.cpp:
2273         (WebKit::NetworkProcessProxy::getLaunchOptions):
2274         * UIProcess/Plugins/PluginProcessProxy.cpp:
2275         (WebKit::PluginProcessProxy::getLaunchOptions): Deleted.
2276         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2277         (WebKit::PluginProcessProxy::platformGetLaunchOptions):
2278         * UIProcess/WebProcessProxy.cpp:
2279         (WebKit::WebProcessProxy::getLaunchOptions):
2280
2281 2016-02-12  Beth Dakin  <bdakin@apple.com>
2282
2283         Re-name isClickableElement in InteractionInformationAtPosition to isElement
2284         https://bugs.webkit.org/show_bug.cgi?id=154179
2285
2286         Reviewed by Enrica Casucci.
2287
2288         The bool is set for all elements, so it’s just confusing to call it a 
2289         clickableElement instead of just element.
2290         * Shared/ios/InteractionInformationAtPosition.h:
2291         * Shared/ios/InteractionInformationAtPosition.mm:
2292         (WebKit::InteractionInformationAtPosition::encode):
2293         (WebKit::InteractionInformationAtPosition::decode):
2294         * UIProcess/ios/WKContentViewInteraction.mm:
2295         (-[WKContentView gestureRecognizerShouldBegin:]):
2296         (-[WKContentView _highlightLongPressRecognized:]):
2297         * WebProcess/WebPage/ios/WebPageIOS.mm:
2298         (WebKit::WebPage::getPositionInformation):
2299
2300 2016-02-12  Anders Carlsson  <andersca@apple.com>
2301
2302         Remove more unused process launcher code
2303         https://bugs.webkit.org/show_bug.cgi?id=154181
2304
2305         Reviewed by Tim Horton.
2306
2307         * UIProcess/Launcher/ProcessLauncher.cpp:
2308         (WebKit::ProcessLauncher::processTypeAsString): Deleted.
2309         (WebKit::ProcessLauncher::getProcessTypeFromString): Deleted.
2310         * UIProcess/Launcher/ProcessLauncher.h:
2311
2312 2016-02-12  Anders Carlsson  <andersca@apple.com>
2313
2314         Remove more unused process launching code
2315         https://bugs.webkit.org/show_bug.cgi?id=154178
2316
2317         Reviewed by Tim Horton.
2318
2319         * UIProcess/Databases/mac/DatabaseProcessProxyMac.mm:
2320         (WebKit::shouldUseXPC): Deleted.
2321         (WebKit::DatabaseProcessProxy::platformGetLaunchOptions): Deleted.
2322         * UIProcess/Launcher/ProcessLauncher.h:
2323         * UIProcess/Launcher/mac/EnvironmentVariables.cpp:
2324         (WebKit::EnvironmentVariables::preexistingProcessServiceNameKey): Deleted.
2325         (WebKit::EnvironmentVariables::preexistingProcessTypeKey): Deleted.
2326         * UIProcess/Launcher/mac/EnvironmentVariables.h:
2327         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2328         (WebKit::ProcessLauncher::launchProcess):
2329         (WebKit::setUpTerminationNotificationHandler): Deleted.
2330         (WebKit::addDYLDEnvironmentAdditions): Deleted.
2331         (WebKit::tryPreexistingProcess): Deleted.
2332         (WebKit::createProcess): Deleted.
2333         * UIProcess/Network/mac/NetworkProcessProxyMac.mm:
2334         (WebKit::shouldUseXPC): Deleted.
2335         (WebKit::NetworkProcessProxy::platformGetLaunchOptions): Deleted.
2336         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2337         (WebKit::PluginProcessProxy::platformGetLaunchOptions): Deleted.
2338         * UIProcess/ios/WebProcessProxyIOS.mm:
2339         (WebKit::WebProcessProxy::platformGetLaunchOptions): Deleted.
2340         * UIProcess/mac/WebProcessProxyMac.mm:
2341         (WebKit::shouldUseXPC): Deleted.
2342         (WebKit::WebProcessProxy::platformGetLaunchOptions): Deleted.
2343
2344 2016-02-12  Brian Burg  <bburg@apple.com>
2345
2346         Add a WebKit SPI for creating an automation session and advertise the active session via RemoteInspector
2347         https://bugs.webkit.org/show_bug.cgi?id=153934
2348
2349         Reviewed by Dan Bernstein and Joseph Pecoraro.
2350
2351         An automation session is the main place where WebKit support for user agent automation is implemented.
2352         A session encapsulates the state (default timeouts, page identifier mappings), objects (active automation
2353         WebPages) and logic (how to open a window, run JS, send user input, etc.) used to implement automation
2354         commands.
2355
2356         A process pool can only have one session at a time. The session is created by the WebKit client in
2357         response to a request that comes through _WKAutomationDelegate. When a session is set on the process pool,
2358         it is advertised to remote drivers and debuggers as a RemoteControllableTarget. A remote driver can use
2359         the existing RemoteInspector API to connect to the session and send it automation commands.
2360
2361         The session has a delegate so that WebKit clients can perform actions that are outside the scope of WebKit,
2362         such as creating new tabs, enumerating windows, or sending native user inputs.
2363
2364         This patch adds AutomationSession classes at the API and implementation level in WebKit2. The
2365         implementation class contains RemoteInspector support, which cannot be used directly by WebKit clients.
2366         AutomationSessionDelegate classes exist at both the API and implementation level to bridge between
2367         Objective-C delegates and C++ clients. All code related to RemoteInspector and RemoteAutomationTarget
2368         must be guarded by ENABLE(REMOTE_INSPECTOR).
2369
2370         * Shared/API/APIObject.h: Add new API type 'AutomationSession'.
2371         * Shared/Cocoa/APIObject.mm:
2372         (API::Object::newObject): Allocate in the wrapper.
2373         * UIProcess/API/APIAutomationSessionClient.h: Added.
2374         (API::AutomationSessionClient::~AutomationSessionClient):
2375         (API::AutomationSessionClient::didRequestNewWindow): Delegate window creation to the client.
2376         * UIProcess/API/Cocoa/WKProcessPool.mm:
2377         (-[WKProcessPool _setAutomationSession:]): Keep at most one WebAutomationSession at a time.
2378         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2379         * UIProcess/API/Cocoa/_WKAutomationSession.h: Added.
2380         * UIProcess/API/Cocoa/_WKAutomationSession.mm: Added.
2381         (-[_WKAutomationSession init]): Construct the API object in the implementation wrapper.
2382         (-[_WKAutomationSession dealloc]): Clear the client before calling the implementation destructor.
2383
2384         (-[_WKAutomationSession sessionIdentifier]):
2385         (-[_WKAutomationSession setSessionIdentifier:]):
2386         Store the session identifier string in the implementation.
2387
2388         (-[_WKAutomationSession delegate]):
2389         (-[_WKAutomationSession setDelegate:]):
2390         Create an Objective-C adapter for the delegate if not nil and set it as the implementation's client.
2391
2392         (-[_WKAutomationSession _apiObject]):
2393         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: Added.
2394         * UIProcess/API/Cocoa/_WKAutomationSessionInternal.h: Added.
2395         (wrapper):
2396         * UIProcess/Cocoa/AutomationSessionClient.h: Added.
2397         Set up the boilerplate for caching delegate method availability. It will include more methods later.
2398
2399         * UIProcess/Cocoa/AutomationSessionClient.mm: Added. Forward requests to the SPI delegate.
2400         (WebKit::AutomationSessionClient::AutomationSessionClient):
2401         (WebKit::AutomationSessionClient::didRequestNewWindow): Delegate window creation to the client.
2402
2403         * UIProcess/WebAutomationSession.cpp: Added.
2404         (WebKit::WebAutomationSession::WebAutomationSession):
2405         By default, a session should be available and not paired to any particular remote driver.
2406
2407         (WebKit::WebAutomationSession::~WebAutomationSession): Require callers to clear the client first.
2408         (WebKit::WebAutomationSession::setClient):
2409         (WebKit::WebAutomationSession::dispatchMessageFromRemote): Stub this out for now.
2410
2411         (WebKit::WebAutomationSession::connect):
2412         (WebKit::WebAutomationSession::disconnect):
2413         To prevent multiple connection attempts, mark the target as paired when a remote client has connected.
2414
2415         * UIProcess/WebAutomationSession.h: Added.
2416         * UIProcess/WebProcessPool.cpp:
2417         (WebKit::WebProcessPool::setAutomationSession):
2418         Store the session object and tell it to register itself. Unregistering happens automatically
2419         in RemoteControllableTarget::~RemoteControllableTarget.
2420
2421         * UIProcess/WebProcessPool.h:
2422         * WebKit2.xcodeproj/project.pbxproj: Add files and headers.
2423
2424 2016-02-12  Anders Carlsson  <andersca@apple.com>
2425
2426         Get rid of NetscapePluginModule::createPluginMIMETypesPreferences
2427         https://bugs.webkit.org/show_bug.cgi?id=154173
2428
2429         Reviewed by Dan Bernstein.
2430
2431         * Shared/Plugins/Netscape/NetscapePluginModule.h:
2432         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2433         (WebKit::NetscapePluginModule::createPluginMIMETypesPreferences): Deleted.
2434
2435 2016-02-11  Anders Carlsson  <andersca@apple.com>
2436
2437         Remove legacy processes from WebKit2
2438         https://bugs.webkit.org/show_bug.cgi?id=154119
2439
2440         Reviewed by Darin Adler.
2441
2442         * Configurations/BaseLegacyProcess.xcconfig: Removed.
2443         * DatabaseProcess/EntryPoint/mac/LegacyProcess/DatabaseProcessMain.mm: Removed.
2444         (DatabaseProcessMain): Deleted.
2445         * DatabaseProcess/EntryPoint/mac/LegacyProcess/Info.plist: Removed.
2446         * NetworkProcess/EntryPoint/mac/LegacyProcess/Info.plist: Removed.
2447         * NetworkProcess/EntryPoint/mac/LegacyProcess/NetworkProcessMain.mm: Removed.
2448         (NetworkProcessMain): Deleted.
2449         * PluginProcess/EntryPoint/mac/LegacyProcess/Info.plist: Removed.
2450         * PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm: Removed.
2451         (WebKit::PluginProcessMainDelegate::PluginProcessMainDelegate): Deleted.
2452         (PluginProcessMain): Deleted.
2453         * Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessEntryPoint.h: Removed.
2454         (WebKit::ChildProcessMainDelegate::ChildProcessMainDelegate): Deleted.
2455         (WebKit::ChildProcessMain): Deleted.
2456         * Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessEntryPoint.mm: Removed.
2457         (WebKit::ChildProcessMainDelegate::~ChildProcessMainDelegate): Deleted.
2458         (WebKit::ChildProcessMainDelegate::installSignalHandlers): Deleted.
2459         (WebKit::ChildProcessMainDelegate::doPreInitializationWork): Deleted.
2460         (WebKit::ChildProcessMainDelegate::getConnectionIdentifier): Deleted.
2461         (WebKit::ChildProcessMainDelegate::getClientIdentifier): Deleted.
2462         (WebKit::ChildProcessMainDelegate::getClientProcessName): Deleted.
2463         (WebKit::ChildProcessMainDelegate::getExtraInitializationData): Deleted.
2464         (WebKit::ChildProcessMainDelegate::startRunLoop): Deleted.
2465         (WebKit::ChildProcessMainDelegate::doPostRunWork): Deleted.
2466         * Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessMain.mm: Removed.
2467         (WebKit::closeUnusedFileDescriptors): Deleted.
2468         (WebKit::BootstrapMain): Deleted.
2469         (main): Deleted.
2470         * WebKit2.xcodeproj/project.pbxproj:
2471         * WebProcess/EntryPoint/mac/LegacyProcess/Info.plist: Removed.
2472         * WebProcess/EntryPoint/mac/LegacyProcess/WebContentProcessMain.mm: Removed.
2473         (WebKit::WebContentProcessMainDelegate::WebContentProcessMainDelegate): Deleted.
2474         (WebContentProcessMain): Deleted.
2475
2476 2016-02-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2477
2478         [GTK] HTTP auth dialog incorrectly rendered with Accelerated Compositing enabled
2479         https://bugs.webkit.org/show_bug.cgi?id=154159
2480
2481         Reviewed by Michael Catanzaro.
2482
2483         There are two problems here, first we are changing the cairo
2484         operator when rendering the xcomposite window pixmap without a
2485         proper save/restore, so it affects the drawing that happens after
2486         that, and second problem is that we are not rendering the gray
2487         background in AC mode because we are returning earlier.
2488
2489         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2490         (webkitWebViewRenderAcceleratedCompositingResults):
2491         (webkitWebViewBaseDraw):
2492
2493 2016-02-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2494
2495         [GTK] Allow applications to disable Accelerated Compositing mode.
2496         https://bugs.webkit.org/show_bug.cgi?id=154147
2497
2498         Reviewed by Carlos Garcia Campos.
2499
2500         * UIProcess/gtk/WebPreferencesGtk.cpp:
2501         (WebKit::WebPreferences::platformInitializeStore): if the environment
2502         variable  WEBKIT_DISABLE_COMPOSITING_MODE is defined, then disable AC.
2503
2504 2016-02-11  Commit Queue  <commit-queue@webkit.org>
2505
2506         Unreviewed, rolling out r196453.
2507         https://bugs.webkit.org/show_bug.cgi?id=154142
2508
2509         This change broke internal iOS builds (Requested by ryanhaddad
2510         on #webkit).
2511
2512         Reverted changeset:
2513
2514         "Move Download authentication code to AuthenticationManager"
2515         https://bugs.webkit.org/show_bug.cgi?id=154132
2516         http://trac.webkit.org/changeset/196453
2517
2518 2016-02-11  Anders Carlsson  <andersca@apple.com>
2519
2520         Use the system PluginProcess.app for generating plug-in MIME type preferences
2521         https://bugs.webkit.org/show_bug.cgi?id=154139
2522
2523         Reviewed by Dan Bernstein.
2524
2525         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2526         (WebKit::PluginProcessProxy::createPropertyListFile):
2527
2528 2016-02-11  Beth Dakin  <bdakin@apple.com>
2529
2530         EditingRangeIsRelativeTo::Document and NSRangeIsRelativeTo::Document should 
2531         be called EditableRoot instead
2532         https://bugs.webkit.org/show_bug.cgi?id=154138
2533
2534         Reviewed by Alexey Proskuryakov.
2535
2536         EditableRoot is much more accurate than Document.
2537         * Shared/EditingRange.h:
2538         * UIProcess/Cocoa/WebViewImpl.mm:
2539         (WebKit::WebViewImpl::insertText):
2540         (WebKit::WebViewImpl::selectedRangeWithCompletionHandler):
2541         * UIProcess/WebPageProxy.h:
2542         * WebProcess/WebPage/WebPage.cpp:
2543         (WebKit::WebPage::rangeFromEditingRange):
2544         * WebProcess/WebPage/WebPage.h:
2545
2546 2016-02-11  Alex Christensen  <achristensen@webkit.org>
2547
2548         Move Download authentication code to AuthenticationManager
2549         https://bugs.webkit.org/show_bug.cgi?id=154132
2550
2551         Reviewed by Sam Weinig.
2552
2553         When a video element makes a request that receives an authentication challenge, the
2554         AuthenticationManager receives an AuthenticationChallenge without an AuthenticationClient.
2555         As a result, Download::receivedCredential and other functions were being called, which
2556         sent a message to the challenge's sender.  This functionality is not specific to downloads,
2557         so I moved it from Download to AuthenticationManager.
2558
2559         This fixes http/tests/media/video-auth.html when using NetworkSession 
2560         because I use AuthenticationManager::receivedCredential if there is no AuthenticationClient
2561         instead of improperly asserting that there is always an AuthenticationClient if there is no
2562         completionHandler.
2563
2564         * NetworkProcess/Downloads/Download.h:
2565         * NetworkProcess/Downloads/ios/DownloadIOS.mm:
2566         (WebKit::Download::platformDidFinish):
2567         (WebKit::Download::receivedCredential): Deleted.
2568         (WebKit::Download::receivedRequestToContinueWithoutCredential): Deleted.
2569         (WebKit::Download::receivedCancellation): Deleted.
2570         (WebKit::Download::receivedRequestToPerformDefaultHandling): Deleted.
2571         (WebKit::Download::receivedChallengeRejection): Deleted.
2572         * NetworkProcess/Downloads/mac/DownloadMac.mm:
2573         (WebKit::Download::platformDidFinish):
2574         (WebKit::Download::receivedCredential): Deleted.
2575         (WebKit::Download::receivedRequestToContinueWithoutCredential): Deleted.
2576         (WebKit::Download::receivedCancellation): Deleted.
2577         (WebKit::Download::receivedRequestToPerformDefaultHandling): Deleted.
2578         (WebKit::Download::receivedChallengeRejection): Deleted.
2579         * NetworkProcess/Downloads/soup/DownloadSoup.cpp:
2580         (WebKit::Download::platformDidFinish):
2581         (WebKit::Download::receivedCredential): Deleted.
2582         (WebKit::Download::receivedRequestToContinueWithoutCredential): Deleted.
2583         (WebKit::Download::receivedCancellation): Deleted.
2584         (WebKit::Download::continueWithoutCredential): Deleted.
2585         (WebKit::Download::useCredential): Deleted.
2586         (WebKit::Download::cancelAuthenticationChallenge): Deleted.
2587         (WebKit::Download::receivedRequestToPerformDefaultHandling): Deleted.
2588         (WebKit::Download::receivedChallengeRejection): Deleted.
2589         * PlatformEfl.cmake:
2590         * PlatformGTK.cmake:
2591         * PlatformMac.cmake:
2592         * Shared/Authentication/AuthenticationManager.cpp:
2593         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
2594         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
2595         (WebKit::AuthenticationManager::continueWithoutCredentialForChallenge):
2596         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
2597         (WebKit::AuthenticationManager::cancelChallenge):
2598         (WebKit::AuthenticationManager::cancelSingleChallenge):
2599         (WebKit::AuthenticationManager::performDefaultHandling):
2600         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
2601         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinue):
2602         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
2603         * Shared/Authentication/AuthenticationManager.h:
2604         (WebKit::AuthenticationManager::outstandingAuthenticationChallengeCount):
2605         * Shared/Authentication/cocoa: Added.
2606         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm: Added.
2607         (WebKit::AuthenticationManager::receivedCredential):
2608         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
2609         (WebKit::AuthenticationManager::receivedCancellation):
2610         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
2611         (WebKit::AuthenticationManager::receivedChallengeRejection):
2612         * Shared/Authentication/soup: Added.
2613         * Shared/Authentication/soup/AuthenticationManagerSoup.cpp: Added.
2614         (WebKit::AuthenticationManager::receivedCredential):
2615         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
2616         (WebKit::AuthenticationManager::receivedCancellation):
2617         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
2618         (WebKit::AuthenticationManager::receivedChallengeRejection):
2619         * WebKit2.xcodeproj/project.pbxproj:
2620
2621 2016-02-11  Beth Dakin  <bdakin@apple.com>
2622
2623         Soft spaces are often tracked in the wrong spot
2624         https://bugs.webkit.org/show_bug.cgi?id=154127
2625         -and corresponding-
2626         rdar://problem/24493140
2627
2628         Reviewed by Sam Weinig.
2629
2630         Soft spaces are in the wrong space now for two reasons. First of all, the 
2631         NSRange we get from the accepted candidate is relative to the paragraph 
2632         start, so without this patch, soft spaces are only ever right for the first 
2633         paragraph. Secondly, if focus changes for any reason other than text 
2634         insertion, soft spaces are also wrong because they need to be re-set.
2635
2636         New enum can be used to indicate what an EditingRange is relative to.
2637         * Shared/EditingRange.h:
2638         (WebKit::EditingRange::EditingRange):
2639
2640         didHandleAcceptedCandidate is a new message that gets sent from the 
2641         WebProcess. This lets us track a bool m_isHandlingAcceptedCandidate.
2642         * UIProcess/Cocoa/WebViewImpl.h:
2643         (WebKit::WebViewImpl::didHandleAcceptedCandidate):
2644
2645         Re-set the m_softSpaceRange on selection changes so long as 
2646         m_isHandlingAcceptedCandidate is false.
2647         * UIProcess/Cocoa/WebViewImpl.mm:
2648         (WebKit::WebViewImpl::selectionDidChange):
2649
2650         Set m_isHandlingAcceptedCandidate to true.
2651         (WebKit::WebViewImpl::handleAcceptedCandidate):
2652
2653         Set m_isHandlingAcceptedCandidate to false.
2654         (WebKit::WebViewImpl::didHandleAcceptedCandidate):
2655
2656         insertTextAsync takes a new parameter indicating what the replacementRange is 
2657         relative to. If needToRemoveSoftSpace is true, then the replacementRange is 
2658         relative to the paragraph.
2659         (WebKit::WebViewImpl::insertText):
2660
2661         Pipe didHandleAcceptedCandidate through to WebViewImpl.
2662         * UIProcess/PageClient.h:
2663
2664         insertTextAsync takes an EditingRangeIsRelativeTo.
2665         * UIProcess/WebPageProxy.cpp:
2666         (WebKit::WebPageProxy::insertTextAsync):
2667
2668         Pipe didHandleAcceptedCandidate through to WebViewImpl.
2669         (WebKit::WebPageProxy::didHandleAcceptedCandidate):
2670         * UIProcess/WebPageProxy.h:
2671
2672         New message lets the WebProcess tell the UIProcess when the candidate has 
2673         been accepted.
2674         * UIProcess/WebPageProxy.messages.in:
2675
2676         Pipe didHandleAcceptedCandidate through to WebViewImpl.
2677         * UIProcess/mac/PageClientImpl.h:
2678         * UIProcess/mac/PageClientImpl.mm:
2679         (WebKit::PageClientImpl::didHandleAcceptedCandidate):
2680
2681         insertTextAsync takes an EditingRangeIsRelativeTo. Pass that through to 
2682         rangeFromEditingRange to get the correct range.
2683         * WebProcess/WebPage/WebPage.cpp:
2684         (WebKit::WebPage::insertTextAsync):
2685
2686         Use the EditingRangeIsRelativeTo to find the right WebCore::Range.
2687         (WebKit::WebPage::rangeFromEditingRange):
2688
2689         Take EditingRangeIsRelativeTo in a few places. 
2690         * WebProcess/WebPage/WebPage.h:
2691
2692         InsertTextAsync takes a EditingRangeIsRelativeTo.
2693         * WebProcess/WebPage/WebPage.messages.in:
2694
2695         Send didHandleAccpetedCandidate to the UIProcess
2696         * WebProcess/WebPage/mac/WebPageMac.mm:
2697         (WebKit::WebPage::handleAcceptedCandidate):
2698
2699 2016-02-11  Alex Christensen  <achristensen@webkit.org>
2700
2701         Use BlobResourceHandle when loading blob urls, even when using NetworkSession
2702         https://bugs.webkit.org/show_bug.cgi?id=154096
2703
2704         Reviewed by Brady Eidson.
2705         
2706         This fixes at least http/tests/xmlhttprequest/blob-request-byte-range.html.
2707
2708         * NetworkProcess/NetworkDataTask.h:
2709         Renamed NetworkDataTaskClient::didReceiveResponse to didReceiveResponseNetworkSession
2710         to avoid conflicting with ResourceHandleClient::didReceiveResponse.
2711         * NetworkProcess/NetworkLoad.cpp:
2712         (WebKit::NetworkLoad::NetworkLoad):
2713         Make a BlobResourceHandle instead of a NetworkDataTask if we have a request for a blob url.
2714         (WebKit::NetworkLoad::~NetworkLoad):
2715         (WebKit::NetworkLoad::setDefersLoading):
2716         (WebKit::NetworkLoad::cancel):
2717         (WebKit::NetworkLoad::continueWillSendRequest):
2718         (WebKit::NetworkLoad::continueDidReceiveResponse):
2719         (WebKit::NetworkLoad::sharedDidReceiveResponse):
2720         (WebKit::NetworkLoad::convertTaskToDownload):
2721         (WebKit::NetworkLoad::setPendingDownloadID):
2722         (WebKit::NetworkLoad::didReceiveChallenge):
2723         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
2724         (WebKit::NetworkLoad::cannotShowURL):
2725         (WebKit::NetworkLoad::didReceiveResponseAsync):
2726         (WebKit::NetworkLoad::willSendRequestAsync):
2727         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
2728         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
2729         (WebKit::NetworkLoad::supportsDataArray):
2730         (WebKit::NetworkLoad::didReceiveDataArray):
2731         (WebKit::NetworkLoad::didSendData):
2732         (WebKit::NetworkLoad::receivedCancellation):
2733         (WebKit::NetworkLoad::didReceiveResponse): Deleted.
2734         Compile ResourceHandleClient when using NetworkSession because it is used for blobs now.
2735         Also, add null checks because we now have NetworkLoads where either m_task or m_handle is always null.
2736         * NetworkProcess/NetworkLoad.h:
2737         (WebKit::NetworkLoad::pendingDownloadID):
2738         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2739         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
2740         * NetworkProcess/mac/NetworkLoadMac.mm:
2741         (WebKit::NetworkLoad::willCacheResponseAsync):
2742
2743 2016-02-11  Frederic Wang  <fred.wang@free.fr>
2744
2745         Bug 154103 - [GTK] Build error after bug 154046
2746         https://bugs.webkit.org/show_bug.cgi?id=154103
2747
2748         Reviewed by Carlos Garcia Campos.
2749
2750         * UIProcess/API/gtk/WebKitUserContent.cpp:
2751         (_WebKitUserStyleSheet::_WebKitUserStyleSheet):
2752         (webkitUserStyleSheetGetUserStyleSheet):
2753         * UIProcess/API/gtk/WebKitUserContentPrivate.h:
2754
2755 2016-02-10  Jiewen Tan  <jiewen_tan@apple.com>
2756
2757         Rename *Event::create* which creates events for bindings to *Event::createForBindings* and cleanup corresponding paths
2758         https://bugs.webkit.org/show_bug.cgi?id=153903
2759         <rdar://problem/24518146>
2760
2761         Reviewed by Darin Adler.
2762
2763         * WebProcess/WebPage/ios/WebPageIOS.mm:
2764         (WebKit::nextAssistableElement):
2765
2766 2016-02-10  Anders Carlsson  <andersca@apple.com>
2767
2768         Add SPI to remove individual user scripts or user style sheets
2769         https://bugs.webkit.org/show_bug.cgi?id=154046
2770         rdar://problem/23596352
2771
2772         Reviewed by Sam Weinig.
2773
2774         * UIProcess/API/Cocoa/WKUserContentController.mm:
2775         (-[WKUserContentController _removeUserScript:]):
2776         (-[WKUserContentController _userStyleSheets]):
2777         (-[WKUserContentController _addUserStyleSheet:]):
2778         (-[WKUserContentController _removeUserStyleSheet:]):
2779         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
2780         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2781         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
2782         (WebKit::WebUserContentControllerProxy::addProcess):
2783         (WebKit::WebUserContentControllerProxy::removeUserScript):
2784         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
2785         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
2786         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
2787         * UIProcess/UserContent/WebUserContentControllerProxy.h:
2788         (WebKit::WebUserContentControllerProxy::userStyleSheets):
2789         * WebProcess/UserContent/WebUserContentController.cpp:
2790         (WebKit::WebUserContentController::removeUserScript):
2791         (WebKit::WebUserContentController::removeUserStyleSheet):
2792         * WebProcess/UserContent/WebUserContentController.h:
2793         * WebProcess/UserContent/WebUserContentController.messages.in:
2794
2795 2016-02-10  Alex Christensen  <achristensen@webkit.org>
2796
2797         Fix assertions when loading from WebProcess
2798         https://bugs.webkit.org/show_bug.cgi?id=154079
2799
2800         Reviewed by Anders Carlsson.
2801
2802         Assertions were failing, mostly when using NetworkProcess, and mostly involving Top Sites.
2803         When we do loading from the WebProcess (which we should eventually not allow), we were sometimes
2804         using a private browsing session that did not exist because the UIProcess had told the NetworkProcess
2805         to create a private browsing session with the given SessionID, but the WebProcess was not told about
2806         the private browsing session.
2807         Also, sometimes we were calling NetworkProcess::singleton() from the WebProcess, which caused problems
2808         with the PlatformStrategies object being reset.  This prevents that, too.
2809
2810         * NetworkProcess/NetworkLoad.cpp:
2811         (WebKit::NetworkLoad::NetworkLoad):
2812         Added an assertion that we have a network session when we have just made a NetworkingContext with the given SessionID.
2813         * NetworkProcess/NetworkSession.h:
2814         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2815         (WebKit::NetworkSession::defaultSession):
2816         (WebKit::NetworkSession::NetworkSession):
2817         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2818         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
2819         Call NetworkProcess::singleton only when we know we are in the network process.
2820         * UIProcess/WebPageProxy.cpp:
2821         (WebKit::WebPageProxy::WebPageProxy):
2822         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2823         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
2824         Tell the WebProcesses about the new private session, too.  Sometimes they use the new private session.
2825         * WebProcess/WebProcess.cpp:
2826         (WebKit::WebProcess::ensurePrivateBrowsingSession):
2827         (WebKit::WebProcess::destroyPrivateBrowsingSession):
2828         Removed useless macros that were always true for all WK2 clients.
2829
2830 2016-02-10  Dan Bernstein  <mitz@apple.com>
2831
2832         [Mac] Stop installing the legacy processes
2833         https://bugs.webkit.org/show_bug.cgi?id=154062
2834
2835         Reviewed by Anders Carlsson.
2836
2837         * Configurations/All.xcconfig: Removed the legacy processes from EXCLUDED_SOURCE_FILE_NAMES
2838           for iOS, now that they are no longer included in a Copy Files build phase.
2839         * Configurations/BaseLegacyProcess.xcconfig: Set SKIP_INSTALL to YES for OS X as well.
2840         * WebKit2.xcodeproj/project.pbxproj: Removed the Copy Files build phase that copied the
2841           processes into the framework in engineering builds. Renamed the “Add current version
2842           symlinks” script build phase to “Add XPCServices symlink”, and changed it to do just that.
2843
2844 2016-02-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2845
2846         REGRESSION(r196183): [GTK] Broke TestInspector
2847         https://bugs.webkit.org/show_bug.cgi?id=153945
2848
2849         Reviewed by Michael Catanzaro.
2850
2851         When the inspector view is detached and not added to a window,
2852         which happens when it's closed, the inspector view is destroyed
2853         because it doesn't have a parent anymore. When the inspector view
2854         is destroyed we notify the web process that the inspector was
2855         closed. Before r196183 this was not a problem, because the call to
2856         WebInspectorProxy::didClose() from platformDetach() returned early
2857         because WebInspectorProxy::didClose() had already set
2858         m_inspectorPage to nullptr. In r196183 m_inspectorPage is set to
2859         nullptr after platformDetach(), so we end up trying to detach the
2860         inpector view again. To prevent this cycle, we should disconnect
2861         the destroyed signal handler from the inspector view when
2862         platformDetach() is called from WebInspectorProxy::didClose().
2863
2864         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2865         (WebKit::WebInspectorProxy::platformDetach):
2866
2867 2016-02-09  Commit Queue  <commit-queue@webkit.org>
2868
2869         Unreviewed, rolling out r196341.
2870         https://bugs.webkit.org/show_bug.cgi?id=154056
2871
2872         This change broke existing API tests on Mac and iOS (Requested
2873         by ryanhaddad on #webkit).
2874
2875         Reverted changeset:
2876
2877         "Add SPI to remove individual user scripts or user style
2878         sheets"
2879         https://bugs.webkit.org/show_bug.cgi?id=154046
2880         http://trac.webkit.org/changeset/196341
2881
2882 2016-02-09  Anders Carlsson  <andersca@apple.com>
2883
2884         Add SPI to remove individual user scripts or user style sheets
2885         https://bugs.webkit.org/show_bug.cgi?id=154046
2886         rdar://problem/23596352
2887
2888         Reviewed by Sam Weinig.
2889
2890         * UIProcess/API/Cocoa/WKUserContentController.mm:
2891         (-[WKUserContentController _removeUserScript:]):
2892         (-[WKUserContentController _userStyleSheets]):
2893         (-[WKUserContentController _addUserStyleSheet:]):
2894         (-[WKUserContentController _removeUserStyleSheet:]):
2895         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
2896         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2897         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
2898         (WebKit::WebUserContentControllerProxy::addProcess):
2899         (WebKit::WebUserContentControllerProxy::removeUserScript):
2900         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
2901         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
2902         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
2903         * UIProcess/UserContent/WebUserContentControllerProxy.h:
2904         (WebKit::WebUserContentControllerProxy::userStyleSheets):
2905         * WebProcess/UserContent/WebUserContentController.cpp:
2906         (WebKit::WebUserContentController::removeUserScript):
2907         (WebKit::WebUserContentController::removeUserStyleSheet):
2908         * WebProcess/UserContent/WebUserContentController.h:
2909         * WebProcess/UserContent/WebUserContentController.messages.in:
2910
2911 2016-02-07  Gavin Barraclough  <barraclough@apple.com>
2912
2913         GetValueFunc/PutValueFunc should not take both slotBase and thisValue
2914         https://bugs.webkit.org/show_bug.cgi?id=154009
2915
2916         Reviewed by Geoff Garen.
2917
2918         In JavaScript there are two types of properties - regular value properties, and accessor properties.
2919         One difference between these is how they are reflected by getOwnPropertyDescriptor, and another is
2920         what object they operate on in the case of a prototype access. If you access a value property of a
2921         prototype object it return a value pertinent to the prototype, but in the case of a prototype object
2922         returning an accessor, then the accessor function is applied to the base object of the access.
2923
2924         JSC supports special 'custom' properties implemented as a c++ callback, and these custom properties
2925         can be used to implement either value- or accessor-like behavior. getOwnPropertyDescriptor behavior
2926         is selected via the CustomAccessor attribute. Value- or accessor-like object selection is current
2927         supported by passing both the slotBase and the thisValue to the callback,and hoping it uses the
2928         right one. This is probably inefficient, bug-prone, and leads to crazy like JSBoundSlotBaseFunction.
2929
2930         Instead, just pass one thisValue to the callback functions, consistent with CustomAccessor.
2931
2932         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
2933         (WebKit::JSNPObject::getOwnPropertyNames):
2934         (WebKit::JSNPObject::propertyGetter):
2935         (WebKit::JSNPObject::methodGetter):
2936         * WebProcess/Plugins/Netscape/JSNPObject.h:
2937             - Merged slotBase & thisValue to custom property callbacks.
2938
2939 2016-02-09  Jer Noble  <jer.noble@apple.com>
2940
2941         [Mac] Exiting fullscreen through the placeholder action leaves window in empty state
2942         https://bugs.webkit.org/show_bug.cgi?id=152979
2943         <rdar://problem/24132309>
2944
2945         Reviewed by Brent Fulgham.
2946
2947         In r194593, we relaxed the _fullScreenState requirement in -finishedExitFullScreenAnimation: to handle
2948         the case where the request to exit fullscreen came from outside the process. However, in so doing, we
2949         allowed -finishedExitFullScreenAnimation: to be called twice, and in so doing, leave the original window
2950         empty of its WebView.  Tighten up the restriction of _fullScreenState to allow only the "InFullScreen"
2951         state (to take care of the external exit command) and the "ExitingFullScreen" state, to handle the
2952         normal teardown path.
2953
2954         * UIProcess/mac/WKFullScreenWindowController.mm:
2955         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
2956
2957 2016-02-04  Jer Noble  <jer.noble@apple.com>
2958
2959         [Mac] Adopt NSURLSession properties in AVAssetResourceLoader
2960         https://bugs.webkit.org/show_bug.cgi?id=153873
2961
2962         Reviewed by Eric Carlson.
2963
2964         Add a WebKit2 preference to control the WebCore isAVFoundationNSURLSessionEnabled()
2965         setting.
2966
2967         * Shared/WebPreferencesDefinitions.h:
2968         * UIProcess/API/C/WKPreferences.cpp:
2969         (WKPreferencesSetAVFoundationNSURLSessionEnabled):
2970         (WKPreferencesGetAVFoundationNSURLSessionEnabled):
2971         * UIProcess/API/C/WKPreferencesRef.h:
2972         * WebProcess/WebPage/WebPage.cpp:
2973         (WebKit::WebPage::updatePreferences):
2974
2975 2016-02-09  Anders Carlsson  <andersca@apple.com>
2976
2977         All 32-bit plug-ins should use the XPC service
2978         https://bugs.webkit.org/show_bug.cgi?id=154036
2979         rdar://problem/16059483
2980
2981         Reviewed by Dan Bernstein.
2982         
2983         Silverlight expects malloced memory from the tiny zone to be executable. It also expects
2984         the data segment from its coreclr image to be executable.
2985         
2986         Make this possible by:
2987         
2988         1. Shimming mach_vm_map, making sure to add the VM_PROT_EXECUTABLE bit to any memory in the tiny zone.
2989         2. Go through the address space, looking for any existing ranges from the tiny zone and mach_vm_protect them
2990            to be executable.
2991         3. Register with dyld so we'll get callbacks whenever a library is bound, look for the coreclr image, and
2992            mach_vm_protect its __DATA segment to be executable.
2993
2994         * Platform/spi/Cocoa/DyldSPI.h: Copied from Source/WebKit2/PluginProcess/mac/PluginProcessShim.h.
2995         * PluginProcess/mac/PluginProcessMac.mm:
2996         (WebKit::isMallocMemoryTag):
2997         (WebKit::shouldMapMemoryExecutable):
2998         (WebKit::initializeShim):
2999         (WebKit::PluginProcess::platformInitializeProcess):
3000         * PluginProcess/mac/PluginProcessShim.h:
3001         * PluginProcess/mac/PluginProcessShim.mm:
3002         (WebKit::shimMachVMMap):
3003         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3004         (WebKit::PluginProcessProxy::platformGetLaunchOptions):
3005         (WebKit::shouldUseXPC): Deleted.
3006         * WebKit2.xcodeproj/project.pbxproj:
3007
3008 2016-02-09  Fujii Hironori  <Hironori.Fujii@jp.sony.com>
3009
3010         possible buffer overrun in Connection::processMessage of Source/WebKit2/Platform/IPC/unix/ConnectionUnix.cpp
3011         https://bugs.webkit.org/show_bug.cgi?id=153637
3012
3013         Reviewed by Carlos Garcia Campos.
3014
3015         * Platform/IPC/unix/ConnectionUnix.cpp:
3016         (IPC::Connection::processMessage): Fix invalid arguments of memmove.
3017
3018 2016-02-09  Carlos Garcia Campos  <cgarcia@igalia.com>
3019
3020         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.11.5 release.
3021
3022         * gtk/NEWS: Add release notes for 2.11.5.
3023
3024 2016-02-08  Carlos Garcia Campos  <cgarcia@igalia.com>
3025
3026         [GTK] WebKitWebView should send crossing events to the WebProcess
3027         https://bugs.webkit.org/show_bug.cgi?id=153740
3028
3029         Reviewed by Michael Catanzaro.
3030
3031         We don't currently handle crossing events in the web view
3032         (enter/leave). That's why if you hover a scrollbar and leave the
3033         window, the scrollbar is still rendered as hovered.
3034
3035         * Shared/gtk/WebEventFactory.cpp:
3036         (WebKit::buttonForEvent): Handle the case of GDK_ENTER_NOTIFY and
3037         GDK_LEAVE_NOTIFY events.
3038         (WebKit::WebEventFactory::createWebMouseEvent): Ditto.
3039         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3040         (webkitWebViewBaseRealize): Add GDK_ENTER_NOTIFY_MASK and
3041         GDK_LEAVE_NOTIFY_MASK flags to the web view event mask.
3042         (webkitWebViewBaseCrossingNotifyEvent): Handle enter/leave notify
3043         events by generating a mouse move event, ensuring the double to
3044         int conversion will not cause any problem.
3045         (webkit_web_view_base_class_init): Add an implementation for
3046         enter_notify_event and leave_notify_event.
3047
3048 2016-02-08  Carlos Garcia Campos  <cgarcia@igalia.com>
3049
3050         Infinite loop when processing mouse events synchronously
3051         https://bugs.webkit.org/show_bug.cgi?id=153995
3052
3053         Reviewed by Darin Adler.
3054
3055         This happened with WTR in the GTK+ port after landing patch in bug
3056         #153740. The thing is that WTR forces events handling IPC messages
3057         to be synchronous. When a drag and drop operation is in progress,
3058         the web process ignores mouse move events and replies with
3059         DidReceiveEvent signal. The DidReceiveEvent message handler in
3060         WebPageProxy checks if we have a m_nextMouseMoveEvent and handles
3061         it, but when all this happens synchronously the
3062         m_nextMouseMoveEvent is the current one because we haven't
3063         returned yet from handleMouseEvent(). We need to invalidate the
3064         m_nextMouseMoveEvent before calling handleMouseEvent().
3065
3066         * UIProcess/WebPageProxy.cpp:
3067         (WebKit::WebPageProxy::didReceiveEvent):
3068
3069 2016-02-08  Jeremy Jones  <jeremyj@apple.com>
3070
3071         Remove __weak from WKAirPlayRoutePicker.mm to fix build warning.
3072         https://bugs.webkit.org/show_bug.cgi?id=153985
3073         rdar://problem/24485348
3074
3075         Reviewed by Darin Adler.
3076
3077         Remove __weak since it is only available when using ARC.
3078
3079         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
3080
3081 2016-02-08  Danilo Cesar Lemes de Paula  <danilo.cesar@collabora.co.uk>
3082
3083         [GTK] Fix crash when creating webview with g_object_new
3084         https://bugs.webkit.org/show_bug.cgi?id=153989
3085
3086         Reviewed by Carlos Garcia Campos.
3087
3088         g_object_new(WEBKIT_TYPE_WEB_VIEW, NULL) crashes webkit
3089         as _WebKitWebViewBasePrivate constructor requires a mainloop, but
3090         webkit is only initialized when a context is created (which
3091         doesn't happen with a direct call to g_object_new).
3092
3093         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3094         (webkit_web_view_base_class_init):
3095
3096 2016-02-08  Commit Queue  <commit-queue@webkit.org>
3097
3098         Unreviewed, rolling out r196253.
3099         https://bugs.webkit.org/show_bug.cgi?id=153990
3100
3101         Caused several crashes in GTK+ bots (Requested by KaL on
3102         #webkit).
3103
3104         Reverted changeset:
3105
3106         "[GTK] WebKitWebView should send crossing events to the
3107         WebProcess"
3108         https://bugs.webkit.org/show_bug.cgi?id=153740
3109         http://trac.webkit.org/changeset/196253
3110
3111 2016-02-08  Carlos Garcia Campos  <cgarcia@igalia.com>
3112
3113         [GTK] WebKitWebView should send crossing events to the WebProcess
3114         https://bugs.webkit.org/show_bug.cgi?id=153740
3115
3116         Reviewed by Michael Catanzaro.
3117
3118         We don't currently handle crossing events in the web view
3119         (enter/leave). That's why if you hover a scrollbar and leave the
3120         window, the scrollbar is still rendered as hovered.
3121
3122         * Shared/gtk/WebEventFactory.cpp:
3123         (WebKit::buttonForEvent): Handle the case of GDK_ENTER_NOTIFY and
3124         GDK_LEAVE_NOTIFY events.
3125         (WebKit::WebEventFactory::createWebMouseEvent): Ditto.
3126         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3127         (webkitWebViewBaseRealize): Add GDK_ENTER_NOTIFY_MASK and
3128         GDK_LEAVE_NOTIFY_MASK flags to the web view event mask.
3129         (webkitWebViewBaseCrossingNotifyEvent): Handle enter/leave notify
3130         events by generating a mouse move event, ensuring the double to
3131         int conversion will not cause any problem.
3132         (webkit_web_view_base_class_init): Add an implementation for
3133         enter_notify_event and leave_notify_event.
3134
3135 2016-02-06  Daniel Bates  <dabates@apple.com>
3136
3137         Call CFRelease() on SecRequirementRef when no longer needed
3138         https://bugs.webkit.org/show_bug.cgi?id=153954
3139         <rdar://problem/24540259>
3140
3141         Reviewed by Dan Bernstein.
3142
3143         * Shared/mac/ChildProcessMac.mm:
3144         (WebKit::ChildProcess::initializeSandbox):
3145
3146 2016-02-06  Darin Adler  <darin@apple.com>
3147
3148         Finish auditing call sites of upper() and lower(), eliminate many, and rename the functions
3149         https://bugs.webkit.org/show_bug.cgi?id=153905
3150
3151         Reviewed by Sam Weinig.
3152
3153         * NetworkProcess/CustomProtocols/CustomProtocolManager.h: Use ASCII case-insensitive hash
3154         for set of registered schemes.
3155
3156         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
3157         (WebKit::getPluginInfoFromPropertyLists): Use convertToASCIILowercase for MIME type and
3158         for file extensions.
3159
3160         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
3161         (WebKit::NetscapePluginModule::parseMIMEDescription): Use convertToASCIILowercase for
3162         MIME description.
3163
3164         * UIProcess/API/efl/ewk_context.cpp:
3165         (ewk_context_preferred_languages_set): Use convertToASCIILowercase for language.
3166
3167         * UIProcess/API/gtk/WebKitWebContext.cpp:
3168         (webkit_web_context_set_preferred_languages): Use convertToASCIILowercase for language.
3169
3170         * UIProcess/Plugins/PluginInfoStore.cpp:
3171         (WebKit::PluginInfoStore::findPluginForExtension): Use Vector::contains instead of
3172         writing it out using std::find.
3173         (WebKit::pathExtension): Lowercase the result with convertToASCIILowercase instead of
3174         leaving that to the caller.
3175         (WebKit::PluginInfoStore::findPlugin): Removed call to lower since pathExtension
3176         handles that now.
3177
3178         * UIProcess/WebPageProxy.cpp:
3179         (WebKit::WebPageProxy::findPlugin): Use convertToASCIILowercase for MIME type.
3180
3181         * UIProcess/WebProcessPool.cpp:
3182         (WebKit::WebProcessPool::globalURLSchemesWithCustomProtocolHandlers): Use
3183         an ASCII case-insensitive hash.
3184         (WebKit::WebProcessPool::registerGlobalURLSchemeAsHavingCustomProtocolHandlers):
3185         Remove lowercasing, since the hash is now ASCII case-insensitive.
3186         (WebKit::WebProcessPool::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers):
3187         Ditto.
3188
3189         * UIProcess/WebProcessPool.h: Use an ASCII case-insensitive hash.
3190
3191         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3192         (WebKit::NetscapePlugin::initialize): Use convertToASCIILowercase on parameter names
3193         and values.
3194
3195         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3196         (WebKit::pluginSupportsExtension): Use convertToASCIILowercase for extension assertion.
3197         Also use a modern for loop.
3198         (WebKit::WebFrameLoaderClient::objectContentType): Make the checks for empty MIME types
3199         a little less redundant. Reordered logic to avoid checking the list of supported MIME
3200         types extra times, and to eliminate the need for a boolean. Use convertToASCIILowercase
3201         on the extension.
3202
3203 2016-02-06  Carlos Garcia Campos  <cgarcia@igalia.com>
3204
3205         Unreviewed. Fix more incorrect ASSERT introduced in r196053.
3206
3207         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
3208         (WebKit::NetscapePluginX11::handleMouseEvent):
3209         (WebKit::NetscapePluginX11::handleWheelEvent):
3210         (WebKit::NetscapePluginX11::setFocus):
3211         (WebKit::NetscapePluginX11::handleMouseEnterEvent):
3212         (WebKit::NetscapePluginX11::handleMouseLeaveEvent):
3213         (WebKit::NetscapePluginX11::handleKeyboardEvent):
3214
3215 2016-02-05  Timothy Hatcher  <timothy@apple.com>
3216
3217         Web Inspector: Error when closing page with WebInspector open
3218         https://bugs.webkit.org/show_bug.cgi?id=152867
3219         rdar://problem/24099423
3220
3221         Reviewed by Brian Burg.
3222
3223         * UIProcess/WebInspectorProxy.cpp:
3224         (WebKit::WebInspectorProxy::didClose): Null out m_inspectorPage after platformDetach(),
3225         so the views can be cleaned up correctly.
3226
3227 2016-02-05  Alex Christensen  <achristensen@webkit.org>
3228
3229         Move NetworkDataTask to its own header and source files
3230         https://bugs.webkit.org/show_bug.cgi?id=153922
3231
3232         Reviewed by Tim Horton.
3233
3234         Also renamed NetworkSessionTaskClient to NetworkDataTaskClient.
3235
3236         * NetworkProcess/NetworkDataTask.h: Added.
3237         (WebKit::NetworkDataTaskClient::~NetworkDataTaskClient):
3238         (WebKit::NetworkDataTask::create):
3239         (WebKit::NetworkDataTask::client):
3240         (WebKit::NetworkDataTask::pendingDownloadID):
3241         (WebKit::NetworkDataTask::pendingDownload):
3242         (WebKit::NetworkDataTask::setPendingDownloadID):
3243         (WebKit::NetworkDataTask::setPendingDownload):
3244         * NetworkProcess/NetworkLoad.h:
3245         * NetworkProcess/NetworkSession.h:
3246         (WebKit::NetworkSessionTaskClient::~NetworkSessionTaskClient): Deleted.
3247         (WebKit::NetworkDataTask::create): Deleted.
3248         (WebKit::NetworkDataTask::client): Deleted.
3249         (WebKit::NetworkDataTask::pendingDownloadID): Deleted.
3250         (WebKit::NetworkDataTask::pendingDownload): Deleted.
3251         (WebKit::NetworkDataTask::setPendingDownloadID): Deleted.
3252         (WebKit::NetworkDataTask::setPendingDownload): Deleted.
3253         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: Added.
3254         (WebKit::NetworkDataTask::NetworkDataTask):
3255         (WebKit::NetworkDataTask::~NetworkDataTask):
3256         (WebKit::NetworkDataTask::scheduleFailure):
3257         (WebKit::NetworkDataTask::failureTimerFired):
3258         (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
3259         (WebKit::NetworkDataTask::cancel):
3260         (WebKit::NetworkDataTask::resume):
3261         (WebKit::NetworkDataTask::suspend):
3262         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3263         (WebKit::NetworkSession::takeDownloadID):
3264         (WebKit::NetworkDataTask::NetworkDataTask): Deleted.
3265         (WebKit::NetworkDataTask::~NetworkDataTask): Deleted.
3266         (WebKit::NetworkDataTask::scheduleFailure): Deleted.
3267         (WebKit::NetworkDataTask::failureTimerFired): Deleted.
3268         (WebKit::NetworkDataTask::tryPasswordBasedAuthentication): Deleted.
3269         (WebKit::NetworkDataTask::cancel): Deleted.
3270         (WebKit::NetworkDataTask::resume): Deleted.
3271         (WebKit::NetworkDataTask::suspend): Deleted.
3272         * WebKit2.xcodeproj/project.pbxproj:
3273
3274 2016-02-05  Alex Christensen  <achristensen@webkit.org>
3275
3276         Clean up Blob code
3277         https://bugs.webkit.org/show_bug.cgi?id=153910
3278
3279         Reviewed by Alexey Proskuryakov.
3280
3281         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
3282         (WebKit::NetworkBlobRegistry::NetworkBlobRegistry):
3283         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
3284         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
3285         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3286         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
3287         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
3288         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
3289         (WebKit::BlobRegistryProxy::registerFileBlobURL):
3290         * WebProcess/FileAPI/BlobRegistryProxy.h:
3291
3292 2016-02-05  Dan Bernstein  <mitz@apple.com>
3293
3294         [Cocoa] Get rid of unused SPI declarations
3295         https://bugs.webkit.org/show_bug.cgi?id=153915
3296
3297         Reviewed by Tim Horton.
3298
3299         * Platform/spi/Cocoa/NSInvocationSPI.h: Removed NSInvocation SPI method declaration.
3300
3301         * Platform/spi/ios/SafariServicesSPI.h: Removed.
3302
3303         * UIProcess/API/Cocoa/WKSecurityOrigin.mm:
3304         (-[WKSecurityOrigin methodSignatureForSelector:]): Deleted.
3305         (-[WKSecurityOrigin forwardInvocation:]): Deleted.
3306
3307         * UIProcess/ios/WKContentViewInteraction.mm: Removed unused #import.
3308
3309         * WebKit2.xcodeproj/project.pbxproj: Removed reference to deleted header.
3310
3311 2016-02-04  Daniel Bates  <dabates@apple.com>
3312
3313         WebKit for iOS Simulator fails to build with public iOS SDK
3314         https://bugs.webkit.org/show_bug.cgi?id=153881
3315
3316         Reviewed by Alex Christensen.
3317
3318         Add version guards around SPI that is now API as of iOS SDK 9.2. Until we upgrade the iOS EWS
3319         and iOS buildbots to use the 9.2 SDK we need to keep these SPI declarations to avoid breaking
3320         the build.
3321
3322         * Platform/spi/ios/UIKitSPI.h:
3323
3324 2016-02-04  Joseph Pecoraro  <pecoraro@apple.com>
3325
3326         Web Inspector: Give nested inspectors their own process pool
3327         https://bugs.webkit.org/show_bug.cgi?id=153880
3328         <rdar://problem/24508310>
3329
3330         Reviewed by Timothy Hatcher.
3331
3332         When inspecting the inspector both inspectors were using the same
3333         Inspector process and sharing the same VM. This meant that profiling
3334         information was confusing (memory and JavaScript sampling) because
3335         it was showing data about both inspectors sharing the same process.
3336
3337         * UIProcess/WebInspectorProxy.cpp:
3338         (WebKit::WebInspectorProxy::inspectorProcessPool):
3339         (WebKit::WebInspectorProxy::isInspectorProcessPool):
3340         Have two process pools. The main inspector process pool (1st level inspectors)
3341         and a nested inspector process pool (inspecting the inspector, only expected
3342         by WebKit developers).
3343
3344         * UIProcess/WebInspectorProxy.h:
3345         * UIProcess/efl/WebInspectorProxyEfl.cpp:
3346         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3347         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3348         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3349         * UIProcess/mac/WebInspectorProxyMac.mm:
3350         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3351         Pass the inspectionLevel to determine the appropriate pool to use.
3352
3353 2016-02-04  Csaba Osztrogonác  <ossy@webkit.org>
3354
3355         Fix the !ENABLE(NETSCAPE_PLUGIN_API) build after r196053
3356         https://bugs.webkit.org/show_bug.cgi?id=153878
3357
3358         Unreviewed buildfix.
3359
3360         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h:
3361
3362 2016-02-04  Chris Dumez  <cdumez@apple.com>
3363
3364         Unreviewed, rolling out r196067.
3365
3366         Re-enable speculative revalidation now that we have measured
3367         the impact on the perf bots
3368
3369         Reverted changeset:
3370
3371         "Unreviewed, rolling out r195555."
3372         https://bugs.webkit.org/show_bug.cgi?id=153443
3373         http://trac.webkit.org/changeset/196067
3374
3375 2016-02-03  Alex Christensen  <achristensen@webkit.org>
3376
3377         Report wasBlocked and cannotShowURL errors when using NetworkSession
3378         https://bugs.webkit.org/show_bug.cgi?id=153846
3379
3380         Reviewed by Antti Koivisto.
3381
3382         * NetworkProcess/NetworkLoad.cpp:
3383         (WebKit::NetworkLoad::NetworkLoad):
3384         (WebKit::NetworkLoad::didSendData):
3385         (WebKit::NetworkLoad::wasBlocked):
3386         (WebKit::NetworkLoad::cannotShowURL):
3387         (WebKit::NetworkLoad::didReceiveResponseAsync):
3388         * NetworkProcess/NetworkLoad.h:
3389         NetworkDataTask is now RefCounted so we can protect it when reporting errors which delete the NetworkLoad.
3390         * NetworkProcess/NetworkSession.h:
3391         (WebKit::NetworkSessionTaskClient::~NetworkSessionTaskClient):
3392         (WebKit::NetworkDataTask::create):
3393         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3394         (WebKit::NetworkSession::takeDownloadID):
3395         (WebKit::NetworkDataTask::NetworkDataTask):
3396         Check the validity of the requested url and check if the port is allowed like we do in the ResourceHandle constructor.
3397         (WebKit::NetworkDataTask::~NetworkDataTask):
3398         Don't remove the task from the NetworkSession's map if we didn't make it because there was an error.
3399         (WebKit::NetworkDataTask::scheduleFailure):
3400         (WebKit::NetworkDataTask::failureTimerFired):
3401         Implemented like ResourceHandle's.
3402         (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
3403         (WebKit::NetworkDataTask::resume):
3404         (WebKit::NetworkDataTask::suspend):
3405         Handle the failure timer like we do in ResourceHandle::setDefersLoading.
3406
3407 2016-02-02  Alex Christensen  <achristensen@webkit.org>
3408
3409         Use proposed credentials in authentication challenges with NetworkSession
3410         https://bugs.webkit.org/show_bug.cgi?id=153811
3411
3412         Reviewed by Darin Adler.
3413
3414         This fixes http/tests/xmlhttprequest/basic-auth-default.html
3415
3416         * NetworkProcess/cocoa/NetworkSessionCocoa.mm: