a4a353fc542935f62dbb39cbb82a276298195b07
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-02-10  Dan Bernstein  <mitz@apple.com>
2
3         [Mac] Stop installing the legacy processes
4         https://bugs.webkit.org/show_bug.cgi?id=154062
5
6         Reviewed by Anders Carlsson.
7
8         * Configurations/All.xcconfig: Removed the legacy processes from EXCLUDED_SOURCE_FILE_NAMES
9           for iOS, now that they are no longer included in a Copy Files build phase.
10         * Configurations/BaseLegacyProcess.xcconfig: Set SKIP_INSTALL to YES for OS X as well.
11         * WebKit2.xcodeproj/project.pbxproj: Removed the Copy Files build phase that copied the
12           processes into the framework in engineering builds. Renamed the “Add current version
13           symlinks” script build phase to “Add XPCServices symlink”, and changed it to do just that.
14
15 2016-02-09  Carlos Garcia Campos  <cgarcia@igalia.com>
16
17         REGRESSION(r196183): [GTK] Broke TestInspector
18         https://bugs.webkit.org/show_bug.cgi?id=153945
19
20         Reviewed by Michael Catanzaro.
21
22         When the inspector view is detached and not added to a window,
23         which happens when it's closed, the inspector view is destroyed
24         because it doesn't have a parent anymore. When the inspector view
25         is destroyed we notify the web process that the inspector was
26         closed. Before r196183 this was not a problem, because the call to
27         WebInspectorProxy::didClose() from platformDetach() returned early
28         because WebInspectorProxy::didClose() had already set
29         m_inspectorPage to nullptr. In r196183 m_inspectorPage is set to
30         nullptr after platformDetach(), so we end up trying to detach the
31         inpector view again. To prevent this cycle, we should disconnect
32         the destroyed signal handler from the inspector view when
33         platformDetach() is called from WebInspectorProxy::didClose().
34
35         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
36         (WebKit::WebInspectorProxy::platformDetach):
37
38 2016-02-09  Commit Queue  <commit-queue@webkit.org>
39
40         Unreviewed, rolling out r196341.
41         https://bugs.webkit.org/show_bug.cgi?id=154056
42
43         This change broke existing API tests on Mac and iOS (Requested
44         by ryanhaddad on #webkit).
45
46         Reverted changeset:
47
48         "Add SPI to remove individual user scripts or user style
49         sheets"
50         https://bugs.webkit.org/show_bug.cgi?id=154046
51         http://trac.webkit.org/changeset/196341
52
53 2016-02-09  Anders Carlsson  <andersca@apple.com>
54
55         Add SPI to remove individual user scripts or user style sheets
56         https://bugs.webkit.org/show_bug.cgi?id=154046
57         rdar://problem/23596352
58
59         Reviewed by Sam Weinig.
60
61         * UIProcess/API/Cocoa/WKUserContentController.mm:
62         (-[WKUserContentController _removeUserScript:]):
63         (-[WKUserContentController _userStyleSheets]):
64         (-[WKUserContentController _addUserStyleSheet:]):
65         (-[WKUserContentController _removeUserStyleSheet:]):
66         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
67         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
68         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
69         (WebKit::WebUserContentControllerProxy::addProcess):
70         (WebKit::WebUserContentControllerProxy::removeUserScript):
71         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
72         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
73         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
74         * UIProcess/UserContent/WebUserContentControllerProxy.h:
75         (WebKit::WebUserContentControllerProxy::userStyleSheets):
76         * WebProcess/UserContent/WebUserContentController.cpp:
77         (WebKit::WebUserContentController::removeUserScript):
78         (WebKit::WebUserContentController::removeUserStyleSheet):
79         * WebProcess/UserContent/WebUserContentController.h:
80         * WebProcess/UserContent/WebUserContentController.messages.in:
81
82 2016-02-07  Gavin Barraclough  <barraclough@apple.com>
83
84         GetValueFunc/PutValueFunc should not take both slotBase and thisValue
85         https://bugs.webkit.org/show_bug.cgi?id=154009
86
87         Reviewed by Geoff Garen.
88
89         In JavaScript there are two types of properties - regular value properties, and accessor properties.
90         One difference between these is how they are reflected by getOwnPropertyDescriptor, and another is
91         what object they operate on in the case of a prototype access. If you access a value property of a
92         prototype object it return a value pertinent to the prototype, but in the case of a prototype object
93         returning an accessor, then the accessor function is applied to the base object of the access.
94
95         JSC supports special 'custom' properties implemented as a c++ callback, and these custom properties
96         can be used to implement either value- or accessor-like behavior. getOwnPropertyDescriptor behavior
97         is selected via the CustomAccessor attribute. Value- or accessor-like object selection is current
98         supported by passing both the slotBase and the thisValue to the callback,and hoping it uses the
99         right one. This is probably inefficient, bug-prone, and leads to crazy like JSBoundSlotBaseFunction.
100
101         Instead, just pass one thisValue to the callback functions, consistent with CustomAccessor.
102
103         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
104         (WebKit::JSNPObject::getOwnPropertyNames):
105         (WebKit::JSNPObject::propertyGetter):
106         (WebKit::JSNPObject::methodGetter):
107         * WebProcess/Plugins/Netscape/JSNPObject.h:
108             - Merged slotBase & thisValue to custom property callbacks.
109
110 2016-02-09  Jer Noble  <jer.noble@apple.com>
111
112         [Mac] Exiting fullscreen through the placeholder action leaves window in empty state
113         https://bugs.webkit.org/show_bug.cgi?id=152979
114         <rdar://problem/24132309>
115
116         Reviewed by Brent Fulgham.
117
118         In r194593, we relaxed the _fullScreenState requirement in -finishedExitFullScreenAnimation: to handle
119         the case where the request to exit fullscreen came from outside the process. However, in so doing, we
120         allowed -finishedExitFullScreenAnimation: to be called twice, and in so doing, leave the original window
121         empty of its WebView.  Tighten up the restriction of _fullScreenState to allow only the "InFullScreen"
122         state (to take care of the external exit command) and the "ExitingFullScreen" state, to handle the
123         normal teardown path.
124
125         * UIProcess/mac/WKFullScreenWindowController.mm:
126         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
127
128 2016-02-04  Jer Noble  <jer.noble@apple.com>
129
130         [Mac] Adopt NSURLSession properties in AVAssetResourceLoader
131         https://bugs.webkit.org/show_bug.cgi?id=153873
132
133         Reviewed by Eric Carlson.
134
135         Add a WebKit2 preference to control the WebCore isAVFoundationNSURLSessionEnabled()
136         setting.
137
138         * Shared/WebPreferencesDefinitions.h:
139         * UIProcess/API/C/WKPreferences.cpp:
140         (WKPreferencesSetAVFoundationNSURLSessionEnabled):
141         (WKPreferencesGetAVFoundationNSURLSessionEnabled):
142         * UIProcess/API/C/WKPreferencesRef.h:
143         * WebProcess/WebPage/WebPage.cpp:
144         (WebKit::WebPage::updatePreferences):
145
146 2016-02-09  Anders Carlsson  <andersca@apple.com>
147
148         All 32-bit plug-ins should use the XPC service
149         https://bugs.webkit.org/show_bug.cgi?id=154036
150         rdar://problem/16059483
151
152         Reviewed by Dan Bernstein.
153         
154         Silverlight expects malloced memory from the tiny zone to be executable. It also expects
155         the data segment from its coreclr image to be executable.
156         
157         Make this possible by:
158         
159         1. Shimming mach_vm_map, making sure to add the VM_PROT_EXECUTABLE bit to any memory in the tiny zone.
160         2. Go through the address space, looking for any existing ranges from the tiny zone and mach_vm_protect them
161            to be executable.
162         3. Register with dyld so we'll get callbacks whenever a library is bound, look for the coreclr image, and
163            mach_vm_protect its __DATA segment to be executable.
164
165         * Platform/spi/Cocoa/DyldSPI.h: Copied from Source/WebKit2/PluginProcess/mac/PluginProcessShim.h.
166         * PluginProcess/mac/PluginProcessMac.mm:
167         (WebKit::isMallocMemoryTag):
168         (WebKit::shouldMapMemoryExecutable):
169         (WebKit::initializeShim):
170         (WebKit::PluginProcess::platformInitializeProcess):
171         * PluginProcess/mac/PluginProcessShim.h:
172         * PluginProcess/mac/PluginProcessShim.mm:
173         (WebKit::shimMachVMMap):
174         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
175         (WebKit::PluginProcessProxy::platformGetLaunchOptions):
176         (WebKit::shouldUseXPC): Deleted.
177         * WebKit2.xcodeproj/project.pbxproj:
178
179 2016-02-09  Fujii Hironori  <Hironori.Fujii@jp.sony.com>
180
181         possible buffer overrun in Connection::processMessage of Source/WebKit2/Platform/IPC/unix/ConnectionUnix.cpp
182         https://bugs.webkit.org/show_bug.cgi?id=153637
183
184         Reviewed by Carlos Garcia Campos.
185
186         * Platform/IPC/unix/ConnectionUnix.cpp:
187         (IPC::Connection::processMessage): Fix invalid arguments of memmove.
188
189 2016-02-09  Carlos Garcia Campos  <cgarcia@igalia.com>
190
191         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.11.5 release.
192
193         * gtk/NEWS: Add release notes for 2.11.5.
194
195 2016-02-08  Carlos Garcia Campos  <cgarcia@igalia.com>
196
197         [GTK] WebKitWebView should send crossing events to the WebProcess
198         https://bugs.webkit.org/show_bug.cgi?id=153740
199
200         Reviewed by Michael Catanzaro.
201
202         We don't currently handle crossing events in the web view
203         (enter/leave). That's why if you hover a scrollbar and leave the
204         window, the scrollbar is still rendered as hovered.
205
206         * Shared/gtk/WebEventFactory.cpp:
207         (WebKit::buttonForEvent): Handle the case of GDK_ENTER_NOTIFY and
208         GDK_LEAVE_NOTIFY events.
209         (WebKit::WebEventFactory::createWebMouseEvent): Ditto.
210         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
211         (webkitWebViewBaseRealize): Add GDK_ENTER_NOTIFY_MASK and
212         GDK_LEAVE_NOTIFY_MASK flags to the web view event mask.
213         (webkitWebViewBaseCrossingNotifyEvent): Handle enter/leave notify
214         events by generating a mouse move event, ensuring the double to
215         int conversion will not cause any problem.
216         (webkit_web_view_base_class_init): Add an implementation for
217         enter_notify_event and leave_notify_event.
218
219 2016-02-08  Carlos Garcia Campos  <cgarcia@igalia.com>
220
221         Infinite loop when processing mouse events synchronously
222         https://bugs.webkit.org/show_bug.cgi?id=153995
223
224         Reviewed by Darin Adler.
225
226         This happened with WTR in the GTK+ port after landing patch in bug
227         #153740. The thing is that WTR forces events handling IPC messages
228         to be synchronous. When a drag and drop operation is in progress,
229         the web process ignores mouse move events and replies with
230         DidReceiveEvent signal. The DidReceiveEvent message handler in
231         WebPageProxy checks if we have a m_nextMouseMoveEvent and handles
232         it, but when all this happens synchronously the
233         m_nextMouseMoveEvent is the current one because we haven't
234         returned yet from handleMouseEvent(). We need to invalidate the
235         m_nextMouseMoveEvent before calling handleMouseEvent().
236
237         * UIProcess/WebPageProxy.cpp:
238         (WebKit::WebPageProxy::didReceiveEvent):
239
240 2016-02-08  Jeremy Jones  <jeremyj@apple.com>
241
242         Remove __weak from WKAirPlayRoutePicker.mm to fix build warning.
243         https://bugs.webkit.org/show_bug.cgi?id=153985
244         rdar://problem/24485348
245
246         Reviewed by Darin Adler.
247
248         Remove __weak since it is only available when using ARC.
249
250         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
251
252 2016-02-08  Danilo Cesar Lemes de Paula  <danilo.cesar@collabora.co.uk>
253
254         [GTK] Fix crash when creating webview with g_object_new
255         https://bugs.webkit.org/show_bug.cgi?id=153989
256
257         Reviewed by Carlos Garcia Campos.
258
259         g_object_new(WEBKIT_TYPE_WEB_VIEW, NULL) crashes webkit
260         as _WebKitWebViewBasePrivate constructor requires a mainloop, but
261         webkit is only initialized when a context is created (which
262         doesn't happen with a direct call to g_object_new).
263
264         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
265         (webkit_web_view_base_class_init):
266
267 2016-02-08  Commit Queue  <commit-queue@webkit.org>
268
269         Unreviewed, rolling out r196253.
270         https://bugs.webkit.org/show_bug.cgi?id=153990
271
272         Caused several crashes in GTK+ bots (Requested by KaL on
273         #webkit).
274
275         Reverted changeset:
276
277         "[GTK] WebKitWebView should send crossing events to the
278         WebProcess"
279         https://bugs.webkit.org/show_bug.cgi?id=153740
280         http://trac.webkit.org/changeset/196253
281
282 2016-02-08  Carlos Garcia Campos  <cgarcia@igalia.com>
283
284         [GTK] WebKitWebView should send crossing events to the WebProcess
285         https://bugs.webkit.org/show_bug.cgi?id=153740
286
287         Reviewed by Michael Catanzaro.
288
289         We don't currently handle crossing events in the web view
290         (enter/leave). That's why if you hover a scrollbar and leave the
291         window, the scrollbar is still rendered as hovered.
292
293         * Shared/gtk/WebEventFactory.cpp:
294         (WebKit::buttonForEvent): Handle the case of GDK_ENTER_NOTIFY and
295         GDK_LEAVE_NOTIFY events.
296         (WebKit::WebEventFactory::createWebMouseEvent): Ditto.
297         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
298         (webkitWebViewBaseRealize): Add GDK_ENTER_NOTIFY_MASK and
299         GDK_LEAVE_NOTIFY_MASK flags to the web view event mask.
300         (webkitWebViewBaseCrossingNotifyEvent): Handle enter/leave notify
301         events by generating a mouse move event, ensuring the double to
302         int conversion will not cause any problem.
303         (webkit_web_view_base_class_init): Add an implementation for
304         enter_notify_event and leave_notify_event.
305
306 2016-02-06  Daniel Bates  <dabates@apple.com>
307
308         Call CFRelease() on SecRequirementRef when no longer needed
309         https://bugs.webkit.org/show_bug.cgi?id=153954
310         <rdar://problem/24540259>
311
312         Reviewed by Dan Bernstein.
313
314         * Shared/mac/ChildProcessMac.mm:
315         (WebKit::ChildProcess::initializeSandbox):
316
317 2016-02-06  Darin Adler  <darin@apple.com>
318
319         Finish auditing call sites of upper() and lower(), eliminate many, and rename the functions
320         https://bugs.webkit.org/show_bug.cgi?id=153905
321
322         Reviewed by Sam Weinig.
323
324         * NetworkProcess/CustomProtocols/CustomProtocolManager.h: Use ASCII case-insensitive hash
325         for set of registered schemes.
326
327         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
328         (WebKit::getPluginInfoFromPropertyLists): Use convertToASCIILowercase for MIME type and
329         for file extensions.
330
331         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
332         (WebKit::NetscapePluginModule::parseMIMEDescription): Use convertToASCIILowercase for
333         MIME description.
334
335         * UIProcess/API/efl/ewk_context.cpp:
336         (ewk_context_preferred_languages_set): Use convertToASCIILowercase for language.
337
338         * UIProcess/API/gtk/WebKitWebContext.cpp:
339         (webkit_web_context_set_preferred_languages): Use convertToASCIILowercase for language.
340
341         * UIProcess/Plugins/PluginInfoStore.cpp:
342         (WebKit::PluginInfoStore::findPluginForExtension): Use Vector::contains instead of
343         writing it out using std::find.
344         (WebKit::pathExtension): Lowercase the result with convertToASCIILowercase instead of
345         leaving that to the caller.
346         (WebKit::PluginInfoStore::findPlugin): Removed call to lower since pathExtension
347         handles that now.
348
349         * UIProcess/WebPageProxy.cpp:
350         (WebKit::WebPageProxy::findPlugin): Use convertToASCIILowercase for MIME type.
351
352         * UIProcess/WebProcessPool.cpp:
353         (WebKit::WebProcessPool::globalURLSchemesWithCustomProtocolHandlers): Use
354         an ASCII case-insensitive hash.
355         (WebKit::WebProcessPool::registerGlobalURLSchemeAsHavingCustomProtocolHandlers):
356         Remove lowercasing, since the hash is now ASCII case-insensitive.
357         (WebKit::WebProcessPool::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers):
358         Ditto.
359
360         * UIProcess/WebProcessPool.h: Use an ASCII case-insensitive hash.
361
362         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
363         (WebKit::NetscapePlugin::initialize): Use convertToASCIILowercase on parameter names
364         and values.
365
366         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
367         (WebKit::pluginSupportsExtension): Use convertToASCIILowercase for extension assertion.
368         Also use a modern for loop.
369         (WebKit::WebFrameLoaderClient::objectContentType): Make the checks for empty MIME types
370         a little less redundant. Reordered logic to avoid checking the list of supported MIME
371         types extra times, and to eliminate the need for a boolean. Use convertToASCIILowercase
372         on the extension.
373
374 2016-02-06  Carlos Garcia Campos  <cgarcia@igalia.com>
375
376         Unreviewed. Fix more incorrect ASSERT introduced in r196053.
377
378         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
379         (WebKit::NetscapePluginX11::handleMouseEvent):
380         (WebKit::NetscapePluginX11::handleWheelEvent):
381         (WebKit::NetscapePluginX11::setFocus):
382         (WebKit::NetscapePluginX11::handleMouseEnterEvent):
383         (WebKit::NetscapePluginX11::handleMouseLeaveEvent):
384         (WebKit::NetscapePluginX11::handleKeyboardEvent):
385
386 2016-02-05  Timothy Hatcher  <timothy@apple.com>
387
388         Web Inspector: Error when closing page with WebInspector open
389         https://bugs.webkit.org/show_bug.cgi?id=152867
390         rdar://problem/24099423
391
392         Reviewed by Brian Burg.
393
394         * UIProcess/WebInspectorProxy.cpp:
395         (WebKit::WebInspectorProxy::didClose): Null out m_inspectorPage after platformDetach(),
396         so the views can be cleaned up correctly.
397
398 2016-02-05  Alex Christensen  <achristensen@webkit.org>
399
400         Move NetworkDataTask to its own header and source files
401         https://bugs.webkit.org/show_bug.cgi?id=153922
402
403         Reviewed by Tim Horton.
404
405         Also renamed NetworkSessionTaskClient to NetworkDataTaskClient.
406
407         * NetworkProcess/NetworkDataTask.h: Added.
408         (WebKit::NetworkDataTaskClient::~NetworkDataTaskClient):
409         (WebKit::NetworkDataTask::create):
410         (WebKit::NetworkDataTask::client):
411         (WebKit::NetworkDataTask::pendingDownloadID):
412         (WebKit::NetworkDataTask::pendingDownload):
413         (WebKit::NetworkDataTask::setPendingDownloadID):
414         (WebKit::NetworkDataTask::setPendingDownload):
415         * NetworkProcess/NetworkLoad.h:
416         * NetworkProcess/NetworkSession.h:
417         (WebKit::NetworkSessionTaskClient::~NetworkSessionTaskClient): Deleted.
418         (WebKit::NetworkDataTask::create): Deleted.
419         (WebKit::NetworkDataTask::client): Deleted.
420         (WebKit::NetworkDataTask::pendingDownloadID): Deleted.
421         (WebKit::NetworkDataTask::pendingDownload): Deleted.
422         (WebKit::NetworkDataTask::setPendingDownloadID): Deleted.
423         (WebKit::NetworkDataTask::setPendingDownload): Deleted.
424         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: Added.
425         (WebKit::NetworkDataTask::NetworkDataTask):
426         (WebKit::NetworkDataTask::~NetworkDataTask):
427         (WebKit::NetworkDataTask::scheduleFailure):
428         (WebKit::NetworkDataTask::failureTimerFired):
429         (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
430         (WebKit::NetworkDataTask::cancel):
431         (WebKit::NetworkDataTask::resume):
432         (WebKit::NetworkDataTask::suspend):
433         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
434         (WebKit::NetworkSession::takeDownloadID):
435         (WebKit::NetworkDataTask::NetworkDataTask): Deleted.
436         (WebKit::NetworkDataTask::~NetworkDataTask): Deleted.
437         (WebKit::NetworkDataTask::scheduleFailure): Deleted.
438         (WebKit::NetworkDataTask::failureTimerFired): Deleted.
439         (WebKit::NetworkDataTask::tryPasswordBasedAuthentication): Deleted.
440         (WebKit::NetworkDataTask::cancel): Deleted.
441         (WebKit::NetworkDataTask::resume): Deleted.
442         (WebKit::NetworkDataTask::suspend): Deleted.
443         * WebKit2.xcodeproj/project.pbxproj:
444
445 2016-02-05  Alex Christensen  <achristensen@webkit.org>
446
447         Clean up Blob code
448         https://bugs.webkit.org/show_bug.cgi?id=153910
449
450         Reviewed by Alexey Proskuryakov.
451
452         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
453         (WebKit::NetworkBlobRegistry::NetworkBlobRegistry):
454         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
455         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
456         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
457         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
458         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
459         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
460         (WebKit::BlobRegistryProxy::registerFileBlobURL):
461         * WebProcess/FileAPI/BlobRegistryProxy.h:
462
463 2016-02-05  Dan Bernstein  <mitz@apple.com>
464
465         [Cocoa] Get rid of unused SPI declarations
466         https://bugs.webkit.org/show_bug.cgi?id=153915
467
468         Reviewed by Tim Horton.
469
470         * Platform/spi/Cocoa/NSInvocationSPI.h: Removed NSInvocation SPI method declaration.
471
472         * Platform/spi/ios/SafariServicesSPI.h: Removed.
473
474         * UIProcess/API/Cocoa/WKSecurityOrigin.mm:
475         (-[WKSecurityOrigin methodSignatureForSelector:]): Deleted.
476         (-[WKSecurityOrigin forwardInvocation:]): Deleted.
477
478         * UIProcess/ios/WKContentViewInteraction.mm: Removed unused #import.
479
480         * WebKit2.xcodeproj/project.pbxproj: Removed reference to deleted header.
481
482 2016-02-04  Daniel Bates  <dabates@apple.com>
483
484         WebKit for iOS Simulator fails to build with public iOS SDK
485         https://bugs.webkit.org/show_bug.cgi?id=153881
486
487         Reviewed by Alex Christensen.
488
489         Add version guards around SPI that is now API as of iOS SDK 9.2. Until we upgrade the iOS EWS
490         and iOS buildbots to use the 9.2 SDK we need to keep these SPI declarations to avoid breaking
491         the build.
492
493         * Platform/spi/ios/UIKitSPI.h:
494
495 2016-02-04  Joseph Pecoraro  <pecoraro@apple.com>
496
497         Web Inspector: Give nested inspectors their own process pool
498         https://bugs.webkit.org/show_bug.cgi?id=153880
499         <rdar://problem/24508310>
500
501         Reviewed by Timothy Hatcher.
502
503         When inspecting the inspector both inspectors were using the same
504         Inspector process and sharing the same VM. This meant that profiling
505         information was confusing (memory and JavaScript sampling) because
506         it was showing data about both inspectors sharing the same process.
507
508         * UIProcess/WebInspectorProxy.cpp:
509         (WebKit::WebInspectorProxy::inspectorProcessPool):
510         (WebKit::WebInspectorProxy::isInspectorProcessPool):
511         Have two process pools. The main inspector process pool (1st level inspectors)
512         and a nested inspector process pool (inspecting the inspector, only expected
513         by WebKit developers).
514
515         * UIProcess/WebInspectorProxy.h:
516         * UIProcess/efl/WebInspectorProxyEfl.cpp:
517         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
518         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
519         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
520         * UIProcess/mac/WebInspectorProxyMac.mm:
521         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
522         Pass the inspectionLevel to determine the appropriate pool to use.
523
524 2016-02-04  Csaba Osztrogonác  <ossy@webkit.org>
525
526         Fix the !ENABLE(NETSCAPE_PLUGIN_API) build after r196053
527         https://bugs.webkit.org/show_bug.cgi?id=153878
528
529         Unreviewed buildfix.
530
531         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h:
532
533 2016-02-04  Chris Dumez  <cdumez@apple.com>
534
535         Unreviewed, rolling out r196067.
536
537         Re-enable speculative revalidation now that we have measured
538         the impact on the perf bots
539
540         Reverted changeset:
541
542         "Unreviewed, rolling out r195555."
543         https://bugs.webkit.org/show_bug.cgi?id=153443
544         http://trac.webkit.org/changeset/196067
545
546 2016-02-03  Alex Christensen  <achristensen@webkit.org>
547
548         Report wasBlocked and cannotShowURL errors when using NetworkSession
549         https://bugs.webkit.org/show_bug.cgi?id=153846
550
551         Reviewed by Antti Koivisto.
552
553         * NetworkProcess/NetworkLoad.cpp:
554         (WebKit::NetworkLoad::NetworkLoad):
555         (WebKit::NetworkLoad::didSendData):
556         (WebKit::NetworkLoad::wasBlocked):
557         (WebKit::NetworkLoad::cannotShowURL):
558         (WebKit::NetworkLoad::didReceiveResponseAsync):
559         * NetworkProcess/NetworkLoad.h:
560         NetworkDataTask is now RefCounted so we can protect it when reporting errors which delete the NetworkLoad.
561         * NetworkProcess/NetworkSession.h:
562         (WebKit::NetworkSessionTaskClient::~NetworkSessionTaskClient):
563         (WebKit::NetworkDataTask::create):
564         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
565         (WebKit::NetworkSession::takeDownloadID):
566         (WebKit::NetworkDataTask::NetworkDataTask):
567         Check the validity of the requested url and check if the port is allowed like we do in the ResourceHandle constructor.
568         (WebKit::NetworkDataTask::~NetworkDataTask):
569         Don't remove the task from the NetworkSession's map if we didn't make it because there was an error.
570         (WebKit::NetworkDataTask::scheduleFailure):
571         (WebKit::NetworkDataTask::failureTimerFired):
572         Implemented like ResourceHandle's.
573         (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
574         (WebKit::NetworkDataTask::resume):
575         (WebKit::NetworkDataTask::suspend):
576         Handle the failure timer like we do in ResourceHandle::setDefersLoading.
577
578 2016-02-02  Alex Christensen  <achristensen@webkit.org>
579
580         Use proposed credentials in authentication challenges with NetworkSession
581         https://bugs.webkit.org/show_bug.cgi?id=153811
582
583         Reviewed by Darin Adler.
584
585         This fixes http/tests/xmlhttprequest/basic-auth-default.html
586
587         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
588         (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
589         Use the proposed credential if there is one.  This matches behavior in
590         ResourceHandle::tryHandlePasswordBasedAuthentication.
591
592 2016-02-03  Jessie Berlin  <jberlin@webkit.org>
593
594         Build fix.
595
596         [NSEvent context] has always returned nil. Replace uses with nullptr.
597
598         * UIProcess/Cocoa/WebViewImpl.mm:
599         (WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent):
600         * UIProcess/mac/WebPopupMenuProxyMac.mm:
601         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
602
603 2016-02-03  Dan Bernstein  <mitz@apple.com>
604
605         [iOS] Engineering builds use manual sandboxing, but don’t need to
606         https://bugs.webkit.org/show_bug.cgi?id=153834
607
608         Reviewed by Anders Carlsson.
609
610         Now that engineering builds use the non-re-execing variant of XPC services, they can be
611         statically sandboxed and no longer need to be manually sandboxed.
612
613         * Configurations/DebugRelease.xcconfig: Don’t set WK_MANUAL_SANDBOXING_ENABLED to YES.
614         * WebKit2.xcodeproj/project.pbxproj: Let Xcode make changes to the built product references.
615
616 2016-02-03  Chris Dumez  <cdumez@apple.com>
617
618         Unreviewed, rolling out r195555.
619
620         Temporarily disable speculative revalidation to measure the
621         impact on the bots
622
623         Reverted changeset:
624
625         "[WK2][NetworkCache] Enable speculative revalidation"
626         https://bugs.webkit.org/show_bug.cgi?id=153443
627         http://trac.webkit.org/changeset/195555
628
629 2016-02-03  Daniel Bates  <dabates@apple.com>
630
631         REGRESSION (r194660): Legacy WebProcess crashes in ChildProcess::initializeSandbox()
632         https://bugs.webkit.org/show_bug.cgi?id=153734
633         <rdar://problem/24433179>
634
635         Reviewed by Dan Bernstein.
636
637         Fixes an issue where clients that used the legacy WebProcess bootstrapping process would crash.
638
639         Additionally, only consider the extra initialization parameter user-directory-suffix for
640         unsigned apps (e.g. WebKitTestRunner).
641
642         * Shared/mac/ChildProcessMac.mm:
643         (WebKit::ChildProcess::initializeSandbox):
644
645 2016-02-03  Csaba Osztrogonác  <ossy@webkit.org>
646
647         Unreviewed speculative buildfix after r195979.
648
649         * PlatformMac.cmake:
650
651 2016-02-03  Carlos Garcia Campos  <cgarcia@igalia.com>
652
653         [GTK] Reduce IPC traffic due to view state changes
654         https://bugs.webkit.org/show_bug.cgi?id=153745
655
656         Reviewed by Sergio Villar Senin.
657
658         Very often view state changes happen one after another in a very
659         short period of time, even in the same run loop iteration. For
660         example, when you switch to the web view window, the view is
661         focused and the active window flag changes as well. In that case
662         we are sending two messages to the web process and the page
663         updates its status according to the new flags in two steps. So, we
664         could group all state changes happening in the same run loop
665         iteration and notify about them all in the next iteration. This
666         also prevents unnecessary changes of state when we quickly go back
667         to a previous state, for example in focus follows mouse
668         configurations if you move the mouse outside the window and then
669         inside the window again quickly.
670
671         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
672         (_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate): Use
673         VirewState::Flags to keep the web view state instead of
674         boolean, and also to keep the flags that need to be updated. Use a
675         timer to update web view state flags.
676         (_WebKitWebViewBasePrivate::updateViewStateTimerFired): Call
677         WebPageProxy::viewStateDidChange() and reset the flags that need
678         to be updated.
679         (webkitWebViewBaseScheduleUpdateViewState): Update the flags that
680         need to be updated and schedule the timer if it's not active.
681         (toplevelWindowFocusInEvent): Use the flags and schedule an update.
682         (toplevelWindowFocusOutEvent): Ditto.
683         (toplevelWindowStateEvent): Also mark the view as hidden when minimized.
684         (webkitWebViewBaseSetToplevelOnScreenWindow): Connect to
685         window-state-event instead of deprecated visibility-notify-event.
686         (webkitWebViewBaseMap): Use the flags and schedule an update.
687         (webkitWebViewBaseUnmap): Ditto.
688         (webkitWebViewBaseSetFocus): Ditto.
689         (webkitWebViewBaseIsInWindowActive): Use the flags.
690         (webkitWebViewBaseIsFocused): Ditto
691         (webkitWebViewBaseIsVisible): Ditto.
692         (webkitWebViewBaseIsInWindow): Removed this since it was unused.
693         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
694
695 2016-02-03  Carlos Garcia Campos  <cgarcia@igalia.com>
696
697         Unreviewed. Fix incorrect ASSERT introduced in r196053.
698
699         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
700         (WebKit::NetscapePluginX11::paint): Ensure the plugin is not
701         windowed if paint() is called.
702
703 2016-02-02  Carlos Garcia Campos  <cgarcia@igalia.com>
704
705         [UNIX] Add support for windowless NPAPI plugins with no UI in non X11 platforms
706         https://bugs.webkit.org/show_bug.cgi?id=151992
707
708         Reviewed by Darin Adler.
709
710         We are currently disabling all plugins when running under wayland,
711         for example. There are some plugins, like the one used by
712         extensions.gnome.org, that don't do any rendering, so there's not
713         reason not to support those plugins under wayland or any other
714         unix non-x11 platform.
715         X11 specific code has been moved to a new class NetscapePluginX11,
716         only used under X11. The common code is in NetscapePluginUnix.cpp
717         that will use the X11 implementatin only when needed and
718         available. For windowed plugins we will fail the initialization
719         under non-X11 plaforms, while for windowless plugins we will just
720         return early from paint method.
721
722         * PlatformEfl.cmake: Add new files to compilation.
723         * PlatformGTK.cmake: Ditto.
724         * UIProcess/API/gtk/WebKitSettings.cpp:
725         (webkit_settings_set_enable_plugins): Do not disable plugins in wayland.
726         * UIProcess/gtk/WebPreferencesGtk.cpp:
727         (WebKit::WebPreferences::platformInitializeStore): Ditto.
728         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
729         (WebKit::NPN_GetValue): Use PlatformDisplay instead of
730         NetscapePlugin::x11HostDisplay() and don't claim to support X11
731         specific features under non-x11 platforms.
732         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
733         (WebKit::NetscapePlugin::NetscapePlugin): Remove X11 and GTK
734         specific memebers that are now moved to a dedicated class NetscapePluginX11.
735         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
736         (WebKit::NetscapePlugin::frameRectInWindowCoordinates): Make this public.
737         (WebKit::NetscapePlugin::clipRect): Add getter.
738         (WebKit::NetscapePlugin::size): Ditto.
739         (WebKit::NetscapePlugin::isWindowed): Ditto.
740         (WebKit::NetscapePlugin::isVisible): Ditto.
741         * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp: Added.
742         (WebKit::NetscapePlugin::platformPreInitialize):
743         (WebKit::NetscapePlugin::platformPostInitialize):
744         (WebKit::NetscapePlugin::platformDestroy):
745         (WebKit::NetscapePlugin::platformInvalidate):
746         (WebKit::NetscapePlugin::platformGeometryDidChange):
747         (WebKit::NetscapePlugin::platformVisibilityDidChange):
748         (WebKit::NetscapePlugin::platformPaint):
749         (WebKit::NetscapePlugin::platformHandleMouseEvent):
750         (WebKit::NetscapePlugin::platformHandleWheelEvent):
751         (WebKit::NetscapePlugin::platformSetFocus):
752         (WebKit::NetscapePlugin::wantsPluginRelativeNPWindowCoordinates):
753         (WebKit::NetscapePlugin::platformHandleMouseEnterEvent):
754         (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent):
755         (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
756         * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.h: Added.
757         (WebKit::NetscapePluginUnix::~NetscapePluginUnix):
758         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
759         (WebKit::getPluginDisplay):
760         (WebKit::displayDepth):
761         (WebKit::x11HostDisplay):
762         (WebKit::NetscapePluginX11::create):
763         (WebKit::NetscapePluginX11::NetscapePluginX11):
764         (WebKit::NetscapePluginX11::~NetscapePluginX11):
765         (WebKit::NetscapePluginX11::windowType):
766         (WebKit::NetscapePluginX11::window):
767         (WebKit::NetscapePluginX11::geometryDidChange):
768         (WebKit::NetscapePluginX11::visibilityDidChange):
769         (WebKit::NetscapePluginX11::paint):
770         (WebKit::initializeXEvent):
771         (WebKit::NetscapePluginX11::handleMouseEvent):
772         (WebKit::NetscapePluginX11::handleWheelEvent):
773         (WebKit::NetscapePluginX11::setFocus):
774         (WebKit::NetscapePluginX11::handleMouseEnterEvent):
775         (WebKit::NetscapePluginX11::handleMouseLeaveEvent):
776         (WebKit::NetscapePluginX11::handleKeyboardEvent):
777         (WebKit::setCommonMouseEventFields): Deleted.
778         (WebKit::setXKeyEventFields): Deleted.
779         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h: Added.
780
781 2016-02-02  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
782
783         Remove ENABLE(GLOBAL_FASTMALLOC_NEW) guard in WebMemorySamplerLinux.cpp
784         https://bugs.webkit.org/show_bug.cgi?id=153812
785
786         Reviewed by Darin Adler.
787
788         r164261 already removed ENABLE_GLOBAL_FASTMALLOC_NEW guard though, WebMemorySamplerLinux
789         is still using it. That's why EFL and GTK memory sampler don't show fast malloc memory use.
790
791         * Shared/linux/WebMemorySamplerLinux.cpp:
792         (WebKit::WebMemorySampler::sampleWebKit): Deleted.
793
794 2016-02-02  Enrica Casucci  <enrica@apple.com>
795
796         Provide handleKeyWebEvent with completion handler.
797         https://bugs.webkit.org/show_bug.cgi?id=153806
798         rdar://problem/24399218
799
800         Reviewed by Tim Horton.
801
802         * UIProcess/ios/WKContentViewInteraction.h:
803         * UIProcess/ios/WKContentViewInteraction.mm:
804         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
805         (-[WKContentView _didHandleKeyEvent:eventWasHandled:]):
806
807 2016-02-02  Alex Christensen  <achristensen@webkit.org>
808
809         Fix authentication with NetworkSession
810         https://bugs.webkit.org/show_bug.cgi?id=153779
811
812         Reviewed by Brady Eidson.
813
814         This fixes many tests, including http/tests/xmlhttprequest/cross-origin-authorization.html.
815
816         * NetworkProcess/NetworkLoad.cpp:
817         (WebKit::NetworkLoad::NetworkLoad):
818         NetworkingContexts are not used with NetworkSession.  NetworkSession is used instead.
819         Pass allowStoredCredentials to the NetworkLoad so it knows whether to use a session with credential storage or not.
820         (WebKit::NetworkLoad::didReceiveChallenge):
821         Always call continueCanAuthenticateAgainstProtectionSpace because we might need credentials for synchronous requests.
822         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
823         Reject the protection space if we cannot authenticate against this protection space.
824         If the protection space is not password-based (such as ServerTrustEvaluationRequested) and we can authenticate against this protection space,
825         then perform default handling instead of asking the UI process for a password, which wouldn't mean anything.
826         * NetworkProcess/NetworkLoad.h:
827         * NetworkProcess/NetworkSession.h:
828         Use a NSURLSession with configuration.URLCredentialStorage = nil but with the same cookie storage for requests without credentials.
829         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
830         (WebKit::NetworkSession::NetworkSession):
831         (WebKit::NetworkSession::~NetworkSession):
832         (WebKit::NetworkSession::dataTaskForIdentifier):
833         (WebKit::NetworkSession::takeDownloadID):
834         (WebKit::NetworkDataTask::NetworkDataTask):
835         * WebProcess/Network/WebResourceLoader.cpp:
836         (WebKit::WebResourceLoader::canAuthenticateAgainstProtectionSpace):
837         Always send a reply message so we can always do the callbacks of NSURLSession delegates.
838
839 2016-02-01  Dave Hyatt  <hyatt@apple.com>
840
841         Add a line grid pagination SPI to WebKit.
842         https://bugs.webkit.org/show_bug.cgi?id=153757
843         <rdar://problem/23041598>
844
845         Reviewed by Anders Carlsson.
846
847         * Shared/WebPageCreationParameters.cpp:
848         (WebKit::WebPageCreationParameters::encode):
849         (WebKit::WebPageCreationParameters::decode):
850         * Shared/WebPageCreationParameters.h:
851         * UIProcess/API/C/WKPage.cpp:
852         (WKPageSetPaginationLineGridEnabled):
853         (WKPageGetPaginationLineGridEnabled):
854         * UIProcess/API/C/WKPagePrivate.h:
855         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
856         (-[WKBrowsingContextController setPaginationLineGridEnabled:]):
857         (-[WKBrowsingContextController paginationLineGridEnabled]):
858         * UIProcess/API/Cocoa/WKBrowsingContextControllerPrivate.h:
859         * UIProcess/API/Cocoa/WKWebView.mm:
860         (-[WKWebView _paginationLineGridEnabled]):
861         (-[WKWebView _setPaginationLineGridEnabled:]):
862        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
863         * UIProcess/WebPageProxy.cpp:
864         (WebKit::WebPageProxy::WebPageProxy):
865         (WebKit::WebPageProxy::setPaginationLineGridEnabled):
866         (WebKit::WebPageProxy::creationParameters):
867         * UIProcess/WebPageProxy.h:
868         (WebKit::WebPageProxy::paginationLineGridEnabled):
869         * WebProcess/WebPage/WebPage.cpp:
870         (WebKit::WebPage::setPaginationLineGridEnabled):
871          WebProcess/WebPage/WebPage.h:
872         * WebProcess/WebPage/WebPage.messages.in:
873
874 2016-02-02  Adrien Plazas  <aplazas@igalia.com>
875
876         [GTK] Several tests fail due to assert not reached in DrawingArea::dispatchAfterEnsuringDrawing()
877         https://bugs.webkit.org/show_bug.cgi?id=153785
878
879         Reviewed by Carlos Garcia Campos.
880
881         * UIProcess/DrawingAreaProxyImpl.cpp:
882         (WebKit::DrawingAreaProxyImpl::dispatchAfterEnsuringDrawing):
883         * UIProcess/DrawingAreaProxyImpl.h:
884
885 2016-02-01  Joseph Pecoraro  <pecoraro@apple.com>
886
887         Web Inspector: High Level Memory Overview Instrument
888         https://bugs.webkit.org/show_bug.cgi?id=153516
889         <rdar://problem/24356378>
890
891         Reviewed by Brian Burg.
892
893         * Configurations/FeatureDefines.xcconfig:
894
895 2016-02-01  Alex Christensen  <achristensen@webkit.org>
896
897         Fix CMake build.
898
899         * PlatformMac.cmake:
900
901 2016-02-01  Dan Bernstein  <mitz@apple.com>
902
903         More iOS build fix.
904
905         * Platform/spi/ios/UIKitSPI.h:
906
907 2016-02-01  Dan Bernstein  <mitz@apple.com>
908
909         iOS build fix.
910
911         * Platform/IPC/mac/ConnectionMac.mm:
912
913 2016-02-01  Dan Bernstein  <mitz@apple.com>
914
915         Copy sandbox profiles during installhdrs.
916
917         Reviewed by Anders Carlsson.
918
919         * Configurations/SandboxProfiles.xcconfig:
920
921 2016-02-01  Dan Bernstein  <mitz@apple.com>
922
923         [Cocoa] Remove some more __has_include guards
924         https://bugs.webkit.org/show_bug.cgi?id=153774
925
926         Reviewed by Tim Horton.
927
928         Guard private header includes with #if USE(APPLE_INTERNAL_SDK) rather than with __has_include.
929
930         * Platform/IPC/mac/ConnectionMac.mm:
931         * Platform/IPC/mac/ImportanceAssertion.h:
932         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
933         * Shared/cf/ArgumentCodersCF.cpp:
934         * Shared/mac/ChildProcessMac.mm:
935         * Shared/mac/SecItemShim.cpp:
936
937 2016-02-01  Dan Bernstein  <mitz@apple.com>
938
939         [Xcode] Let Xcode know that the WebKit XPC service products are XPC services
940         https://bugs.webkit.org/show_bug.cgi?id=153773
941
942         Reviewed by Tim Horton.
943
944         * Configurations/BaseXPCService.xcconfig: Removed now-redundant definitions of
945           MACH_O_TYPE and WRAPPER_EXTENSION.
946         * WebKit2.xcodeproj/project.pbxproj: Updated product types.
947
948 2016-02-01  Tim Horton  <timothy_horton@apple.com>
949
950         Crash using WKPDFView, in -[UIPDFPageView showContent]
951         https://bugs.webkit.org/show_bug.cgi?id=153770
952         <rdar://problem/20157864>
953
954         Reviewed by Anders Carlsson.
955
956         When scrolling, we throw away UIPDFPageViews, but forget to unhook their delegates.
957         In some cases (also because their delegate is a raw pointer, not weak), they can call
958         back into a deleted WKPDFView, causing a crash.
959
960         * UIProcess/ios/WKPDFView.mm:
961         (detachViewForPage):
962         Add a helper to detach a page view, and unhook its delegates.
963
964         (-[WKPDFView _clearPages]):
965         (-[WKPDFView _revalidateViews]):
966         Make use of the new helper.
967
968 2016-02-01  Dan Bernstein  <mitz@apple.com>
969
970         <rdar://problem/20150072> [iOS] Remove some file upload code only needed before iOS 9
971         https://bugs.webkit.org/show_bug.cgi?id=153754
972
973         Reviewed by Darin Adler.
974
975         * Platform/spi/ios/UIKitSPI.h: Removed conditional forward declaration of SPI.
976
977         * UIProcess/ios/forms/WKFileUploadPanel.mm:
978         (photoLibraryIcon): Removed check for HAVE_WEBKIT_DOC_PICKER_ICONS, which is always true in
979           iOS 9 and later.
980         (cameraIcon): Ditto.
981         (-[WKFileUploadPanel presentWithParameters:resultListener:]): Removed branch for when
982           UIDocumentMenuViewController doesn’t respond to
983           -_initIgnoringApplicationEntitlementForImportOfTypes:.
984         (-[WKFileUploadPanel _showMediaSourceSelectionSheet]): Deleted now-unused method.
985
986 2016-02-01  Anders Carlsson  <andersca@apple.com>
987
988         Stop linking to PassKit
989         https://bugs.webkit.org/show_bug.cgi?id=153746
990
991         Reviewed by Tim Horton.
992
993         * Configurations/WebKit.xcconfig:
994
995 2016-02-01  Dan Bernstein  <mitz@apple.com>
996
997         [Cocoa] Get rid of WK_ macros for initializers
998         https://bugs.webkit.org/show_bug.cgi?id=153744
999
1000         Reviewed by Anders Carlsson.
1001
1002         * Shared/API/Cocoa/WKFoundation.h: Removed definitions of WK_DESIGNATED_INITIALIZER and
1003           WK_UNAVAILABLE.
1004
1005         * mac/postprocess-framework-headers.sh: Removed rules for rewriting the above macros. Also
1006           removed Foundation import that became unnecessary, and definitions that were only needed
1007           before iOS 8.
1008
1009         Replaced instances of the above macros with their expansions.
1010
1011         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1012         * UIProcess/API/Cocoa/WKSecurityOrigin.h:
1013         * UIProcess/API/Cocoa/WKWebView.h:
1014         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
1015
1016 2016-02-01  Csaba Osztrogonác  <ossy@webkit.org>
1017
1018         One more unreviewed speculative buildfix after r195755.
1019
1020         * PlatformMac.cmake:
1021
1022 2016-02-01  Csaba Osztrogonác  <ossy@webkit.org>
1023
1024         Unreviewed speculative buildfix after r195755.
1025
1026         * PlatformMac.cmake:
1027
1028 2016-02-01  Csaba Osztrogonác  <ossy@webkit.org>
1029
1030         Unreviewed speculative buildfix after r195795.
1031
1032         * PlatformMac.cmake: Remove Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm.
1033
1034 2016-01-31  Darin Adler  <darin@apple.com>
1035
1036         Get rid of most calls to String::upper; mostly replace them with convertToASCIIUppercase
1037         https://bugs.webkit.org/show_bug.cgi?id=153715
1038
1039         Reviewed by Gyuyoung Kim.
1040
1041         * UIProcess/API/efl/tests/test_ewk2_text_checker.cpp:
1042         Use convertToASCIIUppercase on language names.
1043
1044 2016-01-31  Dan Bernstein  <mitz@apple.com>
1045
1046         [Cocoa] Remove __has_include guards around use of WebKitAdditions
1047         https://bugs.webkit.org/show_bug.cgi?id=153728
1048
1049         Reviewed by Andy Estes.
1050
1051         Guard WebKitAdditions includes with #if USE(APPLE_INTERNAL_SDK) rather than with __has_include.
1052
1053         * Shared/Cocoa/WebKitAdditions.mm:
1054         * Shared/WebCoreArgumentCoders.h:
1055         * Shared/mac/RemoteLayerBackingStore.mm:
1056         * UIProcess/API/Cocoa/WKWebView.mm:
1057         * UIProcess/WebPageProxy.cpp:
1058         (WebKit::WebPageProxy::WebPageProxy):
1059         (WebKit::WebPageProxy::reattachToWebProcess):
1060         (WebKit::WebPageProxy::resetState):
1061         * UIProcess/WebPageProxy.h:
1062         * WebProcess/WebPage/WebPage.cpp:
1063         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
1064
1065 2016-01-31  Timothy Horton  <timothy_horton@apple.com>
1066
1067         Include the right WebKitAdditions files
1068         <rdar://problem/24429804>
1069
1070         * UIProcess/WebPageProxy.cpp:
1071         (WebKit::WebPageProxy::resetState):
1072
1073 2016-01-31  Darin Adler  <darin@apple.com>
1074
1075         Replace CaseFoldingHash with ASCIICaseInsensitiveHash
1076         https://bugs.webkit.org/show_bug.cgi?id=153639
1077
1078         Reviewed by Filip Pizlo.
1079
1080         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm: Use ASCIICaseInsensitiveHash
1081         for MIME types. MIME types are all ASCII.
1082
1083         * UIProcess/Plugins/PlugInAutoStartProvider.h: Use ASCIICaseInsensitiveHash for
1084         origins. Origin strings should use ASCII case insensitive matching and should not
1085         fold non-ASCII case.
1086
1087         * WebProcess/WebPage/WebPage.h: Use ASCIICaseInsensitiveHash for MIME types.
1088         MIME types are all ASCII.
1089
1090         * WebProcess/WebProcess.cpp:
1091         (WebKit::addCaseFoldedCharacters): Use ASCIICaseInsensitiveHash to hash plug-in
1092         origin strings. (See rationale above.)
1093         (WebKit::hashForPlugInOrigin): Updated comment.
1094
1095 2016-01-31  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1096
1097         Use std::make_unique<> when creating an unique_ptr object.
1098         https://bugs.webkit.org/show_bug.cgi?id=153705
1099
1100         Reviewed by Darin Adler.
1101
1102         * UIProcess/WebPageProxy.cpp:
1103         (WebKit::WebPageProxy::WebPageProxy): Use std::make_unique<> instead of RunLoopObserver::create().
1104
1105 2016-01-30  Dan Bernstein  <mitz@apple.com>
1106
1107         [Cocoa] Get rid of many WK_ macros for nullability
1108         https://bugs.webkit.org/show_bug.cgi?id=153718
1109
1110         Sam Weinig reviewed an earlier version of this change, and Simon Fraser rubber-stamped this version.
1111
1112         * Shared/API/Cocoa/WKFoundation.h: Removed definitions of WK_ASSUME_NONNULL_{BEGIN, END},
1113           WK_NULLABLE, WK_NULL_UNSPECIFIED, and WK_NULLABLE_PROPERTY. Removed the
1114           !__has_feature(assume_nonnull) case.
1115
1116         * mac/postprocess-framework-headers.sh: Removed rules for rewriting the above macros. Also
1117           chanegd to rewrite WK_NULLABLE_SPECIFIER to the modern _Nullable instead of __nullable.
1118
1119         Replaced instances of the above macros with their expansions.
1120
1121         * UIProcess/API/Cocoa/WKBackForwardList.h:
1122         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
1123         * UIProcess/API/Cocoa/WKError.h:
1124         * UIProcess/API/Cocoa/WKFrameInfo.h:
1125         * UIProcess/API/Cocoa/WKNavigationAction.h:
1126         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
1127         * UIProcess/API/Cocoa/WKNavigationResponse.h:
1128         * UIProcess/API/Cocoa/WKScriptMessage.h:
1129         * UIProcess/API/Cocoa/WKScriptMessageHandler.h:
1130         * UIProcess/API/Cocoa/WKSecurityOrigin.h:
1131         * UIProcess/API/Cocoa/WKUIDelegate.h:
1132         * UIProcess/API/Cocoa/WKUserContentController.h:
1133         * UIProcess/API/Cocoa/WKUserScript.h:
1134         * UIProcess/API/Cocoa/WKWebView.h:
1135         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1136         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
1137         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
1138         * UIProcess/API/Cocoa/WKWindowFeatures.h:
1139         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
1140         * UIProcess/API/Cocoa/_WKElementInfo.h:
1141         * UIProcess/API/Cocoa/_WKPreviewElementInfo.h:
1142         * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
1143
1144 2016-01-30  Dan Bernstein  <mitz@apple.com>
1145
1146         Reverted r195914, because at least one of the build.webkit.org builders still uses a compiler that doesn’t understand _Nullable.
1147
1148         * Shared/API/Cocoa/WKFoundation.h:
1149         * UIProcess/API/Cocoa/WKBackForwardList.h:
1150         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
1151         * UIProcess/API/Cocoa/WKError.h:
1152         * UIProcess/API/Cocoa/WKFrameInfo.h:
1153         * UIProcess/API/Cocoa/WKNavigationAction.h:
1154         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
1155         * UIProcess/API/Cocoa/WKNavigationResponse.h:
1156         * UIProcess/API/Cocoa/WKScriptMessage.h:
1157         * UIProcess/API/Cocoa/WKScriptMessageHandler.h:
1158         * UIProcess/API/Cocoa/WKSecurityOrigin.h:
1159         * UIProcess/API/Cocoa/WKUIDelegate.h:
1160         * UIProcess/API/Cocoa/WKUserContentController.h:
1161         * UIProcess/API/Cocoa/WKUserScript.h:
1162         * UIProcess/API/Cocoa/WKWebView.h:
1163         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1164         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
1165         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
1166         * UIProcess/API/Cocoa/WKWindowFeatures.h:
1167         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
1168         * UIProcess/API/Cocoa/_WKElementInfo.h:
1169         * UIProcess/API/Cocoa/_WKPreviewElementInfo.h:
1170         * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
1171         * mac/postprocess-framework-headers.sh:
1172
1173 2016-01-30  Commit Queue  <commit-queue@webkit.org>
1174
1175         Unreviewed, rolling out r195911.
1176         https://bugs.webkit.org/show_bug.cgi?id=153723
1177
1178         Caused frequent assertion failures on bots (Requested by ap on
1179         #webkit).
1180
1181         Reverted changeset:
1182
1183         "Replace CaseFoldingHash with ASCIICaseInsensitiveHash"
1184         https://bugs.webkit.org/show_bug.cgi?id=153639
1185         http://trac.webkit.org/changeset/195911
1186
1187 2016-01-30  Dan Bernstein  <mitz@apple.com>
1188
1189         [Cocoa] Get rid of WK_ macros for nullability
1190         https://bugs.webkit.org/show_bug.cgi?id=153718
1191
1192         Reviewed by Sam Weinig.
1193
1194         * Shared/API/Cocoa/WKFoundation.h: Removed definitions of WK_ASSUME_NONNULL_{BEGIN, END},
1195           WK_NULLABLE, WK_NULL_UNSPECIFIED, WK_NULLABLE_SPECIFIER, and WK_NULLABLE_PROPERTY.
1196
1197         * mac/postprocess-framework-headers.sh: Removed rules for rewriting those macros.
1198
1199         Replaced instances of those macros with their expansions, but using the modern _Nullable
1200         instead of __nullable:
1201
1202         * UIProcess/API/Cocoa/WKBackForwardList.h:
1203         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
1204         * UIProcess/API/Cocoa/WKError.h:
1205         * UIProcess/API/Cocoa/WKFrameInfo.h:
1206         * UIProcess/API/Cocoa/WKNavigationAction.h:
1207         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
1208         * UIProcess/API/Cocoa/WKNavigationResponse.h:
1209         * UIProcess/API/Cocoa/WKScriptMessage.h:
1210         * UIProcess/API/Cocoa/WKScriptMessageHandler.h:
1211         * UIProcess/API/Cocoa/WKSecurityOrigin.h:
1212         * UIProcess/API/Cocoa/WKUIDelegate.h:
1213         * UIProcess/API/Cocoa/WKUserContentController.h:
1214         * UIProcess/API/Cocoa/WKUserScript.h:
1215         * UIProcess/API/Cocoa/WKWebView.h:
1216         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1217         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
1218         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
1219         * UIProcess/API/Cocoa/WKWindowFeatures.h:
1220         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
1221         * UIProcess/API/Cocoa/_WKElementInfo.h:
1222         * UIProcess/API/Cocoa/_WKPreviewElementInfo.h:
1223         * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
1224
1225 2016-01-30  Darin Adler  <darin@apple.com>
1226
1227         Replace CaseFoldingHash with ASCIICaseInsensitiveHash
1228         https://bugs.webkit.org/show_bug.cgi?id=153639
1229
1230         Reviewed by Filip Pizlo.
1231
1232         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm: Use ASCIICaseInsensitiveHash
1233         for MIME types. MIME types are all ASCII.
1234
1235         * UIProcess/Plugins/PlugInAutoStartProvider.h: Use ASCIICaseInsensitiveHash for
1236         origins. Origin strings should use ASCII case insensitive matching and should not
1237         fold non-ASCII case.
1238
1239         * WebProcess/WebPage/WebPage.h: Use ASCIICaseInsensitiveHash for MIME types.
1240         MIME types are all ASCII.
1241
1242         * WebProcess/WebProcess.cpp:
1243         (WebKit::addCaseFoldedCharacters): Use ASCIICaseInsensitiveHash to hash plug-in
1244         origin strings. (See rationale above.)
1245         (WebKit::hashForPlugInOrigin): Updated comment.
1246
1247 2016-01-30  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
1248
1249         [GTK] Use configured python executable when executing generate-inspector-gresource-manifest.py
1250         https://bugs.webkit.org/show_bug.cgi?id=153712
1251
1252         Reviewed by Michael Catanzaro.
1253
1254         * PlatformGTK.cmake:
1255
1256 2016-01-29  Ada Chan  <adachan@apple.com>
1257
1258         Enable VIDEO_PRESENTATION_MODE only in Debug and Release builds on Mac
1259         https://bugs.webkit.org/show_bug.cgi?id=153665
1260
1261         Reviewed by Dan Bernstein.
1262
1263         * Configurations/FeatureDefines.xcconfig:
1264
1265 2016-01-29  Dan Bernstein  <mitz@apple.com>
1266
1267         Don’t use the “.Development” suffix for engineering builds targeting iOS devices, because the XPC cache is only aware of the unsuffixed service identifiers.
1268
1269         Reviewed by Chris Dumez.
1270
1271         * Configurations/DebugRelease.xcconfig:
1272
1273 2016-01-29  Enrica Casucci  <enrica@apple.com>
1274
1275         One more iOS build fix.
1276
1277         Unreviewed.
1278
1279         * Platform/spi/ios/UIKitSPI.h:
1280
1281 2016-01-29  Enrica Casucci  <enrica@apple.com>
1282
1283         iOS build fix after r195826.
1284
1285         Unreviewed.
1286
1287         * Platform/spi/ios/UIKitSPI.h:
1288
1289 2016-01-29  Enrica Casucci  <enrica@apple.com>
1290
1291         Disable text interaction with pencil.
1292         https://bugs.webkit.org/show_bug.cgi?id=153655
1293         rdar://problem/24337778
1294
1295         Reviewed by Tim Horton.
1296
1297         * Platform/spi/ios/UIKitSPI.h:
1298         * UIProcess/ios/WKContentViewInteraction.mm:
1299         (-[WKContentView _createAndConfigureDoubleTapGestureRecognizer]):
1300         (-[WKContentView _singleTapCommited:]):
1301
1302 2016-01-29  Mario Sanchez Prada  <mario@endlessm.com>
1303
1304         [GTK] WebProcess crashes when quickly attempting many DnD operations
1305         https://bugs.webkit.org/show_bug.cgi?id=138468
1306
1307         Reviewed by Michael Catanzaro.
1308
1309         Guard all the new DnD-related code under GTK_CHECK_VERSION #if's to
1310         make sure we don't bump the required version of GTK+ up to 3.16, and
1311         it's buildable again with GTK+ >= 3.6.
1312
1313         * UIProcess/gtk/DragAndDropHandler.cpp:
1314         (WebKit::DragAndDropHandler::DragAndDropHandler):
1315         (WebKit::DragAndDropHandler::startDrag):
1316         (WebKit::DragAndDropHandler::fillDragData):
1317         (WebKit::DragAndDropHandler::finishDrag):
1318         * UIProcess/gtk/DragAndDropHandler.h:
1319
1320 2016-01-28  Antti Koivisto  <antti@apple.com>
1321
1322         Enable background tab suspension by default on OSX
1323         https://bugs.webkit.org/show_bug.cgi?id=153629
1324         <rdar://problem/24402895>
1325
1326         Reviewed by Andreas Kling.
1327
1328         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1329         (WebKit::registerUserDefaultsIfNeeded):
1330
1331 2016-01-28  Dan Bernstein  <mitz@apple.com>
1332
1333         [Cocoa] Use the non-Development variants of XPC services for development
1334         https://bugs.webkit.org/show_bug.cgi?id=152545
1335
1336         Reviewed by Darin Adler.
1337
1338         The purpose of the Development variants of the WebKit XPC services is to allow the service
1339         to link against the development WebKit dylibs rather than the system ones. Instead, we
1340         accomplish this here by including dyld environment load commands in the normal services
1341         when the WebKit dylibs are expected to be relocated. A new build setting,
1342         WK_RELOCATABLE_FRAMEWORKS, controls this.
1343
1344         To make it easy to identify engineering builds of the services at runtime, they can be
1345         given a distinctive suffix. A new build setting, WK_XPC_SERVICE_SUFFIX, controls this.
1346
1347         * Configurations/DebugRelease.xcconfig: Set WK_RELOCATABLE_FRAMEWORKS to YES and
1348           WK_XPC_SERVICE_SUFFIX to ".Development".
1349
1350         * Configurations/BaseTarget.xcconfig: Make the quoted value of the WK_XPC_SERVICE_SUFFIX
1351           build setting available as a preprocessor macro.
1352
1353         * Configurations/BaseXPCService.xcconfig:
1354           - Simplify the definition of INSTALL_PATH now that there are no Development variants.
1355           - Define WK_RELOCATABLE_FRAMEWORKS_LDFLAGS when building relocatable frameworks to include
1356             -dyld_env options setting DYLD_FRAMEWORK_PATH to point to the directory containing
1357             WebKit.framework and DYLD_LIBRARY_PATH to the framework’\80\99s Frameworks subdirectory. When
1358             not building relocatable frameworks, define WK_RELOCATABLE_FRAMEWORKS_LDFLAGS to include
1359             a -headerpad option allowing dyld environment load commands to be added after the fact.
1360           - Add WK_RELOCATABLE_FRAMEWORKS_LDFLAGS to OTHER_LDFLAGS.
1361           - Define WK_XPC_SERVICE_INSERT_LIBRARIES_DIR when building relocatable frameworks to be
1362             the path to the Frameworks subdirectory of the WebKit framework containing the service.
1363             When not building relocatable frameworks, define it to the absolute path of the
1364             Frameworks subdirectory of the installed WebKit framework.
1365
1366         * Configurations/DatabaseService.xcconfig: Append WK_XPC_SERVICE_SUFFIX to PRODUCT_NAME,
1367           and remove no-longer-used definition of WK_XPC_SERVICE_VARIANT.
1368         * Configurations/NetworkService.xcconfig: Append WK_XPC_SERVICE_SUFFIX to PRODUCT_NAME, add
1369           WK_RELOCATABLE_FRAMEWORKS_LDFLAGS to OTHER_LDFLAGS, and remove no-longer-used definition
1370           of WK_XPC_SERVICE_VARIANT.
1371         * Configurations/PluginService.32.xcconfig: Ditto.
1372         * Configurations/PluginService.64.xcconfig: Ditto.
1373         * Configurations/WebContentService.xcconfig: Ditto.
1374
1375         * Configurations/DatabaseService.Development.xcconfig: Removed.
1376         * Configurations/NetworkService.Development.xcconfig: Removed.
1377         * Configurations/PluginService.32.Development.xcconfig: Removed.
1378         * Configurations/PluginService.64.Development.xcconfig: Removed.
1379         * Configurations/WebContentService.Development.xcconfig: Removed.
1380
1381         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService.Development: Removed.
1382         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService.Development/Info.plist: Removed.
1383         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist: Set
1384           CFBundleIdentifier to PRODUCT_NAME in order to include the optional suffix.
1385
1386         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development: Removed.
1387         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info-OSX.plist: Removed.
1388         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info-iOS.plist: Removed.
1389         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist: Set
1390           CFBundleIdentifier to PRODUCT_NAME in order to include the optional suffix. Use
1391           WK_XPC_SERVICE_INSERT_LIBRARIES_DIR in the value of DYLD_INSERT_LIBRARIES.
1392         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist: Set
1393           CFBundleIdentifier to PRODUCT_NAME in order to include the optional suffix.
1394         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist: Ditto.
1395
1396         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist: Ditto.
1397         * PluginProcess/EntryPoint/mac/XPCService/PluginService.Development: Removed.
1398         * PluginProcess/EntryPoint/mac/XPCService/PluginService.Development/Info.plist: Removed.
1399
1400         * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development: Removed.
1401         * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-OSX.plist: Removed.
1402         * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-iOS.plist: Removed.
1403         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist: Set
1404           CFBundleIdentifier to PRODUCT_NAME in order to include the optional suffix. Use
1405           WK_XPC_SERVICE_INSERT_LIBRARIES_DIR in the value of DYLD_INSERT_LIBRARIES.
1406         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: Set
1407           CFBundleIdentifier to PRODUCT_NAME in order to include the optional suffix.
1408         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: Ditto.
1409
1410         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm: Removed.
1411
1412         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
1413         (WebKit::XPCServiceEventHandler): If stdout and stderr file descriptors are included in the
1414           bootstrap message, hook them up to the serviceâ\80\99s stdout and stderr, like the Development
1415           services do.
1416         (main): Moved code from XPCServiceMain.Development.mm to handle the optional
1417           OverrideLanguages array.
1418
1419         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1420         (WebKit::addDYLDEnvironmentAdditions): Addressed a FIXME.
1421         (WebKit::serviceName): Removed forDevelopment argument and .Development service names.
1422           Added WK_XPC_SERVICE_SUFFIX to the names.
1423         (WebKit::connectToService): Updated for removal of forDevelopment argument. Removed
1424           "framework-executable-path" key from the bootstrap message, because it was only used in
1425           the Development variants.
1426         (WebKit::connectToReExecService): Deleted.
1427         (WebKit::createService): Removed call to connectToReExecService. Instead pass forDevelopment
1428           to connectToService.
1429
1430         * WebKit2.xcodeproj/project.pbxproj: Removed references to removed files. Removed targets
1431           for Development services. Removed Development services from script build phase that copies
1432           services into the framework in engineering builds, and made it respect
1433           WK_XPC_SERVICE_SUFFIX.
1434
1435 2016-01-28  Enrica Casucci  <enrica@apple.com>
1436
1437         Should avoid navigation for some data detector urls.
1438         https://bugs.webkit.org/show_bug.cgi?id=153600
1439
1440         Reviewed by Tim Horton.
1441
1442         When a tap is commited, we normally generate a synthetic click if
1443         the node responds to click events.
1444         This patch adds the logic to prevent that from happening if the node
1445         is a data detector link with certain characteristics (calendar event, telephone, etc.).
1446         If this is the case, we compute the interaction information as position, send it
1447         over to the UI process and notify that we did not handle the tap.
1448         The page client is now also notified of this event and can show the data detector sheet if
1449         appropriate.
1450
1451         * UIProcess/PageClient.h:
1452         * UIProcess/ios/PageClientImplIOS.h:
1453         * UIProcess/ios/PageClientImplIOS.mm:
1454         (WebKit::PageClientImpl::toolTipChanged):
1455         (WebKit::PageClientImpl::didNotHandleTapAsClick):
1456         (WebKit::PageClientImpl::decidePolicyForGeolocationPermissionRequest):
1457         * UIProcess/ios/WKContentViewInteraction.h:
1458         * UIProcess/ios/WKContentViewInteraction.mm:
1459         (-[WKContentView clearSelection]):
1460         (-[WKContentView _didNotHandleTapAsClick:]):
1461         (-[WKContentView _positionInformationDidChange:]):
1462         * UIProcess/ios/WebPageProxyIOS.mm:
1463         (WebKit::WebPageProxy::didNotHandleTapAsClick):
1464         * WebProcess/WebPage/ios/WebPageIOS.mm:
1465         (WebKit::WebPage::commitPotentialTap):
1466
1467 2016-01-28  Brent Fulgham  <bfulgham@apple.com>
1468
1469         [iOS] Update Web Process sandbox profile for audiodeviceclock access
1470         https://bugs.webkit.org/show_bug.cgi?id=153571
1471         <rdar://problem/24134612>
1472
1473         Reviewed by Alexey Proskuryakov.
1474
1475         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1476
1477 2016-01-26  Ada Chan  <adachan@apple.com>
1478
1479         Get WebVideoFullscreenManager and related classes to also compile for Mac platform
1480         with video presentation mode support.
1481         https://bugs.webkit.org/show_bug.cgi?id=153221
1482
1483         Reviewed by Eric Carlson.
1484
1485         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
1486         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
1487         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1488         Enabled also for Mac with video presentation mode support.
1489         (-[WKLayerHostView makeBackingLayer]):
1490         Make sure this view uses CALayerHost for its layer.
1491         (WebKit::WebVideoFullscreenManagerProxy::invalidate):
1492         (WebKit::WebVideoFullscreenManagerProxy::createModelAndInterface):
1493         (WebKit::WebVideoFullscreenManagerProxy::ensureInterface):
1494         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
1495         Replace WebCore::WebVideoFullscreenInterfaceAVKit with PlatformWebVideoFullscreenInterface.
1496         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
1497         +[UIWindow _synchronizeDrawingAcrossProcesses] is not available on Mac.
1498
1499         * UIProcess/WebPageProxy.cpp:
1500         (WebKit::WebPageProxy::WebPageProxy):
1501         (WebKit::WebPageProxy::reattachToWebProcess):
1502         (WebKit::WebPageProxy::viewDidLeaveWindow):
1503         (WebKit::WebPageProxy::resetState):
1504         * UIProcess/WebPageProxy.h:
1505         The code that creates m_videoFullscreenManager is now enabled also on Mac with video
1506         presentation mode support.
1507
1508         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1509         * WebProcess/WebCoreSupport/WebChromeClient.h:
1510         Enable the API related to the video fullscreen layer also on Mac with video presentation
1511         mode support.
1512
1513         * WebProcess/WebPage/WebPage.cpp:
1514         * WebProcess/WebPage/WebPage.h:
1515         The code that creates m_videoFullscreenManager is now enabled also on Mac with video
1516         presentation mode support.
1517
1518         * WebProcess/cocoa/WebVideoFullscreenManager.h:
1519         * WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
1520         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
1521         Enabled also for Mac with video presentation mode support.
1522         (WebKit::WebVideoFullscreenManager::supportsVideoFullscreen):
1523         Return false for now on Mac.
1524
1525 2016-01-28  Darin Adler  <darin@apple.com>
1526
1527         Remove equalIgnoringCase since all callers really wanted equalIgnoringASCIICase
1528         https://bugs.webkit.org/show_bug.cgi?id=153411
1529
1530         Reviewed by Ryosuke Niwa.
1531
1532         * Shared/API/c/WKString.cpp:
1533         (WKStringIsEqualToUTF8CStringIgnoringCase): Use equalIgnoringASCIICase.
1534         This is a change in behavior for callers who passed non-ASCII letters to
1535         this function and expected case insensitive comparison.
1536
1537         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1538         (WebKit::PDFPlugin::streamDidReceiveResponse): Use equalIgnoringASCIICase.
1539         No change in behavior because this is just checking a fixed ASCII MIME type.
1540         (WebKit::PDFPlugin::manualStreamDidReceiveResponse): Ditto.
1541         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1542         (WebKit::PDFPlugin::streamDidReceiveResponse): Ditto.
1543         (WebKit::PDFPlugin::manualStreamDidReceiveResponse): Ditto.
1544
1545 2016-01-27  Alex Christensen  <achristensen@webkit.org>
1546
1547         Fix CMake build after r195722.
1548
1549         * PlatformMac.cmake:
1550         Include new file.
1551
1552 2016-01-27  Dan Bernstein  <mitz@apple.com>
1553
1554         Fix other builds.
1555
1556         * Configurations/WebKit.xcconfig:
1557
1558 2016-01-27  Anders Carlsson  <andersca@apple.com>
1559
1560         Fix build.
1561
1562         * Configurations/WebKit.xcconfig:
1563
1564 2016-01-27  Krzysztof Czech  <k.czech@samsung.com>
1565
1566         [EFL] Remove unused accessibility related code
1567         https://bugs.webkit.org/show_bug.cgi?id=153543
1568
1569         Reviewed by Darin Adler.
1570
1571         Do not need to load external library to expose WebKit's
1572         accessibility tree. There have been changes in EFL/Elementary
1573         in terms of support of accessibility and we should follow those.
1574
1575         * WebProcess/efl/WebProcessMainEfl.cpp:
1576         (eailLibraryPath): Deleted.
1577         (eail): Deleted.
1578
1579 2016-01-27  Enrica Casucci  <enrica@apple.com>
1580
1581         Cache results of data detection in the UI process when load completes.
1582         https://bugs.webkit.org/show_bug.cgi?id=153560
1583
1584         Reviewed by Tim Horton.
1585
1586         This patch changes when the results of data detections are sent to the
1587         UIProcess. Before this change, they were only provided as part of
1588         InteractionInformationAtPosition, which is populated when long press
1589         gesture is triggered.
1590         We need to have the results available if the client wants to allow navigation
1591         to a data detector link, in order to allow them to retrieve the full url.
1592         With this change, we now send the results as soon as they are computed
1593         and keep them in the WebPageProxy object so that they can be fetched when
1594         necessary from a WKWebView private interface.
1595
1596         * Shared/Cocoa/DataDetectionResult.h: Added.
1597         * Shared/Cocoa/DataDetectionResult.mm: Added.
1598         (WebKit::DataDetectionResult::encode):
1599         (WebKit::DataDetectionResult::decode):
1600         * UIProcess/API/Cocoa/WKWebView.mm:
1601         (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]):
1602         (-[WKWebView _dataDetectionResults]):
1603         (-[WKWebView _didRelaunchProcess]):
1604         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1605         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1606         (WebKit::WebPageProxy::setDataDetectionResult):
1607         (WebKit::WebPageProxy::saveRecentSearches):
1608         * UIProcess/WebPageProxy.h:
1609         (WebKit::WebPageProxy::websiteDataStore):
1610         (WebKit::WebPageProxy::dataDetectionResults):
1611         (WebKit::WebPageProxy::scrollingCoordinatorProxy):
1612         * UIProcess/WebPageProxy.messages.in:
1613         * UIProcess/ios/WKContentViewInteraction.h:
1614         * UIProcess/ios/WKContentViewInteraction.mm:
1615         (-[WKContentView ensurePositionInformationIsUpToDate:]):
1616         (-[WKContentView _dataDetectionResults]):
1617         (-[WKContentView gestureRecognizerShouldBegin:]):
1618         * WebKit2.xcodeproj/project.pbxproj:
1619         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1620         (WebKit::WebFrameLoaderClient::dispatchDidReceiveContentLength):
1621         (WebKit::WebFrameLoaderClient::dispatchDidFinishDataDetection):
1622         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading):
1623         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1624         * WebProcess/WebPage/WebPage.cpp:
1625         (WebKit::WebPage::updatePreferences):
1626         (WebKit::WebPage::setDataDetectionResults):
1627         (WebKit::WebPage::willCommitLayerTree):
1628         * WebProcess/WebPage/WebPage.h:
1629         (WebKit::WebPage::shouldExtendIncrementalRenderingSuppression):
1630
1631 2016-01-27  Anders Carlsson  <andersca@apple.com>
1632
1633         Include the right WebKitAdditions files
1634         https://bugs.webkit.org/show_bug.cgi?id=153572
1635
1636         Reviewed by Tim Horton.
1637
1638         * UIProcess/WebPageProxy.cpp:
1639         (WebKit::WebPageProxy::WebPageProxy):
1640         (WebKit::WebPageProxy::reattachToWebProcess):
1641
1642 2016-01-27  Daniel Bates  <dabates@apple.com>
1643
1644         Move ContentSecurityPolicy.{cpp, h} to its own directory
1645         https://bugs.webkit.org/show_bug.cgi?id=153527
1646         <rdar://problem/24359892>
1647
1648         Reviewed by Sam Weinig.
1649
1650         Add ${WEBCORE_DIR}/page/csp to the list of WebKit2 include directories.
1651
1652         * CMakeLists.txt:
1653
1654 2016-01-27  Anders Carlsson  <andersca@apple.com>
1655
1656         Add WebKitAdditions extension points to WebCore, WebKit and WebKitLegacy
1657         https://bugs.webkit.org/show_bug.cgi?id=153550
1658
1659         Reviewed by Sam Weinig.
1660
1661         * DerivedSources.make:
1662         Add the ability for WebKitAdditions to add new message receivers.
1663
1664         * Shared/Cocoa/WebKitAdditions.mm: Added.
1665         Add addition files.
1666
1667         * Shared/WebCoreArgumentCoders.h:
1668         Add extension points.
1669
1670         * UIProcess/WebPageProxy.cpp:
1671         (WebKit::WebPageProxy::WebPageProxy):
1672         (WebKit::WebPageProxy::reattachToWebProcess):
1673         (WebKit::WebPageProxy::resetState):
1674         Add extension points.
1675
1676         * UIProcess/WebPageProxy.h:
1677         Add extension points.
1678
1679         * WebKit2.xcodeproj/project.pbxproj:
1680         Add new files.
1681
1682         * WebProcess/WebPage/WebPage.cpp:
1683         Add extension points.
1684
1685 2016-01-27  Chris Dumez  <cdumez@apple.com>
1686
1687         window.atob() should ignore spaces in input
1688         https://bugs.webkit.org/show_bug.cgi?id=153522
1689         <rdar://problem/24357822>
1690
1691         Reviewed by Benjamin Poulain.
1692
1693         * UIProcess/mac/WebInspectorProxyMac.mm:
1694         (WebKit::WebInspectorProxy::platformSave):
1695
1696 2016-01-27  Ryosuke Niwa  <rniwa@webkit.org>
1697
1698         Add API to access closed shadowRoot in InjectedBundle
1699         https://bugs.webkit.org/show_bug.cgi?id=153533
1700
1701         Reviewed by Antti Koivisto.
1702
1703         Added WKBundleScriptWorldMakeAllShadowRootsOpen to make all shadow roots open.
1704         This is needed to keep supporting certain browser-level features such as autofill.
1705
1706         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
1707         (WKBundleScriptWorldMakeAllShadowRootsOpen): Added.
1708         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.h:
1709         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
1710         (WebKit::InjectedBundleScriptWorld::makeAllShadowRootsOpen): Added.
1711         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
1712
1713 2016-01-27  Zhuo Li  <zachli@apple.com>
1714
1715         Need ability to specify alternate image for AutoFill button in input fields.
1716         https://bugs.webkit.org/show_bug.cgi?id=153116.
1717         rdar://problem/23384854.
1718
1719         Reviewed by Darin Adler.
1720
1721         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
1722         (toAutoFillButtonType): Convert the WebKit AutoFill button type enum to WebCore AutoFill button
1723         type enum.
1724         (WKBundleNodeHandleSetHTMLInputElementAutoFillButtonEnabledWithButtonType): Added to be able to specify
1725         what the AutoFill button type is. None means the AutoFill button is not shown.
1726         (WKBundleNodeHandleSetHTMLInputElementAutoFillButtonEnabled): Deprecate this method.
1727         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h: Declare an AutoFill button type enum.
1728         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1729         (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFillButtonEnabled): None means the AutoFill button is not enabled.
1730         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFillButtonEnabledWithButtonType): Use the new parameter to specify
1731         what the AutoFill button type is.
1732         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h: Ditto.
1733
1734 2016-01-27  Dan Bernstein  <mitz@apple.com>
1735
1736         More trying to fix the build.
1737
1738         * Configurations/WebKit.xcconfig:
1739
1740 2016-01-27  Alexey Proskuryakov  <ap@apple.com>
1741
1742         Remove ENABLE_CURRENTSRC
1743         https://bugs.webkit.org/show_bug.cgi?id=153545
1744
1745         Reviewed by Simon Fraser.
1746
1747         * Configurations/FeatureDefines.xcconfig:
1748
1749 2016-01-27  Sam Weinig  <sam@webkit.org>
1750
1751         Try to fix the build.
1752
1753         * Configurations/WebKit.xcconfig:
1754
1755 2016-01-26  Sam Weinig  <sam@webkit.org>
1756
1757         Attempt to force a rebuild.
1758
1759         * DerivedSources.make:
1760
1761 2016-01-26  Tim Horton  <timothy_horton@apple.com>
1762
1763         REGRESSION (r194557): Keyboard shortcuts stop working after the WKWebView is unparented and reparented
1764         https://bugs.webkit.org/show_bug.cgi?id=153492
1765         <rdar://problem/24138989>
1766
1767         Reviewed by Dan Bernstein.
1768
1769         * UIProcess/ios/WKContentViewInteraction.h:
1770         * UIProcess/ios/WKContentViewInteraction.mm:
1771         (-[WKContentView canBecomeFirstResponder]):
1772         (-[WKContentView becomeFirstResponder]):
1773         (-[WKContentView resignFirstResponder]):
1774         When WKWebView is unparented, WKContentView will attempt to resignFirstResponder upwards,
1775         first asking WKWebView. After r194557, WKWebView will accept first responder and forward
1776         it on to the WKContentView, which will happily accept it again, despite being the view
1777         that's trying to resign. This will cause us to completely lose first responder,
1778         where it was actually supposed to propagate up above WKWebView to the client.
1779
1780         Keep track of when WKContentView is resigning first responder, and don't
1781         let it become first responder while it is doing so, breaking the cycle.
1782
1783         * UIProcess/ios/WKContentView.h:
1784         * UIProcess/API/Cocoa/WKWebView.mm:
1785         (-[WKWebView canBecomeFirstResponder]):
1786         If the WKContentView is currently in the process of resigning first responder status,
1787         we shouldn't accept it, because clients expect to receive it.
1788
1789 2016-01-26  I-Ting Liu  <iting_liu@apple.com>
1790
1791         Implement wildcard matching for plug-in policy host.
1792         https://bugs.webkit.org/show_bug.cgi?id=153090
1793
1794         Reviewed by Darin Adler.
1795
1796         WebPlatformStrategies decides the plug-in load policy for a host by looking
1797         for a matched hostname in the list of plug-in policies sent by Safari. This
1798         patch adds support for wildcard matching -- if there's a policy with hostname
1799         "*.example.com," the policy for "foo.example.com" would be replaced with that
1800         of "*.example.com" if there's no policy for this hostname. If there is more
1801         than one wildcard hostname, the host with the longest wildcard hostname will
1802         be used.
1803
1804         This patch adds a helper function in StringUtilites that matches a string to
1805         another string, which may contain wildcard ('*') characters.
1806
1807         * Platform/mac/StringUtilities.h:
1808         - Add WebKit::stringMatchesWildcardString.
1809         - Remove #if ENABLE(TELEPHONE_NUMBER_DETECTION) && PLATFORM(MAC) flag so that
1810         the compiler allows exposing StringUtilities.h.
1811         - Add #if __OBJC__ to allow the file to be included in WebPltformStrategies.cpp
1812
1813         * Platform/mac/StringUtilities.mm:
1814         (WebKit::stringMatchesWildcardString):
1815         Return true if the entire first given String matches the second. The second string 
1816         may contain wildcard characters.
1817         (WebKit::wildcardRegexPatternString):
1818         Return the regex expression from a wildcard string by replacing the wildcard
1819         character ('*') with (".*") and escaping regular expression metacharacters.
1820         (WebKit::formattedPhoneNumberString):
1821         To expose StringUtilities.h for tests, we removed #if ENABLE(TELEPHONE_NUMBER_DETECTION)
1822         && PLATFORM(MAC) flag in the header. Add a function that returns nil for
1823         #if !(ENABLE(TELEPHONE_NUMBER_DETECTION) && PLATFORM(MAC)) to fix the removal
1824         of the flag in the header file.
1825
1826         * WebKit2.xcodeproj/project.pbxproj:
1827         Change the file attribute of StringUtilities.h from Project to Private for
1828         testing in TestWebKitAPI.
1829
1830         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1831         (WebKit::WebPlatformStrategies::longestMatchedWildcardHostForHost):
1832         Return the wildcard hostname whose matched substring with the host is the longest.
1833         (WebKit::WebPlatformStrategies::replaceHostWithMatchedWildcardHost):
1834         Replace the look-up host with a matched wildcard host if there is a match and that
1835         the matched wildcard host's plug-in identifier is the same as that of the host.
1836         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost):
1837         Try to replace the look-up host with the wildcard host if there's no policy for
1838         the host. Restructure the function to reduce hashmap lookup.
1839
1840         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1841         Declare the methods.
1842
1843 2016-01-26  Anders Carlsson  <andersca@apple.com>
1844
1845         Remove -d flag from make invocation.
1846
1847         * WebKit2.xcodeproj/project.pbxproj:
1848
1849 2016-01-26  Joseph Pecoraro  <pecoraro@apple.com>
1850
1851         Generalize ResourceUsageData gathering to be used outside of ResourceUsageOverlay
1852         https://bugs.webkit.org/show_bug.cgi?id=153509
1853         <rdar://problem/24354291>
1854
1855         Reviewed by Andreas Kling.
1856
1857         * WebProcess/WebPage/WebPage.cpp:
1858         (WebKit::WebPage::updatePreferences):
1859         Rename the ENABLE flag.
1860
1861 2016-01-26  Commit Queue  <commit-queue@webkit.org>
1862
1863         Unreviewed, rolling out r195602.
1864         https://bugs.webkit.org/show_bug.cgi?id=153526
1865
1866         broke more than it fixed (Requested by thorton on #webkit).
1867
1868         Reverted changeset:
1869
1870         "REGRESSION (r194557): Keyboard shortcuts stop working after
1871         the WKWebView is unparented and reparented"
1872         https://bugs.webkit.org/show_bug.cgi?id=153492
1873         http://trac.webkit.org/changeset/195602
1874
1875 2016-01-26  Anders Carlsson  <andersca@apple.com>
1876
1877         WebKitAdditions should be able to modify derived source rules
1878         https://bugs.webkit.org/show_bug.cgi?id=153514
1879
1880         Reviewed by Tim Horton.
1881
1882         * Configurations/BaseTarget.xcconfig:
1883         * Configurations/WebKit.xcconfig:
1884         Set WEBKITADDITIONS_HEADER_SEARCH_PATHS.
1885
1886         * DerivedSources.make:
1887         Move the path computation earlier and include WebKitDerivedSourcesAdditions.make.
1888
1889         * WebKit2.xcodeproj/project.pbxproj:
1890         Pass our WebKitAdditions paths as include paths to make.
1891
1892 2016-01-26  Anders Carlsson  <andersca@apple.com>
1893
1894         Add a private WKUIDelegate method for getting a presenting view controller for a WKWebView on iOS
1895         https://bugs.webkit.org/show_bug.cgi?id=153510
1896
1897         Reviewed by Dan Bernstein.
1898
1899         * UIProcess/API/APIUIClient.h:
1900         (API::UIClient::presentingViewController):
1901         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1902         * UIProcess/Cocoa/UIDelegate.h:
1903         * UIProcess/Cocoa/UIDelegate.mm:
1904         (WebKit::UIDelegate::setDelegate):
1905         (WebKit::UIDelegate::UIClient::presentingViewController):
1906
1907 2016-01-26  Dean Jackson  <dino@apple.com>
1908
1909         [iOS] Documents without an explicit width should not get fast tapping
1910         https://bugs.webkit.org/show_bug.cgi?id=153465
1911         <rdar://problem/23962529>
1912
1913         Reviewed by Simon Fraser (and Wenson Hseih).
1914
1915         As the title says, documents that do not set a viewport should
1916         not get the fast click behaviour. There were complaints that we broke
1917         double-tap to scroll in ImageDocuments where the image was narrow and long.
1918
1919         The fix is to just keep a flag that tells the UI process if the
1920         width was explicit. However, it turns out that those ImageDocuments
1921         are given an explicit device-width, which is fine for scaling but
1922         really should behave as auto for fast tapping. So we also need
1923         to tell the UIProcess if the viewport arguments came from an
1924         ImageDocument.
1925
1926         * Shared/mac/RemoteLayerTreeTransaction.h: Add two new flags into
1927         the transaction.
1928         (WebKit::RemoteLayerTreeTransaction::viewportMetaTagWidthWasExplicit):
1929         (WebKit::RemoteLayerTreeTransaction::setViewportMetaTagWidthWasExplicit):
1930         (WebKit::RemoteLayerTreeTransaction::viewportMetaTagCameFromImageDocument):
1931         (WebKit::RemoteLayerTreeTransaction::setViewportMetaTagCameFromImageDocument):
1932         * Shared/mac/RemoteLayerTreeTransaction.mm:
1933         (WebKit::RemoteLayerTreeTransaction::encode):
1934         (WebKit::RemoteLayerTreeTransaction::decode):
1935         (WebKit::RemoteLayerTreeTransaction::description):
1936
1937         * UIProcess/API/Cocoa/WKWebView.mm:
1938         (-[WKWebView _didCommitLayerTree:]): Notice whether or not the viewport
1939         width was explicit.
1940         (-[WKWebView _allowsDoubleTapGestures]): Return yes if the width
1941         was not explicit, or if the viewport came from an ImageDocument.
1942         * WebProcess/WebPage/WebPage.cpp:
1943         (WebKit::WebPage::willCommitLayerTree):
1944
1945 2016-01-26  Tim Horton  <timothy_horton@apple.com>
1946
1947         REGRESSION (r194557): Keyboard shortcuts stop working after the WKWebView is unparented and reparented
1948         https://bugs.webkit.org/show_bug.cgi?id=153492
1949         <rdar://problem/24138989>
1950
1951         Reviewed by Dan Bernstein.
1952
1953         * UIProcess/ios/WKContentViewInteraction.h:
1954         * UIProcess/ios/WKContentViewInteraction.mm:
1955         (-[WKContentView canBecomeFirstResponder]):
1956         (-[WKContentView becomeFirstResponder]):
1957         (-[WKContentView resignFirstResponder]):
1958         When WKWebView is unparented, WKContentView will attempt to resignFirstResponder upwards,
1959         first asking WKWebView. After r194557, WKWebView will accept first responder and forward
1960         it on to the WKContentView, which will happily accept it again, despite being the view
1961         that's trying to resign. This will cause us to completely lose first responder,
1962         where it was actually supposed to propagate up above WKWebView to the client.
1963
1964         Keep track of when WKContentView is resigning first responder, and don't
1965         let it become first responder while it is doing so, breaking the cycle.
1966
1967 2016-01-25  Ada Chan  <adachan@apple.com>
1968
1969         Move WebVideoFullscreenManager and related classes from iOS specific folders to cocoa folders
1970         https://bugs.webkit.org/show_bug.cgi?id=153473
1971
1972         Reviewed by Eric Carlson.
1973
1974         * DerivedSources.make:
1975         Add new paths.
1976         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h: Renamed from Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h.
1977         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in: Renamed from Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in.
1978         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm: Renamed from Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm.
1979         (WebKit::WebVideoFullscreenManagerProxy::setSeekableRangesVector):
1980         Fix a style error by moving the opening curly brace to the same line as the for statement.
1981         * WebKit2.xcodeproj/project.pbxproj:
1982         Update due to changes to the file locations.
1983         * WebProcess/cocoa/WebVideoFullscreenManager.h: Renamed from Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h.
1984         * WebProcess/cocoa/WebVideoFullscreenManager.messages.in: Renamed from Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.messages.in.
1985         * WebProcess/cocoa/WebVideoFullscreenManager.mm: Renamed from Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm.
1986         (WebKit::WebVideoFullscreenInterfaceContext::setSeekableRanges):
1987         Fix a style error by adding a missing space after a comma.
1988
1989 2016-01-26  Daniel Bates  <dabates@apple.com>
1990
1991         WebKitTestRunner: Credential cache is not cleared between tests
1992         https://bugs.webkit.org/show_bug.cgi?id=153407
1993         <rdar://problem/24280834>
1994
1995         Reviewed by Alexey Proskuryakov.
1996
1997         Expose SPI to call CredentialStorage::clearCredentials() on the default network storage
1998         session to clear cached credentials.
1999
2000         * NetworkProcess/NetworkProcess.cpp:
2001         (WebKit::NetworkProcess::clearCachedCredentials): Added.
2002         * NetworkProcess/NetworkProcess.h:
2003         * NetworkProcess/NetworkProcess.messages.in: Added message ClearCachedCredentials().
2004         * UIProcess/API/C/WKContext.cpp:
2005         (WKContextClearCachedCredentials): Added.
2006         * UIProcess/API/C/WKContextPrivate.h:
2007         * UIProcess/WebProcessPool.cpp:
2008         (WebKit::WebProcessPool::clearCachedCredentials): Notify all web processes and the
2009         network process to clear cached credentials.
2010         * UIProcess/WebProcessPool.h:
2011         * WebProcess/WebProcess.cpp:
2012         (WebKit::WebProcess::clearCachedCredentials): Clear cached credentials in the default
2013         network storage session.
2014         * WebProcess/WebProcess.h:
2015         * WebProcess/WebProcess.messages.in: Added message ClearCachedCredentials().
2016
2017 2016-01-26  Mario Sanchez Prada  <mario@endlessm.com>
2018
2019         [GTK] WebProcess crashes when quickly attempting many DnD operations
2020         https://bugs.webkit.org/show_bug.cgi?id=138468
2021
2022         Reviewed by Michael Catanzaro.
2023
2024         Do not allow different DnD operations over the same element at the
2025         same time, so that any new attempt to DnD an element happening before
2026         a previous attempt has ended will take precedence, cancelling the older
2027         operation before going ahead with the new one.
2028
2029         This is consistent with how WebCore::EventHandler handles DnD operations,
2030         preventing the web process from crashing in scenarios where the user might
2031         try to perform many DnD operations over the same element very quickly.
2032
2033         * UIProcess/gtk/DragAndDropHandler.cpp:
2034         (WebKit::DragAndDropHandler::DragAndDropHandler): Initialized new member.
2035         (WebKit::DragAndDropHandler::startDrag): Ensure a previous DnD operation
2036         is cancelled before handling the new one that has just started.
2037         (WebKit::DragAndDropHandler::fillDragData): Protect against calling this
2038         function from webkitWebViewBaseDragDataGet for already cancelled operations.
2039         (WebKit::DragAndDropHandler::finishDrag): Protect against calling this
2040         function from webkitWebViewBaseDragEnd for already cancelled operations.
2041         * UIProcess/gtk/DragAndDropHandler.h:
2042
2043 2016-01-25  Enrica Casucci  <enrica@apple.com>
2044
2045         Add support for DataDetectors in WK (iOS).
2046         https://bugs.webkit.org/show_bug.cgi?id=152989
2047         rdar://problem/22855960
2048
2049         Reviewed by Tim Horton.
2050
2051         Moving InteractionInformationAtPosition files to platform folder,
2052         since this is only used on iOS and changing from .cpp to .mm.
2053         The structure is extended to include data detection specific fields
2054         and the relevant encode/decode functions have been updated to
2055         handle the new fields.
2056         The patch also adds a new WKUIDelegatePrivate method to allow
2057         the client to provide additional context for data detection actions.
2058
2059         * Platform/spi/ios/UIKitSPI.h:
2060         * Shared/InteractionInformationAtPosition.cpp: Removed.
2061         * Shared/InteractionInformationAtPosition.h: Removed.
2062         * Shared/ios/InteractionInformationAtPosition.h: Copied from Shared/InteractionInformationAtPosition.h.
2063         * Shared/ios/InteractionInformationAtPosition.mm: Copied from Shared/InteractionInformationAtPosition.cpp.
2064         (WebKit::InteractionInformationAtPosition::encode):
2065         (WebKit::InteractionInformationAtPosition::decode):
2066         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2067         * UIProcess/WebPageProxy.h:
2068         * UIProcess/ios/WKActionSheetAssistant.h:
2069         * UIProcess/ios/WKActionSheetAssistant.mm:
2070         (-[WKActionSheetAssistant showDataDetectorsSheet]):
2071         * UIProcess/ios/WKContentViewInteraction.mm:
2072         (-[WKContentView actionSheetAssistantDidStopInteraction:]):
2073         (-[WKContentView dataDetectionContextForActionSheetAssistant:]):
2074         (-[WKContentView selectedTextForActionSheetAssistant:]):
2075         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
2076         * UIProcess/ios/WebPageProxyIOS.mm:
2077         * WebKit2.xcodeproj/project.pbxproj:
2078         * WebProcess/WebPage/ios/WebPageIOS.mm:
2079         (WebKit::WebPage::getPositionInformation):
2080
2081 2016-01-25  Commit Queue  <commit-queue@webkit.org>
2082
2083         Unreviewed, rolling out r195543.
2084         https://bugs.webkit.org/show_bug.cgi?id=153451
2085
2086         regressed performance of test bots by ~6% (Requested by dydz
2087         on #webkit).
2088
2089         Reverted changeset:
2090
2091         "WebKitTestRunner: Credential cache is not cleared between
2092         tests"
2093         https://bugs.webkit.org/show_bug.cgi?id=153407
2094         http://trac.webkit.org/changeset/195543
2095
2096 2016-01-25  Chris Dumez  <cdumez@apple.com>
2097
2098         [WK2][NetworkCache] Enable speculative revalidation
2099         https://bugs.webkit.org/show_bug.cgi?id=153443
2100         <rdar://problem/23092196>
2101
2102         Reviewed by Antti Koivisto.
2103
2104         Enable speculative revalidation to better evaluate performance and
2105         robustness.
2106
2107         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2108         (WebKit::registerUserDefaultsIfNeeded):
2109
2110 2016-01-25  Beth Dakin  <bdakin@apple.com>
2111
2112         Handle soft spaces after accepted candidates
2113         https://bugs.webkit.org/show_bug.cgi?id=153331
2114         -and corresponding-
2115         rdar://problem/23958418
2116
2117         Reviewed by Darin Adler.
2118
2119         New member variable m_softSpaceRange keeps track to the NSRange of a soft 
2120         space if the last text that was inserted has a soft space at the end.
2121         * UIProcess/Cocoa/WebViewImpl.h:
2122         * UIProcess/Cocoa/WebViewImpl.mm:
2123         (WebKit::WebViewImpl::WebViewImpl):
2124
2125         The space at the end of candidates is a soft space. If that space exists, 
2126         cache the range of the space in m_softSpaceRange.
2127         (WebKit::WebViewImpl::handleAcceptedCandidate):
2128
2129         When new text is inserted, find out if it is being inserted right after a 
2130         soft space. If it is, then [NSSpellChecker deletesAutospaceBeforeString] will 
2131         tell us if the space needs to be removed. If that is the case, then set the 
2132         replacementString to the soft space.
2133         (WebKit::WebViewImpl::insertText):
2134
2135 2016-01-25  Daniel Bates  <dabates@apple.com>
2136
2137         WebKitTestRunner: Credential cache is not cleared between tests
2138         https://bugs.webkit.org/show_bug.cgi?id=153407
2139         <rdar://problem/24280834>
2140
2141         Reviewed by Brady Eidson.
2142
2143         Add SPI to call NetworkStorageSession::switchToNewTestingSession() to create a new testing session.
2144         The new testing session will have an empty credential cache.
2145
2146         * NetworkProcess/NetworkProcess.cpp:
2147         (WebKit::NetworkProcess::switchToNewTestingSession): Added.
2148         * NetworkProcess/NetworkProcess.h:
2149         * NetworkProcess/NetworkProcess.messages.in: Added message SwitchToNewTestingSession().
2150         * UIProcess/API/C/WKContext.cpp:
2151         (WKContextResetTestingNetworkSession): Added.
2152         * UIProcess/API/C/WKContextPrivate.h:
2153         * UIProcess/WebProcessPool.cpp:
2154         (WebKit::WebProcessPool::resetTestingNetworkSession): Added.
2155         * UIProcess/WebProcessPool.h:
2156         * WebProcess/WebProcess.cpp:
2157         (WebKit::WebProcess::switchToNewTestingSession): Added.
2158         * WebProcess/WebProcess.h:
2159         * WebProcess/WebProcess.messages.in: Added message SwitchToNewTestingSession().
2160
2161 2016-01-22  Ryosuke Niwa  <rniwa@webkit.org>
2162
2163         document.createElement should be able to create a custom element
2164         https://bugs.webkit.org/show_bug.cgi?id=153173
2165
2166         Reviewed by Darin Adler.
2167
2168         Use createElementForBindings here since this is for SPI.
2169
2170         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
2171         (-[WKDOMDocument createElement:]):
2172         (-[WKDOMDocument createTextNode:]):
2173
2174 2016-01-24  Alex Christensen  <achristensen@webkit.org>
2175
2176         Report upload progress to NetworkLoadClient when using NetworkSession
2177         https://bugs.webkit.org/show_bug.cgi?id=153388
2178
2179         Reviewed by Darin Adler.
2180
2181         This fixes http/tests/xmlhttprequest/upload-onload-event.html and a few other tests.
2182
2183         * NetworkProcess/NetworkLoad.cpp:
2184         (WebKit::NetworkLoad::didBecomeDownload):
2185         (WebKit::NetworkLoad::didSendData):
2186         (WebKit::NetworkLoad::didReceiveResponseAsync):
2187         * NetworkProcess/NetworkLoad.h:
2188         * NetworkProcess/NetworkSession.h:
2189         (WebKit::NetworkSessionTaskClient::~NetworkSessionTaskClient):
2190         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2191         (-[WKNetworkSessionDelegate initWithNetworkSession:]):
2192         (-[WKNetworkSessionDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]):
2193         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
2194
2195 2016-01-24  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2196
2197         Reduce PassRefPtr uses in dom - 4
2198         https://bugs.webkit.org/show_bug.cgi?id=153270
2199
2200         Reviewed by Darin Adler.
2201
2202         As a step to remove PassRefPtr uses, this patch reduces the uses in WebCore/dom.
2203
2204         * WebProcess/Plugins/PluginView.cpp:
2205         (WebKit::PluginView::focusPluginElement):
2206
2207 2016-01-23  Alex Christensen  <achristensen@webkit.org>
2208
2209         CMake build fix after r195494.
2210
2211         * PlatformMac.cmake:
2212         WebKit2 needs to be able to find DataDetectors.h.
2213
2214 2016-01-23  Alex Christensen  <achristensen@webkit.org>
2215
2216         Use credentials from a URL with NetworkSession like we did with ResourceHandle
2217         https://bugs.webkit.org/show_bug.cgi?id=153328
2218
2219         Reviewed by Alexey Proskuryakov.
2220
2221         * NetworkProcess/NetworkLoad.cpp:
2222         (WebKit::NetworkLoad::NetworkLoad):
2223         createDataTaskWithRequest is being removed, so use std::make_unique<NetworkDataTask> directly instead.
2224         Also, create the task even if we are deferring loading.  Don't call resume if we are deferring loading.
2225         * NetworkProcess/NetworkSession.h:
2226         Callbacks are not just used in NetworkSessionTaskClient, so declare them outside.
2227         The NetworkDataTask now takes a ResourceRequest so we can strip its credentials.
2228         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2229         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
2230         Try credentials stored with the NetworkDataTask before asking the client for credentials.
2231         (WebKit::NetworkSession::~NetworkSession):
2232         (WebKit::NetworkSession::dataTaskForIdentifier):
2233         (WebKit::NetworkSession::takeDownloadID):
2234         (WebKit::NetworkDataTask::NetworkDataTask):
2235         Strip the credentials from the url before creating the task because we do not know the authentication type.
2236         We will use these credentials when a challenge is received.
2237         (WebKit::NetworkDataTask::~NetworkDataTask):
2238         (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
2239         If we have credentials from the initial URL, try using them if it is appropriate.
2240         (WebKit::NetworkDataTask::cancel):
2241         (WebKit::NetworkSession::createDataTaskWithRequest): Deleted.
2242         * Shared/Authentication/AuthenticationManager.h:
2243
2244 2016-01-22  Dan Bernstein  <mitz@apple.com>
2245
2246         <rdar://problem/24304228> REGRESSION (r184215): Staged XPC services load non-staged shims
2247         https://bugs.webkit.org/show_bug.cgi?id=153389
2248
2249         Reviewed by Alexey Proskuryakov.
2250
2251         * Configurations/Shim.xcconfig: Don’t override the install name when using a staged install path.
2252
2253 2016-01-22  Enrica Casucci  <enrica@apple.com>
2254
2255         Add support for DataDetectors in WK (iOS).
2256         https://bugs.webkit.org/show_bug.cgi?id=152989
2257         rdar://problem/22855960
2258
2259         Reviewed by Tim Horton.
2260
2261         * UIProcess/API/Cocoa/WKWebView.mm:
2262         (fromWKDataDetectorTypes): Changed parameter to uint64_t to
2263         successfully compare against WKDataDetectorTypeAll.
2264
2265 2016-01-17  Ada Chan  <adachan@apple.com>
2266
2267         Add a mode parameter to MediaControllerInterface::supportsFullscreen() and ChromeClient::supportsVideoFullscreen().
2268         https://bugs.webkit.org/show_bug.cgi?id=153220
2269
2270         Reviewed by Eric Carlson.
2271
2272         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2273         (WebKit::WebChromeClient::supportsVideoFullscreen):
2274         * WebProcess/WebCoreSupport/WebChromeClient.h:
2275
2276 2016-01-22  Tim Horton  <timothy_horton@apple.com>
2277
2278         Reproducible "Unhanded web process message 'WebUserContentController:AddUserScripts'" and friends
2279         https://bugs.webkit.org/show_bug.cgi?id=153193
2280         <rdar://problem/24222034>
2281
2282         Reviewed by Darin Adler.
2283
2284         The WebPageProxy constructor assumes that if its WebProcess is already running,
2285         it can add itself to the existing WebUserContentController(Proxy) and all will be well.
2286
2287         However, if the API client constructs a different WKUserContentController for two views,
2288         and forces them both into the same process, WebPageProxy's constructor sends a message
2289         with a WebUserContentController ID that doesn't exist yet on the WebProcess side
2290         (because createWebPage, which usually brings it up, hasn't happened yet), and we 
2291         drop the message on the floor (and get the aforementioned logging).
2292
2293         * UIProcess/WebPageProxy.cpp:
2294         (WebKit::WebPageProxy::WebPageProxy):
2295         (WebKit::WebPageProxy::initializeWebPageAfterProcessLaunch):
2296         Instead of connecting our WebUserContentControllerProxy and WebVisitedLinkStoreProxy
2297         to our WebProcessProxy in the constructor, when doing so might send messages
2298         to the WebProcess that arrive before their corresponding WebProcess objects have
2299         been created, do this in initializeWebPageAfterProcessLaunch, which always runs
2300         during-or-after inititalizeWebPage (and always after the CreateWebPage message goes out).
2301
2302         (WebKit::WebPageProxy::initializeWebPage):
2303         Mark us as needing initializeWebPageAfterProcessLaunch run, and run it right now
2304         if the WebProcess is already up.
2305         (WebKit::WebPageProxy::processDidFinishLaunching):
2306         If the WebProcess wasn't up at the end of initializeWebPage, we'll eventually end up here
2307         after it is launched, and will initializeWebPageAfterProcessLaunch.
2308
2309         (WebKit::WebPageProxy::resetStateAfterProcessExited):
2310         If the WebProcess dies, we don't want to initializeWebPageAfterProcessLaunch
2311         until after initializeWebPage runs again, so make sure the flag isn't set.
2312
2313         * UIProcess/WebPageProxy.h:
2314
2315 2016-01-22  Darin Adler  <darin@apple.com>
2316
2317         Reduce use of equalIgnoringCase to just ignore ASCII case
2318         https://bugs.webkit.org/show_bug.cgi?id=153266
2319
2320         Reviewed by Ryosuke Niwa.
2321
2322         * UIProcess/PageLoadState.cpp:
2323         (WebKit::PageLoadState::hasOnlySecureContent): Use the protocolIs
2324         function from WebCore instead of calling startsWith.
2325         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2326         (WebKit::NetscapePlugin::initialize): Use equalLettersIgnoringASCIICase.
2327
2328 2016-01-21  Brent Fulgham  <bfulgham@apple.com>
2329
2330         [Mac] Tooltips do not honor some types of obscuring windows
2331         https://bugs.webkit.org/show_bug.cgi?id=153263
2332         <rdar://problem/21423972>
2333
2334         Reviewed by Simon Fraser.
2335
2336         Recognize that the current WebView is obscured by comparing the current event's Window Number against
2337         the Window Number of the current WebView. If they don't match, something is in the way.
2338
2339         * UIProcess/Cocoa/WebViewImpl.h:
2340         * UIProcess/Cocoa/WebViewImpl.mm:
2341         (WebKit::WebViewImpl::windowIsFrontWindowUnderMouse): Added.
2342         * UIProcess/PageClient.h:
2343         (WebKit::PageClient::windowIsFrontWindowUnderMouse):
2344         * UIProcess/WebPageProxy.cpp:
2345         (WebKit::WebPageProxy::handleMouseEvent): Check if the current WebView is obscured. If it
2346         is, clear the tooltip and return.
2347         * UIProcess/mac/PageClientImpl.h:
2348         * UIProcess/mac/PageClientImpl.mm:
2349         (WebKit::PageClientImpl::windowIsFrontWindowUnderMouse): Added.
2350
2351 2016-01-22  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2352
2353         Remove PassRefPtr from ResourceRequest and FormData
2354         https://bugs.webkit.org/show_bug.cgi?id=153229
2355
2356         Reviewed by Chris Dumez.
2357
2358         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2359         (WebKit::NetworkResourceLoadParameters::decode):
2360         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2361         (WebKit::NetworkCache::Entry::Entry):
2362
2363 2016-01-21  Simon Fraser  <simon.fraser@apple.com>
2364
2365         REGRESSION (r168244): Content in horizontal-bt page is offset such that only the end is viewable and there is a white gap at the top
2366         https://bugs.webkit.org/show_bug.cgi?id=136019
2367
2368         Reviewed by Dan Bernstein.
2369
2370         Now call frameView.positionForRootContentLayer(), and add a FIXME questioning the
2371         behavior in horizontal b-t documents. However, this code isn't hit now that we always
2372         do extended backgrounds, so never have shadow layers.
2373
2374         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2375         (WebKit::shadowLayerPositionForFrame):
2376
2377 2016-01-21  Dean Jackson  <dino@apple.com>
2378
2379         Move _allowsDoubleTapGestures implementation out of category
2380         https://bugs.webkit.org/show_bug.cgi?id=153329
2381         <rdar://problem/24289768>
2382
2383         Reviewed by Simon Fraser.
2384
2385         We were generating a linker warning because the implementation
2386         was located inside the WKPrivate category.
2387
2388         * UIProcess/API/Cocoa/WKWebView.mm:
2389         (-[WKWebView _allowsDoubleTapGestures]): Move this out of
2390         the category.
2391
2392 2016-01-21  Dean Jackson  <dino@apple.com>
2393
2394         [iOS] Crash in _endPotentialTapAndEnableDoubleTapGesturesIfNecessary
2395         https://bugs.webkit.org/show_bug.cgi?id=153326
2396         <rdar://problem/24264339>
2397
2398         Reviewed by Anders Carlsson.
2399
2400         UIKit's UIGestureRecognizer could call back into the WKContentView
2401         after the associated WKWebView has disappeared. The fix is to
2402         explicitly null the WKWebView reference as we deallocate.
2403
2404         * UIProcess/API/Cocoa/WKWebView.mm:
2405         (-[WKWebView dealloc]): Tell the WKContentView we are going away.
2406         * UIProcess/ios/WKContentView.h:
2407         * UIProcess/ios/WKContentView.mm:
2408         (-[WKContentView _webViewDestroyed]):
2409         * UIProcess/ios/WKContentViewInteraction.mm:
2410         (-[WKContentView _endPotentialTapAndEnableDoubleTapGesturesIfNecessary]):
2411         Only do something if the WKWebView is still around.
2412
2413 2016-01-21  Beth Dakin  <bdakin@apple.com>
2414
2415         Add the ability to update WebKitAdditions to WK2
2416         https://bugs.webkit.org/show_bug.cgi?id=153320
2417         -and corresponding-
2418         rdar://problem/23639629
2419
2420         Reviewed by Anders Carlsson.
2421
2422         * UIProcess/API/Cocoa/WKWebView.mm:
2423         * UIProcess/API/mac/WKView.mm:
2424         * UIProcess/Cocoa/WebViewImpl.h:
2425         (WebKit::WebViewImpl::createWeakPtr):
2426         * UIProcess/Cocoa/WebViewImpl.mm:
2427         (WebKit::WebViewImpl::updateWebViewImplAdditions):
2428         (WebKit::WebViewImpl::showCandidates):
2429         (WebKit::WebViewImpl::webViewImplAdditionsWillDestroyView):
2430         (WebKit::trackingAreaOptions):
2431         (WebKit::WebViewImpl::~WebViewImpl):
2432         (WebKit::WebViewImpl::becomeFirstResponder):
2433         (WebKit::WebViewImpl::selectionDidChange):
2434         (WebKit::WebViewImpl::handleRequestedCandidates):
2435         (WebKit::textCheckingResultFromNSTextCheckingResult):
2436
2437 2016-01-19  Ada Chan  <adachan@apple.com>
2438
2439         Make it possible to enable VIDEO_PRESENTATION_MODE on other Cocoa platforms.
2440         https://bugs.webkit.org/show_bug.cgi?id=153218
2441
2442         Reviewed by Eric Carlson.
2443
2444         * Configurations/FeatureDefines.xcconfig:
2445
2446 2016-01-20  Alex Christensen  <achristensen@webkit.org>
2447
2448         Fix CMake build after r195300.
2449
2450         * PlatformMac.cmake:
2451         Include editing/mac to find DataDetection.h.
2452
2453 2016-01-20  Alex Christensen  <achristensen@webkit.org>
2454
2455         Ask UI Process before sending redirect requests when downloading
2456         https://bugs.webkit.org/show_bug.cgi?id=153041
2457
2458         Reviewed by Darin Adler.
2459
2460         * NetworkProcess/Downloads/DownloadManager.cpp:
2461         (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace):
2462         (WebKit::DownloadManager::continueWillSendRequest):
2463         (WebKit::DownloadManager::convertHandleToDownload):
2464         * NetworkProcess/Downloads/DownloadManager.h:
2465         * NetworkProcess/Downloads/PendingDownload.cpp:
2466         (WebKit::PendingDownload::willSendRedirectedRequest):
2467         (WebKit::PendingDownload::continueWillSendRequest):
2468         * NetworkProcess/NetworkProcess.cpp:
2469         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
2470         (WebKit::NetworkProcess::continueWillSendRequest):
2471         (WebKit::NetworkProcess::setCacheModel):
2472         * NetworkProcess/NetworkProcess.h:
2473         * NetworkProcess/NetworkProcess.messages.in:
2474         * UIProcess/API/APIDownloadClient.h:
2475         (API::DownloadClient::didCancel):
2476         (API::DownloadClient::processDidCrash):
2477         (API::DownloadClient::canAuthenticateAgainstProtectionSpace):
2478         (API::DownloadClient::willSendRequest):
2479         * UIProcess/Downloads/DownloadProxy.cpp:
2480         (WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
2481         (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace):
2482         (WebKit::DownloadProxy::willSendRequest):
2483         (WebKit::DownloadProxy::didReceiveResponse):
2484         * UIProcess/Downloads/DownloadProxy.h:
2485         * UIProcess/Downloads/DownloadProxy.messages.in:
2486
2487 2016-01-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2488
2489         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.11.4 release.
2490
2491         * gtk/NEWS: Add release notes for 2.11.4.
2492
2493 2016-01-19  Enrica Casucci  <enrica@apple.com>
2494
2495         Add support for DataDetectors in WK (iOS).
2496         https://bugs.webkit.org/show_bug.cgi?id=152989
2497         rdar://problem/22855960
2498
2499         Reviewed by Tim Horton.
2500
2501         This is the first step toward implementing Data Detectors support
2502         in WK2. The patch adds a new property to the configuration
2503         object to indicate the type of detection desired and propagates
2504         to the WebProcess.
2505
2506         * Configurations/FeatureDefines.xcconfig:
2507         * Shared/WebPreferencesDefinitions.h:
2508         * UIProcess/API/Cocoa/WKWebView.mm:
2509         (fromWKDataDetectorTypes):
2510         (-[WKWebView initWithFrame:configuration:]):
2511         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2512         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2513         (-[WKWebViewConfiguration copyWithZone:]):
2514         * WebProcess/WebPage/WebPage.cpp:
2515         (WebKit::WebPage::updatePreferences):
2516
2517 2016-01-19  Commit Queue  <commit-queue@webkit.org>
2518
2519         Unreviewed, rolling out r195300.
2520         https://bugs.webkit.org/show_bug.cgi?id=153244
2521
2522         enrica wants more time to fix Windows (Requested by thorton on
2523         #webkit).
2524
2525         Reverted changeset:
2526
2527         "Add support for DataDetectors in WK (iOS)."
2528         https://bugs.webkit.org/show_bug.cgi?id=152989
2529         http://trac.webkit.org/changeset/195300
2530
2531 2016-01-19  Enrica Casucci  <enrica@apple.com>
2532
2533         Add support for DataDetectors in WK (iOS).
2534         https://bugs.webkit.org/show_bug.cgi?id=152989
2535         rdar://problem/22855960
2536
2537         Reviewed by Tim Horton.
2538
2539         This is the first step toward implementing Data Detectors support
2540         in WK2. The patch adds a new property to the configuration
2541         object to indicate the type of detection desired and propagates
2542         to the WebProcess.
2543
2544         * Configurations/FeatureDefines.xcconfig:
2545         * Shared/WebPreferencesDefinitions.h:
2546         * UIProcess/API/Cocoa/WKWebView.mm:
2547         (-[WKWebView initWithFrame:configuration:]):
2548         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2549         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2550         (-[WKWebViewConfiguration copyWithZone:]):
2551         * WebKit2.xcodeproj/project.pbxproj:
2552         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: Added.
2553         (WebKit::WebPage::fromWKDataDetectorTypes):
2554         * WebProcess/WebPage/WebPage.cpp:
2555         (WebKit::WebPage::updatePreferences):
2556         * WebProcess/WebPage/WebPage.h:
2557
2558 2016-01-19  Commit Queue  <commit-queue@webkit.org>
2559
2560         Unreviewed, rolling out r187471.
2561         https://bugs.webkit.org/show_bug.cgi?id=153236
2562
2563         purportedly caused a significant memory regression and want to
2564         see if that is true (Requested by thorton on #webkit).
2565
2566         Reverted changeset:
2567
2568         "First in-window viewStateChange synchronously blocks despite
2569         not previously being in-window"
2570         https://bugs.webkit.org/show_bug.cgi?id=147344
2571         http://trac.webkit.org/changeset/187471
2572
2573 2016-01-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2574
2575         [GTK] Runtime critical warnings when loading a URL after a session restore
2576         https://bugs.webkit.org/show_bug.cgi?id=153233
2577
2578         Reviewed by Michael Catanzaro.
2579
2580         This happens when doing a normal load after restoring the back
2581         forward list from session state and the list contained forward
2582         items. In that case the forward items are removed from the list
2583         and we try to reference a WebBackForwardListItem wrapper that
2584         hasn't been created. We create the wrappers on demand, and when
2585         the back forward list is populated from session state, items are
2586         added to the list without creating their wrappers. That was not
2587         possible before, and that's why we assumed that any item that is
2588         removed from the list should have a wrapper already created.
2589
2590         * UIProcess/API/gtk/WebKitBackForwardList.cpp:
2591         (webkitBackForwardListChanged): If we don't have a wrapper for the
2592         removed item, create a new one to be passed to the signal, but
2593         without adding it to the map.
2594
2595 2016-01-19  Ryosuke Niwa  <rniwa@webkit.org>
2596
2597         CharacterData::setData doesn't need ExceptionCode as an out argument
2598         https://bugs.webkit.org/show_bug.cgi?id=153225
2599
2600         Reviewed by Antti Koivisto.
2601
2602         * WebProcess/InjectedBundle/API/mac/WKDOMText.mm:
2603         (-[WKDOMText setData:]):
2604
2605 2016-01-18  Ryuan Choi  <ryuan.choi@navercorp.com>
2606
2607         [EFL] Remove wkView() from EwkView
2608         https://bugs.webkit.org/show_bug.cgi?id=152604
2609
2610         Reviewed by Gyuyoung Kim.
2611
2612         * UIProcess/API/efl/EwkView.cpp:
2613         (EwkViewEventHandler<EVAS_CALLBACK_SHOW>::handleEvent):
2614         (EwkViewEventHandler<EVAS_CALLBACK_HIDE>::handleEvent):
2615         (EwkView::EwkView):
2616         (EwkView::create):
2617         (EwkView::wkPage):
2618         (EwkView::isVisible):
2619         (EwkView::setVisible):
2620         (EwkView::setDeviceScaleFactor):
2621         (EwkView::deviceSize):
2622         (EwkView::displayTimerFired):
2623         (EwkView::setViewportPosition):
2624         (EwkView::requestExitFullScreen):
2625         (EwkView::contentsSize):
2626         (EwkView::setThemePath):
2627         (EwkView::feedTouchEvent):
2628         (EwkView::createGLSurface):
2629         (EwkView::showContextMenu):
2630         (EwkView::requestPopupMenu):
2631         (EwkView::webView):
2632         (EwkView::handleEvasObjectCalculate):
2633         (EwkView::handleEvasObjectColorSet):
2634         (EwkView::handleEwkViewFocusIn):
2635         (EwkView::handleEwkViewFocusOut):
2636         (EwkView::feedTouchEvents):
2637         (EwkView::takeSnapshot):
2638         (EwkView::scrollBy):
2639         (EwkView::setBackgroundColor):
2640         (EwkView::backgroundColor):
2641         * UIProcess/API/efl/EwkView.h:
2642         (EwkView::wkView): Deleted.
2643         * UIProcess/API/efl/GestureRecognizer.cpp:
2644         (WebKit::GestureHandler::handleSingleTap):
2645         * UIProcess/API/efl/ewk_view.cpp:
2646         (EWKViewCreate):
2647         (EWKViewGetWKView):
2648         (ewk_view_fullscreen_exit):
2649         (ewk_view_layout_fixed_set):
2650         (ewk_view_layout_fixed_get):
2651         (ewk_view_layout_fixed_size_set):
2652         (ewk_view_layout_fixed_size_get):
2653         (ewk_view_bg_color_get):
2654         (ewk_view_contents_size_get):
2655         * UIProcess/efl/PageViewportControllerClientEfl.cpp:
2656         (WebKit::PageViewportControllerClientEfl::setPageScaleFactor):
2657         * UIProcess/efl/ViewClientEfl.cpp:
2658         (WebKit::ViewClientEfl::webProcessDidRelaunch):
2659         (WebKit::ViewClientEfl::ViewClientEfl):
2660         (WebKit::ViewClientEfl::~ViewClientEfl):
2661
2662 2016-01-18  Zan Dobersek  <zdobersek@igalia.com>
2663
2664         Sink the Vector<uint8_t> buffer into the SerializedScriptValue constructor
2665         https://bugs.webkit.org/show_bug.cgi?id=142634
2666
2667         Reviewed by Darin Adler.
2668
2669         Update API::SerializedScriptValue::adopt() to take in a Vector<uint8_t>
2670         rvalue, moving it into the WebCore::SerializedScriptValue::adopt() call.
2671
2672         Update other places that are affected by the SerializedScriptValue changes.
2673
2674         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
2675         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createIndex):
2676         * Shared/API/APISerializedScriptValue.h:
2677         (API::SerializedScriptValue::adopt):
2678         * Shared/UserData.cpp:
2679         (WebKit::UserData::decode):
2680         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2681         (WebKit::WebUserContentControllerProxy::didPostMessage):
2682         * UIProcess/WebPageProxy.cpp:
2683         (WebKit::WebPageProxy::scriptValueCallback):
2684         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
2685         (WebKit::applyFrameState):
2686
2687 2016-01-18  Olivier Blin  <olivier.blin@softathome.com>
2688
2689         [EFL][GTK][WK2] Fix UIProcess build with GStreamer and without VIDEO
2690         https://bugs.webkit.org/show_bug.cgi?id=153135
2691
2692         Reviewed by Michael Catanzaro.
2693
2694         GStreamer builds fail when WebAudio is enabled but VIDEO disabled.
2695
2696         This change makes the flag more consistent around the
2697         decicePolicyForInstallMissingMediaPluginsPermissionRequest() method:
2698         ENABLE(VIDEO) && USE(GSTREAMER) everywhere, while the code used to
2699         test either one or the other.
2700
2701         This does not enable InstallMissingMediaPlugins for WebAudio, since no
2702         code makes use of this in WebKitWebAudioSourceGStreamer.
2703
2704         It also fixes a naming typo for the following method:
2705         decidePolicyForInstallMissingMediaPluginsPermissionRequest()
2706
2707         * UIProcess/API/gtk/PageClientImpl.cpp:
2708         (WebKit::PageClientImpl::decidePolicyForInstallMissingMediaPluginsPermissionRequest):
2709         * UIProcess/API/gtk/PageClientImpl.h:
2710         * UIProcess/PageClient.h:
2711         * UIProcess/efl/WebViewEfl.h:
2712         * UIProcess/gstreamer/WebPageProxyGStreamer.cpp:
2713         (WebKit::WebPageProxy::requestInstallMissingMediaPlugins):
2714
2715 2016-01-17  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
2716
2717         Add quotes around ${CMAKE_SHARED_LINKER_FLAGS} in case it is unset
2718         https://bugs.webkit.org/show_bug.cgi?id=153175
2719
2720         Reviewed by Michael Catanzaro.
2721
2722         * PlatformGTK.cmake:
2723
2724 2016-01-16  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
2725
2726         Remove a now-irrelevant darwin build hack
2727         https://bugs.webkit.org/show_bug.cgi?id=153117
2728
2729         Reviewed by Michael Catanzaro.
2730
2731         * PlatformGTK.cmake:
2732
2733 2016-01-16  Jon Honeycutt  <jhoneycutt@apple.com>
2734
2735         [iOS] Replace deprecated -[UIDocumentMenuViewController
2736         _setIgnoreApplicationEntitlementForImport:]
2737
2738         <https://bugs.webkit.org/show_bug.cgi?id=145690>
2739         <rdar://problem/20636577>
2740
2741         Reviewed by Brent Fulgham.
2742
2743         * Platform/spi/ios/UIKitSPI.h:
2744         Replace deprecated SPI with newer SPI.
2745
2746         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2747         (-[WKFileUploadPanel presentWithParameters:resultListener:]):
2748         (-[WKFileUploadPanel _showDocumentPickerMenu]):
2749         Ditto.
2750
2751 2016-01-16  Michael Catanzaro  <mcatanzaro@igalia.com>
2752
2753         [GTK] Unreviewed. Fix a typo in an API comment.
2754
2755         * UIProcess/API/gtk/WebKitWebViewSessionState.cpp:
2756
2757 2016-01-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2758
2759         [GTK] GVariant runtime critical errors when encoding session data
2760         https://bugs.webkit.org/show_bug.cgi?id=153130
2761
2762         Reviewed by Michael Catanzaro.
2763
2764         It happens when the FrameState has children, because the recursive
2765         serialization is wrong. Also fix serialization of
2766         documentSequenceNumber and itemSequenceNumber that are gint64, not
2767         guint64.
2768
2769         * UIProcess/API/gtk/WebKitWebViewSessionState.cpp:
2770         (encodeFrameState): Let the caller open/init the given
2771         builder. Use a new builder to encode child states recursively.
2772         (encodePageState): Do the builder open/close for the FrameState encoding.
2773         (decodeFrameState): Get the variant of every child.
2774
2775 2016-01-15  Michael Catanzaro  <mcatanzaro@igalia.com>
2776
2777         Fix internal Windows build
2778         https://bugs.webkit.org/show_bug.cgi?id=153142
2779
2780         Unreviewed addition to Alex's JSC patch, which was reviewed by Brent Fulgham. Pass
2781         -I${JAVASCRIPTCORE_DIR} to g-ir-scanner.
2782
2783         * PlatformGTK.cmake:
2784
2785 2016-01-14  Simon Fraser  <simon.fraser@apple.com>
2786
2787         Remove workaround for rdar://problem/23623670
2788         https://bugs.webkit.org/show_bug.cgi?id=153107
2789         rdar://problem/23633319
2790
2791         Reviewed by Tim Horton.
2792
2793         Remove the code that uses IOSurfaceAcceleratorTransformSurface() when copying from
2794         back-to-front buffer, now that CGIOSurfaceContextCreate()-code path works correctly.
2795
2796         * Shared/mac/RemoteLayerBackingStore.mm:
2797         (WebKit::RemoteLayerBackingStore::display):
2798
2799 2016-01-14  Beth Dakin  <bdakin@apple.com>
2800
2801         WK1 and WK2 should share more candidate request code
2802         https://bugs.webkit.org/show_bug.cgi?id=153108
2803
2804         Reviewed by Simon Fraser.
2805
2806         requestCandidatesForSelection() does not need to be exposed as an 
2807         EditorClient function. WK1 can just call invoke this code from the existing 
2808         respondToChangedSelection EditorClient function, which is what WK2 does.
2809         * WebProcess/WebCoreSupport/WebEditorClient.h:
2810
2811 2016-01-14  Beth Dakin  <bdakin@apple.com>
2812
2813         WK2: Request completion candidates when needed
2814         https://bugs.webkit.org/show_bug.cgi?id=153040
2815         -and corresponding-
2816         rdar://problem/24155631
2817
2818         Reviewed by Enrica Casucci and Tim Horton.
2819
2820         Mac needs to support postLayoutData in order to have some layout-related 
2821         editing information to request candidates. This patch re-shuffles some items 
2822         in the struct so that they can be shared by Mac and iOS, and it adds 3 new 
2823         items for Mac only.
2824         * Shared/EditorState.cpp:
2825         (WebKit::EditorState::encode):
2826         (WebKit::EditorState::decode):
2827         (WebKit::EditorState::PostLayoutData::encode):
2828         (WebKit::EditorState::PostLayoutData::decode):
2829         * Shared/EditorState.h:
2830
2831         Request and handle candidates here in WebViewImpl, and cache the 
2832         m_lastStringForCandidateRequest so that we can ensure the results we receive 
2833         were received in a timely enough manner that they are still for the same 
2834         String.
2835         * UIProcess/Cocoa/WebViewImpl.h:
2836         * UIProcess/Cocoa/WebViewImpl.mm:
2837         (WebKit::WebViewImpl::selectionDidChange):
2838
2839         When selection changes, request new candidates.
2840         (WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
2841
2842         Once candidates have been received, we ask the sharedSpellChecker to show 
2843         them.
2844         (WebKit::WebViewImpl::handleRequestedCandidates):
2845
2846         If a candidate is accepted, we ask the WebProcess to accept it, so we start 
2847         by converting the NSTextCheckingResult to a WebCore::TextCheckingResult.
2848         (WebKit::textCheckingResultFromNSTextCheckingResult):
2849         (WebKit::WebViewImpl::handleAcceptedCandidate):
2850
2851         Ask the WebProcess to handle accepting the candidate.
2852         * UIProcess/WebPageProxy.cpp:
2853         (WebKit::WebPageProxy::handleAcceptedCandidate):
2854         * UIProcess/WebPageProxy.h:
2855         * WebProcess/WebPage/WebPage.h:
2856         (WebKit::WebPage:: handleAcceptedCandidate):
2857         * WebProcess/WebPage/WebPage.messages.in:
2858
2859         Now that Mac has some postLayoutData in the EditorState, fill that in in 
2860         platformEditorState().
2861         * WebProcess/WebPage/mac/WebPageMac.mm:
2862         (WebKit::WebPage::platformEditorState):
2863
2864         Ask WebCore::Editor to handle the accepted candidate.
2865         (WebKit::WebPage::handleAcceptedCandidate):
2866
2867 2016-01-14  Commit Queue  <commit-queue@webkit.org>
2868
2869         Unreviewed, rolling out r195002.
2870         https://bugs.webkit.org/show_bug.cgi?id=153098
2871
2872         Crashes many/most editing tests (Requested by ap on #webkit).
2873
2874         Reverted changeset:
2875
2876         "WK2: Request completion candidates when needed"
2877         https://bugs.webkit.org/show_bug.cgi?id=153040
2878         http://trac.webkit.org/changeset/195002
2879
2880 2016-01-14  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2881
2882         [EFL][GTK][SeccompFilter] Fix build break when enabling --seccomp-filters
2883         https://bugs.webkit.org/show_bug.cgi?id=153094
2884
2885         Reviewed by Csaba Osztrogonác.
2886
2887         diskCacheDirectory and cookiePersistentStoragePath were removed by r192796.
2888         But SyscallPolicy::addDefaultWebProcessPolicy has added directory permission
2889         to the removed paths.
2890
2891         It looks two paths needs to be handled by network process.
2892
2893         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
2894         (WebKit::SyscallPolicy::addDefaultWebProcessPolicy): Deleted.
2895
2896 2016-01-13  Alex Christensen  <achristensen@webkit.org>
2897
2898         Implement custom protocols when using NetworkSession
2899         https://bugs.webkit.org/show_bug.cgi?id=153078
2900
2901         Reviewed by Andy Estes.
2902
2903         * NetworkProcess/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
2904         (WebKit::generateCustomProtocolID):
2905         (+[WKCustomProtocol canInitWithRequest:]):
2906         (+[WKCustomProtocol canonicalRequestForRequest:]):
2907         (-[WKCustomProtocol initWithRequest:cachedResponse:client:]):
2908         (-[WKCustomProtocol startLoading]):
2909         (-[WKCustomProtocol stopLoading]):
2910         There's no need to have a static pointer when we can use NetworkProcess::singleton to access 
2911         the process-global CustomProtocolManager, and add null checks because that's a good thing to do.
2912         (WebKit::CustomProtocolManager::CustomProtocolManager):
2913         Call UTF8Encoding when creating the CustomProtocolManager on the main thread to make sure it exists
2914         for when we decode URLS in ResourceResponses from IPC later, which is done on a different WorkQueue.
2915         (WebKit::CustomProtocolManager::initializeConnection):
2916         (WebKit::CustomProtocolManager::initialize):
2917         (WebKit::CustomProtocolManager::removeCustomProtocol):
2918         (WebKit::CustomProtocolManager::registerProtocolClass):
2919         (WebKit::CustomProtocolManager::registerScheme):
2920         * NetworkProcess/CustomProtocols/CustomProtocolManager.h:
2921         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2922         (WebKit::NetworkSession::NetworkSession):
2923         Call registerProtocolClass to set configuration.protocolClasses if there is a CustomProtocolManager.
2924
2925 2016-01-13  Beth Dakin  <bdakin@apple.com>
2926
2927         WK2: Request completion candidates when needed
2928         https://bugs.webkit.org/show_bug.cgi?id=153040
2929         -and corresponding-
2930         rdar://problem/24155631
2931
2932         Reviewed by Enrica Casucci.
2933
2934         Mac needs to support postLayoutData in order to have some layout-related 
2935         editing information to request candidates. This patch re-shuffles some items 
2936         in the struct so that they can be shared by Mac and iOS, and it adds 3 new 
2937         items for Mac only.
2938         * Shared/EditorState.cpp:
2939         (WebKit::EditorState::encode):
2940         (WebKit::EditorState::decode):
2941         (WebKit::EditorState::PostLayoutData::encode):
2942         (WebKit::EditorState::PostLayoutData::decode):
2943         * Shared/EditorState.h:
2944
2945         Request and handle candidates here in WebViewImpl, and cache the 
2946         m_lastStringForCandidateRequest so that we can ensure the results we receive 
2947         were received in a timely enough manner that they are still for the same 
2948         String.
2949         * UIProcess/Cocoa/WebViewImpl.h:
2950         * UIProcess/Cocoa/WebViewImpl.mm:
2951         (WebKit::WebViewImpl::selectionDidChange):
2952
2953         When selection changes, request new candidates.
2954         (WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
2955
2956         Once candidates have been received, we ask the sharedSpellChecker to show 
2957         them.
2958         (WebKit::WebViewImpl::handleRequestedCandidates):
2959
2960         If a candidate is accepted, we ask the WebProcess to accept it, so we start 
2961         by converting the NSTextCheckingResult to a WebCore::TextCheckingResult.
2962         (WebKit::textCheckingResultFromNSTextCheckingResult):
2963         (WebKit::WebViewImpl::handleAcceptedCandidate):
2964
2965         Ask the WebProcess to handle accepting the candidate.
2966         * UIProcess/WebPageProxy.cpp:
2967         (WebKit::WebPageProxy::handleAcceptedCandidate):
2968         * UIProcess/WebPageProxy.h:
2969         * WebProcess/WebPage/WebPage.h:
2970         (WebKit::WebPage:: handleAcceptedCandidate):
2971         * WebProcess/WebPage/WebPage.messages.in:
2972
2973         Now that Mac has some postLayoutData in the EditorState, fill that in in 
2974         platformEditorState().
2975         * WebProcess/WebPage/mac/WebPageMac.mm:
2976         (WebKit::WebPage::platformEditorState):
2977
2978         Ask WebCore::Editor to handle the accepted candidate.
2979         (WebKit::WebPage::handleAcceptedCandidate):
2980
2981 2016-01-12  Geoffrey Garen  <ggaren@apple.com>
2982
2983         WebKit2 should have an API for eagerly querying whether the web process is responsive
2984         https://bugs.webkit.org/show_bug.cgi?id=153037
2985
2986         Reviewed by Tim Horton.
2987
2988         WebKit2 provides a delegate notification when the web process doesn't
2989         respond to a message after a while. But there's no way to send a message
2990         eagerly and check for reply.
2991
2992         We want this new mechanism so that navigation can terminate the web
2993         process eagerly if it is hung.
2994
2995         * UIProcess/API/C/WKPage.cpp:
2996         (WKPageGetWebProcessIsResponsive):
2997         * UIProcess/API/C/WKPagePrivate.h: This is the new API.
2998
2999         * UIProcess/WebPageProxy.cpp:
3000         (WebKit::WebPageProxy::sendWheelEvent): Updated for interface change.
3001
3002         (WebKit::WebPageProxy::getWebProcessIsResponsive): Calls through to the
3003         web process proxy. We claim that we are responsive when there is no
3004         web process because we assume that a fresh web process will not hang.
3005
3006         * UIProcess/WebPageProxy.h:
3007
3008         * UIProcess/WebProcessProxy.cpp:
3009         (WebKit::WebProcessProxy::WebProcessProxy):
3010         (WebKit::WebProcessProxy::didBecomeUnresponsive): Keep a flag indicating
3011         whether the process is unresponsive so that we can fire unresponsiveness
3012         callbacks immediately for a hung process instead of waiting another 3s.
3013
3014         (WebKit::WebProcessProxy::didBecomeResponsive): We don't fire responsiveness
3015         callbacks inside didBecomeResponsive because we assume that a responsive
3016         web process will invoke didReceiveMainThreadPing -- and we fire the
3017         callbacks there.
3018
3019         (WebKit::WebProcessProxy::getIsResponsive): If the web process is already
3020         known to be unresponsive, fire the callback right away. Otherwise, queue
3021         it up to fire once we have an answer from a main thread ping.
3022
3023         (WebKit::WebProcessProxy::didReceiveMainThreadPing): Fire any pending
3024         callbacks when we learn that the web process is responsive.
3025
3026         * UIProcess/WebProcessProxy.h:
3027
3028 2016-01-12  Carlos Garcia Campos  <cgarcia@igalia.com>
3029
3030         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.11.3 release.
3031
3032         * gtk/NEWS: Add release notes for 2.11.3.
3033
3034 2016-01-12  Geoffrey Garen  <ggaren@apple.com>
3035
3036         WebPageProxy should reattach to the web process before navigating
3037         https://bugs.webkit.org/show_bug.cgi?id=153026
3038
3039         Reviewed by Anders Carlsson.
3040
3041         This fixes a crash (and lots of other corruption) when force-quitting
3042         the web process during navigation.
3043
3044         Some objects (like ViewGestureController) use one-time initialization
3045         to point to a ChildProcessProxy -- and, by design, we destroy them when
3046         the ChildProcessProxy becomes invalid (i.e., crashes or quits).
3047
3048         If we navigate *before* creating a new, valid ChildProcessProxy, then
3049         we accidentally re-create these objects pointing to the old, invalid
3050         ChildProcessProxy.
3051
3052         We need to wait until we have a valid ChildProcessProxy before we
3053         initialize these objects.
3054
3055         * UIProcess/WebPageProxy.cpp:
3056         (WebKit::WebPageProxy::reattachToWebProcessWithItem): Navigate after
3057         reattaching to the web process so that lazily allocated helper objects
3058         point to the right ChildProcessProxy.
3059
3060 2016-01-12  Ryosuke Niwa  <rniwa@webkit.org>
3061
3062         Add a build flag for custom element
3063         https://bugs.webkit.org/show_bug.cgi?id=153005
3064
3065         Reviewed by Alex Christensen.
3066
3067         * Configurations/FeatureDefines.xcconfig:
3068
3069 2016-01-12  Alex Christensen  <achristensen@webkit.org>
3070
3071         Ask for UI Process approval of ProtectionSpace when authenticating downloads with NetworkSession
3072         https://bugs.webkit.org/show_bug.cgi?id=152999
3073
3074         Reviewed by Brady Eidson.
3075
3076         * DerivedSources.make:
3077         I mistakenly added PendingDownload.messages.in in r194810, but this will not be needed because
3078         the PendingDownload is not a MessageReceiver.  Rather, the NetworkProcess receives the messages
3079         and forwards their contents to the PendingDownload through its DownloadManager.
3080         * NetworkProcess/Downloads/DownloadManager.cpp:
3081         (WebKit::DownloadManager::dataTaskBecameDownloadTask):
3082         (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace):
3083         (WebKit::DownloadManager::convertHandleToDownload):
3084         * NetworkProcess/Downloads/DownloadManager.h:
3085         * NetworkProcess/Downloads/PendingDownload.cpp:
3086         (WebKit::PendingDownload::continueWillSendRequest):
3087         (WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync):
3088         Instead of taking a shortcut I added in r194810, send a message to the UI process and wait for its
3089         asynchronous reply to determine if we can authenticate against this protection space.
3090         (WebKit::PendingDownload::continueCanAuthenticateAgainstProtectionSpace):
3091         (WebKit::PendingDownload::didConvertToDownload):
3092         * NetworkProcess/Downloads/PendingDownload.h:
3093         * NetworkProcess/Downloads/PendingDownload.messages.in: Removed.
3094         * NetworkProcess/NetworkProcess.cpp:
3095         (WebKit::NetworkProcess::cancelDownload):
3096         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
3097         (WebKit::NetworkProcess::setCacheModel):
3098         * NetworkProcess/NetworkProcess.h:
3099         * NetworkProcess/NetworkProcess.messages.in:
3100         * Shared/Authentication/AuthenticationManager.h:
3101         * UIProcess/API/APIDownloadClient.h:
3102         (API::DownloadClient::didFail):
3103         (API::DownloadClient::didCancel):
3104         (API::DownloadClient::processDidCrash):
3105         (API::DownloadClient::canAuthenticateAgainstProtectionSpace):
3106         * UIProcess/Downloads/DownloadProxy.cpp:
3107         (WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
3108         (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace):
3109         (WebKit::DownloadProxy::didReceiveResponse):
3110         * UIProcess/Downloads/DownloadProxy.h:
3111         * UIProcess/Downloads/DownloadProxy.messages.in:
3112         * WebKit2.xcodeproj/project.pbxproj:
3113
3114 2016-01-12  Carlos Garcia Campos  <cgarcia@igalia.com>
3115
3116         Move ChildProcessProxy from Shared to UIProcess
3117         https://bugs.webkit.org/show_bug.cgi?id=125570
3118
3119         Reviewed by Darin Adler.
3120
3121         ChildProcessProxy is only used by the UI process.
3122
3123         * CMakeLists.txt:
3124         * PlatformGTK.cmake:
3125         * UIProcess/ChildProcessProxy.cpp: Renamed from Source/WebKit2/Shared/ChildProcessProxy.cpp.
3126         (WebKit::ChildProcessProxy::ChildProcessProxy):
3127         (WebKit::ChildProcessProxy::~ChildProcessProxy):
3128         (WebKit::ChildProcessProxy::fromConnection):
3129         (WebKit::ChildProcessProxy::getLaunchOptions):
3130         (WebKit::ChildProcessProxy::connect):
3131         (WebKit::ChildProcessProxy::terminate):
3132         (WebKit::ChildProcessProxy::state):
3133         (WebKit::ChildProcessProxy::sendMessage):
3134         (WebKit::ChildProcessProxy::addMessageReceiver):
3135         (WebKit::ChildProcessProxy::removeMessageReceiver):
3136         (WebKit::ChildProcessProxy::dispatchMessage):
3137         (WebKit::ChildProcessProxy::dispatchSyncMessage):
3138         (WebKit::ChildProcessProxy::didFinishLaunching):
3139         (WebKit::ChildProcessProxy::shutDownProcess):
3140         (WebKit::ChildProcessProxy::connectionWillOpen):
3141         * UIProcess/ChildProcessProxy.h: Renamed from Source/WebKit2/Shared/ChildProcessProxy.h.
3142         (WebKit::ChildProcessProxy::connection):
3143         (WebKit::ChildProcessProxy::processIdentifier):
3144         (WebKit::ChildProcessProxy::canSendMessage):
3145         (WebKit::ChildProcessProxy::send):
3146         (WebKit::ChildProcessProxy::sendSync):
3147         * WebKit2.xcodeproj/project.pbxproj:
3148
3149 2016-01-12  Carlos Garcia Campos  <cgarcia@igalia.com>
3150
3151         [GTK] UI process crashes if webkit_web_view_get_tls_info is called before internal load-committed event
3152         https://bugs.webkit.org/show_bug.cgi?id=142375
3153
3154         Reviewed by Michael Catanzaro.
3155
3156         Remove all the hacks to emit delayed load events now that the
3157         page cache resource load delegates are consistent with all other
3158         resource loads.
3159
3160         * UIProcess/API/gtk/WebKitWebView.cpp:
3161         (webkitWebViewLoadChanged):
3162         (webkitWebViewResourceLoadStarted):
3163         (webkit_web_view_get_tls_info): Add a g_return_val_if_fail to
3164         prevent this function from being misused.
3165         (webkitWebViewDisconnectMainResourceResponseChangedSignalHandler): Deleted.
3166         (webkitWebViewDispose): Deleted.
3167         (webkitWebViewEmitLoadChanged): Deleted.
3168         (webkitWebViewEmitDelayedLoadEvents): Deleted.
3169         (mainResourceResponseChangedCallback): Deleted.
3170         (waitForMainResourceResponseIfWaitingForResource): Deleted.
3171
3172 2016-01-11  Carlos Garcia Campos  <cgarcia@igalia.com>
3173
3174         REGRESSION(r190717): [GTK] Popup menus stop working after being dismissed without selecting an item
3175         https://bugs.webkit.org/show_bug.cgi?id=152977
3176
3177         Reviewed by Michael Catanzaro.
3178
3179         This happens since r190717 when you open a popup menu and without
3180         selecting any option it's dismissed (press ESC or click somewhere
3181         else). This is because I removed the code to track when the menu
3182         is unmapped, thinking that it was no longer necessary. But we need
3183         to send the DidChangeSelectedIndexForActivePopupMenu to the
3184         WebProcess with -1 as index to keep the web process in sync.
3185
3186         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
3187         (WebKit::WebPopupMenuProxyGtk::WebPopupMenuProxyGtk):
3188         (WebKit::WebPopupMenuProxyGtk::showPopupMenu):
3189         (WebKit::WebPopupMenuProxyGtk::cancelTracking):
3190         (WebKit::WebPopupMenuProxyGtk::menuItemActivated):
3191         (WebKit::WebPopupMenuProxyGtk::dismissMenuTimerFired):
3192         (WebKit::WebPopupMenuProxyGtk::menuUnmappedCallback):
3193         * UIProcess/gtk/WebPopupMenuProxyGtk.h:
3194
3195 2016-01-09  Andy Estes  <aestes@apple.com>
3196
3197         [Cocoa] Add SPI to opt out a URL scheme from the memory cache
3198         https://bugs.webkit.org/show_bug.cgi?id=152950
3199         rdar://problem/24066652
3200
3201         Reviewed by Tim Horton.
3202
3203         Added a alwaysRevalidatedURLSchemes property to _WKProcessPoolConfiguration. Taught WebProcess to add these
3204         schemes to SchemeRegistry when initializing a new web process.
3205
3206         * Shared/API/Cocoa/WKFoundation.h: Added a newline to force re-postprocessing.
3207         * Shared/WebProcessCreationParameters.cpp:
3208         (WebKit::WebProcessCreationParameters::encode):
3209         (WebKit::WebProcessCreationParameters::decode):
3210         * Shared/WebProcessCreationParameters.h:
3211         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3212         (API::ProcessPoolConfiguration::copy):
3213         * UIProcess/API/APIProcessPoolConfiguration.h:
3214         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3215         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3216         (-[_WKProcessPoolConfiguration alwaysRevalidatedURLSchemes]):
3217         (-[_WKProcessPoolConfiguration setAlwaysRevalidatedURLSchemes:]):
3218         * UIProcess/WebProcessPool.cpp:
3219         (WebKit::WebProcessPool::createNewWebProcess):
3220         * UIProcess/WebProcessPool.h:
3221         * WebProcess/WebProcess.cpp:
3222         (WebKit::WebProcess::initializeWebProcess):
3223         (WebKit::WebProcess::registerURLSchemeAsAlwaysRevalidated):
3224         * WebProcess/WebProcess.h:
3225
3226 2016-01-11  Anders Carlsson  <andersca@apple.com>
3227
3228         Get rid of CFMakeCollectable, it is a no-op
3229         https://bugs.webkit.org/show_bug.cgi?id=152988
3230
3231         Reviewed by Sam Weinig.
3232
3233         * Shared/Cocoa/WKNSString.mm:
3234         * Shared/Cocoa/WKNSURL.mm:
3235         (-[WKNSURL _web_createTarget]):
3236
3237 2016-01-11  Commit Queue  <commit-queue@webkit.org>
3238
3239         Unreviewed, rolling out r194866.
3240         https://bugs.webkit.org/show_bug.cgi?id=152986
3241
3242         This change broke the mac build (Requested by ryanhaddad on
3243         #webkit).
3244
3245         Reverted changeset:
3246
3247         "[Cocoa] Add SPI to opt out a URL scheme from the memory
3248         cache"
3249         https://bugs.webkit.org/show_bug.cgi?id=152950
3250         http://trac.webkit.org/changeset/194866
3251
3252 2016-01-11  Andy Estes  <aestes@apple.com>
3253
3254         [Cocoa] Add SPI to opt out a URL scheme from the memory cache
3255         https://bugs.webkit.org/show_bug.cgi?id=152950
3256         rdar://problem/24066652
3257
3258         Reviewed by Tim Horton.
3259
3260         Added a alwaysRevalidatedURLSchemes property to _WKProcessPoolConfiguration. Taught WebProcess to add these
3261         schemes to SchemeRegistry when initializing a new web process.
3262
3263         * Shared/WebProcessCreationParameters.cpp:
3264         (WebKit::WebProcessCreationParameters::encode):
3265         (WebKit::WebProcessCreationParameters::decode):
3266         * Shared/WebProcessCreationParameters.h:
3267         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3268         (API::ProcessPoolConfiguration::copy):
3269         * UIProcess/API/APIProcessPoolConfiguration.h:
3270         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3271         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3272         (-[_WKProcessPoolConfiguration alwaysRevalidatedURLSchemes]):
3273         (-[_WKProcessPoolConfiguration setAlwaysRevalidatedURLSchemes:]):
3274         * UIProcess/WebProcessPool.cpp:
3275         (WebKit::WebProcessPool::createNewWebProcess):
3276         * UIProcess/WebProcessPool.h:
3277         * WebProcess/WebProcess.cpp:
3278         (WebKit::WebProcess::initializeWebProcess):
3279         (WebKit::WebProcess::registerURLSchemeAsAlwaysRevalidated):
3280         * WebProcess/WebProcess.h:
3281
3282 2016-01-11  Alex Christensen  <achristensen@webkit.org>
3283
3284         Fix Mac CMake build after r194810.
3285
3286         * PlatformMac.cmake:
3287         PendingDownload isn't needed until NETWORK_SESSION is used by default.
3288         I'll figure this out when I make the switch.
3289
3290 2016-01-11  Mario Sanchez Prada  <mario@endlessm.com>
3291
3292         [WK2][GTK] Propagate motion-notify-event signals from the WebView
3293         https://bugs.webkit.org/show_bug.cgi?id=152974
3294
3295         Reviewed by Carlos Garcia Campos.
3296
3297         Always propagate motion-notify-event signals, regardless of what the
3298         web process does, so that we can listen for those events (which does
3299         not act on specific targets inside the webview) from the container
3300         widget too, and not just from the WebView itself.
3301
3302         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3303         (webkitWebViewBaseMotionNotifyEvent): Ensure the signal gets propagated.
3304
3305 2016-01-10  Dan Bernstein  <mitz@apple.com>
3306
3307         [Cocoa] Disable header postprocessing when building for El Capitan
3308         https://bugs.webkit.org/show_bug.cgi?id=152962
3309
3310         Reviewed by Anders Carlsson.
3311
3312         * Configurations/WebKit.xcconfig:
3313
3314 2016-01-09  Dan Bernstein  <mitz@apple.com>
3315
3316         [Cocoa] Allow overriding the frameworks directory independently of using a staging install path
3317         https://bugs.webkit.org/show_bug.cgi?id=152926
3318
3319         Reviewed by Tim Horton.
3320
3321         Introduce a new build setting, WK_OVERRIDE_FRAMEWORKS_DIR. When not empty, it determines
3322         where the frameworks are installed. Setting USE_STAGING_INSTALL_PATH to YES sets
3323         WK_OVERRIDE_FRAMEWORKS_DIR to $(SYSTEM_LIBRARY_DIR)/StagedFrameworks/Safari.
3324
3325         Account for the possibility of WK_OVERRIDE_FRAMEWORKS_DIR containing spaces.
3326
3327         * Configurations/BaseTarget.xcconfig:
3328         - Add quotes to account for spaces.
3329         - Define WEBKIT_FRAMEWORKS_DIR and UMBRELLA_FRAMEWORKS_DIR based on
3330           WK_OVERRIDE_FRAMEWORKS_DIR.
3331
3332         * WebKit2.xcodeproj/project.pbxproj:
3333         - In the Migrate WebKitLegacy Headers build phase, work around make’s inability to handle
3334           spaces in paths by creating a symlink to WEBKIT_LEGACY_PRIVATE_HEADERS_DIR under
3335           BUILT_PRODUCTS_DIR and using the symlink as the value of
3336           WEBKIT_LEGACY_PRIVATE_HEADERS_DIR.
3337         - In the Postprocess WKBase.h and Postprocess WKFoundation.h build phases, add quotes to
3338           account for spaces.
3339
3340         * mac/MigrateHeadersFromWebKitLegacy.make:
3341           Use a BUILT_PRODUCTS_DIR-based path to the framework instead of a TARGET_BUILD_DIR-based
3342           one in order to avoid spaces.
3343
3344         * mac/postprocess-framework-headers.sh:
3345           Add quotes to account for spaces.
3346
3347 2016-01-08  Alex Christensen  <achristensen@webkit.org>
3348
3349         Implement download authentication with NetworkSession
3350         https://bugs.webkit.org/show_bug.cgi?id=152878
3351
3352         Reviewed by Brady Eidson.
3353
3354         * DerivedSources.make:
3355         * NetworkProcess/Downloads/Download.h:
3356         * NetworkProcess/Downloads/DownloadManager.cpp:
3357         (WebKit::DownloadManager::startDownload):
3358         * NetworkProcess/Downloads/PendingDownload.cpp: Added.
3359         (WebKit::PendingDownload::PendingDownload):
3360         (WebKit::PendingDownload::willSendRedirectedRequest):
3361         (WebKit::PendingDownload::continueWillSendRequest):
3362         (WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync):
3363         (WebKit::PendingDownload::continueCanAuthenticateAgainstProtectionSpace):
3364         (WebKit::PendingDownload::didConvertToDownload):
3365         (WebKit::PendingDownload::messageSenderConnection):
3366         (WebKit::PendingDownload::messageSenderDestinationID):
3367         * NetworkProcess/Downloads/PendingDownload.h:
3368         (WebKit::PendingDownload::PendingDownload): Deleted.
3369         * NetworkProcess/Downloads/PendingDownload.messages.in: Added.
3370         * NetworkProcess/NetworkLoad.cpp:
3371         (WebKit::NetworkLoad::continueWillSendRequest):
3372         The completion handler should always be called.  If m_currentRequest is null, then the request will not proceed, which is the same as canceling it.
3373         (WebKit::NetworkLoad::setPendingDownloadID):
3374         (WebKit::NetworkLoad::setPendingDownload):
3375         (WebKit::NetworkLoad::willPerformHTTPRedirection):
3376         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
3377         If this load is going to become a download, then call the PendingDownload version of didReceiveAuthenticationChallenge to communicate with the 
3378         UI process directly because there wasn't necessarily a web process associated with this request that will become a download.
3379         * NetworkProcess/NetworkLoad.h:
3380         (WebKit::NetworkLoad::pendingDownloadID):
3381         * NetworkProcess/NetworkSession.h:
3382         (WebKit::NetworkDataTask::client):
3383         (WebKit::NetworkDataTask::pendingDownloadID):
3384         (WebKit::NetworkDataTask::pendingDownload):
3385         (WebKit::NetworkDataTask::setPendingDownloadID):
3386         (WebKit::NetworkDataTask::setPendingDownload):
3387         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3388         * PlatformMac.cmake:
3389         * Shared/Authentication/AuthenticationManager.cpp:
3390         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
3391         * Shared/Authentication/AuthenticationManager.h:
3392         * WebKit2.xcodeproj/project.pbxproj:
3393         * WebProcess/Network/WebResourceLoader.cpp:
3394         (WebKit::WebResourceLoader::canAuthenticateAgainstProtectionSpace):
3395         Removed unnecessary protection and move null check to before using the pointer it checks.
3396
3397 2016-01-07  Simon Fraser  <simon.fraser@apple.com>
3398
3399         Use an appropriate buffer format for swipe snapshots
3400         https://bugs.webkit.org/show_bug.cgi?id=152880
3401         rdar://problem/23728299
3402
3403         Reviewed by Tim Horton.
3404         
3405         Choose an appropriate buffer format for swipe snapshots, and avoid converting
3406         them to YUV422.
3407
3408         * UIProcess/API/Cocoa/WKWebView.mm:
3409         (WebKit::bufferFormat):
3410         (-[WKWebView _takeViewSnapshot]):
3411
3412 2016-01-07  Alex Christensen  <achristensen@webkit.org>
3413
3414         Progress towards implementing downloads with NetworkSession
3415         https://bugs.webkit.org/show_bug.cgi?id=152760
3416
3417         Reviewed by Brady Eidson.
3418
3419         * NetworkProcess/Downloads/Download.cpp:
3420         (WebKit::Download::Download):
3421         There's no need to store the unused NetworkSession&.
3422         (WebKit::Download::didStart):
3423         (WebKit::Download::didReceiveAuthenticationChallenge):
3424         Downloads with NetworkSession are NetworkLoads until the response is received, which is after authentication
3425         challenges are handled by NetworkLoad's code.
3426         (WebKit::Download::didReceiveResponse):
3427         * NetworkProcess/Downloads/Download.h:
3428         * NetworkProcess/Downloads/DownloadManager.cpp:
3429         (WebKit::DownloadManager::startDownload):
3430         Create a PendingDownload, which is basically a NetworkLoad that knows that it will become a Download 
3431         when the response is received, regardless of whether or not there is a Content-Disposition header.
3432         (WebKit::DownloadManager::dataTaskBecameDownloadTask):
3433         * NetworkProcess/Downloads/DownloadManager.h:
3434         * NetworkProcess/Downloads/PendingDownload.h: Added.
3435         (WebKit::PendingDownload::PendingDownload):
3436         Added a new NetworkLoadClient for requests that will become downloads.
3437         A PendingDownload contains a NetworkLoad so we can always keep them together
3438         and so it can handle setting its pending download id.
3439         * WebKit2.xcodeproj/project.pbxproj:
3440         * NetworkProcess/NetworkLoad.cpp:
3441         (WebKit::NetworkLoad::NetworkLoad):
3442         Avoid dereferencing a pointer if the NetworkSession hadn't been created when a NetworkLoad starts.
3443         This shouldn't be possible, but it's good to not assume that all pointers are non-null.
3444         (WebKit::NetworkLoad::cancel):
3445         Add a null check in case the constructor doesn't make m_task.
3446         (WebKit::NetworkLoad::convertTaskToDownload):
3447         (WebKit::NetworkLoad::setPendingDownloadID):
3448         Added for downloads that start with startDownload.  The pending DownloadID is used to indicate that
3449         this request should always become a download, regardless of whether or not the response has a 
3450         Content-Disposition header.
3451         (WebKit::NetworkLoad::willPerformHTTPRedirection):
3452         (WebKit::NetworkLoad::didReceiveResponse):
3453         * NetworkProcess/NetworkLoad.h:
3454         There's no need to store a DownloadID here.  It's stored in the NetworkDataTask (m_task).
3455         * NetworkProcess/NetworkSession.h:
3456         (WebKit::NetworkDataTask::client):
3457         (WebKit::NetworkDataTask::pendingDownloadID):
3458         (WebKit::NetworkDataTask::setPendingDownloadID):
3459         (WebKit::NetworkDataTask::downloadID): Deleted.
3460         (WebKit::NetworkDataTask::setDownloadID): Deleted.
3461         Renamed downloadID and setDownloadID to pendingDownloadID and setPendingDownloadID, respectively,