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