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