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