[WK2] Notifications clobber each other with multiple processes
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2013-05-26  Jon Lee  <jonlee@apple.com>
2
3         [WK2] Notifications clobber each other with multiple processes
4         https://bugs.webkit.org/show_bug.cgi?id=116428
5         <rdar://problem/13935191>
6
7         Reviewed by Darin Adler.
8
9         With multiple processes, the notification IDs, when passed up to the UI process, can clobber
10         each other. To fix this, we need to maintain a global map of notification IDs. This map is
11         keyed by its own unique notification ID, and maps to a pair containing the web page ID and that
12         web page's ID for the notification.
13
14         Now that we maintain groups of notifications based on the web page, we no longer send IPC messages
15         from WebNotificationManager to WebNotificationManagerProxy; instead we send messages to the
16         WebPageProxy. This removes the need for WebNotificationManagerProxy to be a message receiver.
17
18         When a page closes, all of the web notifications are cleared out. However, by the time the
19         WebPage::close() is called, the connection between WebPage and WebPageProxy is destroyed. Since
20         the WebPage is told to close from the UI process anyway, we clear out the notifications separately,
21         instead of waiting for a message from the WebPage.
22
23         * UIProcess/Notifications/WebNotificationManagerProxy.h: Update to take into account the
24         notification's web page. Remove inheritance of CoreIPC::MessageReceiver. Expose the original message
25         handlers as public functions, since they will be called from WebPageProxy. Add a new map that
26         associates a global ID with a notification ID that came from a web page.
27             There are now two flavors of clearNotifications(). One clears out all notifications associated
28         with a web page. This is called when the page is closed. The other clears out a subset of
29         notifications associated with a web page. This is called when notifications associated with a sub-frame
30         is closed.
31         * UIProcess/Notifications/WebNotificationManagerProxy.messages.in: Removed. All messages from
32         the web process go to WebPageProxy now.
33
34         * UIProcess/Notifications/WebNotificationManagerProxy.cpp: Update to take into account the
35         notification's web page.
36
37         (WebKit::generateGlobalNotificationID): The manager proxy now maintains its own global notification
38         ID generator.
39         (WebKit::WebNotificationManagerProxy::WebNotificationManagerProxy): The proxy is no longer a
40         message receiver. Remove code that registers it as such.
41
42         (WebKit::WebNotificationManagerProxy::show): Refactor to differentiate between the notification ID
43         that came from the web process, and the global notification ID the proxy maintains. Add the mapping
44         from the global ID to the (web page ID, notification ID) pair.
45         (WebKit::WebNotificationManagerProxy::cancel): Refactor to take into consideration the web page.
46         (WebKit::WebNotificationManagerProxy::didDestroyNotification): Refactor to take into consideration
47         the web page. Fixes a leak where we did not remove the item from the maps. This function is called
48         from the web process, when the ScriptExecutionContext is destroyed, so we remove it from our maps
49         before we pass the message along to the provider.
50
51         Helper functions that evaluate when a given notification in the map matches the desired parameters.
52         (WebKit::pageIDsMatch): The notification is associated with the provided page.
53         (WebKit::pageAndNotificationIDsMatch): The notification is associated with the provided page and is
54         contained within the list of provided notifications.
55
56         (WebKit::WebNotificationManagerProxy::clearNotifications): Changed to only remove notifications
57         associated with the provided web page, and could include a specific list of notifications. This latter
58         situation occurs if notifications were associated with an iframe, and that iframe was removed.
59         There is an O(n) walk that could be make more efficient using another hash map, but that's overhead
60         for a map that should be small in size anyway.
61
62         (WebKit::WebNotificationManagerProxy::providerDidShowNotification): Refactor to take into
63         consideration the web page.
64         (WebKit::WebNotificationManagerProxy::providerDidClickNotification): Refactor to take into
65         consideration the web page.
66         (WebKit::WebNotificationManagerProxy::providerDidCloseNotifications): Now we need to comb through
67         the list of global IDs and put them in buckets based on the notification's web pages. After that
68         is done we can send the DidCloseNotifications() to those pages' processes. There is a possible
69         extra optimization here where we group based on the page's process instead, to reduce the number
70         of messages sent to processes.
71
72         * UIProcess/WebPageProxy.cpp:
73         (WebKit::WebPageProxy::close): When a web page is closed, we clear the notifications associated
74         with the page.
75         (WebKit::WebPageProxy::cancelNotification): Forward call to WebNotificationManagerProxy.
76         (WebKit::WebPageProxy::clearNotifications): Ditto.
77         (WebKit::WebPageProxy::didDestroyNotification): Ditto.
78         * UIProcess/WebPageProxy.h:
79         * UIProcess/WebPageProxy.messages.in:
80
81         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
82         * WebProcess/Notifications/WebNotificationManager.cpp:
83         (WebKit::WebNotificationManager::cancel):
84         (WebKit::WebNotificationManager::clearNotifications):
85         (WebKit::WebNotificationManager::didDestroyNotification):
86         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp: Remove extraneous include.
87
88         * CMakeLists.txt: Remove WebNotificationManagerProxy.messages.in and related files.
89         * DerivedSources.pri: Ditto.
90         * DerivedSources.make: Ditto.
91         * GNUmakefile.list.am: Ditto.
92         * WebKit2.xcodeproj/project.pbxproj: Ditto.
93
94 2013-05-27  Tim Horton  <timothy_horton@apple.com>
95
96         Unreviewed build fix take 2.
97
98         * WebProcess/Plugins/PDF/PDFPlugin.mm:
99
100 2013-05-27  Tim Horton  <timothy_horton@apple.com>
101
102         Unreviewed build fix.
103
104         * WebProcess/Plugins/PDF/PDFPlugin.mm:
105
106 2013-05-27  Tim Horton  <timothy_horton@apple.com>
107
108         PDFPlugin: Main-frame PDFPlugin Accessibility
109         https://bugs.webkit.org/show_bug.cgi?id=116563
110         <rdar://problem/13458534>
111
112         Reviewed by Sam Weinig.
113
114         * WebProcess/Plugins/PDF/PDFLayerControllerDetails.h:
115         Forward-declare a variety of accessibility methods.
116
117         * WebProcess/Plugins/PDF/PDFPlugin.h:
118         Add convertFromPDFViewToScreen, boundsOnScreen, accessibilityObject, and
119         storage for our accessibility wrapper.
120         * WebProcess/Plugins/PDF/PDFPlugin.mm:
121         Add WKPDFPluginAccessibilityObject.
122
123         (-[WKPDFPluginAccessibilityObject accessibilityIsIgnored]):
124         We want to be included in the accessibility tree.
125
126         (-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:]):
127         (-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:forParameter:]):
128         Grab values for accessibility attributes from the relevant sources
129         (mostly from PDFLayerController).
130
131         (-[WKPDFPluginAccessibilityObject readingModel]): Ditto.
132         (-[WKPDFPluginAccessibilityObject accessibilityAttributeNames]):
133         (-[WKPDFPluginAccessibilityObject accessibilityParameterizedAttributeNames]):
134         (-[WKPDFPluginAccessibilityObject accessibilityActionNames]):
135         Return the set of accessibility attributes, actions, and parameterized
136         attributes that we support.
137
138         (-[WKPDFPluginAccessibilityObject accessibilityIsAttributeSettable:]):
139         (-[WKPDFPluginAccessibilityObject accessibilitySetValue:forAttribute:]):
140         Forward some other accessibility methods to PDFLayerController.
141
142         (-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]):
143         (-[WKPDFPluginAccessibilityObject accessibilityHitTest:]):
144         We have no children, so if a hit test makes it to us, it's ours.
145
146         (WebKit::PDFPlugin::PDFPlugin):
147         Make a WKPDFPluginAccessibilityObject and hook it up.
148         [FIXME: this could use some de-crapifying]
149
150         (WebKit::PDFPlugin::convertFromPluginToPDFView):
151         Transform a point from plugin space to PDFLayerController space.
152
153         (WebKit::PDFPlugin::convertFromPDFViewToRootView):
154         (WebKit::PDFPlugin::convertFromPDFViewToScreen): Added.
155         (WebKit::PDFPlugin::boundsOnScreen):
156         Return the PDFPlugin's frame in screen coordinates.
157
158         (WebKit::PDFPlugin::accessibilityObject):
159         Return our accessibility wrapper.
160
161         * WebProcess/Plugins/PDF/SimplePDFPlugin.h:
162         * WebProcess/Plugins/Plugin.h:
163         (WebKit::Plugin::accessibilityObject):
164         * WebProcess/Plugins/PluginView.cpp:
165         (WebKit::PluginView::accessibilityObject):
166         * WebProcess/Plugins/PluginView.h:
167         Add accessibilityObject(), to acquire accessibility wrappers from plugins.
168
169         * WebProcess/WebPage/WebPage.h:
170         (WebPage): Add accessibilityObjectForMainFramePlugin();
171         * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.mm:
172         (-[WKAccessibilityWebPageObject accessibilityRootObjectWrapper]):
173         If the main frame has a PluginDocument that has an accessibilityObject,
174         use that one instead of the WebPage's.
175
176         * WebProcess/WebPage/mac/WebPageMac.mm:
177         (WebKit::WebPage::accessibilityObjectForMainFramePlugin):
178         Return the accessibilityObject from the main-frame PluginDocument, if
179         there is one.
180
181 2013-05-27  Marcelo Lira  <marcelo.lira@openbossa.org>
182
183         [WK2][CoordinatedGraphics] Misuse of DrawingAreaProxy::setVisibleContentsRect() in WebView::updateViewportSize()
184         https://bugs.webkit.org/show_bug.cgi?id=116688
185
186         Reviewed by Noam Rosenthal.
187
188         Visible contents area passed to DrawingAreaProxy::setVisibleContentsRect()
189         must be calculated including the page scale factor and avoid crossing the
190         boundaries of the page contents size. In other words the DrawingArea
191         must know the actual dimensions of what it being drawn. If the
192         DrawingArea thinks the visible rectangle is bigger than it is, the
193         contents will be drawn pixelated and blurry.
194
195         * UIProcess/CoordinatedGraphics/WebView.cpp:
196         (WebKit::WebView::didChangeContentsSize):
197         (WebKit::WebView::updateViewportSize):
198         (WebKit::WebView::visibleContentsSize):
199         (WebKit):
200         * UIProcess/CoordinatedGraphics/WebView.h:
201         (WebKit::WebView::contentsSize):
202         (WebView):
203
204 2013-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
205
206         [GTK] WebKitWebView child widgets are not rendered with recent GTK+
207         https://bugs.webkit.org/show_bug.cgi?id=116794
208
209         Reviewed by Xan Lopez.
210
211         Since rev d22fd7223c75f4720ddb982c659efb0d8d7543c4 of GTK+ expose
212         events are not propagated to child GdkWindows anymore, and child
213         widgets are rendered via gtk_container_propagate_draw(). Since all
214         our children have its own GdkWindow (auth widget, inspector view
215         and windowed plugins) we don't propagate the draw signal making
216         them invisible with current GTK+.
217
218         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
219         (webkitWebViewBaseDraw): Chain up to the parent draw(), so it's
220         propagated to the children. This shouldn't have any effect in
221         previous versions of GTK+ because gtk_container_propagate_draw()
222         returned early when the child widget had its own GdkWindow.
223
224 2013-05-27  Xan Lopez  <xlopez@igalia.com>
225
226         Reset all clients on WebPage close
227         https://bugs.webkit.org/show_bug.cgi?id=112334
228
229         Reviewed by Anders Carlsson.
230
231         We do not reset the clients on WebPage::close(), so there's a
232         small chance that someone will try to access them after that. This
233         won't work and will generally cause runtime warnings, crashes or
234         other issues. Reset them all to null to prevent this situation.
235
236         * WebProcess/WebPage/WebPage.cpp:
237         (WebKit::WebPage::close):
238
239 2013-05-27  Manuel Rego Casasnovas  <rego@igalia.com>
240
241         [GTK] Notify WebProcess in WebKitURISchemeRequest when we fail to read the user InputStream
242         https://bugs.webkit.org/show_bug.cgi?id=114347
243
244         Reviewed by Carlos Garcia Campos.
245
246         While processing a WebKitURISchemeRequest if there is any error reading
247         the InputStream provided by the user (for example the stream is already
248         closed) we have to notify the WebProcess that the request has failed.
249
250         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
251         (webkitURISchemeRequestReadCallback): Get the error from
252         g_input_stream_read_finish() and use it to call
253         webkit_uri_scheme_request_finish_error() in order to finish the failing
254         WebKitURISchemeRequest properly.
255         * UIProcess/API/gtk/tests/TestWebKitWebContext.cpp:
256         (testWebContextURIScheme): Modify test to check the new situation using
257         an already closed InputStream.
258
259 2013-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
260
261         Unreviewed. Fix make distcheck.
262
263         * GNUmakefile.list.am: Add missing header file.
264
265 2013-05-26  Changhun Kang  <temoochin@company100.net>
266
267         The public WK header file should not include WKAPICast.h
268         https://bugs.webkit.org/show_bug.cgi?id=115230
269
270         Reviewed by Darin Adler.
271
272         Otherwise, WebKit internal headers are exposed.
273         No new tests. No change in behavior.
274         * UIProcess/API/C/soup/WKSoupRequestManager.h:
275         * UIProcess/soup/WebSoupRequestManagerClient.h:
276
277 2013-05-26  Andreas Kling  <akling@apple.com>
278
279         FocusController::setFocusedNode() should be setFocusedElement().
280         <http://webkit.org/b/116780>
281
282         Reviewed by Antti Koivisto.
283
284         * WebProcess/Plugins/PluginView.cpp:
285         (WebKit::PluginView::focusPluginElement):
286
287 2013-05-25  Andreas Kling  <akling@apple.com>
288
289         PluginDocument::pluginNode() should be pluginElement() instead.
290         <http://webkit.org/b/116774>
291
292         Reviewed by Anders Carlsson.
293
294         * WebProcess/WebPage/WebPage.cpp:
295         (WebKit::WebPage::focusedPluginViewForFrame):
296
297 2013-05-25  Simon Fraser  <simon.fraser@apple.com>
298
299         Unprefix Page Visibility API
300         https://bugs.webkit.org/show_bug.cgi?id=102340
301
302         Reviewed by Tim Horton.
303         
304         Renaming of the "preview" state to "unloaded".
305
306         * Shared/API/c/WKPageVisibilityTypes.h:
307         * Shared/API/c/WKSharedAPICast.h:
308         (WebKit::toPageVisibilityState):
309
310 2013-05-25  Andreas Kling  <akling@apple.com>
311
312         Move Node::isMouseFocusable() to Element.
313         <http://webkit.org/b/116762>
314
315         Reviewed by Anders Carlsson.
316
317         * WebProcess/WebPage/WebPage.cpp:
318         (WebKit::WebPage::highlightPotentialActivation):
319
320             Check that the potentially activated Node is an Element before asking if it's mouse-focusable.
321
322 2013-05-25  Andreas Kling  <akling@apple.com>
323
324         REGRESSION: WebProcess is terminated when all Safari windows are closed.
325         <rdar://problem/13990901>
326         <http://webkit.org/b/116766>
327
328         Reviewed by Alexey Proskuryakov.
329
330         When closing the last page, only disconnect the web process if we're using a network process.
331         Otherwise there might be session state in the web process getting lost.
332
333         * UIProcess/WebProcessProxy.cpp:
334         (WebKit::WebProcessProxy::removeWebPage):
335
336 2013-05-25  Santosh Mahto  <santosh.ma@samsung.com>
337
338         WebFrameProxy::didFailLoad clears frame title for no apparent reason
339         https://bugs.webkit.org/show_bug.cgi?id=116655
340
341         Reviewed by Alexey Proskuryakov.
342
343         * UIProcess/WebFrameProxy.cpp:
344         (WebKit::WebFrameProxy::didFailLoad):
345
346 2013-05-24  Seokju Kwon  <seokju.kwon@gmail.com>
347
348         [Qt][GTK] Build fix after r150669
349         https://bugs.webkit.org/show_bug.cgi?id=116751
350
351         Reviewed by Christophe Dumez.
352
353         * GNUmakefile.list.am:
354         * Target.pri:
355         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
356         (WebKit::WebEditorClient::getEditorCommandsForKeyEvent):
357
358 2013-05-24  Seokju Kwon  <seokju.kwon@gmail.com>
359
360         [EFL] Build fix after r150669
361         https://bugs.webkit.org/show_bug.cgi?id=116750
362
363         Reviewed by Anders Carlsson.
364
365         * CMakeLists.txt:
366         * WebProcess/Battery/WebBatteryManager.cpp:
367         (WebKit::WebBatteryManager::registerWebPage):
368         (WebKit::WebBatteryManager::unregisterWebPage):
369         * WebProcess/NetworkInfo/WebNetworkInfoManager.cpp:
370         (WebKit::WebNetworkInfoManager::registerWebPage):
371         (WebKit::WebNetworkInfoManager::unregisterWebPage):
372         (WebKit::WebNetworkInfoManager::bandwidth):
373         (WebKit::WebNetworkInfoManager::metered):
374         * WebProcess/WebCoreSupport/WebVibrationClient.cpp:
375         (WebKit::WebVibrationClient::vibrate):
376         (WebKit::WebVibrationClient::cancelVibration):
377         * WebProcess/soup/WebSoupRequestManager.cpp:
378         (WebKit::WebSoupRequestManager::didReceiveURIRequestData):
379         (WebKit::WebSoupRequestManager::send):
380
381 2013-05-24  Anders Carlsson  <andersca@apple.com>
382
383         MessageSender shouldn't be a class template
384         https://bugs.webkit.org/show_bug.cgi?id=116743
385
386         Reviewed by Andreas Kling.
387
388         Change MessageSender to be a proper abstract base class. Subclasses of MessageSender must
389         implement messageSenderConnection() as well as messageSenderDestinationID().
390
391         This reduces code size and will allow us to be more flexible with MessageSender in the future.
392
393         * NetworkProcess/NetworkResourceLoader.cpp:
394         (WebKit::NetworkResourceLoader::sendAbortingOnFailure):
395         (WebKit::NetworkResourceLoader::messageSenderConnection):
396         (WebKit):
397         (WebKit::NetworkResourceLoader::messageSenderDestinationID):
398         * NetworkProcess/NetworkResourceLoader.h:
399         (NetworkResourceLoader):
400         * NetworkProcess/mac/DiskCacheMonitor.h:
401         (DiskCacheMonitor):
402         * NetworkProcess/mac/DiskCacheMonitor.mm:
403         (WebKit::DiskCacheMonitor::messageSenderConnection):
404         (WebKit::DiskCacheMonitor::messageSenderDestinationID):
405         (WebKit):
406         * Platform/CoreIPC/MessageSender.h:
407         (CoreIPC):
408         (MessageSender):
409         (CoreIPC::MessageSender::send):
410         (CoreIPC::MessageSender::sendSync):
411         * Shared/ChildProcess.cpp:
412         (WebKit::ChildProcess::messageSenderConnection):
413         (WebKit):
414         (WebKit::ChildProcess::messageSenderDestinationID):
415         * Shared/ChildProcess.h:
416         (ChildProcess):
417         * Shared/Downloads/Download.cpp:
418         (WebKit::Download::messageSenderConnection):
419         (WebKit):
420         (WebKit::Download::messageSenderDestinationID):
421         * Shared/Downloads/Download.h:
422         (Download):
423         * Shared/Network/CustomProtocols/mac/CustomProtocolManagerMac.mm:
424         (WebKit::CustomProtocolManager::initialize):
425         * Shared/WebConnection.h:
426         (WebConnection):
427         * Shared/mac/SecItemShim.cpp:
428         (WebKit::sendSecItemRequest):
429         * UIProcess/WebConnectionToWebProcess.cpp:
430         (WebKit::WebConnectionToWebProcess::hasValidConnection):
431         (WebKit::WebConnectionToWebProcess::messageSenderConnection):
432         (WebKit::WebConnectionToWebProcess::messageSenderDestinationID):
433         * UIProcess/WebConnectionToWebProcess.h:
434         (WebConnectionToWebProcess):
435         * WebKit2.xcodeproj/project.pbxproj:
436         * WebProcess/Geolocation/WebGeolocationManager.cpp:
437         (WebKit::WebGeolocationManager::registerWebPage):
438         (WebKit::WebGeolocationManager::unregisterWebPage):
439         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
440         (WebKit::WebIconDatabaseProxy::retainIconForPageURL):
441         (WebKit::WebIconDatabaseProxy::releaseIconForPageURL):
442         (WebKit::WebIconDatabaseProxy::synchronousIconForPageURL):
443         (WebKit::WebIconDatabaseProxy::loadDecisionForIconURL):
444         (WebKit::WebIconDatabaseProxy::setIconURLForPageURL):
445         (WebKit::WebIconDatabaseProxy::setIconDataForIconURL):
446         * WebProcess/InjectedBundle/InjectedBundle.cpp:
447         (WebKit::InjectedBundle::postMessage):
448         (WebKit::InjectedBundle::postSynchronousMessage):
449         * WebProcess/Network/WebResourceLoader.cpp:
450         (WebKit::WebResourceLoader::messageSenderConnection):
451         (WebKit::WebResourceLoader::messageSenderDestinationID):
452         * WebProcess/Network/WebResourceLoader.h:
453         (WebResourceLoader):
454         * WebProcess/Notifications/WebNotificationManager.cpp:
455         (WebKit::WebNotificationManager::show):
456         (WebKit::WebNotificationManager::cancel):
457         (WebKit::WebNotificationManager::clearNotifications):
458         (WebKit::WebNotificationManager::didDestroyNotification):
459         * WebProcess/Plugins/PDF/PDFPlugin.mm:
460         (WebKit::PDFPlugin::writeItemsToPasteboard):
461         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
462         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
463         * WebProcess/Storage/StorageAreaMap.cpp:
464         (WebKit::StorageAreaMap::StorageAreaMap):
465         (WebKit::StorageAreaMap::~StorageAreaMap):
466         (WebKit::StorageAreaMap::setItem):
467         (WebKit::StorageAreaMap::removeItem):
468         (WebKit::StorageAreaMap::clear):
469         (WebKit::StorageAreaMap::loadValuesIfNeeded):
470         * WebProcess/WebConnectionToUIProcess.cpp:
471         (WebKit::WebConnectionToUIProcess::hasValidConnection):
472         (WebKit::WebConnectionToUIProcess::messageSenderConnection):
473         (WebKit::WebConnectionToUIProcess::messageSenderDestinationID):
474         * WebProcess/WebConnectionToUIProcess.h:
475         (WebConnectionToUIProcess):
476         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
477         (WebKit::WebChromeClient::windowRect):
478         (WebKit::WebChromeClient::focusedFrameChanged):
479         (WebKit::WebChromeClient::createWindow):
480         (WebKit::WebChromeClient::toolbarsVisible):
481         (WebKit::WebChromeClient::statusbarVisible):
482         (WebKit::WebChromeClient::menubarVisible):
483         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
484         (WebKit::WebChromeClient::runJavaScriptAlert):
485         (WebKit::WebChromeClient::runJavaScriptConfirm):
486         (WebKit::WebChromeClient::runJavaScriptPrompt):
487         (WebKit::WebChromeClient::shouldInterruptJavaScript):
488         (WebKit::WebChromeClient::exceededDatabaseQuota):
489         * WebProcess/WebCoreSupport/WebColorChooser.cpp:
490         (WebKit::WebColorChooser::WebColorChooser):
491         (WebKit::WebColorChooser::setSelectedColor):
492         (WebKit::WebColorChooser::endChooser):
493         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
494         (WebKit::WebFrameLoaderClient::dispatchDidReceiveIcon):
495         (WebKit::WebFrameLoaderClient::updateGlobalHistory):
496         (WebKit::WebFrameLoaderClient::updateGlobalHistoryRedirectLinks):
497         (WebKit::WebFrameLoaderClient::setTitle):
498         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
499         (WebKit::WebPlatformStrategies::populatePluginCache):
500         (WebKit::WebPlatformStrategies::getTypes):
501         (WebKit::WebPlatformStrategies::bufferForType):
502         (WebKit::WebPlatformStrategies::getPathnamesForType):
503         (WebKit::WebPlatformStrategies::stringForType):
504         (WebKit::WebPlatformStrategies::copy):
505         (WebKit::WebPlatformStrategies::changeCount):
506         (WebKit::WebPlatformStrategies::uniqueName):
507         (WebKit::WebPlatformStrategies::color):
508         (WebKit::WebPlatformStrategies::url):
509         (WebKit::WebPlatformStrategies::addTypes):
510         (WebKit::WebPlatformStrategies::setTypes):
511         (WebKit::WebPlatformStrategies::setBufferForType):
512         (WebKit::WebPlatformStrategies::setPathnamesForType):
513         (WebKit::WebPlatformStrategies::setStringForType):
514         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
515         (WebKit::WebPopupMenu::show):
516         (WebKit::WebPopupMenu::hide):
517         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp:
518         (WebKit::WebSearchPopupMenu::saveRecentSearches):
519         (WebKit::WebSearchPopupMenu::loadRecentSearches):
520         * WebProcess/WebPage/EventDispatcher.cpp:
521         (WebKit::EventDispatcher::sendDidReceiveEvent):
522         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
523         (WebKit::updateBackForwardItem):
524         (WebKit::WebBackForwardListProxy::itemAtIndex):
525         (WebKit::WebBackForwardListProxy::backListCount):
526         (WebKit::WebBackForwardListProxy::forwardListCount):
527         * WebProcess/WebPage/WebInspector.cpp:
528         (WebKit::WebInspector::createInspectorPage):
529         (WebKit::WebInspector::didClose):
530         (WebKit::WebInspector::bringToFront):
531         (WebKit::WebInspector::inspectedURLChanged):
532         (WebKit::WebInspector::save):
533         (WebKit::WebInspector::append):
534         (WebKit::WebInspector::attachBottom):
535         (WebKit::WebInspector::attachRight):
536         (WebKit::WebInspector::detach):
537         (WebKit::WebInspector::setAttachedWindowHeight):
538         (WebKit::WebInspector::setAttachedWindowWidth):
539         (WebKit::WebInspector::setToolbarHeight):
540         (WebKit::WebInspector::updateDockingAvailability):
541         (WebKit::WebInspector::sendMessageToRemoteFrontend):
542         * WebProcess/WebPage/WebPage.cpp:
543         (WebKit::WebPage::messageSenderConnection):
544         (WebKit):
545         (WebKit::WebPage::messageSenderDestinationID):
546         * WebProcess/WebPage/WebPage.h:
547         (WebPage):
548         * WebProcess/WebPage/mac/WebPageMac.mm:
549         (WebKit::WebPage::executeKeypressCommandsInternal):
550         (WebKit::WebPage::handleEditingKeyboardEvent):
551         * WebProcess/WebProcess.cpp:
552         (WebKit::WebProcess::ensureNetworkProcessConnection):
553         (WebKit::WebProcess::shouldTerminate):
554
555 2013-05-24  Tim Horton  <timothy_horton@apple.com>
556
557         Animated GIFs don't repaint after TiledCoreAnimationDrawingArea un-suspends painting
558         https://bugs.webkit.org/show_bug.cgi?id=116744
559         <rdar://problem/13973514>
560
561         Reviewed by Simon Fraser.
562
563         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
564         (WebKit::TiledCoreAnimationDrawingArea::resumePainting):
565         Force WebCore to repaint animated images when painting is resumed.
566
567 2013-05-24  Christophe Dumez  <ch.dumez@sisa.samsung.com>
568
569         Remove custom code for webkitAudioContext global constructor getter
570         https://bugs.webkit.org/show_bug.cgi?id=116530
571
572         Reviewed by Geoffrey Garen.
573
574         Use RuntimeEnabledFeatures instead of WebCore Settings to toggle Web Audio support.
575
576         * WebProcess/InjectedBundle/InjectedBundle.cpp:
577         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
578         * WebProcess/WebPage/WebPage.cpp:
579         (WebKit::WebPage::updatePreferences):
580
581 2013-05-24  Thomas Deniau  <deniau@apple.com>
582
583         Add more lines to the context during Dictionary lookups
584         https://bugs.webkit.org/show_bug.cgi?id=115256
585
586         Reviewed by Ryosuke Niwa.
587
588         * WebProcess/WebPage/mac/WebPageMac.mm:
589         (WebKit::WebPage::performDictionaryLookupAtLocation):
590         Instead of using the current paragraph as the context (which stops at
591         line breaks), get a few lines before and after the point, so that the
592         context contains at least four lines in each direction.
593         This way the Dictionary will be able to look up things that extend past
594         the current line.
595
596 2013-05-24  Anders Carlsson  <andersca@apple.com>
597
598         Intermittent crash when typing in Address Bar
599         https://bugs.webkit.org/show_bug.cgi?id=116728
600         <rdar://problem/13976781>
601
602         Reviewed by Sam Weinig.
603
604         If a web process connection has been removed from the storage manager because we disconnected it
605         since there were no more active pages associated with the web process, we'll fail to find it here
606         so just return early instead of crashing.
607
608         * UIProcess/Storage/StorageManager.cpp:
609         (WebKit::StorageManager::destroyStorageMap):
610
611 2013-05-24  Andreas Kling  <akling@apple.com>
612
613         Typing in Safari's unified field causes unnecessary web content repaints.
614         <http://webkit.org/b/116703>
615
616         Reviewed by Andy Estes.
617
618         * WebProcess/WebPage/FindController.cpp:
619         (WebKit::FindController::countStringMatches):
620
621             Call WebCore::Page::countMatchesForText() instead of markAllMatchesForText(). If the search string
622             is found inside the page content, the renderer containing that text will no longer be repainted.
623
624 2013-05-23  Ryuan Choi  <ryuan.choi@samsung.com>
625
626         [WK2][EFL][QT] Build break after r150610
627         https://bugs.webkit.org/show_bug.cgi?id=116699
628
629         Reviewed by Csaba Osztrogonác.
630
631         * UIProcess/WebPageProxy.cpp:
632         (WebKit::WebPageProxy::findPlugin): Initialized pluginProcessSandboxPolicy.
633
634 2013-05-23  Anders Carlsson  <andersca@apple.com>
635
636         Shim Flash plug-in to allow its updater to run
637         https://bugs.webkit.org/show_bug.cgi?id=116692
638         <rdar://problem/13938510>
639
640         Reviewed by Sam Weinig.
641
642         * PluginProcess/PluginProcess.h:
643         * PluginProcess/mac/PluginProcessMac.mm:
644         (WebKit::replacedNSConcreteTask_launch):
645         (WebKit::initializeCocoaOverrides):
646         Patch -[NSConcreteTask launch] to call PluginProcess::launchProcess.
647
648         (WebKit::PluginProcess::launchProcess):
649         Send a LaunchProcess message to the UI process.
650
651         * UIProcess/Plugins/PluginProcessProxy.cpp:
652         * UIProcess/Plugins/PluginProcessProxy.h:
653         Remove PluginProcessProxy::didReceiveMessage.
654
655         (PluginProcessProxy):
656         * UIProcess/Plugins/PluginProcessProxy.messages.in:
657         Add LaunchProcess message and remove LegacyReceiver attribute.
658
659         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
660         (WebKit::isFlashUpdater):
661         Helper function to determine whether the process is the flash updater.
662
663         (WebKit::shouldLaunchProcess):
664         Return whether we should launch this process.
665
666         (WebKit::PluginProcessProxy::launchProcess):
667         Determine if we should launch this process and then do so.
668
669 2013-05-23  Anders Carlsson  <andersca@apple.com>
670
671         Don't run all plug-ins unsandboxed
672         https://bugs.webkit.org/show_bug.cgi?id=116690
673         <rdar://problem/13975569>
674
675         Reviewed by Jessie Berlin.
676
677         Remove debugging code.
678
679         * UIProcess/WebPageProxy.cpp:
680         (WebKit::WebPageProxy::findPlugin):
681
682 2013-05-23  Anders Carlsson  <andersca@apple.com>
683
684         Crash in convertMainResourceLoadToDownload when downloading file by option-return
685         https://bugs.webkit.org/show_bug.cgi?id=116451
686
687         Reviewed by Andreas Kling.
688
689         If the main resource loader is null, create a new download instead since there's no existing loader to convert.
690
691         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
692         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
693         * WebProcess/WebPage/WebFrame.cpp:
694         (WebKit::WebFrame::convertMainResourceLoadToDownload):
695
696 2013-05-22  Alexey Proskuryakov  <ap@apple.com>
697
698         <rdar://problem/13849260> Sandbox violations reading .CFUserTextEncoding
699
700         Reviewed by Dan Bernstein.
701
702         * WebProcess/com.apple.WebProcess.sb.in: Allow this.
703
704 2013-05-23  Gavin Barraclough  <barraclough@apple.com>
705
706         Move posix_spawn onto a zero delay timer
707         https://bugs.webkit.org/show_bug.cgi?id=116682
708
709         Reviewed by Anders Carlson.
710
711         <rdar://problem/13973468>
712
713         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
714         (ReexecInfo):
715             - struct to hold info from the XPC message.
716         (WebKit::reexec):
717             - moved call to posix_spawn out to this helper.
718         (WebKit::reexecCallBack):
719             - calls reexec.
720         (WebKit::XPCServiceEventHandler):
721             - removed call to posix_spawn; schedule a call to reexecCallBack.
722
723 2013-05-23  Csaba Osztrogonác  <ossy@webkit.org>
724
725         [cmake] Fix generating-forwarding-headers rule after r150460
726         https://bugs.webkit.org/show_bug.cgi?id=116659
727
728         Reviewed by Christophe Dumez.
729
730         * CMakeLists.txt: Typo fix.
731
732 2013-05-23  Anton Obzhirov  <a.obzhirov@samsung.com>
733
734         [GTK] Remote Web Inspector sometimes won't serve any content
735         https://bugs.webkit.org/show_bug.cgi?id=116225
736
737         Reviewed by Gustavo Noronha Silva.
738
739         Added an option to use environment variable to set up path to
740         inspector server files. Implementation is similar to InspectorClientGtk
741         implementation.
742
743         * UIProcess/InspectorServer/WebInspectorServer.h:
744         (WebInspectorServer):
745         * UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp:
746         (WebKit::WebInspectorServer::platformResourceForPath):
747         (WebKit::WebInspectorServer::inspectorServerFilesPath):
748         (WebKit):
749
750 2013-05-23  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
751
752         [EFL][WK2] Use WK2 C API in ewk_view_pagination_mode_set|get
753         https://bugs.webkit.org/show_bug.cgi?id=116657
754
755         Reviewed by Christophe Dumez.
756
757         WKPageGet|SetPaginationMode APIs is present in WK2 C APIs. So, we need to use them for
758         ewk_view_pagination_mode_set|get.
759
760         Besides we don't need to use WebCore namespace anymore.
761
762         * UIProcess/API/efl/ewk_view.cpp:
763         (ewk_view_pagination_mode_set):
764         (ewk_view_pagination_mode_get):
765
766 2013-05-23  Roland Takacs  <rtakacs@inf.u-szeged.hu>
767
768         Support frame instrumentation for coordinated graphics
769         https://bugs.webkit.org/show_bug.cgi?id=115260
770
771         Reviewed by Andreas Kling.
772
773         Enabled supportsFrameInstrumentation on ports that use coordinated graphics
774         by calling didBeginFrame().
775
776         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
777         (WebKit::WebInspectorClient::supportsFrameInstrumentation):
778         (WebKit):
779         * WebProcess/WebCoreSupport/WebInspectorClient.h:
780         (WebInspectorClient):
781         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
782         (WebKit::CoordinatedLayerTreeHost::syncDisplayState):
783
784 2013-05-22  Dean Jackson  <dino@apple.com>
785
786         Don't snapshot plugins that can't be snapshotted
787         https://bugs.webkit.org/show_bug.cgi?id=116490
788
789         Reviewed by Tim Horton.
790
791         Some plugins, such as QuickTime, don't support snapshotting. We're
792         planning on another way to capture snapshots, but in the meantime make
793         sure that they don't fail to initialise because they were told to
794         not use accelerated rendering.
795
796         Expose a new message on the plugins so that they can tell the PluginView
797         if they support snapshotting or not.
798
799         * PluginProcess/PluginControllerProxy.cpp:
800         (WebKit::PluginControllerProxy::supportsSnapshotting): New method.
801         * PluginProcess/PluginControllerProxy.h: Ditto.
802         * PluginProcess/PluginControllerProxy.messages.in: Message signature.
803
804         * WebProcess/Plugins/Netscape/NetscapePlugin.h: Add supportsSnapshotting.
805         * WebProcess/Plugins/PDF/SimplePDFPlugin.h: Ditto.
806         * WebProcess/Plugins/Plugin.h: Ditto - pure virtual here.
807
808         * WebProcess/Plugins/PluginProxy.cpp:
809         (WebKit::PluginProxy::supportsSnapshotting): Send the message to the plugin process and return the results.
810         * WebProcess/Plugins/PluginProxy.h:
811
812         * WebProcess/Plugins/PluginView.cpp:
813         (WebKit::PluginView::didInitializePlugin): If the snapshotting plugin has a layer, make
814             sure to add it to the tree.
815         (WebKit::PluginView::isAcceleratedCompositingEnabled): Snapshotting plugins can use
816             accelerated compositing, just like normal plugins.
817         (WebKit::PluginView::pluginSnapshotTimerFired): If the plugin doesn't allow snapshotting,
818             immediately restart it.
819
820 2013-05-22  Anders Carlsson  <andersca@apple.com>
821
822         Fix crash when closing a page that's trying to access session storage
823         https://bugs.webkit.org/show_bug.cgi?id=116634
824         <rdar://problem/13904054>
825
826         Reviewed by Geoffrey Garen.
827
828         It is possible for the StorageManager to get messages from a web page that has already been closed by the UI process.
829         If that happens, just ignore the messages.
830
831         * UIProcess/Storage/StorageManager.cpp:
832         (WebKit::StorageManager::createSessionStorageMap):
833         (WebKit::StorageManager::getValues):
834         (WebKit::StorageManager::setItem):
835         (WebKit::StorageManager::removeItem):
836         (WebKit::StorageManager::clear):
837         (WebKit::StorageManager::destroySessionStorageNamespaceInternal):
838
839 2013-05-22  Alexey Proskuryakov  <ap@apple.com>
840
841         Crashes in NetworkProcess due to incorrect private browsing session tracking
842         https://bugs.webkit.org/show_bug.cgi?id=116628
843
844         Reviewed by Brady Eidson.
845
846         The current API for private browsing makes it extremely difficult to track sessions.
847         Private browsing is enabled via WKPreferences, but the session is shared, so it
848         has to be maintained while there is any chance that any page group anywhere still
849         needs it.
850
851         This patch fixes some of the issues, but ultimately, I think that we'll just need
852         to deprecate and replace the API.
853
854         * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::storageSession):
855         There are valid scenarios where privateBrowsingEnabled is true, but there is no
856         private browsing session. Handle that without crashing, although this unfortunately
857         means that it will be harder to spot logic errors when using a wrong session.
858         (WebKit::NetworkConnectionToWebProcess::registerBlobURL): Removed an obsolete FIXME.
859
860         * NetworkProcess/mac/RemoteNetworkingContext.h: Changed privateBrowsingSession()
861         to return a pointer, as no caller could know when it was safe to call it.
862
863         * NetworkProcess/mac/RemoteNetworkingContext.mm:
864         (WebKit::RemoteNetworkingContext::storageSession): Handle the case where private
865         browsing session is unexpectedly missing without crashing.
866         (WebKit::RemoteNetworkingContext::privateBrowsingSession): Changed to return a pointer.
867
868         * UIProcess/WebContext.cpp: (WebKit::WebContext::ensureNetworkProcess):
869         Actually initialize privateBrowsingEnabled creation parameter. It would be very
870         difficult to figure out 100% reliably whether NetworkProcess needs a private browsing
871         session with the current API, but for existing clients, looking at
872         m_privateBrowsingEnterCount is good enough. Certainly better than not initializing.
873
874         * WebProcess/InjectedBundle/InjectedBundle.cpp:
875         (WebKit::InjectedBundle::setPrivateBrowsingEnabled): Added a FIXME.
876
877 2013-05-22  Tim Horton  <timothy_horton@apple.com>
878
879         [wk2] Should be able to make tiled WKViews clip to the view's exposed rect without using autolayout
880         https://bugs.webkit.org/show_bug.cgi?id=116625
881         <rdar://problem/13962816>
882
883         Reviewed by Anders Carlsson.
884
885         The two modes are not dependent; it should be possible to enable
886         clips-to-exposed-rect without using autolayout. This enables apps to
887         make very large tiled WKViews that don't create tiles for the whole
888         area of the view (and also disables scrolling, since that is currently
889         incompatible with clipping to the exposed rect).
890
891         * UIProcess/API/mac/WKView.mm:
892         (-[WKView setFrameSize:]):
893         (-[WKView _updateWindowAndViewFrames]):
894         (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
895         (-[WKView enableFrameSizeUpdates]):
896         (-[WKView forceAsyncDrawingAreaSizeUpdate:]):
897         Rename _expandsToFitContentViaAutoLayout to _clipsToVisibleRect for accuracy.
898
899         (-[WKView setMinimumWidthForAutoLayout:]):
900         Factor clips-to-sisible-rect toggle out into setShouldClipToVisibleRect.
901
902         (-[WKView shouldClipToVisibleRect]):
903         (-[WKView setShouldClipToVisibleRect:]):
904         Allow setting clips-to-visible-rect without autolayout.
905
906         * UIProcess/API/mac/WKViewPrivate.h:
907         Add shouldClipToVisibleRect property.
908
909 2013-05-22  Alexey Proskuryakov  <ap@apple.com>
910
911         Remove unused private browsing override support
912         <rdar://problem/11969491>
913
914         Rubber-stamped by Sam Weinig.
915
916         Private browsing override is unused, and it complicates tracking of private
917         browsing sessions in UI process (in fact, it doesn't plug into this tracking at all,
918         so we would just assert if we used the API).
919
920         * Shared/WebPageCreationParameters.cpp:
921         (WebKit::WebPageCreationParameters::encode):
922         (WebKit::WebPageCreationParameters::decode):
923         * Shared/WebPageCreationParameters.h:
924         * UIProcess/API/C/WKPage.cpp:
925         * UIProcess/API/C/WKPagePrivate.h:
926         * UIProcess/WebPageProxy.cpp:
927         (WebKit::WebPageProxy::WebPageProxy):
928         (WebKit::WebPageProxy::creationParameters):
929         * UIProcess/WebPageProxy.h:
930         * WebProcess/WebPage/WebPage.cpp:
931         (WebKit::WebPage::WebPage):
932         (WebKit::WebPage::updatePreferences):
933         * WebProcess/WebPage/WebPage.h:
934         * WebProcess/WebPage/WebPage.messages.in:
935
936 2013-05-22  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
937
938         [EFL][WK2] Change Ewk_Context_Menu_Item's parent menu to raw pointer
939         https://bugs.webkit.org/show_bug.cgi?id=116549
940
941         Reviewed by Christophe Dumez.
942
943         A context menu item should have only a pointer to parent menu instead
944         of owning parent menu.
945
946         * UIProcess/API/efl/ewk_context_menu_item.cpp:
947         (EwkContextMenuItem::EwkContextMenuItem):
948         * UIProcess/API/efl/ewk_context_menu_item_private.h:
949         (EwkContextMenuItem::create):
950         (EwkContextMenuItem::parentMenu):
951         (EwkContextMenuItem):
952
953 2013-05-22  Csaba Osztrogonác  <ossy@webkit.org>
954
955         [Qt][WK2] Unreviewed buildfix after r150484.
956
957         * UIProcess/Plugins/qt/PluginProcessProxyQt.cpp:
958         (WebKit::PluginProcessProxy::platformGetLaunchOptions):
959
960 2013-05-21  Andreas Kling  <akling@apple.com>
961
962         REGRESSION(r150491): WebKit2.CloseThenTerminate asserting below WebContext::disconnectProcess().
963         <http://webkit.org/b/116588>
964
965         Reviewed by Sam Weinig.
966
967         Do an early return from WebProcessProxy::requestTermination() if there is no child process
968         connection to terminate.
969
970         * UIProcess/WebProcessProxy.cpp:
971         (WebKit::WebProcessProxy::requestTermination):
972
973 2013-05-21  Mark Rowe  <mrowe@apple.com>
974
975         <rdar://problem/13915556> Sluggish scrolling in web content
976
977         Reviewed by Gavin Barraclough.
978
979         * Shared/mac/ChildProcessMac.mm:
980         (WebKit::ChildProcess::setProcessSuppressionEnabled): When process suppression is disabled, low latency is important.
981
982 2013-05-21  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
983
984         Fix build break after r150484
985
986         Unreviewed, fix build break on EFL, GTK.
987
988         * UIProcess/Plugins/PluginInfoStore.cpp:
989         (WebKit::PluginInfoStore::defaultLoadPolicyForPlugin):
990         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
991         (WebKit::PluginProcessProxy::platformGetLaunchOptions):
992
993 2013-05-21  Andreas Kling  <akling@apple.com>
994
995         PPT: Closing tab that is hung or chewing 100% CPU leaves abandoned WebProcess.
996         <http://webkit.org/b/116464>
997         <rdar://problem/10103795>
998
999         Reviewed by Anders Carlsson.
1000
1001         Simplify the web process sacrifice ritual. Instead of murderizing the process when its last tab closes,
1002         just shut down the CoreIPC connection from the UI process. The web process, upon noticing this,
1003         will start a 10 second watchdog timer, and if it hasn't shut down by the time it fires, well, it'll shut down.
1004
1005         (WebKit::WebProcessProxy::removeWebPage):
1006
1007             When the last page is removed from a WebProcessProxy, disconnect the process so that it'll die off
1008             eventually, even if the WebPage::Close message never gets properly handled.
1009
1010         * Shared/ChildProcessProxy.h:
1011         * Shared/ChildProcessProxy.cpp:
1012         (WebKit::ChildProcessProxy::abortProcessLaunchIfNeeded):
1013
1014             Added a helper to abort any in-progress launch of a new web process. Otherwise we'll have a race
1015             where the exiting web process may get re-used for a new tab.
1016
1017         * UIProcess/WebProcessProxy.h:
1018         * UIProcess/WebProcessProxy.cpp:
1019         (WebKit::WebProcessProxy::WebProcessProxy):
1020         (WebKit::WebProcessProxy::enableSuddenTermination):
1021         (WebKit::WebProcessProxy::disableSuddenTermination):
1022
1023             Remove WebProcessProxy's sudden termination counter. The web process will do what it needs in
1024             response to the WebPage::Close message. We still forward these calls to NSProcessInfo on Mac though.
1025
1026 2013-05-21  Anders Carlsson  <andersca@apple.com>
1027
1028         Fix build.
1029
1030         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
1031         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
1032         Stop using lambdas :(
1033
1034 2013-05-21  Anders Carlsson  <andersca@apple.com>
1035
1036         Provide an API to run sandboxed plug-ins outside of their sandbox
1037         https://bugs.webkit.org/show_bug.cgi?id=116578
1038
1039         Reviewed by Andreas Kling.
1040
1041         * Platform/CoreIPC/HandleMessage.h:
1042         (CoreIPC::callMemberFunction):
1043         Add new overload.
1044
1045         * PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm:
1046         (WebKit::PluginProcessMainDelegate::getExtraInitializationData):
1047         Handle "disable-sandbox".
1048
1049         * PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm:
1050         (WebKit::PluginServiceInitializerDelegate::getExtraInitializationData):
1051         Handle "disable-sandbox".
1052         
1053         * PluginProcess/PluginProcess.h:
1054         Move Type to PluginProcessAttributes and remove hash traits for type.
1055         
1056         * PluginProcess/mac/PluginProcessMac.mm:
1057         (WebKit::PluginProcess::platformInitializePluginProcess):
1058         Update for new type name.
1059
1060         (WebKit::PluginProcess::initializeSandbox):
1061         Return early if the sandbox is disabled.
1062
1063         * Shared/Plugins/Netscape/PluginInformation.cpp:
1064         (WebKit::getPluginModuleInformation):
1065         PluginInfoStore::policyForPlugin has been renamed to PluginInfoStore::defaultLoadPolicyForPlugin.
1066
1067         * Shared/Plugins/PluginModuleInfo.h:
1068         Add PluginModuleLoadUnsandboxed.
1069
1070         * Shared/Plugins/PluginProcessAttributes.h: Added.
1071         Add new header with various plug-in process attributes.
1072
1073         * Shared/Plugins/PluginProcessCreationParameters.h:
1074         Change type enum.
1075
1076         * UIProcess/API/C/WKAPICast.h:
1077         (WebKit::toWKPluginLoadPolicy):
1078         (WebKit::toPluginModuleLoadPolicy):
1079         Handle the unsandboxed enum.
1080
1081         * UIProcess/API/C/WKPage.h:
1082         Add kWKPluginLoadPolicyLoadUnsandboxed.
1083
1084         * UIProcess/Plugins/PluginInfoStore.h:
1085         Rename policyForPlugin to defaultLoadPolicyForPlugin.
1086
1087         * UIProcess/Plugins/PluginProcessManager.cpp:
1088         (WebKit::PluginProcessManager::pluginProcessToken):
1089         Add new helper function for getting a token given plug-in attributes.
1090
1091         (WebKit::PluginProcessManager::getPluginProcessConnection):
1092         This now takes a pluginProcessToken.
1093
1094         (WebKit::PluginProcessManager::getSitesWithData):
1095         Make sure to call pluginProcessToken.
1096
1097         (WebKit::PluginProcessManager::clearSiteData):
1098         Ditto.
1099
1100         (WebKit::PluginProcessManager::getOrCreatePluginProcess):
1101         This now takes a token.
1102
1103         * UIProcess/Plugins/PluginProcessProxy.cpp:
1104         (WebKit::PluginProcessProxy::create):
1105         (WebKit::PluginProcessProxy::PluginProcessProxy):
1106         Pass the PluginProcessAttributes as well as the plug-in process token.
1107
1108         (WebKit::PluginProcessProxy::getLaunchOptions):
1109         Pass the plug-in process attributes to platformGetLaunchOptions.
1110
1111         (WebKit::PluginProcessProxy::didClose):
1112         Pass the token to PluginProcessCrashed.
1113
1114         (WebKit::PluginProcessProxy::didFinishLaunching):
1115         Update for type change.
1116
1117         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
1118         (WebKit::shouldBlockPlugin):
1119         (WebKit::PluginInfoStore::defaultLoadPolicyForPlugin):
1120         Rename policyForPlugin to defaultLoadPolicyForPlugin.
1121
1122         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1123         (WebKit::PluginProcessProxy::platformGetLaunchOptions):
1124         Set the "disable-sandbox" data if needed.
1125
1126         (WebKit::PluginProcessProxy::platformInitializePluginProcess):
1127         (WebKit::PluginProcessProxy::openPluginPreferencePane):
1128         Get the module info from m_pluginProcessAttributes.
1129
1130         * UIProcess/WebPageProxy.cpp:
1131         (WebKit::WebPageProxy::findPlugin):
1132         This now returns a token.
1133
1134         * UIProcess/WebPageProxy.messages.in:
1135         FindPlugin now returns a token instead of the path.
1136
1137         * UIProcess/WebProcessProxy.cpp:
1138         (WebKit::WebProcessProxy::getPluginProcessConnection):
1139         Pass the token to the plug-in process manager.
1140
1141         * UIProcess/WebProcessProxy.messages.in:
1142         This now takes a token.
1143
1144         * WebKit2.xcodeproj/project.pbxproj:
1145         Add new files.
1146
1147         * WebProcess/Plugins/PluginProcessConnection.cpp:
1148         (WebKit::PluginProcessConnection::PluginProcessConnection):
1149         This now takes a token.
1150
1151         * WebProcess/Plugins/PluginProcessConnection.h:
1152         (WebKit::PluginProcessConnection::create):
1153         (WebKit::PluginProcessConnection::pluginProcessToken):
1154         Create this with a token instead of a path and process type.
1155
1156         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
1157         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
1158         This now takes a token.
1159
1160         (WebKit::PluginProcessConnectionManager::pluginProcessCrashed):
1161         Ditto.
1162
1163         * WebProcess/Plugins/PluginProcessConnectionManager.messages.in:
1164         PluginProcessCrashed now takes a token.
1165
1166         * WebProcess/Plugins/PluginProxy.cpp:
1167         (WebKit::PluginProxy::create):
1168         (WebKit::PluginProxy::PluginProxy):
1169         These now take tokens.
1170
1171         (WebKit::PluginProxy::initialize):
1172         Pass the token when getting the connection.
1173
1174         * WebProcess/WebPage/WebPage.cpp:
1175         (WebKit::WebPage::createPlugin):
1176         Get the token from the UI process and pass it to the PluginProxy.
1177
1178         (WebKit::WebPage::canPluginHandleResponse):
1179         Update now that FindPlugin returns a token.
1180
1181 2013-05-21  Martin Robinson  <mrobinson@igalia.com>
1182
1183         [GTK] [CMake] Add support for building WebKit2
1184         https://bugs.webkit.org/show_bug.cgi?id=116372
1185
1186         Reviewed by Gustavo Noronha Silva.
1187
1188         * CMakeLists.txt: Add common directories to the common include list and remove UIProcess/PageViewportController.cpp
1189         from the source list since it should only be compiled for WebKitEFL. Instead of taking explicit forwarding-header
1190         dependencies accept a list of "tacked-on" dependencies for WebKit2. This allows GTK+ to specify its extra fake
1191         installed header step.
1192         * PlatformEfl.cmake: Remove common include directories and add UIProcess/PageViewportController.cpp to the source
1193         list. Fix up forwarding header dependencies now.
1194         * PlatformGTK.cmake: Added.
1195         * config.h: First check whether this is a CMake build and then fall back to the autotools header.
1196
1197 2013-05-21  Zan Dobersek  <zdobersek@igalia.com>
1198
1199         [GTK] Compile everything in C++11 mode
1200         https://bugs.webkit.org/show_bug.cgi?id=116452
1201
1202         Reviewed by Anders Carlsson.
1203
1204         * GNUmakefile.am: Remove the -std=c++11 flags from the various CPPFLAGS lists, the mode is now specified
1205         by default for all the C++ source code in SetupCompilerFlags.m4.
1206
1207 2013-05-21  Jessie Berlin  <jberlin@apple.com>
1208
1209         Expose a way to know when forms are added to a page or when form controls are added to a form
1210         in the injected bundle
1211         https://bugs.webkit.org/show_bug.cgi?id=116334
1212
1213         Reviewed by Alexey Proskuryakov.
1214
1215         Add shouldNotifyOnFormChanges and didAssociateFormControls to the WKBundlePageFormClient.
1216
1217         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1218         Add the new callbacks as part of version 2 of the WKBundlePageFormClient.
1219
1220         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
1221         (WebKit::InjectedBundlePageFormClient::didAssociateFormControls):
1222         Pass the message along to the client if the client has a handler.
1223         (WebKit::InjectedBundlePageFormClient::shouldNotifyOnFormChanges):
1224         Ditto.
1225         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.h:
1226
1227         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1228         (WebKit::WebChromeClient::didAssociateFormControls):
1229         Tell the injected bundle form client for the page.
1230         (WebKit::WebChromeClient::shouldNotifyOnFormChanges):
1231         Ditto.
1232         * WebProcess/WebCoreSupport/WebChromeClient.h:
1233
1234 2013-05-21  Michael Brüning  <michael.bruning@digia.com>
1235
1236         [Qt][WK2] Fix Mountain Lion builds after r150277.
1237         https://bugs.webkit.org/show_bug.cgi?id=116467
1238
1239         Reviewed by Jocelyn Turcotte.
1240
1241         * Shared/API/c/WKBase.h:
1242
1243 2013-05-20  Lucas Forschler  <lforschler@apple.com>
1244
1245     Rollout r150398.
1246
1247 2013-05-20  Zan Dobersek  <zdobersek@igalia.com>
1248
1249         [GTK] Fix concatenations of string literals that are not C++11-compliant
1250         https://bugs.webkit.org/show_bug.cgi?id=116449
1251
1252         Reviewed by Martin Robinson.
1253
1254         Fix the problematic concatenations of string literals so they are compilable under the C++11 standard. This
1255         is simply a matter of separating the string and the string literal that are being concatenated with a space.
1256
1257         * UIProcess/API/gtk/tests/TestPrinting.cpp:
1258         (testPrintOperationPrint):
1259         * UIProcess/API/gtk/tests/WebExtensionTest.cpp:
1260         (methodCallCallback):
1261
1262 2013-05-20  Commit Queue  <commit-queue@webkit.org>
1263
1264         Unreviewed, rolling out r150384.
1265         http://trac.webkit.org/changeset/150384
1266         https://bugs.webkit.org/show_bug.cgi?id=116513
1267
1268         Not ready for primetime. (Requested by kling on #webkit).
1269
1270         * UIProcess/WebProcessProxy.cpp:
1271         (WebKit::WebProcessProxy::WebProcessProxy):
1272         (WebKit::WebProcessProxy::removeWebPage):
1273         * UIProcess/WebProcessProxy.h:
1274         (WebProcessProxy):
1275
1276 2013-05-20  Martin Robinson  <mrobinson@igalia.com>
1277
1278         Remove SharedMemoryGtk.cpp
1279         https://bugs.webkit.org/show_bug.cgi?id=116457
1280
1281         Reviewed by Andreas Kling.
1282
1283         * Platform/gtk/SharedMemoryGtk.cpp: Removed.
1284
1285 2013-05-20  Jessie Berlin  <jberlin@apple.com>
1286
1287         Expose a way to know when forms are added to a page or when form controls are added to a form
1288         in the injected bundle
1289         https://bugs.webkit.org/show_bug.cgi?id=116334
1290
1291         Reviewed by Alexey Proskuryakov.
1292
1293         Add shouldNotifyOnFormChanges and didAssociateFormControls to the WKBundlePageFormClient.
1294
1295         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1296         Add the new callbacks as part of version 2 of the WKBundlePageFormClient.
1297
1298         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
1299         (WebKit::InjectedBundlePageFormClient::didAssociateFormControls):
1300         Pass the message along to the client if the client has a handler.
1301         (WebKit::InjectedBundlePageFormClient::shouldNotifyOnFormChanges):
1302         Ditto.
1303         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.h:
1304
1305         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1306         (WebKit::WebChromeClient::didAssociateFormControls):
1307         Tell the injected bundle form client for the page.
1308         (WebKit::WebChromeClient::shouldNotifyOnFormChanges):
1309         Ditto.
1310         * WebProcess/WebCoreSupport/WebChromeClient.h:
1311
1312 2013-05-20  Tim Horton  <timothy_horton@apple.com>
1313
1314         Clients should have a way to extend rendering suppression
1315         https://bugs.webkit.org/show_bug.cgi?id=116463
1316         <rdar://problem/13738496>
1317
1318         Reviewed by Andy Estes.
1319
1320         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1321         (WKBundlePageExtendIncrementalRenderingSuppression): Added.
1322         (WKBundlePageStopExtendingIncrementalRenderingSuppression): Added.
1323         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
1324         These only have any effect if SuppressesIncrementalRendering is also enabled.
1325
1326         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1327         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
1328         Inform the FrameView if there are any outstanding rendering suppression tokens.
1329
1330         * WebProcess/WebPage/WebPage.cpp:
1331         (WebKit::WebPage::WebPage):
1332         (WebKit::WebPage::extendIncrementalRenderingSuppression):
1333         Return the next available rendering suppression token.
1334         Add it to the list of active tokens.
1335         Inform the FrameView that we want to suppress rendering.
1336
1337         (WebKit::WebPage::stopExtendingIncrementalRenderingSuppression):
1338         Remove the given token from the list of active tokens.
1339         Un-suppress rendering if appropriate.
1340
1341         * WebProcess/WebPage/WebPage.h:
1342         (WebKit::WebPage::shouldExtendIncrementalRenderingSuppression):
1343         Return if there are any active rendering suppression tokens.
1344
1345 2013-05-20  Andreas Kling  <akling@apple.com>
1346
1347         PPT: Closing tab that is hung or chewing 100% CPU leaves abandoned WebProcess.
1348         <http://webkit.org/b/116464>
1349         <rdar://problem/10103795>
1350
1351         Reviewed by Anders Carlsson.
1352
1353         Give the web process a 10 second chance to exit nicely after closing the last tab belonging to it.
1354         This code only runs if there was something on the page (e.g an unload/beforeunload event handler)
1355         preventing the UI process from killing it right away.
1356
1357         * UIProcess/WebProcessProxy.cpp:
1358         (WebKit::WebProcessProxy::WebProcessProxy):
1359         (WebKit::WebProcessProxy::removeWebPage):
1360         (WebKit::WebProcessProxy::forcefulTerminationTimerFired):
1361         * UIProcess/WebProcessProxy.h:
1362         (WebProcessProxy):
1363
1364 2013-05-20  Anders Carlsson  <andersca@apple.com>
1365
1366         Add helper function for converting a KeyedCodingValue to a CFTypeRef
1367         https://bugs.webkit.org/show_bug.cgi?id=116461
1368
1369         Reviewed by Tim Horton.
1370
1371         * Shared/cf/KeyedCodingValueCF.cpp: Added.
1372         * Shared/cf/KeyedCodingValueCF.h: Added.
1373
1374         * WebKit2.xcodeproj/project.pbxproj:
1375
1376 2013-05-20  Anders Carlsson  <andersca@apple.com>
1377
1378         Begin stubbing out a new KeyedEncoder class
1379         https://bugs.webkit.org/show_bug.cgi?id=116456
1380
1381         Reviewed by Sam Weinig.
1382
1383         This class (and it's coming counterpart, KeyedDecoder) will be used for serializing
1384         object graphs to a tree-like structure of dictionaries. It is up to individual ports to
1385         serialize them further (for example, on Mac they could be serialized to CFPropertyList objects).
1386         
1387         This will be used for serializing session storage state but I hope that it can be used for serializing
1388         back forward state in the future as our current implementation of back forward state serialization
1389         is fragile and depends on our IPC layer's binary encoding(!).
1390         
1391         * Shared/KeyedCodingValue.h: Added.
1392         * Shared/KeyedEncoder.cpp: Added.
1393         * Shared/KeyedEncoder.h: Added.
1394
1395         * WebKit2.xcodeproj/project.pbxproj:
1396
1397 2013-05-19  Sam Weinig  <sam@webkit.org>
1398
1399         Bump WKBundlePageLoaderClient version number so as not to break some clients
1400         https://bugs.webkit.org/show_bug.cgi?id=116426
1401
1402         Reviewed by Anders Carlsson.
1403
1404         * Shared/APIClientTraits.cpp:
1405         (WebKit):
1406         * Shared/APIClientTraits.h:
1407         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1408
1409 2013-05-19  Anders Carlsson  <andersca@apple.com>
1410
1411         Remove link prerendering code
1412         https://bugs.webkit.org/show_bug.cgi?id=116415
1413
1414         Reviewed by Darin Adler.
1415
1416         This code was only used by Chromium and is dead now.
1417
1418         * Configurations/FeatureDefines.xcconfig:
1419
1420 2013-05-18  Anders Carlsson  <andersca@apple.com>
1421
1422         Simplify the StorageArea setter functions
1423         https://bugs.webkit.org/show_bug.cgi?id=116402
1424
1425         Reviewed by Sam Weinig.
1426
1427         Remove security checking code that lives in Storage now.
1428
1429         * WebProcess/Storage/StorageAreaImpl.cpp:
1430         (WebKit::StorageAreaImpl::setItem):
1431         (WebKit::StorageAreaImpl::removeItem):
1432         (WebKit::StorageAreaImpl::clear):
1433         * WebProcess/Storage/StorageAreaImpl.h:
1434
1435 2013-05-18  Sam Weinig  <sam@webkit.org>
1436
1437         Fix some builds.
1438
1439         * UIProcess/API/mac/WKTypeRefWrapper.mm:
1440
1441 2013-05-18  Carlos Garcia Campos  <cgarcia@igalia.com>
1442
1443         REGRESSION(r150305): WebKit2 build broken with INDEXED_DATABASE enabled
1444         https://bugs.webkit.org/show_bug.cgi?id=116389
1445
1446         Reviewed by Martin Robinson.
1447
1448         There's no longer WebKeyValueStorageManager in the web process
1449         after r150305.
1450
1451         * WebProcess/WebPage/WebPageGroupProxy.cpp:
1452         (WebKit::WebPageGroupProxy::WebPageGroupProxy):
1453
1454 2013-05-17  Sam Weinig  <sam@webkit.org>
1455
1456         Add a way to pass WebKit2 WKTypeRefs in Objective-C style user data messages
1457         https://bugs.webkit.org/show_bug.cgi?id=116345
1458
1459         Reviewed by Anders Carlsson.
1460
1461         In order to efficiently send a WKImageRef to another process when using the
1462         Objective-C WKConnection (or other user data messages), we need a way to encode
1463         WKTypeRefs in the objective-c object graph. Thus was born WKTypeRefWrapper.
1464
1465         * Shared/mac/ObjCObjectGraphCoders.mm:
1466         (WebKit::typeFromObject):
1467         (WebKit::WebContextObjCObjectGraphEncoderImpl::encode):
1468         (WebKit::WebContextObjCObjectGraphDecoderImpl::decode):
1469         (WebKit::InjectedBundleObjCObjectGraphEncoderImpl::encode):
1470         (WebKit::InjectedBundleObjCObjectGraphDecoderImpl::decode):
1471         * UIProcess/API/mac/WKTypeRefWrapper.h: Added.
1472         * UIProcess/API/mac/WKTypeRefWrapper.mm: Added.
1473         (-[WKTypeRefWrapper initWithObject:]):
1474         (-[WKTypeRefWrapper object]):
1475         * WebKit2.xcodeproj/project.pbxproj:
1476
1477 2013-05-18  Anders Carlsson  <andersca@apple.com>
1478
1479         Simplify StorageArea getter functions
1480         https://bugs.webkit.org/show_bug.cgi?id=116399
1481
1482         Reviewed by Sam Weinig.
1483
1484         Remove security and private browsing checks.
1485
1486         * WebProcess/Storage/StorageAreaImpl.cpp:
1487         (WebKit::StorageAreaImpl::key):
1488         (WebKit::StorageAreaImpl::item):
1489         (WebKit::StorageAreaImpl::contains):
1490         * WebProcess/Storage/StorageAreaImpl.h:
1491
1492 2013-05-18  Patrick Gansterer  <paroga@webkit.org>
1493
1494         [CMake] Replace *_LIBRARY_NAME with *_OUTPUT_NAME
1495         https://bugs.webkit.org/show_bug.cgi?id=114554
1496
1497         Reviewed by Gyuyoung Kim.
1498
1499         Using variables as target names is very uncommon in CMake.
1500         The usual way to specify the name of the resulting binary
1501         is to set the OUTPUT_NAME target property.
1502
1503         * CMakeLists.txt:
1504         * PlatformEfl.cmake:
1505         * efl/ewebkit2.pc.in:
1506
1507 2013-05-18  Carlos Garcia Campos  <cgarcia@igalia.com>
1508
1509         [GTK] Move GTK port off legacy clipboard
1510         https://bugs.webkit.org/show_bug.cgi?id=116221
1511
1512         Reviewed by Martin Robinson.
1513
1514         * UIProcess/API/gtk/WebKitWebViewBase.cpp: Remove ClipboardGtk.h
1515         include.
1516         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
1517         (WebKit::WebDragClient::startDrag): Get the DataObjectGtk from the
1518         Pasteboard associated to the given Clipboard.
1519
1520 2013-05-18  Jinwoo Song  <jinwoo7.song@samsung.com>
1521
1522         [EFL][WK2] Refactor ewk_view_custom_encoding_set/get API
1523         https://bugs.webkit.org/show_bug.cgi?id=116386
1524
1525         Reviewed by Christophe Dumez.
1526
1527         Refactor the API to handle 'const char*' parameter in right way and
1528         enable the unit test which was disabled in r136230 as there is no assertion now.
1529
1530         * UIProcess/API/efl/EwkView.cpp:
1531         (EwkView::setCustomTextEncodingName):
1532         * UIProcess/API/efl/EwkView.h:
1533         (EwkView::customTextEncodingName):
1534         (EwkView):
1535         * UIProcess/API/efl/ewk_view.cpp:
1536         (ewk_view_custom_encoding_set):
1537         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
1538         (TEST_F):
1539
1540 2013-05-18  Csaba Osztrogonác  <ossy@webkit.org>
1541
1542         [CMake] Unreviewed speculative build fix after r150305 and r150306.
1543
1544         * CMakeLists.txt:
1545
1546 2013-05-18  Csaba Osztrogonác  <ossy@webkit.org>
1547
1548         [Qt][WK2] Unreviewed build fix after r150305 and r150306.
1549
1550         * DerivedSources.pri:
1551         * Target.pri:
1552
1553 2013-05-18  Zan Dobersek  <zdobersek@igalia.com>
1554
1555         Unreviewed build fix for the GTK port after r150305 and r150306.
1556
1557         * GNUmakefile.list.am:
1558
1559 2013-05-17  Alexey Proskuryakov  <ap@apple.com>
1560
1561         <rdar://problem/13819878> Disable SharedWorker when in multiple web process model
1562         https://bugs.webkit.org/show_bug.cgi?id=116359
1563
1564         The condition was accidentally negated, fixing.
1565
1566         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1567         (WebKit::WebPlatformStrategies::isAvailable):
1568
1569 2013-05-17  Gavin Barraclough  <barraclough@apple.com>
1570
1571         Only allow 1 WebProcess to hold a PageCache
1572         https://bugs.webkit.org/show_bug.cgi?id=116368
1573         <rdar://problem/13392600>
1574
1575         Reviewed by Geoff Garen & Anders Carlson.
1576
1577         * UIProcess/WebContext.cpp:
1578         (WebKit::WebContext::WebContext):
1579         (WebKit::WebContext::processDidSaveToPageCache):
1580         (WebKit):
1581         (WebKit::WebContext::disconnectProcess):
1582         * UIProcess/WebContext.h:
1583             - Added m_processWithPageCache, only allow one process to keep a PageCache.
1584         (WebContext):
1585         * UIProcess/WebPageProxy.cpp:
1586         (WebKit::WebPageProxy::didSaveToPageCache):
1587         (WebKit):
1588         * UIProcess/WebPageProxy.h:
1589         (WebPageProxy):
1590         * UIProcess/WebPageProxy.messages.in:
1591             - Forward didSaveToPageCache to the WebProcessProxy.
1592         * UIProcess/WebProcessProxy.cpp:
1593         (WebKit::WebProcessProxy::addBackForwardItem):
1594         (WebKit::WebProcessProxy::didSaveToPageCache):
1595         (WebKit):
1596         (WebKit::WebProcessProxy::releasePageCache):
1597             - Forward releasePageCache to the WebProcess.
1598             - Forward didSaveToPageCache to the WebContext.
1599         * UIProcess/WebProcessProxy.h:
1600         (WebProcessProxy):
1601         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1602         (WebKit::WebFrameLoaderClient::didSaveToPageCache):
1603             - Forward didSaveToPageCache to the WebPageProxy.
1604         * WebProcess/WebProcess.cpp:
1605         (WebKit::WebProcess::releasePageCache):
1606         (WebKit):
1607         * WebProcess/WebProcess.h:
1608         (WebProcess):
1609         * WebProcess/WebProcess.messages.in:
1610             - Added 'ReleasePageCache' to instruct a web process to drop any cached pages.
1611
1612 2013-05-17  Anders Carlsson  <andersca@apple.com>
1613
1614         Share code between WebKit1 and WebKit2 StorageArea subclasses
1615         https://bugs.webkit.org/show_bug.cgi?id=116367
1616
1617         Reviewed by Andreas Kling.
1618
1619         * WebProcess/Storage/StorageAreaImpl.cpp:
1620         (WebKit::StorageAreaImpl::length):
1621         Remove code that's now in Storage::length.
1622
1623         (WebKit::StorageAreaImpl::storageType):
1624         Make this a virtual member function.
1625
1626         * WebProcess/Storage/StorageAreaImpl.h:
1627
1628 2013-05-17  Alexey Proskuryakov  <ap@apple.com>
1629
1630         <rdar://problem/13819878> Disable SharedWorker when in multiple web process model
1631         https://bugs.webkit.org/show_bug.cgi?id=116359
1632
1633         Reviewed by Anders Carlsson.
1634
1635         Implement SharedWorkerStrategy::isAvailable.
1636
1637         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1638         (WebKit::WebPlatformStrategies::isAvailable):
1639         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1640
1641 2013-05-17  Beth Dakin  <bdakin@apple.com>
1642
1643         Headers and footers will sometimes disappear and re-appear during page loads
1644         https://bugs.webkit.org/show_bug.cgi?id=116336
1645         -and corresponding-
1646         <rdar://problem/13886753>
1647
1648         Reviewed by Simon Fraser.
1649
1650         This patch changes the WebCore-level API that WebKit uses to create a banner. 
1651         Specifically this patch removes FrameView::setWantsLayerForHeader(), which created 
1652         and returned a layer. Instead, WK2 will call Page::addHeaderWithHeight(). When the 
1653         layer has been created, it will call back into WK2 via ChromeClient. This will 
1654         allow WebCore to re-create the header/footer layers as needed whenever the 
1655         FrameView/RenderLayerCompositor have been destroyed and recreated.
1656
1657         Send the layers over to PageBanner.
1658         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1659         (WebKit::WebChromeClient::didAddHeaderLayer):
1660         (WebKit::WebChromeClient::didAddFooterLayer):
1661         * WebProcess/WebCoreSupport/WebChromeClient.h:
1662         (WebChromeClient):
1663
1664         PageBanner::addToPage() now does much less work since it can’t get the parent 
1665         layer right away. The work that is used to do once it had the parent layer is now 
1666         performed in didAddParentLayer()
1667         * WebProcess/WebPage/PageBanner.cpp:
1668         (WebKit::PageBanner::didAddParentLayer):
1669         * WebProcess/WebPage/PageBanner.h:
1670         * WebProcess/WebPage/mac/PageBannerMac.mm:
1671         (WebKit::PageBanner::addToPage):
1672         (WebKit::PageBanner::didAddParentLayer):
1673
1674 2013-05-17  Anders Carlsson  <andersca@apple.com>
1675
1676         Rename WebKeyValueStorageManagerProxy to WebKeyValueStorageManager
1677         https://bugs.webkit.org/show_bug.cgi?id=116361
1678
1679         Reviewed by Andreas Kling.
1680
1681         There's nothing proxy about this class anymore!
1682
1683         * UIProcess/API/C/WKAPICast.h:
1684         * UIProcess/API/C/WKContext.cpp:
1685         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
1686         * UIProcess/WebKeyValueStorageManager.cpp: Renamed from Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp.
1687         * UIProcess/WebKeyValueStorageManager.h: Renamed from Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.h.
1688         * WebKit2.xcodeproj/project.pbxproj:
1689
1690 2013-05-17  Anders Carlsson  <andersca@apple.com>
1691
1692         Remove dead local storage code
1693         https://bugs.webkit.org/show_bug.cgi?id=116360
1694
1695         Reviewed by Beth Dakin.
1696
1697         Storage is all handled in the UI process now so we no longer need a WebKeyValueStorageManager in the web process.
1698
1699         * DerivedSources.make:
1700         * UIProcess/WebKeyValueStorageManagerProxy.cpp:
1701         (WebKit::WebKeyValueStorageManagerProxy::WebKeyValueStorageManagerProxy):
1702         (WebKit):
1703         (WebKit::didGetKeyValueStorageOrigins):
1704         (WebKit::WebKeyValueStorageManagerProxy::getKeyValueStorageOrigins):
1705         * UIProcess/WebKeyValueStorageManagerProxy.h:
1706         (WebKeyValueStorageManagerProxy):
1707         * UIProcess/WebKeyValueStorageManagerProxy.messages.in: Removed.
1708         * WebKit2.xcodeproj/project.pbxproj:
1709         * WebProcess/Storage/WebKeyValueStorageManager.cpp: Removed.
1710         * WebProcess/Storage/WebKeyValueStorageManager.h: Removed.
1711         * WebProcess/Storage/WebKeyValueStorageManager.messages.in: Removed.
1712         * WebProcess/WebPage/WebPage.cpp:
1713         (WebKit::WebPage::updatePreferences):
1714         * WebProcess/WebProcess.cpp:
1715         (WebKit::WebProcess::WebProcess):
1716
1717 2013-05-17  Anders Carlsson  <andersca@apple.com>
1718
1719         Use the UI process storage manager for deleting local storage data
1720         https://bugs.webkit.org/show_bug.cgi?id=116358
1721         <rdar://problem/13852829>
1722
1723         Reviewed by Andreas Kling.
1724
1725         * Shared/WebSecurityOrigin.h:
1726         (WebKit::WebSecurityOrigin::protocol):
1727         (WebKit::WebSecurityOrigin::host):
1728         (WebKit::WebSecurityOrigin::databaseIdentifier):
1729         (WebKit::WebSecurityOrigin::toString):
1730         Remove unneeded consts.
1731
1732         (WebKit::WebSecurityOrigin::securityOrigin):
1733         Add getter.
1734
1735         * UIProcess/Storage/LocalStorageDatabase.cpp:
1736         (WebKit::LocalStorageDatabase::close):
1737         deleteEmptyDatabaseWithOrigin has been renamed to deleteDatabaseWithOrigin.
1738
1739         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1740         (WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
1741         Rename since this is no longer used only for empty databases.
1742
1743         (WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
1744         Loop over the tracker database and delete all database files.
1745
1746         * UIProcess/Storage/StorageManager.cpp:
1747         (WebKit::StorageManager::StorageArea::clear):
1748         Clear the map, close the database and tell all event listeners to reset their caches.
1749
1750         (WebKit::StorageManager::LocalStorageNamespace::clearStorageAreasMatchingOrigin):
1751         Loop over all storage areas and call clear on those matching the security origin.
1752
1753         (WebKit::StorageManager::LocalStorageNamespace::clearAllStorageAreas):
1754         Loop over all storage areas and call clear on them.
1755         
1756         (WebKit::StorageManager::deleteEntriesForOrigin):
1757         Dispatch deleteEntriesForOriginInternal on the work queue.
1758
1759         (WebKit::StorageManager::deleteAllEntries):
1760         Dispatch deleteAllEntriesInternal on the work queue.
1761
1762         (WebKit::StorageManager::deleteEntriesForOriginInternal):
1763         Call clearStorageAreasMatchingOrigin on all local storage namespaces and then delete the database.
1764
1765         (WebKit::StorageManager::deleteAllEntriesInternal):
1766         Call clearAllStorageAreas on all local storage namespaces and then delete all databases.
1767
1768         * UIProcess/WebKeyValueStorageManagerProxy.cpp:
1769         (WebKit::WebKeyValueStorageManagerProxy::deleteEntriesForOrigin):
1770         Call out to the storage manager.
1771
1772         (WebKit::WebKeyValueStorageManagerProxy::deleteAllEntries):
1773         Ditto.
1774
1775         * WebProcess/Storage/StorageAreaMap.cpp:
1776         (WebKit::StorageAreaMap::clearCache):
1777         Call resetValues which will null out the storage map.
1778
1779         * WebProcess/Storage/StorageAreaMap.messages.in:
1780         Add ClearCache message.
1781
1782 2013-05-17  Anders Carlsson  <andersca@apple.com>
1783
1784         Only import local storage items from the database once
1785         https://bugs.webkit.org/show_bug.cgi?id=116354
1786
1787         Reviewed by Andreas Kling.
1788
1789         We import items from the database over and over, when we only want to do it once. Use a 
1790         boolean flag to guard against doing it more than once. 
1791         
1792         Also, rename importItemsFromDatabase to openDatabaseAndImportItemsIfNeeded since it now
1793         also opens the database (even if it doesn't need to import anything). This is preparation for an
1794         upcoming patch where the database will be closed when it's cleared.
1795
1796         * UIProcess/Storage/StorageManager.cpp:
1797         (StorageManager::StorageArea):
1798         (WebKit::StorageManager::StorageArea::StorageArea):
1799         (WebKit::StorageManager::StorageArea::setItem):
1800         (WebKit::StorageManager::StorageArea::removeItem):
1801         (WebKit::StorageManager::StorageArea::clear):
1802         (WebKit::StorageManager::StorageArea::items):
1803         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
1804
1805 2013-05-17  Alexey Proskuryakov  <ap@apple.com>
1806
1807         <rdar://problem/13869765> Lion: Crashes in islcCanLoadInputMethodFromBundleID.
1808
1809         Reviewed by Anders Carlsson.
1810
1811         * WebProcess/com.apple.WebProcess.sb.in: Allow text input directories.
1812
1813 2013-05-17  Anders Carlsson  <andersca@apple.com>
1814
1815         WKKeyValueStorageManagerGetKeyValueStorageOrigins should get origins from the UI process
1816         https://bugs.webkit.org/show_bug.cgi?id=116346
1817         <rdar://problem/13852829>
1818
1819         Reviewed by Andreas Kling.
1820
1821         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1822         (WebKit::LocalStorageDatabaseTracker::origins):
1823         New helper function to return all the tracked origins.
1824
1825         * UIProcess/Storage/StorageManager.cpp:
1826         (WebKit::StorageManager::StorageManager):
1827         Initialize the UTF-8 encoding.
1828
1829         (WebKit::StorageManager::getOrigins):
1830         Call getOriginsInternal on our queue.
1831
1832         (WebKit::callCallbackFunction):
1833         Helper function for calling the callback function.
1834
1835         (WebKit::StorageManager::getOriginsInternal):
1836         Get the origins and make sure we call the callback with the given function dispatcher.
1837
1838         * UIProcess/WebKeyValueStorageManagerProxy.cpp:
1839         (WebKit::didGetKeyValueStorageOriginsCallback):
1840         Construct the array of WebSecurityOrigin objects and call the callback.
1841
1842         (WebKit::WebKeyValueStorageManagerProxy::getKeyValueStorageOrigins):
1843         Call StorageManager::getOrigins.
1844
1845 2013-05-16  Alexey Proskuryakov  <ap@apple.com>
1846
1847         Text input is largely broken when there are subframes loading
1848         http://bugs.webkit.org/show_bug.cgi?id=59121
1849         <rdar://problem/9320468>
1850
1851         Reviewed by Darin Adler.
1852
1853         * UIProcess/PageClient.h:
1854         * UIProcess/API/mac/PageClientImpl.h:
1855         * UIProcess/API/mac/PageClientImpl.mm:
1856         (WebKit::PageClientImpl::updateSecureInputState): Separated secure input state
1857         updating into a separate function. Removed updateTextInputState, we don't need
1858         to go through PageClient to implement its behavior at all.
1859         (WebKit::PageClientImpl::dismissDictionaryLookupPanel): Added a FIXME.
1860
1861         * UIProcess/API/mac/WKView.mm:
1862         * UIProcess/API/mac/WKViewInternal.h:
1863         Removed _updateTextInputStateIncludingSecureInputState.
1864
1865         * UIProcess/WebPageProxy.h: Added m_temporarilyClosedComposition, which helps
1866         to figure out that WebCore decided to close a composition. The issue is that WebCore
1867         would first send an EditorState with hasComposition set to false, and with
1868         shouldIgnoreCompositionSelectionChange set to true, at which time we forget the
1869         previous m_editorState, but can't make any decisions based on this transient state.
1870         We should find a way to simplify this (maybe not send these updates with
1871         shouldIgnoreCompositionSelectionChange at all?)
1872
1873         * UIProcess/WebPageProxy.cpp:
1874         (WebKit::WebPageProxy::WebPageProxy): Initialize m_temporarilyClosedComposition.
1875         (WebKit::WebPageProxy::didCommitLoadForFrame): Removed the code to kill a composition
1876         when any frame commits a load, which made no sense (along with surrounding code,
1877         which will unfortunately survive longer).
1878         (WebKit::WebPageProxy::editorStateChanged): Implemented state updating here,
1879         we don't need to go to WKView.mm to implement this logic. Figure out when WebCore
1880         discards a composition, and notify input methods about this.
1881         (WebKit::WebPageProxy::resetStateAfterProcessExited): Reset m_temporarilyClosedComposition.
1882         Added some FIXMEs.
1883
1884 2013-05-17  Manuel Rego Casasnovas  <rego@igalia.com>
1885
1886         [WK2] Add support for selectTrailingWhitespaceEnabled setting
1887         https://bugs.webkit.org/show_bug.cgi?id=112426
1888
1889         Reviewed by Ryosuke Niwa.
1890
1891         * Shared/WebPreferencesStore.h:
1892         (WebKit): Add macro for selectTrailingWhitespaceEnabled.
1893         * UIProcess/API/C/WKPreferences.cpp:
1894         (WKPreferencesSetSelectTrailingWhitespaceEnabled):
1895         (WKPreferencesGetSelectTrailingWhitespaceEnabled): Implement methods
1896         using the new setting.
1897         * UIProcess/API/C/WKPreferencesPrivate.h: Add new methods headers.
1898         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1899         (WebKit::WebEditorClient::isSelectTrailingWhitespaceEnabled): Implement
1900         method delegating in WebPage.
1901         * WebProcess/WebPage/WebPage.cpp:
1902         (WebKit::WebPage::updatePreferences): Set
1903         selectTrailingWhitespaceEnabled setting.
1904         (WebKit::WebPage::setSmartInsertDeleteEnabled): Set
1905         selectTrailingWhitespaceEnabled as they are mutually exclusive.
1906         (WebKit):
1907         (WebKit::WebPage::isSelectTrailingWhitespaceEnabled): Implement method
1908         using settings.
1909         (WebKit::WebPage::setSelectTrailingWhitespaceEnabled): Implement method
1910         using settings and set smartInsertDeleteEnabled as they are mutually
1911         exclusive.
1912         * WebProcess/WebPage/WebPage.h:
1913         (WebPage): Add new methods headers.
1914
1915 2013-05-17  Brady Eidson  <beidson@apple.com>
1916
1917         Fix crash introduced by http://trac.webkit.org/changeset/150282
1918         Followup to https://bugs.webkit.org/show_bug.cgi?id=116253
1919
1920         Reviewed by Andreas Kling.
1921
1922         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1923         (WebKit::WebChromeClient::focusedFrameChanged): Frame might be null.
1924
1925 2013-05-17  Brady Eidson  <beidson@apple.com>
1926
1927         Replace WebFrameLoaderClient static_casts with a function that might return null.
1928         https://bugs.webkit.org/show_bug.cgi?id=116253
1929
1930         The general approach here is:
1931         1 - Introduce a toWebFrameLoaderClient() function to convert FrameLoaderClients, and that may return null.
1932         2 - Adopt toWebFrameLoaderClient() everywhere we used to do a direct static_cast<WebFrameLoaderClient*>
1933         3 - In functions that already support a "return 0" scenario, a failed cast results in a return 0.
1934         4 - In other functions that assume no failure to get the WebFrameLoaderClient, add an ASSERT.
1935
1936         Reviewed by Alexey Proskuryakov.
1937
1938         Add the utility function to cast:
1939         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1940         (WebKit::toWebFrameLoaderClient):
1941
1942         Adopt it everywhere:
1943         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
1944         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
1945
1946         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1947         (WebKit::InjectedBundleNodeHandle::documentFrame):
1948         (WebKit::InjectedBundleNodeHandle::htmlFrameElementContentFrame):
1949         (WebKit::InjectedBundleNodeHandle::htmlIFrameElementContentFrame):
1950
1951         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1952         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1953
1954         * WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.cpp:
1955         (WebKit::InjectedBundleDOMWindowExtension::frame):
1956
1957         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
1958         (WebKit::InjectedBundleHitTestResult::frame):
1959         (WebKit::InjectedBundleHitTestResult::targetFrame):
1960
1961         * WebProcess/Network/WebResourceLoadScheduler.cpp:
1962         (WebKit::WebResourceLoadScheduler::scheduleLoad):
1963
1964         * WebProcess/Plugins/PluginView.cpp:
1965         (WebKit::webPage):
1966         (WebKit::PluginView::performFrameLoadURLRequest):
1967
1968         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1969         (WebKit::WebChromeClient::focusedNodeChanged):
1970         (WebKit::WebChromeClient::focusedFrameChanged):
1971         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
1972         (WebKit::WebChromeClient::runJavaScriptAlert):
1973         (WebKit::WebChromeClient::runJavaScriptConfirm):
1974         (WebKit::WebChromeClient::runJavaScriptPrompt):
1975         (WebKit::WebChromeClient::print):
1976         (WebKit::WebChromeClient::exceededDatabaseQuota):
1977         (WebKit::WebChromeClient::runOpenPanel):
1978
1979         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1980         (WebKit::WebEditorClient::textFieldDidBeginEditing):
1981         (WebKit::WebEditorClient::textFieldDidEndEditing):
1982         (WebKit::WebEditorClient::textDidChangeInTextField):
1983         (WebKit::WebEditorClient::textDidChangeInTextArea):
1984         (WebKit::WebEditorClient::doTextFieldCommandFromEvent):
1985         (WebKit::WebEditorClient::textWillBeDeletedInTextField):
1986
1987         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1988         (WebKit::WebFrameLoaderClient::dispatchWillSendSubmitEvent):
1989         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
1990
1991         * WebProcess/WebPage/WebFrame.cpp:
1992         (WebKit::WebFrame::contentsAsString):
1993         (WebKit::WebFrame::parentFrame):
1994         (WebKit::WebFrame::childFrames):
1995         (WebKit::WebFrame::frameForContext):
1996         (WebKit::WebFrameFilter::shouldIncludeSubframe):
1997
1998         * WebProcess/WebPage/WebPage.cpp:
1999         (WebKit::WebPage::mainFrameHasCustomRepresentation):
2000
2001 2013-05-17  Sam Weinig  <sam@webkit.org>
2002
2003         Expose new load-with-userData API to Objective-C
2004         https://bugs.webkit.org/show_bug.cgi?id=116335
2005
2006         Reviewed by Anders Carlsson.
2007
2008         - Adds loadRequest:userData:, loadFileURL:restrictToFilesWithin:userData:, loadHTMLString:baseURL:userData:
2009           loadData:MIMEType:textEncodingName:baseURL:, and loadData:MIMEType:textEncodingName:baseURL:userData.
2010         - Adds a WKObjCTypeWrapperRef (which is a ObjCObjectGraph under the covers) to allow the userData to be unwrapped
2011           in the injected bundles willLoadURLRequest and willLoadDataRequest C-SPI callbacks.
2012
2013         * Shared/API/c/WKBase.h:
2014         * Shared/API/c/WKSharedAPICast.h:
2015         * Shared/API/c/mac/WKBaseMac.h: Added.
2016         * Shared/API/c/mac/WKObjCTypeWrapperRef.h: Added.
2017         * Shared/API/c/mac/WKObjCTypeWrapperRef.mm: Added.
2018         (WKObjCTypeWrapperGetTypeID):
2019         (WKObjCTypeWrapperCreate):
2020         (WKObjCTypeWrapperGetObject):
2021         * UIProcess/API/mac/WKBrowsingContextController.h:
2022         * UIProcess/API/mac/WKBrowsingContextController.mm:
2023         (+[WKBrowsingContextController registerSchemeForCustomProtocol:]):
2024         (+[WKBrowsingContextController unregisterSchemeForCustomProtocol:]):
2025         (-[WKBrowsingContextController loadRequest:]):
2026         (-[WKBrowsingContextController loadRequest:userData:]):
2027         (-[WKBrowsingContextController loadFileURL:restrictToFilesWithin:]):
2028         (-[WKBrowsingContextController loadFileURL:restrictToFilesWithin:userData:]):
2029         (-[WKBrowsingContextController loadHTMLString:baseURL:]):
2030         (-[WKBrowsingContextController loadHTMLString:baseURL:userData:]):
2031         (-[WKBrowsingContextController loadData:MIMEType:textEncodingName:baseURL:]):
2032         (-[WKBrowsingContextController loadData:MIMEType:textEncodingName:baseURL:userData:]):
2033         * WebKit2.xcodeproj/project.pbxproj:
2034
2035 2013-05-17  Sam Weinig  <sam@webkit.org>
2036
2037         Add WKPageLoadData and WKPageLoadDataWithUserData SPI to support loading arbitrary data blobs
2038         https://bugs.webkit.org/show_bug.cgi?id=116325
2039
2040         Reviewed by Simon Fraser.
2041
2042         * UIProcess/API/C/WKPage.cpp:
2043         (WKPageLoadData):
2044         (WKPageLoadDataWithUserData):
2045         Add new SPI.
2046
2047         * UIProcess/API/C/WKPage.h:
2048         * UIProcess/WebPageProxy.cpp:
2049         (WebKit::WebPageProxy::loadData):
2050         * UIProcess/WebPageProxy.h:
2051         Pipe through to the WebProcess.
2052
2053         * WebProcess/WebPage/WebPage.h:
2054         * WebProcess/WebPage/WebPage.messages.in:
2055         * WebProcess/WebPage/WebPage.cpp:
2056         (WebKit::WebPage::loadDataImpl):
2057         (WebKit::WebPage::loadData):
2058         (WebKit::WebPage::loadHTMLString):
2059         (WebKit::WebPage::loadAlternateHTMLString):
2060         (WebKit::WebPage::loadPlainTextString):
2061         (WebKit::WebPage::loadWebArchiveData):
2062         Rename existing loadData function to loadDataImpl (I hate it) to avoid overload conflict
2063         from IPC magic.
2064
2065
2066 2013-05-17  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
2067
2068         [EFL][WK2] Fix sub menu initialization in ewk_context_menu_item
2069         https://bugs.webkit.org/show_bug.cgi?id=116321
2070
2071         Reviewed by Christophe Dumez.
2072
2073         During sub menu creation, after initializing m_parentMenu, parentMenu
2074         pointer became null which may cause segfaults. This patch fixes it by
2075         using m_parentMenu.
2076
2077         * UIProcess/API/efl/ewk_context_menu_item.cpp:
2078         (EwkContextMenuItem::EwkContextMenuItem):
2079
2080 2013-05-17  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
2081
2082         [EFL][WK2] Support sub menu in ewk context menus
2083         https://bugs.webkit.org/show_bug.cgi?id=114729
2084
2085         Reviewed by Christophe Dumez.
2086
2087         Added submenu support in EwkContextMenu and an API function to receive
2088         Ewk_Context_Menu from submenu context menu item. A test case was added
2089         for new API function.
2090         EwkContextMenu is now an EwkObject allowing multiple instances of submenu
2091         to be used in different submenu type context menu items.
2092
2093         * UIProcess/API/efl/ewk_context_menu_item.cpp:
2094         (EwkContextMenuItem::EwkContextMenuItem):
2095         (ewk_context_menu_item_new):
2096         (ewk_context_menu_item_parent_menu_get):
2097         (ewk_context_menu_item_submenu_get):
2098         * UIProcess/API/efl/ewk_context_menu_item.h:
2099         * UIProcess/API/efl/ewk_context_menu_item_private.h:
2100         (EwkContextMenuItem::create):
2101         (EwkContextMenuItem::parentMenu):
2102         (EwkContextMenuItem::subMenu):
2103         (EwkContextMenuItem):
2104         * UIProcess/API/efl/ewk_context_menu_private.h:
2105         (EwkContextMenu::ewkView):
2106         (EwkContextMenu):
2107         * UIProcess/API/efl/tests/test_ewk2_context_menu.cpp:
2108         (showContextMenu):
2109
2110 2013-05-17  Zoltan Arvai  <zarvai@inf.u-szeged.hu>, Ádám Kallai  <kadam@inf.u-szeged.hu>
2111
2112         [Qt] Unreviewed build fix.
2113
2114         Add missing Qt specific initializer for willLoadURLRequest and willLoadDataRequest.
2115
2116         * WebProcess/qt/QtBuiltinBundlePage.cpp:
2117         (WebKit::QtBuiltinBundlePage::QtBuiltinBundlePage):
2118
2119 2013-05-16  Beth Dakin  <bdakin@apple.com>
2120
2121         Remove WKBundlePageGetHeaderLayer/Footer SPI
2122         https://bugs.webkit.org/show_bug.cgi?id=116254
2123
2124         Reviewed by Benjamin Poulain.
2125
2126         We should remove the Remove WKBundlePageGetHeaderLayer/Footer SPI. It was only 
2127         recently added and have been replaced by WKBundlePageSetHeaderBanner/Footer.
2128
2129         * WebKit2.xcodeproj/project.pbxproj:
2130         * WebProcess/InjectedBundle/API/c/mac/WKBundlePagePrivateMac.h: Removed.
2131         * WebProcess/InjectedBundle/API/c/mac/WKBundlePagePrivateMac.mm: Removed.
2132         * WebProcess/WebPage/WebPage.h:
2133         (WebPage):
2134         * WebProcess/WebPage/mac/WebPageMac.mm:
2135         (WebKit):
2136         (WebKit::WebPage::updateHeaderAndFooterLayersForDeviceScaleChange):
2137
2138 2013-05-14  Sam Weinig  <sam@webkit.org>
2139
2140         Add variants of the loading APIs that take user data and a way for the injected bundle to find out about them
2141         https://bugs.webkit.org/show_bug.cgi?id=116132
2142
2143         Reviewed by Anders Carlsson.
2144
2145         Adds "WithUserData" versions of all the load APIs and two new WKBundlePageLoaderClient functions,
2146         willLoadURLRequest and willLoadDataRequest to let the bundle access them.
2147
2148         Adds WebKit2WillLoadTest.* API tests.
2149
2150         * UIProcess/API/C/WKPage.cpp:
2151         (WKPageLoadURLWithUserData):
2152         (WKPageLoadURLRequestWithUserData):
2153         (WKPageLoadFile):
2154         (WKPageLoadFileWithUserData):
2155         (WKPageLoadHTMLStringWithUserData):
2156         (WKPageLoadAlternateHTMLStringWithUserData):
2157         (WKPageLoadPlainTextStringWithUserData):
2158         (WKPageLoadWebArchiveDataWithUserData):
2159         * UIProcess/API/C/WKPage.h:
2160         * UIProcess/WebPageProxy.cpp:
2161         * UIProcess/WebPageProxy.h:
2162         (WebPageProxy):
2163         * WebKit2.xcodeproj/project.pbxproj:
2164         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2165         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2166         (WebKit::InjectedBundlePageLoaderClient::willLoadURLRequest):
2167         (WebKit::InjectedBundlePageLoaderClient::willLoadDataRequest):
2168         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
2169         (WebCore):
2170         (InjectedBundlePageLoaderClient):
2171         * WebProcess/WebPage/WebPage.cpp:
2172         * WebProcess/WebPage/WebPage.h:
2173         * WebProcess/WebPage/WebPage.messages.in:
2174
2175 2013-05-16  Manuel Rego Casasnovas  <rego@igalia.com>
2176
2177         [GTK] Fix memory leak in WebKitBackForwardList
2178         https://bugs.webkit.org/show_bug.cgi?id=116222
2179
2180         Reviewed by Carlos Garcia Campos.
2181
2182         Due to the use of leakRef() the ImmutableArray is not being released
2183         automatically. Adding a local variable in the methods to make sure that
2184         the ImmutableArray is freed.
2185
2186         * UIProcess/API/gtk/WebKitBackForwardList.cpp:
2187         (webkit_back_forward_list_get_back_list_with_limit): Add local variable
2188         RefPtr and pass the ImmutableArray to
2189         WebKitBackForwardList::webkitBackForwardListCreateList() using
2190         RefPtr::get().
2191         (webkit_back_forward_list_get_forward_list_with_limit): Ditto.
2192
2193 2013-05-16  Commit Queue  <commit-queue@webkit.org>
2194
2195         Unreviewed, rolling out r150034.
2196         http://trac.webkit.org/changeset/150034
2197         https://bugs.webkit.org/show_bug.cgi?id=116257
2198
2199         This work around doesn't work due to another bug NSUndoManager
2200         has (Requested by rniwa on #webkit).
2201
2202         * UIProcess/API/mac/PageClientImpl.mm:
2203         (WebKit::PageClientImpl::registerEditCommand):
2204
2205 2013-05-16  Tim Horton  <timothy_horton@apple.com>
2206
2207         PDFPlugins don't load when plugins are disabled, but they should
2208         https://bugs.webkit.org/show_bug.cgi?id=75790
2209         <rdar://problem/11650197>
2210
2211         Reviewed by Anders Carlsson.
2212
2213         Support loading "application" plug-ins even if plug-ins are explicitly disabled.
2214
2215         Make PDFPlugin and SimplePDFPlugin "application" plug-ins, so they can
2216         be loaded even if plug-ins are disabled.
2217
2218         * Platform/CoreIPC/HandleMessage.h:
2219         (CoreIPC::callMemberFunction):
2220         Add a 5-argument, 3-reply version of callMemberFunction.
2221
2222         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2223         (WebKit::NetscapePluginModule::getPluginInfo):
2224         NPAPI plug-ins are not application plug-ins.
2225
2226         * Shared/WebCoreArgumentCoders.cpp:
2227         (CoreIPC::::encode):
2228         (CoreIPC::::decode):
2229         Encode/decode the new isApplicationPlugin field on PluginInfo.
2230
2231         * UIProcess/Plugins/PluginInfoStore.cpp:
2232         (WebKit::PluginInfoStore::findPluginForMIMEType):
2233         (WebKit::PluginInfoStore::findPluginForExtension):
2234         (WebKit::PluginInfoStore::findPlugin):
2235         * UIProcess/Plugins/PluginInfoStore.h:
2236         (PluginInfoStore):
2237         Give PluginInfoStore's findPlugin method and its private helper
2238         methods an argument allowing them to only match application plug-ins.
2239
2240         (WebKit::WebPageProxy::findPlugin):
2241         * UIProcess/WebPageProxy.h:
2242         (WebPageProxy):
2243         * UIProcess/WebPageProxy.messages.in:
2244         Add an argument allowing findPlugin to restrict its search to only application plug-ins.
2245
2246         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2247         (WebKit::WebFrameLoaderClient::objectContentType):
2248         Previously, this caller depended on pluginData() returning null if
2249         plug-ins were disabled. Since that is no longer the case, we have to
2250         check if we can use plug-ins, and otherwise ignore non-application-plug-ins.
2251
2252         * WebProcess/WebPage/WebPage.cpp:
2253         (WebKit::WebPage::createPlugin):
2254         When going to search for a plug-in, ask subframeLoader whether or not
2255         it's OK to use ordinary non-application plug-ins, and pass that information
2256         on to the UIProcess when performing the search.
2257
2258         (WebKit::WebPage::canPluginHandleResponse): Ditto.
2259         (WebKit::WebPage::canShowMIMEType):
2260         Ensure that canShowMIMEType returns true if we have an application plug-in
2261         that can display a particular MIME type, even if we're not allowed to load plug-ins.
2262
2263 2013-05-16  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
2264
2265         [EFL][WK2] Make Ewk_Context_Menu Ewk_Object
2266         https://bugs.webkit.org/show_bug.cgi?id=116097
2267
2268         Reviewed by Gyuyoung Kim.
2269
2270         Changed Ewk_Context_Menu to be an Ewk_Object so pointer to menu
2271         object can be shared between different modules.
2272
2273         * UIProcess/API/efl/EwkView.cpp:
2274         (EwkView::showContextMenu):
2275         * UIProcess/API/efl/EwkView.h:
2276         (EwkView):
2277         * UIProcess/API/efl/ewk_context_menu.cpp:
2278         (EwkContextMenu::appendItem):
2279         (EwkContextMenu::removeItem):
2280         (ewk_context_menu_new):
2281         (ewk_context_menu_new_with_items):
2282         (ewk_context_menu_item_append):
2283         (ewk_context_menu_item_remove):
2284         (ewk_context_menu_hide):
2285         (ewk_context_menu_items_get):
2286         (ewk_context_menu_item_select):
2287         * UIProcess/API/efl/ewk_context_menu_item.cpp:
2288         (EwkContextMenuItem::EwkContextMenuItem):
2289         (ewk_context_menu_item_new_with_submenu):
2290         * UIProcess/API/efl/ewk_context_menu_item_private.h:
2291         (EwkContextMenuItem):
2292         * UIProcess/API/efl/ewk_context_menu_private.h:
2293         (EwkContextMenu):
2294         (EwkContextMenu::create):
2295         * UIProcess/API/efl/ewk_defines.h:
2296
2297 2013-05-16  Andreas Kling  <akling@apple.com>
2298
2299         Page::chrome() should return a reference.
2300         <http://webkit.org/b/116185>
2301
2302         Reviewed by Anders Carlsson.
2303
2304 2013-05-16  Brady Eidson  <beidson@apple.com>
2305
2306         svg/as-image/img-zoom-svg-stylesheet.html crashes with NetworkProcess enabled.
2307         <rdar://problem/13837408> and https://bugs.webkit.org/show_bug.cgi?id=115917
2308
2309         Reviewed by Sam Weinig.
2310
2311         * NetworkProcess/SchedulableLoader.cpp:
2312         (WebKit::SchedulableLoader::SchedulableLoader): ASSERT that either there’s a frame and page ID, or
2313           that the client cannot be asked for credentials.
2314
2315         * WebProcess/Network/WebResourceLoadScheduler.cpp:
2316         (WebKit::WebResourceLoadScheduler::scheduleLoad): Only cast the FrameLoaderClient and get WebFrame/WebPage
2317           if that is actually possible. Set the clientCredentialPolicy based on whether or not WebFrame/WebPage are
2318           available since they are needed to ask the UIProcess for credentials. ASSERT that either there’s both
2319           a frame and page ID or that the client won’t be asked for credentials.
2320
2321 2013-05-16  Timothy Hatcher  <timothy@apple.com>
2322
2323         Make the Find Banner in Safari work again with the docked Web Inspector.
2324
2325         https://webkit.org/b/116182
2326         rdar://problem/13857423
2327
2328         Reviewed by Benjamin Poulain.
2329
2330         * UIProcess/mac/WebInspectorProxyMac.mm:
2331         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
2332         (WebKit::WebInspectorProxy::platformDetach):
2333         Preserve the top position of the inspected view so banners in Safari still work.
2334
2335 2013-05-16  Tim Horton  <timothy_horton@apple.com>
2336
2337         [wk2] didGetImageForFindMatch can return a null image
2338         https://bugs.webkit.org/show_bug.cgi?id=116251
2339         <rdar://problem/13277246>
2340
2341         Reviewed by Simon Fraser.
2342
2343         Don't send didGetImageForFindMatch if we didn't get an image for
2344         the find match, which can happen if the selection is not visible.
2345
2346         * WebProcess/WebPage/FindController.cpp:
2347         (WebKit::FindController::getImageForFindMatch):
2348
2349 2013-05-16  Tim Horton  <timothy_horton@apple.com>
2350
2351         [wk2] Minimum layout width is lost if the WebProcess crashes
2352         https://bugs.webkit.org/show_bug.cgi?id=116202
2353         <rdar://problem/13202320>
2354
2355         Reviewed by Darin Adler.
2356
2357         Send the minimum layout width to the WebProcess upon initialization,
2358         so that crashed-and-restarted WebProcesses have the correct width.
2359
2360         * Shared/WebPageCreationParameters.cpp:
2361         (WebKit::WebPageCreationParameters::encode):
2362         (WebKit::WebPageCreationParameters::decode):
2363         * Shared/WebPageCreationParameters.h:
2364         (WebPageCreationParameters):
2365         Add minimumLayoutWidth WebPage creation parameter.
2366
2367         * UIProcess/WebPageProxy.cpp:
2368         (WebKit::WebPageProxy::creationParameters):
2369         Send the current minimumLayoutWidth to the WebPage when it's created.
2370
2371         (WebKit::WebPageProxy::setMinimumLayoutWidth):
2372         Store minimumLayoutWidth changes that come in while the WebProcess is
2373         not valid, so that the correct width is sent once it is restarted.
2374
2375         * WebProcess/WebPage/WebPage.cpp:
2376         (WebKit::WebPage::WebPage):
2377         Set minimumLayoutWidth to the value provided by our creation parameters.
2378
2379 2013-05-16  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
2380
2381         [Win] Unreviewed buildfix after r150161.
2382
2383         'Unknown' in HTTPRequest.cpp is ambiguous symbol with MSVC,
2384         because it is also defined in MS SDK 7.1 winioctl.h.
2385
2386         * UIProcess/InspectorServer/HTTPRequest.cpp:
2387         (WebKit::HTTPRequest::HTTPRequest):
2388
2389 2013-05-16  Andras Becsi  <andras.becsi@digia.com>
2390
2391         [WK2] PluginInformation.cpp fails to build because of missing ENABLE(NETSCAPE_PLUGIN_API) guard
2392         https://bugs.webkit.org/show_bug.cgi?id=116018
2393
2394         Rubber-stamped by Jocelyn Turcotte.
2395
2396         * Shared/Plugins/Netscape/PluginInformation.cpp:
2397         (WebKit::getPluginModuleInformation):
2398
2399 2013-05-15  Simon Cooper  <scooper@apple.com>
2400
2401         Enable printing in plugins
2402         https://bugs.webkit.org/show_bug.cgi?id=116201
2403         <rdar://problem/12347902>
2404
2405         Reviewed by Alexey Proskuryakov.
2406
2407         Add the printing entitlement so that legacy printing drivers can
2408         customize the print panel. Update the printing rules and enable them
2409         for the plugins.
2410
2411         * Configurations/PluginService.entitlements:
2412         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb:
2413         * Resources/PlugInSandboxProfiles/com.macromedia.Flash Player.plugin.sb:
2414         * Resources/PlugInSandboxProfiles/com.microsoft.SilverlightPlugin.sb:
2415         * Resources/PlugInSandboxProfiles/com.oracle.java.JavaAppletPlugin.sb:
2416
2417 2013-05-15  Anders Carlsson  <andersca@apple.com>
2418
2419         Move HTTPRequest class to WebKit2
2420         https://bugs.webkit.org/show_bug.cgi?id=116192
2421
2422         Reviewed by Darin Adler.
2423
2424         Move HTTPRequest to WebKit2 and put it in the WebKit namespace.
2425
2426         * CMakeLists.txt:
2427         * GNUmakefile.list.am:
2428         * Target.pri:
2429         * UIProcess/InspectorServer/HTTPRequest.cpp: Renamed from Source/WebCore/platform/network/HTTPRequest.cpp.
2430         * UIProcess/InspectorServer/HTTPRequest.h: Renamed from Source/WebCore/platform/network/HTTPRequest.h.
2431         * UIProcess/InspectorServer/WebInspectorServer.cpp:
2432         * UIProcess/InspectorServer/WebInspectorServer.h:
2433         (WebInspectorServer):
2434         * UIProcess/InspectorServer/WebSocketServerClient.h:
2435         (WebKit::WebSocketServerClient::didReceiveUnrecognizedHTTPRequest):
2436         (WebKit::WebSocketServerClient::didReceiveWebSocketUpgradeHTTPRequest):
2437         (WebKit::WebSocketServerClient::didEstablishWebSocketConnection):
2438         * UIProcess/InspectorServer/WebSocketServerConnection.cpp:
2439         * UIProcess/InspectorServer/WebSocketServerConnection.h:
2440         (WebKit):
2441         (WebSocketServerConnection):
2442
2443 2013-05-15  Arnaud Renevier  <a.renevier@sisa.samsung.com>
2444
2445         [GTK] [WebKit2] enable displaying console.log messages to system console
2446         https://bugs.webkit.org/show_bug.cgi?id=115578
2447
2448         Reviewed by Martin Robinson.
2449
2450         Add a setting to enable/disable displaying of page messages to system
2451         console. Property is called enable-write-console-messages-to-stdout.
2452         Getter API function is
2453         webkit_settings_get_enable_write_console_messages_to_stdout
2454         Setter API function is
2455         webkit_settings_set_enable_write_console_messages_to_stdout
2456
2457         * UIProcess/API/gtk/WebKitSettings.cpp:
2458         (webKitSettingsSetProperty):
2459         (webKitSettingsGetProperty):
2460         (webkit_settings_class_init):
2461         (webkit_settings_get_enable_write_console_messages_to_stdout):
2462         (webkit_settings_set_enable_write_console_messages_to_stdout):
2463         * UIProcess/API/gtk/WebKitSettings.h:
2464         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
2465         * UIProcess/API/gtk/tests/TestWebKitSettings.cpp:
2466         (testWebKitSettings):
2467
2468 2013-05-08  Gavin Barraclough  <barraclough@apple.com>
2469
2470         Process suppression should throttle scripted animations
2471         https://bugs.webkit.org/show_bug.cgi?id=115812
2472
2473         Reviewed by Simon Fraser.
2474
2475         <rdar://problem/13799726>
2476
2477         * WebProcess/WebPage/WebPage.cpp:
2478         (WebKit::WebPage::setThrottled):
2479         (WebKit):
2480         * WebProcess/WebPage/WebPage.h:
2481         (WebPage):
2482             - Added setThrottled, forwards to WebCore::Page.
2483         * WebProcess/WebProcess.cpp:
2484         (WebKit):
2485         (WebKit::WebProcess::setProcessSuppressionEnabled):
2486         * WebProcess/WebProcess.h:
2487         (WebProcess):
2488             - Intercept calls to setProcessSuppressionEnabled, also mark all pages as being throttled.
2489
2490 2013-05-15  Anders Carlsson  <andersca@apple.com>
2491
2492         WKPageGetPluginInformationDisplayNameKey doesn't return the right key
2493         https://bugs.webkit.org/show_bug.cgi?id=116188
2494
2495         Reviewed by Andreas Kling.
2496
2497         * UIProcess/API/C/WKPage.cpp:
2498         (WKPageGetPluginInformationDisplayNameKey):
2499
2500 2013-05-15  Alexey Proskuryakov  <ap@apple.com>
2501
2502         More fixing after WebProcessShim renaming in r149074.
2503
2504         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
2505         (WebContentServiceInitializer): Updated a comment to mention the shim by its new name.
2506
2507 2013-05-15  Alexey Proskuryakov  <ap@apple.com>
2508
2509         <rdar://problem/13902706> Lion: com.apple.tsm.uiserver sandbox error in Console when
2510         launching Safari
2511
2512         Reviewed by Anders Carlsson.
2513
2514         * WebProcess/com.apple.WebProcess.sb.in: Silence the violation.
2515
2516 2013-05-13  Anders Carlsson  <andersca@apple.com>
2517
2518         Frame::editor() should return a reference
2519         https://bugs.webkit.org/show_bug.cgi?id=116037
2520
2521         Reviewed by Darin Adler.
2522
2523         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
2524         (WebKit::WebContextMenuClient::searchWithGoogle):
2525         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2526         (WebKit::WebEditorClient::updateGlobalSelection):
2527         * WebProcess/WebCoreSupport/efl/WebEditorClientEfl.cpp:
2528         (WebKit::WebEditorClient::handleInputMethodKeydown):
2529         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
2530         (WebKit::WebEditorClient::executePendingEditorCommands):
2531         (WebKit::WebEditorClient::handleKeyboardEvent):
2532         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
2533         (WebKit::WebContextMenuClient::searchWithGoogle):
2534         (WebKit::WebContextMenuClient::searchWithSpotlight):
2535         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
2536         (WebKit::changeWordCase):
2537         * WebProcess/WebPage/WebFrame.cpp:
2538         (WebKit::WebFrame::selectionAsString):
2539         (WebKit::WebFrame::setTextDirection):
2540         * WebProcess/WebPage/WebPage.cpp:
2541         (WebKit::WebPage::editorState):
2542         (WebKit::WebPage::executeEditingCommand):
2543         (WebKit::WebPage::isEditingCommandEnabled):
2544         (WebKit::WebPage::validateCommand):
2545         (WebKit::WebPage::handleEditingKeyboardEvent):
2546         (WebKit::WebPage::advanceToNextMisspelling):
2547         (WebKit::WebPage::uppercaseWord):
2548         (WebKit::WebPage::lowercaseWord):
2549         (WebKit::WebPage::capitalizeWord):
2550         (WebKit::WebPage::replaceSelectionWithText):
2551         (WebKit::WebPage::handleAlternativeTextUIResult):
2552         (WebKit::WebPage::setCompositionForTesting):
2553         (WebKit::WebPage::hasCompositionForTesting):
2554         (WebKit::WebPage::confirmCompositionForTesting):
2555         (WebKit::WebPage::setComposition):
2556         (WebKit::WebPage::cancelComposition):
2557         * WebProcess/WebPage/efl/WebPageEfl.cpp:
2558         (WebKit::WebPage::confirmComposition):
2559         (WebKit::WebPage::setComposition):
2560         (WebKit::WebPage::cancelComposition):
2561         * WebProcess/WebPage/mac/WebPageMac.mm:
2562         (WebKit::WebPage::executeKeypressCommandsInternal):
2563         (WebKit::WebPage::handleEditingKeyboardEvent):
2564         (WebKit::WebPage::setComposition):
2565         (WebKit::WebPage::confirmComposition):
2566         (WebKit::WebPage::cancelComposition):
2567         (WebKit::WebPage::insertText):
2568         (WebKit::WebPage::insertDictatedText):
2569         (WebKit::WebPage::getMarkedRange):
2570         (WebKit::WebPage::firstRectForCharacterRange):
2571         (WebKit::WebPage::readSelectionFromPasteboard):
2572         (WebKit::WebPage::getStringSelectionForPasteboard):
2573         (WebKit::WebPage::getDataSelectionForPasteboard):
2574
2575 2013-05-15  Anders Carlsson  <andersca@apple.com>
2576
2577         Need a way for NPAPI plug-ins to open preference panes
2578         https://bugs.webkit.org/show_bug.cgi?id=116173
2579         <rdar://problem/13503848>
2580
2581         Reviewed by Sam Weinig.
2582
2583         * PluginProcess/PluginControllerProxy.h:
2584         Add openPluginPreferencePane().
2585
2586         * PluginProcess/mac/PluginControllerProxyMac.mm:
2587         (WebKit::PluginControllerProxy::openPluginPreferencePane):
2588         Send OpenPluginPreferencePane to the UI process.
2589
2590         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2591         (WebKit::NetscapePluginModule::getPluginInfo):
2592         Get the preference pane path.
2593         
2594         * Shared/Plugins/PluginModuleInfo.h:
2595         Add preferencePanePath member variable.
2596
2597         * UIProcess/Plugins/PluginProcessProxy.h:
2598         Add openPluginPreferencePane message handler.
2599
2600         * UIProcess/Plugins/PluginProcessProxy.messages.in:
2601         ADd OpenPluginPreferencePane message.
2602
2603         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2604         (WebKit::PluginProcessProxy::openPluginPreferencePane):
2605         Get the path to the preference pane and use LS to open it.
2606
2607         * WebKit2.xcodeproj/project.pbxproj:
2608         Add new files.
2609
2610         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2611         (WebKit::NPN_GetValue):
2612         Handle WKNVPlugInContainer.
2613
2614         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2615         Add WKNVPlugInContainer member variable.
2616
2617         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2618         (WebKit::NetscapePlugin::openPluginPreferencePane):
2619         Call through to the plug-in controller.
2620
2621         (WebKit::NetscapePlugin::plugInContainer):
2622         Create a WKNPAPIPlugInContainer object if necessary.
2623
2624         (WebKit::NetscapePlugin::platformDestroy):
2625         Invalidate the WKNPAPIPlugInContainer object.
2626
2627         * WebProcess/Plugins/Netscape/mac/WKNPAPIPlugInContainer.h:
2628         New file with the protocol definition.
2629
2630         * WebProcess/Plugins/Netscape/mac/WKNPAPIPlugInContainer.mm:
2631         (-[WKNPAPIPlugInContainer dealloc]):
2632         Assert that the plug-in is null (that we've been invalidated).
2633
2634         (-[WKNPAPIPlugInContainer _invalidate]):
2635         Set the plug-in to null.
2636
2637         (-[WKNPAPIPlugInContainer openPlugInPreferencePane]):
2638         Call through to the plug-in.
2639
2640         * WebProcess/Plugins/Netscape/mac/WKNPAPIPlugInContainerInternal.h:
2641         New file with the interface declaration for the object that implements the protocol.
2642
2643         * WebProcess/Plugins/PluginController.h:
2644         Add openPluginPreferencePane member function.
2645
2646         * WebProcess/Plugins/PluginView.cpp:
2647         (WebKit::PluginView::openPluginPreferencePane):
2648         Add stub; this should never be called since we always go through the UI process.
2649
2650 2013-05-15  Alexey Proskuryakov  <ap@apple.com>
2651
2652         [WK2][Mac] Split resetTextInputState into two functions
2653         https://bugs.webkit.org/show_bug.cgi?id=116174
2654
2655         Reviewed by Anders Carlsson.
2656
2657         Splitting resetTextInputState into resetSecureInputState and
2658         notifyInputContextAboutDiscardedComposition, paving the way for a fix where these
2659         won't be happening simultaneously.
2660
2661         * UIProcess/API/mac/PageClientImpl.h:
2662         * UIProcess/API/mac/PageClientImpl.mm:
2663         (WebKit::PageClientImpl::resetSecureInputState):
2664         (WebKit::PageClientImpl::notifyInputContextAboutDiscardedComposition):
2665         * UIProcess/API/mac/WKView.mm:
2666         (-[WKView resignFirstResponder]):
2667         (-[WKView _resetSecureInputState]):
2668         (-[WKView _notifyInputContextAboutDiscardedComposition]):
2669         * UIProcess/API/mac/WKViewInternal.h:
2670         * UIProcess/PageClient.h:
2671         * UIProcess/WebPageProxy.cpp:
2672         (WebKit::WebPageProxy::didCommitLoadForFrame):
2673
2674 2013-05-15  Carlos Garcia Campos  <cgarcia@igalia.com>
2675
2676         [GTK] Add padding to all public class structs for future expansion without breaking ABI
2677         https://bugs.webkit.org/show_bug.cgi?id=112565
2678
2679         Reviewed by Anders Carlsson.
2680
2681         Use 4 pointers for most of the classes that are unlikely to grow
2682         and 8 for WebKitWebView and WebKitWebContext.
2683
2684         * UIProcess/API/gtk/WebKitBackForwardList.h:
2685         (_WebKitBackForwardListClass):
2686         * UIProcess/API/gtk/WebKitBackForwardListItem.h:
2687         (_WebKitBackForwardListItemClass):
2688         * UIProcess/API/gtk/WebKitContextMenu.h:
2689         (_WebKitContextMenuClass):
2690         * UIProcess/API/gtk/WebKitContextMenuItem.h:
2691         (_WebKitContextMenuItemClass):
2692         * UIProcess/API/gtk/WebKitCookieManager.h:
2693         (_WebKitCookieManagerClass):
2694         * UIProcess/API/gtk/WebKitDownload.h:
2695         (_WebKitDownloadClass):
2696         * UIProcess/API/gtk/WebKitFaviconDatabase.h:
2697         (_WebKitFaviconDatabaseClass):
2698         * UIProcess/API/gtk/WebKitFileChooserRequest.h:
2699         (_WebKitFileChooserRequestClass):
2700         * UIProcess/API/gtk/WebKitFindController.h:
2701         (_WebKitFindControllerClass):
2702         * UIProcess/API/gtk/WebKitFormSubmissionRequest.h:
2703         (_WebKitFormSubmissionRequestClass):
2704         * UIProcess/API/gtk/WebKitGeolocationPermissionRequest.h:
2705         (_WebKitGeolocationPermissionRequestClass):
2706         * UIProcess/API/gtk/WebKitHitTestResult.h:
2707         (_WebKitHitTestResultClass):
2708         * UIProcess/API/gtk/WebKitNavigationPolicyDecision.h:
2709         (_WebKitNavigationPolicyDecisionClass):
2710         * UIProcess/API/gtk/WebKitPlugin.h:
2711         (_WebKitPluginClass):
2712         * UIProcess/API/gtk/WebKitPolicyDecision.h:
2713         (_WebKitPolicyDecisionClass):
2714         * UIProcess/API/gtk/WebKitPrintOperation.h:
2715         (_WebKitPrintOperationClass):
2716         * UIProcess/API/gtk/WebKitResponsePolicyDecision.h:
2717         (_WebKitResponsePolicyDecisionClass):
2718         * UIProcess/API/gtk/WebKitSecurityManager.h:
2719         (_WebKitSecurityManagerClass):
2720         * UIProcess/API/gtk/WebKitSettings.h:
2721         (_WebKitSettingsClass):
2722         * UIProcess/API/gtk/WebKitURIRequest.h:
2723         (_WebKitURIRequestClass):
2724         * UIProcess/API/gtk/WebKitURIResponse.h:
2725         (_WebKitURIResponseClass):
2726         * UIProcess/API/gtk/WebKitURISchemeRequest.h:
2727         (_WebKitURISchemeRequestClass):
2728         * UIProcess/API/gtk/WebKitWebContext.h:
2729         (_WebKitWebContextClass):
2730         * UIProcess/API/gtk/WebKitWebInspector.h:
2731         (_WebKitWebInspectorClass):
2732         * UIProcess/API/gtk/WebKitWebResource.h:
2733         (_WebKitWebResourceClass):
2734         * UIProcess/API/gtk/WebKitWebView.h:
2735         (_WebKitWebViewClass):
2736         * UIProcess/API/gtk/WebKitWebViewBase.h:
2737         (_WebKitWebViewBaseClass):
2738         * UIProcess/API/gtk/WebKitWebViewGroup.h:
2739         (_WebKitWebViewGroupClass):
2740         * UIProcess/API/gtk/WebKitWindowProperties.h:
2741         (_WebKitWindowPropertiesClass):
2742
2743 2013-05-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2744
2745         Remove WTF_USE_PLATFORM_STRATEGIES
2746         https://bugs.webkit.org/show_bug.cgi?id=114431
2747
2748         Reviewed by Darin Adler.
2749
2750         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2751         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2752         * WebProcess/WebProcess.cpp:
2753         (WebKit::WebProcess::WebProcess):
2754
2755 2013-05-14  Simon Cooper  <scooper@apple.com>
2756
2757         Add a preference that can disable the fake SYSV SHM shim
2758         https://bugs.webkit.org/show_bug.cgi?id=116127
2759         <rdar://problem/13810524>
2760
2761         Reviewed by Alexey Proskuryakov.
2762
2763         * PluginProcess/mac/PluginProcessShim.mm:
2764         (WebKit::shim_disabled):
2765         (WebKit::shim_shmdt):
2766         (WebKit::shim_shmat):
2767         (WebKit::shim_shmget):
2768         (WebKit::shim_shmctl):
2769
2770 2013-05-14  Tim Horton  <timothy_horton@apple.com>
2771
2772         [wk2] Not updating tiled backing coverage when main frame scrollability changes
2773         https://bugs.webkit.org/show_bug.cgi?id=116123
2774         <rdar://problem/13836559>
2775
2776         Reviewed by Simon Fraser.
2777
2778         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2779         (TiledCoreAnimationDrawingArea):
2780         Add updateMainFrameClipsToExposedRect.
2781
2782         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2783         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2784         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2785         Remove m_clipsToExposedRect. We don't actually need it.
2786
2787         (WebKit::TiledCoreAnimationDrawingArea::mainFrameScrollabilityChanged):
2788         Call updateMainFrameClipsToExposedRect so that we can always update
2789         tiled backing coverage and can factor out our calls to setClipsToExposedRect.
2790
2791         (WebKit::TiledCoreAnimationDrawingArea::updateMainFrameClipsToExposedRect):
2792         Factor out setClipsToExposedRect calls to here, and also call
2793         FrameView::adjustTiledBackingCoverage so that the FrameView's tiled
2794         backing is informed to allow overdraw in the UI-process-scrolling case.
2795
2796         (WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
2797         Use updateMainFrameClipsToExposedRect.
2798
2799 2013-05-14  Alexey Proskuryakov  <ap@apple.com>
2800
2801         [Mac] Add a testing shim for secure event input functions
2802         https://bugs.webkit.org/show_bug.cgi?id=116122
2803
2804         Reviewed by Mark Rowe.
2805
2806         Moved DyldInterpose.h to WebCore, as we now use it there too.
2807
2808         * PluginProcess/mac/PluginProcessShim.mm:
2809         * Shared/mac/CookieStorageShimLibrary.cpp:
2810         * Shared/mac/DyldInterpose.h: Removed.
2811         * WebKit2.xcodeproj/project.pbxproj:
2812         * WebProcess/mac/SecItemShimLibrary.mm:
2813
2814 2013-05-14  Jocelyn Turcotte  <jocelyn.turcotte@digia.com>
2815
2816         [Win] REGRESSION(r149944): mmap is not available on Windows
2817         https://bugs.webkit.org/show_bug.cgi?id=116015
2818
2819         Reviewed by Anders Carlsson.
2820
2821         Use fastAlloc/fastFree for platforms other than OS(DARWIN) where
2822         using mmap is not necessary and maybe not available.
2823
2824         * Platform/CoreIPC/ArgumentEncoder.cpp:
2825         (CoreIPC::allocBuffer):
2826         (CoreIPC::freeBuffer):
2827         (CoreIPC::ArgumentEncoder::~ArgumentEncoder):
2828         (CoreIPC::ArgumentEncoder::grow):
2829
2830 2013-05-14  Zan Dobersek  <zdobersek@igalia.com>
2831
2832         [GTK] Move generated ColorData.cpp, WebKitFontFamilyNames.(cpp|h) build targets into libPlatform
2833         https://bugs.webkit.org/show_bug.cgi?id=115921
2834
2835         Reviewed by Gustavo Noronha Silva.
2836
2837         * GNUmakefile.am: Add platform_cppflags to the list of libwebkit2gtk CPPFLAGS.
2838
2839 2013-05-14  Jocelyn Turcotte  <jocelyn.turcotte@digia.com>
2840
2841         [WK2][Win] Fix ASSERT(DeleteTimerQueueTimer...)
2842         https://bugs.webkit.org/show_bug.cgi?id=116039
2843
2844         Reviewed by Benjamin Poulain.
2845
2846         According to the documentation, DeleteTimerQueueTimer can be expected to return
2847         false with an ERROR_IO_PENDING error when called from the timer's callback.
2848
2849         * Platform/win/WorkQueueWin.cpp:
2850         (WorkQueue::timerCallback):
2851
2852 2013-05-14  Alexey Proskuryakov  <ap@apple.com>
2853
2854         Remove unused "type" field from DictionaryPopupInfo
2855         https://bugs.webkit.org/show_bug.cgi?id=116011
2856
2857         Reviewed by Darin Adler.
2858
2859         It is unused, and furthermore, PDFPlugin sets it incorrectly anyway.
2860
2861         * Shared/DictionaryPopupInfo.cpp:
2862         (WebKit::DictionaryPopupInfo::encode):
2863         (WebKit::DictionaryPopupInfo::decode):
2864         * Shared/DictionaryPopupInfo.h:
2865         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2866         (WebKit::PDFPlugin::showDefinitionForAttributedString):
2867         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
2868         (WebKit::WebContextMenuClient::lookUpInDictionary):
2869         * WebProcess/WebPage/WebPage.h:
2870         * WebProcess/WebPage/mac/WebPageMac.mm:
2871         (WebKit::WebPage::performDictionaryLookupAtLocation):
2872         (WebKit::WebPage::performDictionaryLookupForSelection):
2873         (WebKit::WebPage::performDictionaryLookupForRange):
2874
2875 2013-05-14  Michael Brüning  <michael.bruning@digia.com>
2876
2877         [WK2] Make WebPageProxy use deviceScaleFactor() in creationParameters().
2878         https://bugs.webkit.org/show_bug.cgi?id=110218
2879
2880         Reviewed by Darin Adler.
2881
2882         Make the WebPageProxy::creationParameters use the accessor
2883         deviceScaleFactor() instead of using m_intrinsicDeviceScaleFactor
2884         directly. This will restore the custom device scale factor when
2885         reattaching to the WebProcess after a crash.
2886
2887         Moreover, it will enable the Qt and ELF ports to use the
2888         existing C API for overriding the device scale factor instead
2889         of using the WebPageProxy directly or adding new C API to set
2890         the intrinsic device scale factor.
2891
2892         * UIProcess/API/efl/EwkView.cpp:
2893         (EwkView::setDeviceScaleFactor):
2894         * UIProcess/API/qt/qquickwebpage.cpp:
2895         (QQuickWebPage::updatePaintNode):
2896         * UIProcess/WebPageProxy.cpp:
2897         (WebKit::WebPageProxy::creationParameters):
2898
2899 2013-05-13  Alex Christensen  <achristensen@apple.com>
2900
2901         Added testRunner.setPrinting.
2902         https://bugs.webkit.org/show_bug.cgi?id=42693
2903         rdar://problem/8213845
2904
2905         Reviewed by Darin Adler.
2906
2907         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2908         (WKBundlePageCopyRenderTreeExternalRepresentationForPrinting): Added.
2909         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
2910         Added WKBundlePageCopyRenderTreeExternalRepresentationForPrinting declaration.
2911         * WebProcess/WebPage/WebPage.cpp:
2912         (WebKit::WebPage::renderTreeExternalRepresentationForPrinting): Added.
2913         * WebProcess/WebPage/WebPage.h:
2914         Added renderTreeExternalRepresentationForPrinting declaration.
2915
2916 2013-05-13  Timothy Hatcher  <timothy@apple.com>
2917
2918         Add support for updating the Web Inspector toolbar height.
2919
2920         https://bugs.webkit.org/show_bug.cgi?id=115996
2921
2922         Reviewed by Joseph Pecoraro and Benjamin Poulain.
2923
2924         * UIProcess/WebInspectorProxy.h:
2925         (WebKit::WebInspectorProxy::setToolbarHeight):
2926         (WebInspectorProxy):
2927         * UIProcess/WebInspectorProxy.messages.in:
2928         * UIProcess/efl/WebInspectorProxyEfl.cpp:
2929         (WebKit::WebInspectorProxy::platformSetToolbarHeight):
2930         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2931         (WebKit::WebInspectorProxy::platformSetToolbarHeight):
2932         (WebKit):
2933         * UIProcess/mac/WebInspectorProxyMac.mm:
2934         (WebKit::WebInspectorProxy::platformSetToolbarHeight):
2935         * UIProcess/qt/WebInspectorProxyQt.cpp:
2936         (WebKit::WebInspectorProxy::platformSetToolbarHeight):
2937         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
2938         (WebKit::WebInspectorFrontendClient::setToolbarHeight):
2939         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.h:
2940         (WebInspectorFrontendClient):
2941         * WebProcess/WebPage/WebInspector.cpp:
2942         (WebKit::WebInspector::setToolbarHeight):
2943         * WebProcess/WebPage/WebInspector.h:
2944
2945 2013-05-13  Ryosuke Niwa  <rniwa@webkit.org>
2946
2947         Sometimes NSUndoManager can get into an inconsistent state
2948         https://bugs.webkit.org/show_bug.cgi?id=116050
2949
2950         Reviewed by Enrica Casucci.
2951
2952         Always group undo items to work around a bug in NSUndoManager that manifests
2953         when we call removeAllActionsWithTarget.
2954
2955         * UIProcess/API/mac/PageClientImpl.mm:
2956         (WebKit::PageClientImpl::registerEditCommand):
2957
2958 2013-05-13  Anders Carlsson  <andersca@apple.com>
2959
2960         [WK2] Crash in WebKit::StorageAreaMap::didSetItem()
2961         https://bugs.webkit.org/show_bug.cgi?id=116026
2962
2963         Reviewed by Andreas Kling.
2964
2965         Make sure that we ignore any leftover messages from the UI process after we've reset
2966         the storage map. Achieve this by keeping a seed count in the StorageAreaMap object that's incremented
2967         everytime the map is reset. Associate every storage area change with the seed and ignore any incoming 
2968         notification messages from the UI process if the seeds are different.
2969
2970         * Platform/CoreIPC/HandleMessage.h:
2971         (CoreIPC):
2972         (CoreIPC::callMemberFunction):
2973         * UIProcess/Storage/StorageManager.cpp:
2974         (WebKit::StorageManager::getValues):
2975         (WebKit::StorageManager::setItem):
2976         (WebKit::StorageManager::removeItem):
2977         (WebKit::StorageManager::clear):
2978         * UIProcess/Storage/StorageManager.h:
2979         (StorageManager):
2980         * UIProcess/Storage/StorageManager.messages.in:
2981         * WebProcess/Storage/StorageAreaMap.cpp:
2982         (WebKit::StorageAreaMap::StorageAreaMap):
2983         (WebKit::StorageAreaMap::setItem):
2984         (WebKit::StorageAreaMap::removeItem):
2985         (WebKit::StorageAreaMap::clear):
2986         (WebKit::StorageAreaMap::resetValues):
2987         (WebKit::StorageAreaMap::loadValuesIfNeeded):
2988         (WebKit::StorageAreaMap::didGetValues):
2989         (WebKit::StorageAreaMap::didSetItem):
2990         (WebKit::StorageAreaMap::didRemoveItem):
2991         (WebKit::StorageAreaMap::didClear):
2992         (WebKit::StorageAreaMap::applyChange):
2993         * WebProcess/Storage/StorageAreaMap.h:
2994         (StorageAreaMap):
2995         * WebProcess/Storage/StorageAreaMap.messages.in:
2996
2997 2013-05-13  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
2998
2999         [WK2][CoordinatedGraphics] Avoid dispensable calls to WebView::updateViewportSize()
3000         https://bugs.webkit.org/show_bug.cgi?id=116045
3001
3002         Reviewed by Darin Adler.
3003
3004         * UIProcess/CoordinatedGraphics/WebView.cpp:
3005         (WebKit::WebView::setSize):
3006
3007 2013-05-13  Jon Lee  <jonlee@apple.com>
3008
3009         [WK2] Notification manager removal should not be tied to termination of web processes
3010         https://bugs.webkit.org/show_bug.cgi?id=116038
3011         <rdar://problem/10968680>
3012
3013         Reviewed by Ryosuke Niwa.
3014
3015         WebNotificationManagerProxy incorrectly removes the manager when web processes close.
3016         Since it is a supplemental on the web context, the manager should only be removed
3017         when the context is destroyed.
3018
3019         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
3020         * UIProcess/Notifications/WebNotificationManagerProxy.h: Remove implementation of
3021         processDidClose().
3022
3023 2013-05-13  Martin Robinson  <mrobinson@igalia.com>
3024
3025         [GTK] [WebKit2] Use a template file for generated GObject enum files
3026         https://bugs.webkit.org/show_bug.cgi?id=115867
3027
3028         Reviewed by Carlos Garcia Campos.
3029
3030         * GNUmakefile.am: Use a template file instead of specifying portions of the file on the command-line.
3031         * UIProcess/API/gtk/WebKitEnumTypes.cpp.template: Added.
3032         * UIProcess/API/gtk/WebKitEnumTypes.h.template: Added.
3033         * UIProcess/API/gtk/WebKitFindController.cpp: We can no longer rely on WebKitEnumTypes.h to pull in WebKitWebView.h.
3034
3035 2013-05-13  Noam Rosenthal  <noam@webkit.org>
3036
3037         [CoordGfx] requestAnimationFrame performance issues
3038         https://bugs.webkit.org/show_bug.cgi?id=112345
3039
3040         Reviewed by Jocelyn Turcotte.
3041
3042         Changed the logic of requestAnimationFrame in Coordinated Graphics.
3043         We don't send any IPC messages for requestAnimationFrame. Instead, we do one of two things:
3044         - If there is already a frame pending in the UI process, do nothing, as the animations would
3045           be serviced when the frame is returned to the web process.
3046         - If there is no frame pending, we schedule a flush, making sure that that flush occurs at 
3047           least 1/60 seconds after the last animation service, so that we don't get an infinite loop
3048           of flushes.
3049
3050         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
3051         (WebKit::CoordinatedLayerTreeHostProxy::requestAnimationFrame):
3052         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
3053         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3054         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
3055         (WebKit::CoordinatedLayerTreeHost::flushPendingLayerChanges):
3056         (WebKit::CoordinatedLayerTreeHost::scheduleAnimation):
3057         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
3058         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.messages.in:
3059
3060 2013-05-13  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
3061
3062         [WK2][CoordinatedGraphics] WKView needs API for handling opacity
3063         https://bugs.webkit.org/show_bug.cgi?id=116032
3064
3065         Reviewed by Kenneth Rohde Christiansen.
3066
3067         Add WKViewSetOpacity and WKViewOpacity APIs and use them in
3068         WebView.cpp.
3069
3070         * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
3071         (WKViewSetOpacity):
3072         (WKViewOpacity):
3073         * UIProcess/API/C/CoordinatedGraphics/WKView.h:
3074         * UIProcess/CoordinatedGraphics/WebView.cpp:
3075         (WebKit::WebView::WebView):
3076         (WebKit::WebView::paintToCurrentGLContext):
3077         * UIProcess/CoordinatedGraphics/WebView.h:
3078         (WebKit::WebView::setOpacity):
3079         (WebKit::WebView::opacity):
3080         (WebView):
3081
3082 2013-05-13  Zan Dobersek  <zdobersek@igalia.com>
3083
3084         [GTK] Use WebCore layer archives for TestWebCore, WebKitPluginProcess
3085         https://bugs.webkit.org/show_bug.cgi?id=115918
3086
3087         Reviewed by Gustavo Noronha Silva.
3088
3089         Due to layer violations and circular dependencies the WebKitPluginProcess requires for the
3090         libraries containing the built code of the intertwining Platform and WebCore layers to be
3091         specified multiple times when linking. This can be avoided by packing the two layers' archives
3092         into one big archive, named after the WebCore layer due to no clear boundary between it and the
3093         Platform layer. The big archive can then be specified only once when linking, simplifying the code
3094         and suppressing all the layering violations so they do not cause build problems.
3095
3096         First the libtool libraries that the WebCore layer (as required by the WebKitPluginProcess) depends on
3097         are specified. These are then used as dependencies for the archive creation rule as well as the list
3098         from which the archive file paths are constructed and then used to dump the member files from these archives.
3099         The member files are then added to the big archive. The latter is added to the list of libraries the
3100         WebKitPluginProcess requires to successfully link.
3101
3102         * GNUmakefile.am:
3103
3104 2013-05-13  Zalan Bujtas  <zalan@apple.com>
3105
3106         WebProcess consuming very high CPU on linkedin.com
3107         https://bugs.webkit.org/show_bug.cgi?id=115601
3108
3109         Reviewed by Andreas Kling.
3110
3111         Disable WEB_TIMING_MINIMAL.
3112         Turn off window.performance and performance.now(). Some JS frameworks expect
3113         additional Web Timing APIs, when performance.now() is available.
3114
3115         * Configurations/FeatureDefines.xcconfig:
3116
3117 2013-05-12  Anders Carlsson  <andersca@apple.com>
3118
3119         Stop including UnusedParam.h
3120         https://bugs.webkit.org/show_bug.cgi?id=116003
3121
3122         Reviewed by Sam Weinig.
3123
3124         UnusedParam.h is empty now so there's no need to include it anymore.
3125
3126         * UIProcess/API/C/WKContext.cpp:
3127         * UIProcess/API/C/WKInspector.cpp:
3128         * UIProcess/API/C/WKPage.cpp:
3129         * UIProcess/API/efl/ewk_text_checker.cpp:
3130         * UIProcess/API/efl/ewk_view.cpp:
3131         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:
3132         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
3133         * UIProcess/mac/WKFullScreenWindowController.mm:
3134         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3135         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
3136
3137 2013-05-12  Andreas Kling  <akling@apple.com>
3138
3139         Unload event listeners should prevent Safari from insta-killing the web process on last tab close.
3140         <http://webkit.org/b/115988>
3141         <rdar://problem/13870943>
3142
3143         Reviewed by Anders Carlsson.
3144
3145         Let WebCore control the UI process's suppression of the sudden termination mechanism.
3146         This is implemented by having WebChromeClient push Enable/DisableSuddenTermination messages
3147         over to the UI process where the appropriate NSProcessInfo calls are made.
3148
3149         We also use this information when deciding whether to insta-kill a web process when its last
3150         page is closed. This mechanism is re-usable in WebCore to protect against sudden termination
3151         by the UI process.
3152
3153         * UIProcess/WebProcessProxy.cpp:
3154         (WebKit::WebProcessProxy::WebProcessProxy):
3155         (WebKit::WebProcessProxy::removeWebPage):
3156         (WebKit::WebProcessProxy::enableSuddenTermination):
3157         (WebKit::WebProcessProxy::disableSuddenTermination):
3158         * UIProcess/WebProcessProxy.h:
3159         (WebProcessProxy):
3160         * UIProcess/WebProcessProxy.messages.in:
3161         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3162         (WebKit::WebChromeClient::enableSuddenTermination):
3163         (WebKit::WebChromeClient::disableSuddenTermination):
3164         * WebProcess/WebCoreSupport/WebChromeClient.h:
3165         (WebChromeClient):
3166
3167 2013-05-12  Alexey Proskuryakov  <ap@apple.com>
3168
3169         <rdar://problem/13402976> Sandbox violations in com.nvidia.OpenGL on Lion.
3170
3171         Reviewed by Dan Bernstein.
3172
3173         * WebProcess/com.apple.WebProcess.sb.in: Silence the violations (on Lion only).
3174
3175 2013-05-12  Carlos Garcia Campos  <cgarcia@igalia.com>
3176
3177         [GTK] Remove unnecessary GTK_CHECK_VERSION #ifdefs
3178         https://bugs.webkit.org/show_bug.cgi?id=115914
3179
3180         Reviewed by Martin Robinson.
3181
3182         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3183         (webkitWebViewBaseRealize):
3184
3185 2013-05-12  Raphael Kubo da Costa  <raphael.kubo.da.costa@intel.com>
3186
3187         Unreviewed build fix after r149944.
3188
3189         * Platform/CoreIPC/ArgumentEncoder.cpp: Include <sys/mman.h> for mmap(2).
3190
3191 2013-05-11  Anders Carlsson  <andersca@apple.com>
3192
3193         Don't pass malloced pointers as out-of-line data when sending Mach messages
3194         https://bugs.webkit.org/show_bug.cgi?id=115970
3195         <rdar://problem/13144680>
3196
3197         Reviewed by Sam Weinig.
3198
3199         Give ArgumentEncoder an inline buffer of 512 bytes. If we need more than that, use mmap to allocate data
3200         since that gives us fresh zero-filled memory that we can safely share.
3201
3202         * Platform/CoreIPC/ArgumentEncoder.cpp:
3203         (CoreIPC::ArgumentEncoder::ArgumentEncoder):
3204         Set up the buffer pointers to point to the inline buffer.
3205
3206         (CoreIPC::ArgumentEncoder::~ArgumentEncoder):
3207         Unmap the buffer if necessary.
3208
3209         (CoreIPC::ArgumentEncoder::grow):
3210         Grow the allocation exponentially, rounded up to the nearest page. This is a simplification from the
3211         current strategy, but most messages are either tiny in which case they will fit inside the inline buffer,
3212         or big in which case we'll end up doing less allocations + memory copying.
3213
3214         * Platform/CoreIPC/ArgumentEncoder.h:
3215         (ArgumentEncoder):
3216
3217 2013-05-11  Zan Dobersek  <zdobersek@igalia.com>
3218
3219         Unreviewed GTK build fix after r149904.
3220
3221         * GNUmakefile.list.am: Adding missing build targets.
3222
3223 2013-05-11  Christophe Dumez  <ch.dumez@sisa.samsung.com>
3224
3225         Unreviewed, Fix WK2 EFL build after r149904.
3226
3227         Add new PluginInformation.cpp file to CMake.
3228
3229         * CMakeLists.txt:
3230
3231 2013-05-11  Christophe Dumez  <ch.dumez@sisa.samsung.com>
3232
3233         Unreviewed, fix WK2 EFL build after r149904.
3234
3235         Add new WKPluginInformation.cpp file to CMake.
3236
3237         * CMakeLists.txt:
3238
3239 2013-05-11  Andreas Kling  <akling@apple.com>
3240
3241         When possible, terminate web processes immediately when closing their last page.
3242         <http://webkit.org/b/115964>
3243         <rdar://problem/13869266>
3244
3245         Reviewed by Geoffrey Garen.
3246
3247         When we're using a network process, there's no need for the UI process to wait for web processes
3248         to clear resource caches and terminate nicely.
3249
3250         We can just kill them off right away in WebProcessProxy::removeWebPage() when the last page is closed.
3251
3252         * UIProcess/WebProcessProxy.cpp:
3253         (WebKit::WebProcessProxy::removeWebPage):
3254
3255             Terminate the child process immediately if possible.
3256
3257         * UIProcess/WebProcessProxy.h:
3258         (WebKit::WebProcessProxy::canTerminateChildProcess):
3259         (WebKit::WebProcessProxy::shouldTerminate):
3260
3261             Broke out the logic from the shouldTerminate() IPC message handler into a separate function
3262             so we can call it from removeWebPage().
3263
3264 2013-05-11  Anders Carlsson  <andersca@apple.com>
3265
3266         Crash when terminating a process that has not been fully launched
3267         https://bugs.webkit.org/show_bug.cgi?id=115962
3268         <rdar://problem/13660916>
3269
3270         Reviewed by Andreas Kling.
3271
3272         Handle terminating a process that has not been fully launched.
3273
3274         * UIProcess/Launcher/ProcessLauncher.cpp:
3275         (WebKit::ProcessLauncher::didFinishLaunchingProcess):
3276         If we have been invalidated, dispose the connection identifier.
3277
3278         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3279         (WebKit::ProcessLauncher::terminateProcess):
3280         If we're still launching the process, invalidate so the client won't get an unexpected
3281         didFinishLaunching callback.
3282
3283         * UIProcess/WebProcessProxy.cpp:
3284         (WebKit::WebProcessProxy::requestTermination):
3285         Check if webConnection() is null before calling it. (It will be null if the process isn't fully launched).
3286
3287 2013-05-10  Brian J. Burg  <burg@cs.washington.edu>
3288
3289         Web Inspector: Implement WK2 version of WebInspectorFrontendClient::save
3290         https://bugs.webkit.org/show_bug.cgi?id=115564
3291
3292         Reviewed by Benjamin Poulain.
3293
3294         Implement InspectorFrontendHost's save() and append() methods for
3295         Mac WebKit2. Add canSave() for all ports.
3296
3297         * UIProcess/WebInspectorProxy.cpp:
3298         (WebKit::WebInspectorProxy::save):
3299         (WebKit):
3300         (WebKit::WebInspectorProxy::append):
3301         * UIProcess/WebInspectorProxy.h:
3302         (WebInspectorProxy):
3303         * UIProcess/WebInspectorProxy.messages.in:
3304         * UIProcess/efl/WebInspectorProxyEfl.cpp:
3305         (WebKit::WebInspectorProxy::platformSave):
3306         (WebKit):
3307         (WebKit::WebInspectorProxy::platformAppend):
3308         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3309         (WebKit::WebInspectorProxy::platformSave):
3310         (WebKit):
3311         (WebKit::WebInspectorProxy::platformAppend):
3312         * UIProcess/mac/WebInspectorProxyMac.mm:
3313         (WebKit::WebInspectorProxy::platformSave):
3314         (WebKit):
3315         (WebKit::WebInspectorProxy::platformAppend):
3316         * UIProcess/qt/WebInspectorProxyQt.cpp:
3317         (WebKit::WebInspectorProxy::platformSave):
3318         (WebKit):
3319         (WebKit::WebInspectorProxy::platformAppend):
3320         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
3321         (WebKit::WebInspectorFrontendClient::canSave):
3322         (WebKit):
3323         (WebKit::WebInspectorFrontendClient::save):
3324         (WebKit::WebInspectorFrontendClient::append):
3325         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.h:
3326         (WebInspectorFrontendClient):
3327         * WebProcess/WebPage/WebInspector.cpp:
3328         (WebKit::WebInspector::save):
3329         (WebKit):
3330         (WebKit::WebInspector::append):
3331         (WebKit::WebInspector::didSave):
3332         (WebKit::WebInspector::didAppend):
3333         * WebProcess/WebPage/WebInspector.h:
3334         (WebInspector):
3335         * WebProcess/WebPage/WebInspector.messages.in:
3336         * WebProcess/WebPage/efl/WebInspectorEfl.cpp:
3337         (WebKit::WebInspector::canSave):
3338         (WebKit):
3339         * WebProcess/WebPage/gtk/WebInspectorGtk.cpp:
3340         (WebKit::WebInspector::canSave):
3341         (WebKit):
3342         * WebProcess/WebPage/mac/WebInspectorMac.mm:
3343         (WebKit::WebInspector::canSave):
3344         (WebKit):
3345         * WebProcess/WebPage/qt/WebInspectorQt.cpp:
3346         (WebKit::WebInspector::canSave):
3347         (WebKit):
3348
3349 2013-05-10  Remy Demarest  <rdemarest@apple.com>
3350
3351         Copy WKPluginInformation.h header to the WebKit2 Framework private headers.
3352         https://bugs.webkit.org/show_bug.cgi?id=115940
3353
3354         Reviewed by Darin Adler.
3355
3356         * WebKit2.xcodeproj/project.pbxproj:
3357         Move WKPluginInformation.h file from the framework's Project Headers to
3358         Private Headers.
3359
3360 2013-05-10  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
3361
3362         [Qt][Mac] Unreviewed. Roll out the fix attempt in r149912.
3363
3364         * Target.pri:
3365
3366 2013-05-10  Simon Cooper  <scooper@apple.com>
3367
3368         Fix AppleConnect issues for WiFi interfaces
3369         <rdar://problem/13776227&13776240&13776281>
3370         https://bugs.webkit.org/show_bug.cgi?id=115932
3371
3372         Reviewed by Alexey Proskuryakov.
3373
3374         Add support for WiFi interfaces for the AppleConnect plugin.
3375         Remove the FIXME.
3376
3377         * Resources/PlugInSandboxProfiles/com.apple.ist.ds.appleconnect.webplugin.sb:
3378
3379 2013-05-10  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
3380
3381         [Qt][Mac] Unreviewed speculative build fix after r149904.
3382
3383         * Target.pri:
3384
3385 2013-05-10  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
3386
3387         [Qt] Unreviewed buildfix after r149904.
3388
3389         * Target.pri:
3390
3391 2013-05-09  Sam Weinig  <sam@webkit.org>
3392
3393         Unify plug-in information dictionaries
3394         <rdar://problem/13852080>
3395         https://bugs.webkit.org/show_bug.cgi?id=115891
3396
3397         Reviewed by Anders Carlsson.
3398
3399         This unifies the plug-in information dictionaries vended by WKContextCopyPlugInInfoForBundleIdentifier
3400         and WKContextGetInfoForInstalledPlugIns with those from the WKPageLoaderClient and WKPageUIClient.
3401
3402         All the old keys will continue to work, but have been deprecated in favor of new keys defined in 
3403         WKPluginInformation.h
3404
3405         * Shared/API/c/WKPluginInformation.cpp: Added.
3406         * Shared/API/c/WKPluginInformation.h: Added.
3407         Export new keys as SPI.
3408
3409         * Shared/Plugins/Netscape/PluginInformation.h: Added.
3410         * Shared/Plugins/Netscape/PluginInformation.cpp: Added.
3411         (WebKit::pluginInformationBundleIdentifierKey):
3412         (WebKit::pluginInformationBundleVersionKey):
3413         (WebKit::pluginInformationPathKey):
3414         (WebKit::pluginInformationDisplayNameKey):
3415         (WebKit::pluginInformationDefaultLoadPolicyKey):
3416         (WebKit::pluginInformationUpdatePastLastBlockedVersionIsKnownAvailableKey):
3417         (WebKit::pluginInformationHasSandboxProfileKey):
3418         (WebKit::pluginInformationFrameURLKey):
3419         (WebKit::pluginInformationMIMETypeKey):
3420         (WebKit::pluginInformationPageURLKey):
3421         (WebKit::pluginInformationPluginspageAttributeURLKey):
3422         (WebKit::pluginInformationPluginURLKey):
3423         Add new keys.
3424
3425         (WebKit::pluginModuleInformation):
3426         (WebKit::createPluginInformationDictionary):
3427         Add creation functions to simplify multiple sites.
3428
3429         * Shared/Plugins/Netscape/mac/PluginInformationMac.mm: Added.
3430         (WebKit::platformPluginModuleInformation):
3431         Add platform specific data to the dictionary.
3432
3433         * UIProcess/API/C/WKPage.cpp:
3434         (WKPageGetPluginInformationBundleIdentifierKey):
3435         (WKPageGetPluginInformationBundleVersionKey):
3436         (WKPageGetPluginInformationDisplayNameKey):
3437         (WKPageGetPluginInformationFrameURLKey):
3438         (WKPageGetPluginInformationMIMETypeKey):
3439         (WKPageGetPluginInformationPageURLKey):
3440         (WKPageGetPluginInformationPluginspageAttributeURLKey):
3441         (WKPageGetPluginInformationPluginURLKey):
3442         * UIProcess/API/C/WKPage.h:
3443         Deprecate the old keys.
3444
3445         * UIProcess/API/C/mac/WKContextPrivateMac.h:
3446         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
3447         (WKContextCopyPlugInInfoForBundleIdentifier):
3448         (WKContextGetInfoForInstalledPlugIns):
3449         Simplify by using the new createPluginInformationDictionary functions.
3450
3451         (WKPlugInInfoPathKey):
3452         (WKPlugInInfoBundleIdentifierKey):
3453         (WKPlugInInfoVersionKey):
3454         (WKPlugInInfoLoadPolicyKey):
3455         (WKPlugInInfoUpdatePastLastBlockedVersionIsKnownAvailableKey):
3456         (WKPlugInInfoIsSandboxedKey):
3457         Deprecate the old keys.
3458
3459         * UIProcess/WebLoaderClient.cpp:
3460         (WebKit::WebLoaderClient::didFailToInitializePlugin):
3461         (WebKit::WebLoaderClient::didBlockInsecurePluginVersion):
3462         (WebKit::WebLoaderClient::pluginLoadPolicy):
3463         * UIProcess/WebLoaderClient.h:
3464         * UIProcess/WebUIClient.cpp:
3465         (WebKit::WebUIClient::unavailablePluginButtonClicked):
3466         * UIProcess/WebUIClient.h:
3467         Optimize for the most recent callback type which takes a dictionary,
3468         and pull out the necessary bits from it for deprecated callbacks as necessary.
3469
3470         * UIProcess/WebPageProxy.h:
3471         * UIProcess/WebPageProxy.cpp:
3472         (WebKit::WebPageProxy::findPlugin):
3473         (WebKit::WebPageProxy::unavailablePluginButtonClicked):
3474         (WebKit::WebPageProxy::didFailToInitializePlugin):
3475         (WebKit::WebPageProxy::didBlockInsecurePluginVersion):
3476         Use createPluginInformationDictionary() consistently, to get consistent results for callbacks.
3477
3478         * WebKit2.xcodeproj/project.pbxproj:
3479         Add new files.
3480
3481 2013-05-10  Brian J. Burg  <burg@cs.washington.edu>
3482
3483         Web Inspector: implement runOpenPanel callback for WebKit2 inspector
3484         https://bugs.webkit.org/show_bug.cgi?id=115865
3485
3486         Reviewed by Sam Weinig.
3487
3488         * UIProcess/WebInspectorProxy.h:
3489         (WebKit::WebInspectorProxy::inspectorWindow):
3490         Add an accessor for m_inspectorWindow.
3491
3492         * UIProcess/mac/WebInspectorProxyMac.mm:
3493         (WebKit::runOpenPanel):
3494         Show the open panel dialog when requested.
3495
3496         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3497         Register the callback when the inspector page is created.
3498
3499 2013-05-10  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
3500
3501         [WK2][CoordinatedGraphics] WKViewSetThemePath is EFL specific
3502         https://bugs.webkit.org/show_bug.cgi?id=115928
3503
3504         Reviewed by Kenneth Rohde Christiansen.
3505
3506         WKViewSetThemePath was moved to WKViewEfl.h since it is EFL specific.
3507
3508         * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
3509         * UIProcess/API/C/CoordinatedGraphics/WKView.h:
3510         * UIProcess/API/C/efl/WKViewEfl.cpp:
3511         (WKViewSetThemePath):
3512         * UIProcess/API/C/efl/WKViewEfl.h:
3513         * UIProcess/CoordinatedGraphics/WebView.cpp:
3514         * UIProcess/CoordinatedGraphics/WebView.h:
3515         (WebView):
3516         * UIProcess/efl/ViewClientEfl.cpp:
3517         * UIProcess/efl/WebInspectorProxyEfl.cpp:
3518         * UIProcess/efl/WebViewEfl.cpp:
3519         (WebKit::WebViewEfl::setThemePath):
3520         * UIProcess/efl/WebViewEfl.h:
3521         (WebViewEfl):
3522
3523 2013-05-10  Jer Noble  <jer.noble@apple.com>
3524
3525         REGRESSION (r149439): Video turns blank upon entering full screen for the first time
3526         https://bugs.webkit.org/show_bug.cgi?id=115617
3527
3528         Reviewed by Eric Carlson.
3529
3530         Partially revert the change introduced in r149439 for OS X 10.8 and previous. On these
3531         platforms, create a window with a NSZeroSize initial frame, which fixes the "blank"
3532         first-full screen behavior.
3533
3534         * UIProcess/API/mac/WKView.mm:
3535         (-[WKView createFullScreenWindow]):
3536
3537 2013-05-10  Zan Dobersek  <zdobersek@igalia.com>
3538
3539         [WK2] Make the WebSoupRequestManager a supplement to the WebProcess
3540         https://bugs.webkit.org/show_bug.cgi?id=115717
3541
3542         Reviewed by Andreas Kling.
3543
3544         WebSoupRequestManager should inherit from WebProcessSupplement and should be used as such
3545         by the WebProcess. This removes the need for the m_soupRequestManager member variable in
3546         the WebProcess class and brings the WebSoupRequestManager in line with other manager classes
3547         of which instances are controlled by the WebProcess class.
3548
3549         * WebProcess/WebProcess.cpp:
3550         (WebKit::WebProcess::WebProcess): Add  the WebSoupRequestManager as a supplement.
3551         * WebProcess/WebProcess.h:
3552         (WebProcess): Remove the m_soupRequestManager member variable and its getter method.
3553         * WebProcess/soup/WebKitSoupRequestGeneric.cpp:
3554         (webkitSoupRequestGenericSendAsync): Access the WebSoupRequestManager as a supplement.
3555         (webkitSoupRequestGenericSendFinish): Ditto.
3556         * WebProcess/soup/WebProcessSoup.cpp:
3557         (WebKit::WebProcess::platformInitializeWebProcess): Access the WebSoupRequestManager as a supplement.
3558         * WebProcess/soup/WebSoupRequestManager.cpp:
3559         (WebKit::WebSoupRequestManager::supplementName): Specify the supplement's name.
3560         * WebProcess/soup/WebSoupRequestManager.h:
3561         (WebSoupRequestManager): Inherit from the WebProcessSupplement interface.
3562
3563 2013-05-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3564
3565         [GTK] Remove unnecessary GLIB_CHECK_VERSION #ifdefs
3566         https://bugs.webkit.org/show_bug.cgi?id=115904
3567
3568         Reviewed by Martin Robinson.
3569
3570         * UIProcess/API/gtk/tests/TestInspectorServer.cpp:
3571         (startTestServerMonitor):
3572         * UIProcess/API/gtk/tests/TestWebKitAccessibility.cpp:
3573         (startTestServerMonitor):
3574
3575 2013-05-09  Anders Carlsson  <andersca@apple.com>
3576
3577         Fix build.
3578
3579         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
3580
3581 2013-05-09  Anders Carlsson  <andersca@apple.com>
3582
3583         Enable UI process storage
3584         https://bugs.webkit.org/show_bug.cgi?id=115879
3585         <rdar://problem/12239765>
3586
3587         Reviewed by Beth Dakin.
3588
3589         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3590         Flip the switch.
3591
3592 2013-05-09  Anders Carlsson  <andersca@apple.com>
3593
3594         Remove extra spaces between right angle brackets in template declarations
3595         https://bugs.webkit.org/show_bug.cgi?id=115877
3596
3597         Reviewed by Beth Dakin.
3598
3599         C++11 doesn't require spaces between right angle brackets so remove all of them.
3600
3601         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
3602         (WebKit::NetworkBlobRegistry::registerBlobURL):
3603         (WebKit::NetworkBlobRegistry::sandboxExtensions):
3604         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
3605         (NetworkBlobRegistry):
3606         * NetworkProcess/HostRecord.h:
3607         (HostRecord):
3608         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3609         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
3610         (WebKit::NetworkConnectionToWebProcess::didClose):
3611         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
3612         * NetworkProcess/NetworkConnectionToWebProcess.h:
3613         (NetworkConnectionToWebProcess):
3614         * NetworkProcess/NetworkProcess.h:
3615         (NetworkProcess):
3616         * NetworkProcess/NetworkResourceLoadScheduler.cpp:
3617         (WebKit::NetworkResourceLoadScheduler::servePendingRequests):
3618         (WebKit::NetworkResourceLoadScheduler::removeScheduledLoaders):
3619         * NetworkProcess/NetworkResourceLoadScheduler.h:
3620         * NetworkProcess/SchedulableLoader.cpp:
3621         (WebKit::SchedulableLoader::SchedulableLoader):
3622         * NetworkProcess/SchedulableLoader.h:
3623         (SchedulableLoader):
3624         * Platform/CoreIPC/ArgumentCoders.h:
3625         * Platform/CoreIPC/Connection.cpp:
3626         (Connection::SyncMessageState):
3627         (CoreIPC::Connection::waitForMessage):
3628         (CoreIPC::Connection::processIncomingMessage):
3629         * Platform/CoreIPC/Connection.h:
3630         (Connection):
3631         * Platform/WorkQueue.h:
3632         (WorkQueue):
3633         * PluginProcess/PluginProcess.h:
3634         (PluginProcess):
3635         * Scripts/webkit2/messages_unittest.py:
3636         (CoreIPC):
3637         * Shared/BlockingResponseMap.h:
3638         (BlockingResponseMap):
3639         * Shared/ChildProcessProxy.h:
3640         (ChildProcessProxy):
3641         * Shared/ImmutableArray.cpp:
3642         (WebKit::ImmutableArray::ImmutableArray):
3643         * Shared/ImmutableArray.h:
3644         (WebKit::ImmutableArray::adopt):
3645         (ImmutableArray):
3646         * Shared/ImmutableDictionary.cpp:
3647         (WebKit::ImmutableDictionary::keys):
3648         * Shared/ImmutableDictionary.h:
3649         (ImmutableDictionary):
3650         * Shared/Network/CustomProtocols/CustomProtocolManager.h:
3651         (CustomProtocolManager):
3652         * Shared/SecurityOriginData.cpp:
3653         (WebKit::performAPICallbackWithSecurityOriginDataVector):
3654         * Shared/SessionState.cpp:
3655         * Shared/StatisticsData.h:
3656         (StatisticsData):
3657         * Shared/UserMessageCoders.h:
3658         (WebKit::UserMessageDecoder::baseDecode):
3659         * Shared/WebArchive.cpp:
3660         (WebKit::WebArchive::WebArchive):
3661         (WebKit::WebArchive::subresources):
3662         (WebKit::WebArchive::subframeArchives):
3663         * Shared/WebContextMenuItem.cpp:
3664         (WebKit::WebContextMenuItem::submenuItemsAsImmutableArray):
3665         * Shared/WebOpenPanelParameters.cpp:
3666         (WebKit::WebOpenPanelParameters::acceptMIMETypes):
3667         (WebKit::WebOpenPanelParameters::selectedFileNames):
3668         * Shared/mac/ArgumentCodersMac.mm:
3669         (CoreIPC::encode):
3670         * SharedWorkerProcess/SharedWorkerProcess.h:
3671         (SharedWorkerProcess):
3672         * UIProcess/API/mac/WKPrintingView.h:
3673         (WebFrameProxy):
3674         * UIProcess/API/mac/WKPrintingView.mm:
3675         (-[WKPrintingView _drawPreview:]):
3676         * UIProcess/API/mac/WKView.mm:
3677         (WebKit):
3678         * UIProcess/Downloads/DownloadProxyMap.cpp:
3679         (WebKit::DownloadProxyMap::processDidClose):
3680         * UIProcess/Downloads/DownloadProxyMap.h:
3681         (DownloadProxyMap):
3682         * UIProcess/GeolocationPermissionRequestManagerProxy.h:
3683         (GeolocationPermissionRequestManagerProxy):
3684         * UIProcess/Launcher/mac/DynamicLinkerEnvironmentExtractor.h:
3685         (DynamicLinkerEnvironmentExtractor):
3686         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
3687         (CustomProtocolManagerProxy):
3688         * UIProcess/Network/NetworkProcessProxy.h:
3689         (NetworkProcessProxy):
3690         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h:
3691         (NotificationPermissionRequestManagerProxy):
3692         * UIProcess/Notifications/WebNotificationManagerProxy.h:
3693         (WebNotificationManagerProxy):
3694         * UIProcess/Plugins/PluginProcessManager.h:
3695         (PluginProcessManager):
3696         * UIProcess/Plugins/PluginProcessProxy.h:
3697         (PluginProcessProxy):
3698         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
3699         (WebKit::WebPluginSiteDataManager::didGetSitesWithData):
3700         * UIProcess/Plugins/WebPluginSiteDataManager.h:
3701         (WebPluginSiteDataManager):
3702         * UIProcess/SharedWorkers/SharedWorkerProcessManager.h:
3703         (SharedWorkerProcessManager):
3704         * UIProcess/SharedWorkers/SharedWorkerProcessProxy.h:
3705         (SharedWorkerProcessProxy):
3706         * UIProcess/StatisticsRequest.cpp:
3707         (WebKit::StatisticsRequest::completedRequest):
3708         * UIProcess/Storage/StorageManager.cpp:
3709         (StorageManager::StorageArea):
3710         (WebKit::StorageManager::StorageArea::dispatchEvents):
3711         (StorageManager::SessionStorageNamespace):
3712         (WebKit::StorageManager::SessionStorageNamespace::getOrCreateStorageArea):
3713         (WebKit::StorageManager::SessionStorageNamespace::cloneTo):
3714         (WebKit::StorageManager::createLocalStorageMap):
3715         (WebKit::StorageManager::createSessionStorageMap):
3716         (WebKit::StorageManager::destroyStorageMap):
3717         (WebKit::StorageManager::invalidateConnectionInternal):
3718         (WebKit::StorageManager::findStorageArea):
3719         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
3720         * UIProcess/Storage/StorageManager.h:
3721         (StorageManager):
3722         * UIProcess/WebApplicationCacheManagerProxy.h:
3723         (WebApplicationCacheManagerProxy):
3724         * UIProcess/WebBackForwardList.cpp:
3725         (WebKit::WebBackForwardList::addItem):
3726         (WebKit::WebBackForwardList::backListAsImmutableArrayWithLimit):
3727         (WebKit::WebBackForwardList::forwardListAsImmutableArrayWithLimit):
3728         (WebKit::WebBackForwardList::clear):
3729         * UIProcess/WebBackForwardList.h:
3730         (WebKit):
3731         * UIProcess/WebContext.cpp:
3732         (WebKit::WebContext::createNewWebProcess):
3733         (WebKit::WebContext::enableProcessTermination):
3734         (WebKit::WebContext::pluginInfoStoreDidLoadPlugins):
3735         * UIProcess/WebContext.h:
3736         (WebContext):
3737         * UIProcess/WebCookieManagerProxy.cpp:
3738         (WebKit::WebCookieManagerProxy::didGetHostnamesWithCookies):
3739         * UIProcess/WebCookieManagerProxy.h:
3740         (WebCookieManagerProxy):
3741         * UIProcess/WebDatabaseManagerProxy.cpp:
3742         (WebKit::WebDatabaseManagerProxy::didGetDatabasesByOrigin):
3743         (WebKit::WebDatabaseManagerProxy::didGetDatabaseOrigins):
3744         * UIProcess/WebDatabaseManagerProxy.h:
3745         (WebDatabaseManagerProxy):
3746         * UIProcess/WebFormClient.cpp:
3747         (WebKit::WebFormClient::willSubmitForm):
3748         * UIProcess/WebFormClient.h:
3749         (WebFormClient):
3750         * UIProcess/WebKeyValueStorageManagerProxy.h:
3751         (WebKeyValueStorageManagerProxy):
3752         * UIProcess/WebLoaderClient.cpp:
3753         (WebKit::WebLoaderClient::didChangeBackForwardList):
3754         * UIProcess/WebLoaderClient.h:
3755         (WebLoaderClient):
3756         * UIProcess/WebMediaCacheManagerProxy.cpp:
3757         (WebKit::WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache):
3758         * UIProcess/WebMediaCacheManagerProxy.h:
3759         (WebMediaCacheManagerProxy):
3760         * UIProcess/WebPageContextMenuClient.cpp:
3761         (WebKit::WebPageContextMenuClient::showContextMenu):
3762         * UIProcess/WebPageProxy.cpp:
3763         (ExceededDatabaseQuotaRecords):
3764         (WebKit::WebPageProxy::relatedPages):
3765         (WebKit::WebPageProxy::didChangeBackForwardList):
3766         (WebKit::WebPageProxy::handleWheelEvent):
3767         (WebKit::WebPageProxy::processNextQueuedWheelEvent):
3768         (WebKit::WebPageProxy::findStringMatches):
3769         (WebKit::WebPageProxy::willSubmitForm):
3770         (WebKit::WebPageProxy::pluginInformationDictionary):
3771         (WebKit::WebPageProxy::didFindStringMatches):
3772         (WebKit::WebPageProxy::didReceiveEvent):
3773         * UIProcess/WebPageProxy.h:
3774         (WebPageProxy):
3775         * UIProcess/WebPageProxy.messages.in:
3776         * UIProcess/WebProcessProxy.cpp:
3777         (WebKit::WebProcessProxy::disconnect):
3778         (WebKit::WebProcessProxy::didClose):
3779         (WebKit::WebProcessProxy::didBecomeUnresponsive):
3780         (WebKit::WebProcessProxy::interactionOccurredWhileUnresponsive):
3781         (WebKit::WebProcessProxy::didBecomeResponsive):
3782         (WebKit::WebProcessProxy::disconnectFramesFromPage):
3783         (WebKit::WebProcessProxy::frameCountInPage):
3784         * UIProcess/WebProcessProxy.h:
3785         (WebProcessProxy):
3786         * UIProcess/WebResourceCacheManagerProxy.h:
3787         (WebResourceCacheManagerProxy):
3788         * UIProcess/mac/WebContextMenuProxyMac.mm:
3789         (WebKit::populateNSMenu):
3790         (WebKit::nsMenuItemVector):
3791         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp:
3792         (WebKit::WebApplicationCacheManager::getApplicationCacheOrigins):
3793         * WebProcess/Geolocation/WebGeolocationManager.cpp:
3794         (WebKit::WebGeolocationManager::didChangePosition):
3795         (WebKit::WebGeolocationManager::didFailToDeterminePosition):
3796         * WebProcess/IconDatabase/WebIconDatabaseProxy.h:
3797         (WebIconDatabaseProxy):
3798         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
3799         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3800         (WebKit::InjectedBundle::originsWithApplicationCache):
3801         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp:
3802         (WebKit::InjectedBundleBackForwardListItem::children):
3803         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
3804         (WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange):
3805         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
3806         (InjectedBundlePageEditorClient):
3807         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
3808         (WebKit::InjectedBundlePageFormClient::willSendSubmitEvent):
3809         (WebKit::InjectedBundlePageFormClient::willSubmitForm):
3810         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.h:
3811         (InjectedBundlePageFormClient):
3812         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
3813         (WebKit::InjectedBundlePageLoaderClient::featuresUsedInPage):
3814         * WebProcess/Network/WebResourceLoadScheduler.cpp:
3815         (WebKit::WebResourceLoadScheduler::internallyFailedLoadTimerFired):
3816         (WebKit::WebResourceLoadScheduler::networkProcessCrashed):
3817         * WebProcess/Network/WebResourceLoadScheduler.h:
3818         (WebResourceLoadScheduler):
3819         * WebProcess/Notifications/NotificationPermissionRequestManager.h:
3820         (NotificationPermissionRequestManager):
3821         * WebProcess/Notifications/WebNotificationManager.h:
3822         (WebNotificationManager):
3823         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
3824         (WebKit::NPRuntimeObjectMap::invalidate):
3825         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
3826         (NPRuntimeObjectMap):
3827         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3828         (WebKit::NetscapePlugin::stopAllStreams):
3829         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
3830         (NetscapePlugin):
3831         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
3832         (NetscapePluginStream):
3833         * WebProcess/Plugins/PDF/SimplePDFPlugin.mm:
3834         (getAllScriptsInPDFDocument):
3835         (WebKit::SimplePDFPlugin::runScriptsInPDFDocument):
3836         * WebProcess/Plugins/PluginProcessConnectionManager.h:
3837         (PluginProcessConnectionManager):
3838         * WebProcess/Plugins/PluginView.cpp:
3839         (WebKit::PluginView::cancelAllStreams):
3840         * WebProcess/Plugins/PluginView.h:
3841         (PluginView):
3842         * WebProcess/Storage/StorageAreaMap.cpp:
3843         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
3844         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
3845         * WebProcess/Storage/StorageNamespaceImpl.cpp:
3846         (WebKit::StorageNamespaceImpl::storageArea):
3847         * WebProcess/Storage/StorageNamespaceImpl.h:
3848         (StorageNamespaceImpl):
3849         * WebProcess/Storage/WebKeyValueStorageManager.cpp:
3850         (WebKit::keyValueStorageOriginIdentifiers):
3851         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
3852         (WebKit::WebDatabaseManager::getDatabasesByOrigin):
3853         (WebKit::WebDatabaseManager::getDatabaseOrigins):
3854         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3855         (WebKit::WebEditorClient::getClientPasteboardDataForRange):
3856         * WebProcess/WebCoreSupport/WebEditorClient.h:
3857         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3858         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
3859         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
3860         (WebKit::WebEditorClient::documentFragmentFromAttributedString):
3861         * WebProcess/WebPage/EventDispatcher.h:
3862         (EventDispatcher):
3863         * WebProcess/WebPage/FindController.cpp:
3864         (WebKit::FindController::findStringMatches):
3865         * WebProcess/WebPage/FindController.h:
3866         (FindController):
3867         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3868         (WebKit):
3869         * WebProcess/WebPage/WebFrame.cpp:
3870         (WebKit::WebFrame::childFrames):
3871         * WebProcess/WebPage/WebPage.cpp:
3872         (WebKit::WebPage::trackedRepaintRects):
3873         * WebProcess/WebPage/WebPage.h:
3874         (WebKit):
3875         (WebPage):
3876         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
3877         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3878         (TiledCoreAnimationDrawingArea):
3879         * WebProcess/WebProcess.cpp:
3880         (WebKit::WebProcess::visitedLinkStateChanged):
3881         (WebKit::WebProcess::allVisitedLinkStateChanged):
3882         (WebKit::WebProcess::focusedWebPage):
3883         (WebKit::WebProcess::createWebPage):
3884         (WebKit::WebProcess::didClose):
3885         (WebKit::WebProcess::webPageGroup):
3886         (WebKit::addCaseFoldedCharacters):
3887         (WebKit::getWebCoreMemoryCacheStatistics):
3888         (WebKit::WebProcess::setTextCheckerState):
3889         * WebProcess/WebProcess.h:
3890         (WebProcess):
3891
3892 2013-05-09  Anders Carlsson  <andersca@apple.com>
3893
3894         Implement WebPlatformStrategies::transientLocalStorageNamespace
3895         https://bugs.webkit.org/show_bug.cgi?id=115876
3896         <rdar://problem/13852871>
3897
3898         Reviewed by Beth Dakin.
3899
3900         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3901         (WebKit::WebPlatformStrategies::transientLocalStorageNamespace):
3902         Return a session storage namespace for a random page when UI process storage is enabled,
3903         otherwise call the base class implementation.
3904
3905 2013-05-09  Anders Carlsson  <andersca@apple.com>
3906
3907         Use explicit qualifiers for names in the std:: namespace
3908         https://bugs.webkit.org/show_bug.cgi?id=115868
3909
3910         Reviewed by Andreas Kling.
3911
3912         * Shared/mac/ArgumentCodersMac.mm:
3913         (CoreIPC::encode):
3914         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
3915         (WKPluginSiteDataManagerClearAllSiteData):
3916         * UIProcess/Plugins/PluginInfoStore.cpp:
3917         (WebKit::PluginInfoStore::findPluginForExtension):
3918         * UIProcess/WebFrameProxy.cpp:
3919         * UIProcess/WebProcessProxy.cpp:
3920         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
3921         (WebKit::parsePostBuffer):
3922         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3923         (WebKit::NetscapePlugin::loadURL):
3924         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
3925         (WebKit::NetscapePluginStream::deliverDataToPlugin):
3926         * WebProcess/Plugins/PDF/SimplePDFPlugin.mm:
3927         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3928         * WebProcess/WebPage/FindController.cpp:
3929         (WebKit::FindController::countStringMatches):
3930         (WebKit::FindController::updateFindUIAfterPageScroll):
3931         * WebProcess/WebPage/WebPage.cpp:
3932         * WebProcess/WebPage/mac/WebPageMac.mm:
3933         (WebKit::drawPDFPage):
3934         * WebProcess/mac/WebProcessMac.mm:
3935
3936 2013-05-09  Max Feil  <mfeil@rim.com>
3937
3938         shouldUsePluginDocument() needs to be respected when a document is created
3939         https://bugs.webkit.org/show_bug.cgi?id=110308
3940
3941         Reviewed by Rob Buis.
3942
3943         Renaming shouldUsePluginDocument() to shouldAlwaysUsePluginDocument()
3944         for clarity.
3945
3946         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3947         (WebKit::WebFrameLoaderClient::shouldAlwaysUsePluginDocument):
3948         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3949         (WebFrameLoaderClient):
3950
3951 2013-05-09  Timothy Hatcher  <timothy@apple.com>
3952
3953         Make dragging off a tab in Safari with a docked Inspector reattach the Inspector.
3954
3955         https://webkit.org/b/115832
3956         rdar://problem/13605661
3957
3958         Reviewed by Benjamin Poulain.
3959
3960         * UIProcess/mac/WebInspectorProxyMac.mm:
3961         (WebKit::WebInspectorProxy::platformBringToFront):
3962         If the Web Inspector is no longer in the same window as the inspected view,
3963         then we need to reopen the Inspector to get it attached to the right window.
3964
3965 2013-05-08  Anders Carlsson  <andersca@apple.com>
3966
3967         Fix a typo in a comment.
3968
3969         Rubber-stamped by Darin Adler.
3970
3971         * WebProcess/WebProcess.cpp:
3972         (WebKit::WebProcess::initializeConnection):
3973
3974 2013-05-08  Anders Carlsson  <andersca@apple.com>
3975
3976         Remove bogus StorageAreaMap assertions
3977         https://bugs.webkit.org/show_bug.cgi?id=115838
3978
3979         Reviewed by Sam Weinig.
3980
3981         It is possible for didGetValues, and didClear to be called even if m_hasPendingClear is false so remove the assertions.
3982
3983         * WebProcess/Storage/StorageAreaMap.cpp:
3984         (WebKit::StorageAreaMap::didGetValues):
3985         (WebKit::StorageAreaMap::didClear):
3986
3987 2013-05-08  Anders Carlsson  <andersca@apple.com>
3988
3989         Handle incoming clear operations
3990         https://bugs.webkit.org/show_bug.cgi?id=115829
3991
3992         Reviewed by Sam Weinig.
3993
3994         Handle clear by building up a new storage map with our pending changes.
3995
3996         * WebProcess/Storage/StorageAreaMap.cpp:
3997         (WebKit::StorageAreaMap::applyChange):
3998
3999 2013-05-08  Anders Carlsson  <andersca@apple.com>
4000
4001         Don't apply changes while we're clearing the database
4002         https://bugs.webkit.org/show_bug.cgi?id=115826
4003
4004         Reviewed by Darin Adler.
4005
4006         * UIProcess/Storage/LocalStorageDatabase.cpp:
4007         (WebKit::LocalStorageDatabase::openDatabase):
4008         Only call didOpenDatabaseWithOrigin if we actually did open the database.
4009
4010         (WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems):
4011         Create the database if needed.
4012
4013         * UIProcess/Storage/StorageManager.cpp:
4014         (WebKit::StorageManager::getValues):
4015         Send back a DidGetValues message.
4016
4017         * WebProcess/Storage/StorageAreaMap.cpp:
4018         (WebKit::StorageAreaMap::StorageAreaMap):
4019         Initialize m_hasPendingClear.
4020
4021         (WebKit::StorageAreaMap::clear):
4022         Set m_hasPendingClear to true.
4023
4024         (WebKit::StorageAreaMap::resetValues):
4025         Set m_hasPendingClear back to false.
4026
4027         (WebKit::StorageAreaMap::loadValuesIfNeeded):
4028         Set m_hasPendingClear to true so we'll ignore any changes that are already part of the returned items.
4029
4030         (WebKit::StorageAreaMap::didGetValues):
4031         Set m_hasPendingClear back to false.
4032
4033         (WebKit::StorageAreaMap::didClear):
4034         Set m_hasPendingClear back to false.
4035
4036         (WebKit::StorageAreaMap::applyChange):
4037         Don't apply the change if m_hasPendingClear is true.
4038
4039         * WebProcess/Storage/StorageAreaMap.messages.in:
4040         Add DidGetValues message.
4041
4042 2013-05-08  Andy Estes  <aestes@apple.com>
4043
4044         [WebKit2] REGRESSION (Custom Protocols): Reproducible crash when navigating to URL with an invalid scheme
4045         https://bugs.webkit.org/show_bug.cgi?id=115790
4046
4047         Reviewed by Alexey Proskuryakov.
4048
4049         NSMutableSet does not support adding or removing nil objects, and
4050         WTF::HashSet does not support adding, removing, or checking for null
4051         WTF::Strings.
4052
4053         For the NSMutableSet case, make sure that we don't try to add or remove
4054         nil NSStrings.
4055
4056         For the WTF::HashSet case, NSURL will return a nil NSString if we ask
4057         it for its scheme when it is invalid, which we will convert to a null
4058         WTF::String. Don't try to check if our HashSet of registered schemes
4059         contains a null String.
4060
4061         * Shared/Network/CustomProtocols/mac/CustomProtocolManagerMac.mm:
4062         (WebKit::CustomProtocolManager::registerScheme): Assert that the scheme
4063         isn't null. We reject null schemes at the WKBrowsingContextController level.
4064         (WebKit::CustomProtocolManager::unregisterScheme): Ditto.
4065         (WebKit::CustomProtocolManager::supportsScheme): If scheme is null, return false.
4066         * UIProcess/API/mac/WKBrowsingContextController.mm:
4067         (+[WKBrowsingContextController registerSchemeForCustomProtocol:]): Do not register a nil scheme.
4068         (+[WKBrowsingContextController unregisterSchemeForCustomProtocol:]): Ditto.
4069
4070 2013-05-08  Anders Carlsson  <andersca@apple.com>
4071
4072         Apply remote changes to storage maps locally
4073         https://bugs.webkit.org/show_bug.cgi?id=115825
4074
4075         Reviewed by Beth Dakin.
4076
4077         * WebProcess/Storage/StorageAreaMap.cpp:
4078         (WebKit::StorageAreaMap::resetValues):
4079         Clear the pending values map.
4080
4081         (WebKit::StorageAreaMap::didSetItem):
4082         If we failed to set the item, forget everything we know about this storage map.
4083         Otherwise, remove the pending item.
4084
4085         (WebKit::StorageAreaMap::didRemoveItem):
4086         Remove the pending item.
4087
4088         (WebKit::StorageAreaMap::shouldApplyChangeForKey):
4089         Helper function that returns whether a change for a given key should be applied.
4090
4091         (WebKit::StorageAreaMap::applyChange):
4092         Apply the change. Currently only adds and removes are handled.
4093
4094         (WebKit::StorageAreaMap::dispatchStorageEvent):
4095         Apply the change locally as well if needed.
4096
4097         * WebProcess/Storage/StorageAreaMap.h:
4098
4099 2013-05-08  Anders Carlsson  <andersca@apple.com>
4100
4101         Assert at compile time that we don't pass Objective-C object pointers to adoptCF
4102         https://bugs.webkit.o