Query directly for cache partition names
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2013-04-12  Jeffrey Pfau  <jpfau@apple.com>
2
3         Query directly for cache partition names
4         https://bugs.webkit.org/show_bug.cgi?id=114538
5
6         Reviewed by David Kilzer.
7
8         Call back into WebKitSystemInterface to ask it for the cache
9         partition names instead of trying to figure them out.
10
11         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
12         (WebKit::WebResourceCacheManager::getCacheOrigins):
13         (WebKit):
14         (WebKit::WebResourceCacheManager::returnCacheOrigins):
15         * WebProcess/ResourceCache/WebResourceCacheManager.h:
16         (WebResourceCacheManager):
17         * WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.cpp:
18         (WebKit::WebResourceCacheManager::cfURLCacheHostNames):
19         (WebKit):
20         (WebKit::WebResourceCacheManager::cfURLCacheHostNamesWithCallback):
21
22 2013-04-12  Gavin Barraclough  <barraclough@apple.com>
23
24         Build fix - too soon!
25
26         * UIProcess/API/mac/WKViewPrivate.h:
27
28 2013-04-12  Gavin Barraclough  <barraclough@apple.com>
29
30         Build fix - too soon!
31
32         * UIProcess/API/mac/WKView.mm:
33         (-[WKView setFrameSize:]):
34
35 2013-04-12  Adenilson Cavalcanti  <cavalcantii@gmail.com>
36
37         [WK2] WebPageProxy loadURL() won't work when called just after terminateProcess()
38         https://bugs.webkit.org/show_bug.cgi?id=110743
39
40         Reviewed by Benjamin Poulain.
41
42         A call to loadURL() just after terminating WebProcess will fail thanks to
43         WebPageProxy being in an undefined state since it is in the middle of its own
44         cleanup after process termination.
45
46         To properly fix this, not only WebPageProxy cleanup should be made
47         at WebProcess termination request, but also WebProcessProxy needs
48         to only return to its caller after terminating the process and
49         closing connections. Otherwise, WebPageProxy can even be able to
50         detect that WebProcess is no longer running, but a call to respawn
51         the process will fail.
52
53         To fix these issues, this patch moves the cleanup code to a shared private function
54         that is used for both the cases i.e. user termination and real crash. WebProcess
55         shutdown is done using a new method that ensures that all cleanup was done before
56         returning.
57
58         A last change introduced in this patch is that for user requested termination,
59         clients are no longer notified of a crash (since it is not a crash).
60
61         * UIProcess/WebPageProxy.cpp:
62         (WebKit::WebPageProxy::terminateProcess):
63         (WebKit::WebPageProxy::processDidCrash):
64         (WebKit):
65         (WebKit::WebPageProxy::resetStateAfterProcessExited):
66         * UIProcess/WebPageProxy.h:
67         (WebPageProxy):
68         * UIProcess/WebProcessProxy.cpp:
69         (WebKit::WebProcessProxy::userRequestedTerminate):
70         (WebKit):
71         * UIProcess/WebProcessProxy.h:
72         (WebProcessProxy):
73
74 2013-04-12  Gavin Barraclough  <barraclough@apple.com>
75
76         Add contentAnchor to WKView
77         http://bugs.webkit.org/show_bug.cgi?id=114469
78         
79         Currently if you call setFrameSize: while frame size updates are disabled, or if the geometry
80         update times out, then the previously rendered page content will be rendered anchored to the
81         top left corner of the frame.
82
83         This is appropriate if the frame is being resized from the bottom right corner. In order to
84         achieve a more desirable appearance if the frame is being resized from another corner we
85         should allow the corner at which the content anchors to be specified.
86
87         Reviewed by Simon Fraser.
88
89         * UIProcess/API/mac/WKView.mm:
90         (-[WKView setFrameSize:]):
91             - If the content anchor has been set, then updating the frame size moves the origin within the layer.
92         (-[WKView _setDrawingAreaSize:]):
93             - Instruct the drawing area to paint at the correct position within the layer.
94         (-[WKView _setAcceleratedCompositingModeRootLayer:]):
95             - If the root layer is cleared this implicitly resets any origin position we had set within it.
96         (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
97             - initialize new data members.
98         (-[WKView setContentAnchor:]):
99         (-[WKView contentAnchor]):
100             - Accessor implementation for @property contentAnchor.
101
102         * UIProcess/API/mac/WKViewPrivate.h:
103         (NS_ENUM):
104             - Added WKContentAnchor enum type, and @property contentAnchor.
105
106         * UIProcess/DrawingAreaProxy.cpp:
107         (WebKit::DrawingAreaProxy::setSize):
108             - Don't suppress geometry updates where the layer poistion has changed.
109
110         * UIProcess/DrawingAreaProxy.h:
111         (DrawingAreaProxy):
112             - Added m_layerPosition, layerPosition argument to setSize
113
114         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
115         (TiledCoreAnimationDrawingAreaProxy):
116             - Added m_lastSentLayerPosition
117
118         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
119         (WebKit::TiledCoreAnimationDrawingAreaProxy::didUpdateGeometry):
120             - Don't suppress geometry updates where the layer poistion has changed.
121
122         (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
123             - Pass layer position in UpdateGeometry message.
124
125         * WebProcess/WebPage/DrawingArea.h:
126         (WebKit::DrawingArea::updateGeometry):
127             - Added layerPosition argument to updateGeometry
128
129         * WebProcess/WebPage/DrawingArea.messages.in:
130             - Added layerPosition argument to updateGeometry
131
132         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
133         (TiledCoreAnimationDrawingArea):
134             - Added layerPosition argument to updateGeometry
135
136         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
137         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
138             - Added layerPosition argument to updateGeometry
139
140 2013-04-12  Commit Queue  <rniwa@webkit.org>
141
142         Unreviewed, rolling out r148296 and r148297.
143         http://trac.webkit.org/changeset/148296
144         http://trac.webkit.org/changeset/148297
145         https://bugs.webkit.org/show_bug.cgi?id=114536
146
147         Needs more thought (Requested by ap on #webkit).
148
149         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
150
151 2013-04-12  Tim Horton  <timothy_horton@apple.com>
152
153         REGRESSION (r138858): GIFs don't start playing when they come out of background tabs
154         https://bugs.webkit.org/show_bug.cgi?id=108864
155         <rdar://problem/13140489>
156
157         Reviewed by Antti Koivisto.
158
159         Don't repaint the world when animations resume; instead, FrameView
160         will cause all animated images to repaint. This line also had no effect for
161         TiledCoreAnimationDrawingArea, which does not implement setNeedsDisplay.
162
163         * WebProcess/WebPage/WebPage.cpp:
164         (WebKit::WebPage::resumeActiveDOMObjectsAndAnimations):
165
166 2013-04-12  Alexey Proskuryakov  <ap@apple.com>
167
168         <rdar://problem/13334446> [Mac] Tweak sandbox profile.
169
170         Apply a post-landing review comment.
171
172         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
173
174 2013-04-12  Alexey Proskuryakov  <ap@apple.com>
175
176         <rdar://problem/13334446> [Mac] Tweak sandbox profile.
177
178         Reviewed by Jessie Berlin.
179
180         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
181
182 2013-04-12  Carlos Garcia Campos  <cgarcia@igalia.com>
183
184         [GTK] Split GtkAuthenticationDialog in two widgets
185         https://bugs.webkit.org/show_bug.cgi?id=103644
186
187         Reviewed by Xan Lopez.
188
189         * GNUmakefile.list.am: Add new files to compilation.
190         * UIProcess/API/gtk/WebKit2GtkAuthenticationDialog.cpp: Removed.
191         * UIProcess/API/gtk/WebKit2GtkAuthenticationDialog.h: Removed.
192         * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp: Added.
193         (webkitAuthenticationDialogAuthenticate): Use the
194         AuthenticationChallengeProxy to authenticate and destroy the dialog.
195         (okButtonClicked): Call webkitAuthenticationDialogAuthenticate()
196         with the credential.
197         (cancelButtonClicked): Call
198         webkitAuthenticationDialogAuthenticate() with a NULL credential to
199         continue without credential.
200         (webkitAuthenticationDialogInitialize): Build the UI.
201         (webkitAuthenticationDialogDraw): Draw a background.
202         (webkitAuthenticationDialogMap): Grab default button.
203         (webkitAuthenticationDialogConstructed): Create a GtkStyleContext
204         with the GtkWindow path to draw the widget background like a real
205         dialog.
206         (webkit_authentication_dialog_class_init):
207         (webkitAuthenticationDialogNew): Create a new
208         WebKitAuthenticationDialog widget.
209         * UIProcess/API/gtk/WebKitAuthenticationDialog.h: Added.
210         * UIProcess/API/gtk/WebKitLoaderClient.cpp:
211         * UIProcess/API/gtk/WebKitWebView.cpp:
212         (webkitWebViewHandleAuthenticationChallenge): Create a
213         WebKitAuthenticationDialog widget and pass add it to the
214         container.
215         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
216         (_WebKitWebViewBasePrivate): Updated to use the widget directly.
217         (webkitWebViewChildIsInternalWidget): Ditto.
218         (webkitWebViewBaseAddAuthenticationDialog): Ditto.
219         (webkitWebViewBaseCancelAuthenticationDialog): Ditto.
220         (webkitWebViewBaseContainerRemove): Ditto.
221         (webkitWebViewBaseContainerForall): Ditto.
222         (resizeWebKitWebViewBaseFromAllocation): Ditto.
223         (webkitWebViewBaseFocus): Ditto.
224         (webkitWebViewBaseDestroy): Destroy the auth widget is present.
225         (webkit_web_view_base_class_init): Add implementation for
226         GtkWidgetClass::destroy.
227         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
228
229 2013-04-12  Carlos Garcia Campos  <cgarcia@igalia.com>
230
231         [GTK] Web Process crash when the UI process finishes too early
232         https://bugs.webkit.org/show_bug.cgi?id=112729
233
234         Reviewed by Anders Carlsson.
235
236         The problem is when creating the GSocket in the WorkQeue for the
237         socket descriptor. GLib considers a programmer error to create a
238         GSocket providing an invalid socket and finishes the process with
239         g_error(). We are actually providing a valid socket when creating
240         the GSocket, but it can be invalidated by the worker thread while
241         the GSocket is being created. This is because
242         registerEventSourceHandler is called from the main thread and
243         unregisterEventSourceHandler can be called from the worker
244         thread. We are currently registering two event handlers, one to
245         read data from the socket and another one to close the CoreIPC
246         connection when the socket connection is broken. Every event
247         source registered uses its own GSocket (even if the file
248         descriptor is actually the same), so that when the UI process
249         finishes too early, the first event handler can be executed in the
250         worker thread, closing the socket descriptor, while the main
251         thread is creating the GSocket for the second one.
252         We don't really need to use a separate event handler to monitor
253         the connection, because GSocket always notifies when condition is
254         G_IO_HUP and G_IO_ERR even if they haven't been explicitly set in
255         g_socket_create_source(). We can register socket event sources
256         differently, providing also a function to be called when the
257         connection is closed, using a single socket and the same even source.
258
259         * Platform/CoreIPC/unix/ConnectionUnix.cpp:
260         (CoreIPC::Connection::platformInvalidate):
261         (CoreIPC::Connection::open): Register a single socket event
262         handler providing also a function to be called when the connection
263         is closed.
264         * Platform/WorkQueue.h:
265         (WorkQueue):
266         * Platform/gtk/WorkQueueGtk.cpp: The EventSource class has been
267         split, moving everyting specific to socket event source to a
268         derived class SocketEventSource.
269         (WorkQueue::EventSource::EventSource):
270         (WorkQueue::EventSource::performWork):
271         (WorkQueue::EventSource::performWorkOnce):
272         (WorkQueue::EventSource::performWorkOnTermination):
273         (WorkQueue::EventSource::deleteEventSource):
274         (WorkQueue::EventSource):
275         (WorkQueue::SocketEventSource):
276         (WorkQueue::SocketEventSource::SocketEventSource):
277         (WorkQueue::SocketEventSource::cancel):
278         (WorkQueue::SocketEventSource::didClose):
279         (WorkQueue::SocketEventSource::checkCondition):
280         (WorkQueue::SocketEventSource::eventCallback):
281         (WorkQueue::registerSocketEventHandler):
282         (WorkQueue::unregisterSocketEventHandler):
283         (WorkQueue::dispatchOnSource):
284
285 2013-04-12  Alexey Proskuryakov  <ap@apple.com>
286
287         <rdar://problem/13126204> [Mac] Tweak sandbox profile.
288
289         Reviewed by Anders Carlsson.
290
291         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
292         * WebProcess/com.apple.WebProcess.sb.in:
293
294 2013-04-12  Manuel Rego Casasnovas  <rego@igalia.com>
295
296         [GTK][WK2] Add document-loaded signal to WebKitWebPage
297         https://bugs.webkit.org/show_bug.cgi?id=110614
298
299         Reviewed by Carlos Garcia Campos.
300
301         Add a new signal document-loaded to WebKitWebPage that will be emitted
302         when the DOM document has been loaded for the main frame.
303
304         * UIProcess/API/gtk/tests/TestWebExtensions.cpp:
305         (documentLoadedCallback):
306         (testDocumentLoadedSignal):
307         (beforeAll): Add test for document-loaded signal.
308         * UIProcess/API/gtk/tests/WebExtensionTest.cpp:
309         (documentLoadedCallback):
310         (pageCreatedCallback):
311         (methodCallCallback): Add new D-Bus signal DocumentLoaded in order to
312         test document-loaded signal.
313         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
314         (webkit_web_page_class_init):
315         (webkitWebPageCreate): Add document-loaded signal and emit it when
316         didFinishDocumentLoadForFrame is called.
317
318 2013-04-12  Hanyee Kim  <choco@company100.net>
319
320         [GTK] Webkit fails to build webkit2gtk-tests-resources.gresource.
321         https://bugs.webkit.org/show_bug.cgi?id=114485
322
323         Reviewed by Martin Robinson.
324
325         Generating webkit2gtk-tests-resources.gresource can be failed due to
326         the non-existing target directory.
327         We need to make target directory before generating it.
328
329         * UIProcess/API/gtk/tests/GNUmakefile.am:
330
331 2013-04-12  Andreas Kling  <akling@apple.com>
332
333         REGRESSION(r145869): Right-click on SWF contents displays the context menu at the wrong place.
334         <http://webkit.org/b/113836>
335         <rdar://problem/13587624>
336
337         Reviewed by Anders "Wesley Crusher" Carlsson.
338
339         Mac plugins expect flipped-Y screen coordinates, while DOM APIs speak in unflipped coordinates,
340         and we were mixing them up in the window frame caching optimization.
341
342         Solve this by having the UIProcess send both flipped and unflipped window frames to the WebProcess.
343         The flipped frame is passed on to plugins, and the unflipped frame is used for window.screenX/Y etc.
344
345         * UIProcess/API/mac/WKView.mm:
346         (-[WKView _updateWindowAndViewFrames]):
347
348             No need to retrieve the window frame here as WebPageProxy::windowAndViewFramesChanged() will
349             always override it anyway.
350
351         * UIProcess/mac/WebPageProxyMac.mm:
352         (WebKit::WebPageProxy::windowAndViewFramesChanged):
353         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
354         (WebKit::WebChromeClient::windowRect):
355         * WebProcess/WebPage/WebPage.cpp:
356         (WebKit::WebPage::windowAndViewFramesChanged):
357         * WebProcess/WebPage/WebPage.h:
358         (WebKit::WebPage::windowFrameInUnflippedScreenCoordinates):
359         * WebProcess/WebPage/WebPage.messages.in:
360
361 2013-04-12  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
362
363         [WK2][EFL] WebView: Add callbacks to the WKViewClient to handle page viewport update
364         https://bugs.webkit.org/show_bug.cgi?id=110463
365
366         Reviewed by Anders Carlsson.
367
368         * UIProcess/efl/ViewClientEfl.h:
369         (ViewClientEfl):
370         * UIProcess/efl/WebView.cpp:
371         (WebKit::WebView::didChangeViewportProperties):
372         * UIProcess/efl/WebViewClient.cpp:
373         (WebKit::WebViewClient::didChangeViewportAttributes):
374         (WebKit):
375         * UIProcess/efl/WebViewClient.h:
376
377             Added didChangeViewportAttributes callback to the WKViewClient to
378             handle page viewport updates.
379
380         * CMakeLists.txt:
381         * Shared/API/c/WKBase.h:
382         * Shared/APIObject.h:
383         * UIProcess/API/C/WKAPICast.h:
384         (WebKit):
385         * UIProcess/API/C/WKViewportAttributes.cpp: Added.
386         (WKViewportAttributesGetTypeID):
387         * UIProcess/API/C/WKViewportAttributes.h: Added.
388         * UIProcess/API/C/efl/WKView.h:
389         * UIProcess/WebViewportAttributes.cpp: Added.
390         (WebKit):
391         (WebKit::WebViewportAttributes::WebViewportAttributes):
392         (WebKit::WebViewportAttributes::~WebViewportAttributes):
393         * UIProcess/WebViewportAttributes.h: Added.
394         (WebKit):
395         (WebViewportAttributes):
396         (WebKit::WebViewportAttributes::create):
397         (WebKit::WebViewportAttributes::originalAttributes):
398         (WebKit::WebViewportAttributes::type):
399
400             Added WKViewportAttributesRef - WK2 C API object that is wrapping 
401             WebCore::ViewportAttributes structure and is passed in didChangeViewportAttributes
402             WKViewClient callback.
403
404         * UIProcess/efl/ViewClientEfl.cpp:
405         (WebKit::ViewClientEfl::didChangeViewportAttributes):
406         (WebKit):
407
408             Added implementaion of didChangeViewportAttributes WKViewClient 
409             callback so that existing EFL WK2 funtionality is kept.
410
411
412 2013-04-12  Carlos Garcia Campos  <cgarcia@igalia.com>
413
414         [GTK] The style of visited links doesn't change in WebKit2
415         https://bugs.webkit.org/show_bug.cgi?id=112175
416
417         Reviewed by Benjamin Poulain.
418
419         The problem is that visited links were not tracked by the web
420         process. There's a web process initial parameter to set whether
421         web process should track visited links or not and it's disabled by
422         default.
423
424         * UIProcess/gtk/WebContextGtk.cpp:
425         (WebKit::WebContext::platformInitializeWebProcess): Always set
426         shouldTrackVisitedLinks to true.
427
428 2013-04-11  Tim Horton  <timothy_horton@apple.com>
429
430         REGRESSION (r146956): ASSERTion failure: WebKit::WebProcess::pageWillLeaveWindow
431         https://bugs.webkit.org/show_bug.cgi?id=114481
432         <rdar://problem/13534784>
433
434         Reviewed by Simon Fraser.
435
436         Inform the WebProcess of WebPages which are already in a window when created.
437
438         * WebProcess/WebPage/WebPage.cpp:
439         (WebKit::WebPage::WebPage):
440
441 2013-04-11  Anders Carlsson  <andersca@apple.com>
442
443         Add support for clearing storage areas
444         https://bugs.webkit.org/show_bug.cgi?id=114479
445
446         Reviewed by Beth Dakin.
447
448         * UIProcess/Storage/StorageManager.cpp:
449         (WebKit::StorageManager::StorageArea::StorageArea):
450         Store the quota size so we can recreate the underlying StorageMap when clearing.
451         
452         (WebKit::StorageManager::StorageArea::clear):
453         Create a new storage map and dispatch events.
454
455         (WebKit::StorageManager::clear):
456         Find the right storage area and call clear.
457
458         * UIProcess/Storage/StorageManager.messages.in:
459         Add Clear message.
460
461         * WebProcess/Storage/StorageAreaImpl.cpp:
462         (WebKit::StorageAreaImpl::clear):
463         Call the storage map.
464
465         * WebProcess/Storage/StorageAreaMap.cpp:
466         (WebKit::StorageAreaMap::clear):
467         Reset the cached values and send a clear message.
468
469         (WebKit::StorageAreaMap::resetValues):
470         New helper function.
471
472         (WebKit::StorageAreaMap::didClear):
473         New stub.
474
475         * WebProcess/Storage/StorageAreaMap.messages.in:
476         Add DidClear message.
477
478 2013-04-11  Beth Dakin  <bdakin@apple.com>
479
480         WebKit should set the header and footer layers' contentsScale when the device 
481         scale factor changes
482         https://bugs.webkit.org/show_bug.cgi?id=114471
483         -and corresponding-
484         <rdar://problem/13621288>
485
486         Reviewed by Simon Fraser.
487
488         Update the header and footer contentsScale when the device scale factor has 
489         changed.
490
491         * WebProcess/WebPage/WebPage.cpp:
492         (WebKit::WebPage::setDeviceScaleFactor):
493         * WebProcess/WebPage/WebPage.h:
494         * WebProcess/WebPage/mac/WebPageMac.mm:
495         (WebKit::WebPage::updateHeaderAndFooterLayersForDeviceScaleChange):
496
497 2013-04-11  Anders Carlsson  <andersca@apple.com>
498
499         Implement removing storage area items
500         https://bugs.webkit.org/show_bug.cgi?id=114472
501
502         Reviewed by Beth Dakin.
503
504         * UIProcess/Storage/StorageManager.cpp:
505         (StorageManager::StorageArea):
506         (WebKit::StorageManager::StorageArea::setItem):
507         Rename connection to sourceConnection.
508
509         (WebKit::StorageManager::StorageArea::removeItem):
510         Remove the item from the map and dispatch events if needed.
511
512         (WebKit::StorageManager::removeItem):
513         Find the right storage area, remove the item and send back a DidRemoveItem message.
514
515         * UIProcess/Storage/StorageManager.messages.in:
516         Add RemoveItem message.
517
518         * WebProcess/Storage/StorageAreaImpl.cpp:
519         (WebKit::StorageAreaImpl::removeItem):
520         Call StorageAreaMap::removeItem.
521
522         * WebProcess/Storage/StorageAreaMap.cpp:
523         (WebKit::StorageAreaMap::removeItem):
524         Send a RemoveItem message to the storage manager.
525         
526         (WebKit::StorageAreaMap::didRemoveItem):
527         Add empty stub.
528
529         * WebProcess/Storage/StorageAreaMap.messages.in:
530         Add DidRemoveItem message.
531
532 2013-04-11  Tim Horton  <timothy_horton@apple.com>
533
534         InjectedBundleNodeHandle::imageForRect doesn't respect device scale factor or highlighting option
535         https://bugs.webkit.org/show_bug.cgi?id=114466
536         <rdar://problem/13508513>
537
538         Reviewed by Simon Fraser.
539
540         Respect the device scale factor when creating the snapshot image.
541         Clear the snapshot image before drawing into it.
542         Respect SnapshotOptionsExcludeSelectionHighlighting.
543
544         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
545         (WebKit::imageForRect):
546
547 2013-04-11  Commit Queue  <rniwa@webkit.org>
548
549         Unreviewed, rolling out r148034, r148052, r148097, and
550         r148194.
551         http://trac.webkit.org/changeset/148034
552         http://trac.webkit.org/changeset/148052
553         http://trac.webkit.org/changeset/148097
554         http://trac.webkit.org/changeset/148194
555         https://bugs.webkit.org/show_bug.cgi?id=114463
556
557         broke mutiresolution favicons, among other things (Requested
558         by thorton on #webkit).
559
560         * UIProcess/WebIconDatabase.cpp:
561         (WebKit::WebIconDatabase::setIconDataForIconURL):
562         * UIProcess/WebIconDatabase.h:
563         (WebIconDatabase):
564         * UIProcess/WebIconDatabase.messages.in:
565         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
566         (WebKit::WebIconDatabaseProxy::setIconDataForIconURL):
567         * WebProcess/Plugins/PDF/PDFPlugin.mm:
568         (WebKit::PDFPlugin::destroy):
569
570 2013-04-11  Anders Carlsson  <andersca@apple.com>
571
572         Implement StorageManager::getValues
573         https://bugs.webkit.org/show_bug.cgi?id=114461
574
575         Reviewed by Beth Dakin.
576
577         * UIProcess/Storage/StorageManager.cpp:
578         (WebKit::StorageManager::StorageArea::items):
579         (WebKit::StorageManager::getValues):
580         Return the items from the right storage area.
581
582 2013-04-11  Anders Carlsson  <andersca@apple.com>
583
584         Clean up related storage areas when a connection is destroyed
585         https://bugs.webkit.org/show_bug.cgi?id=114459
586
587         Reviewed by Beth Dakin.
588
589         * UIProcess/Storage/StorageManager.cpp:
590         (WebKit::StorageManager::processWillCloseConnection):
591         Dispatch invalidateConnectionInternal on the work queue.
592         
593         (WebKit::StorageManager::createStorageMap):
594         (WebKit::StorageManager::destroyStorageMap):
595         Rename m_storageAreas to m_storageAreasByConnection.
596
597         (WebKit::StorageManager::invalidateConnectionInternal):
598         Go over all known storage areas and remove this connection as a listener.
599
600         (WebKit::StorageManager::findStorageArea):
601         Rename m_storageAreas to m_storageAreasByConnection.
602
603         * UIProcess/Storage/StorageManager.h:
604         Rename m_storageAreas to m_storageAreasByConnection.
605
606 2013-04-11  Anders Carlsson  <andersca@apple.com>
607
608         Make StorageAreaMap dispatch session storage events
609         https://bugs.webkit.org/show_bug.cgi?id=114454
610
611         Reviewed by Beth Dakin.
612
613         * WebProcess/Storage/StorageAreaMap.cpp:
614         (WebKit::StorageAreaMap::dispatchStorageEvent):
615         Depending on the storage area type, call dispatchSessionStorageEvent or dispatchLocalStorageEvent.
616
617         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
618         Enumerate all the frames in our page and dispatch the event to the relevant ones.
619
620         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
621         Add empty stub for now.
622
623 2013-04-11  Anders Carlsson  <andersca@apple.com>
624
625         Implement more logic in StorageAreaMap
626         https://bugs.webkit.org/show_bug.cgi?id=114451
627
628         Reviewed by Alexey Proskuryakov.
629
630         * Platform/CoreIPC/HandleMessage.h:
631         (CoreIPC::callMemberFunction):
632         Add new overload.
633
634         * UIProcess/Storage/StorageManager.cpp:
635         (WebKit::StorageManager::StorageArea::addListener):
636         (WebKit::StorageManager::StorageArea::removeListener):
637         These take storage map IDs.
638
639         (WebKit::StorageManager::StorageArea::setItem):
640         Rename storageAreaID to sourceStorageAreaID.
641
642         (WebKit::StorageManager::StorageArea::dispatchEvents):
643         Remove the code that would not dispatch to the source connection, there may still be storage areas interested in those events.
644
645         (WebKit::StorageManager::setItem):
646         This now takes the source storage area ID.
647
648         (WebKit::StorageManager::findStorageArea):
649         This takes a storage map ID.
650
651         * UIProcess/Storage/StorageManager.messages.in:
652         SetItem now takes the source storage area ID as well.
653
654         * WebProcess/Storage/StorageAreaImpl.cpp:
655         (WebKit::StorageAreaImpl::setItem):
656         Pass the source frame to StorageAreaMap::setItem.
657
658         * WebProcess/Storage/StorageAreaMap.cpp:
659         (WebKit::StorageAreaMap::StorageAreaMap):
660         Send CreateStorageMap and add the object as a message receiver.
661
662         (WebKit::StorageAreaMap::~StorageAreaMap):
663         Send DestroyStorageMap and remove the object as a message receiver.
664
665         (WebKit::StorageAreaMap::length):
666         (WebKit::StorageAreaMap::key):
667         (WebKit::StorageAreaMap::item):
668         (WebKit::StorageAreaMap::contains):
669         Load values and forward calls to the storage map.
670
671         (WebKit::StorageAreaMap::setItem):
672         This now takes the source frame as well. Update the local storage map and send a SetItem message.
673         
674         (WebKit::StorageAreaMap::loadValuesIfNeeded):
675         Get the values from the storage manager.
676
677         (WebKit::StorageAreaMap::dispatchStorageEvent):
678         This now takes the source storage area ID.
679
680         * WebProcess/Storage/StorageAreaMap.messages.in:
681         DispatchStorageEvent now takes the source storage area ID.
682
683 2013-04-10  Brady Eidson  <beidson@apple.com>
684
685         Web/Plugin process deadlock initializing async plugins.
686         <rdar://problem/13525232> and https://bugs.webkit.org/show_bug.cgi?id=114217
687
688         Rubberstamped by Anders Carlsson.
689
690         Rollout r147953 and r147968 as we identified other causes for this.
691
692         * PluginProcess/WebProcessConnection.cpp:
693         (WebKit::WebProcessConnection::createPluginAsynchronously):
694         * WebProcess/Plugins/PluginProxy.messages.in:
695
696 2013-04-11  Alexey Proskuryakov  <ap@apple.com>
697
698         Remove some ResourceHandle.h includes
699         https://bugs.webkit.org/show_bug.cgi?id=114416
700
701         Reviewed by Ryosuke Niwa.
702
703         * WebProcess/Network/NetworkProcessConnection.cpp: Added an include that is now
704         necessary.
705
706 2013-04-11  Allan Sandfeld Jensen  <allan.jensen@digia.com>
707
708         [Qt] EventHandler should handle Space and BackSpace 
709         https://bugs.webkit.org/show_bug.cgi?id=114428
710
711         Reviewed by Jocelyn Turcotte.
712
713         Remove our own handling of space and backspace.
714
715         * WebProcess/WebPage/qt/WebPageQt.cpp:
716         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
717
718 2013-04-11  Csaba Osztrogonác  <ossy@webkit.org>
719
720         Unreviewed Qt buildfixes after r148147, r148148 and r148154.
721
722         * DerivedSources.pri:
723         * Target.pri:
724
725 2013-04-10  Zan Dobersek  <zdobersek@igalia.com>
726
727         Unreviewed GTK build fix, fixing the WebKit2 build.
728
729         * GNUmakefile.list.am:
730
731 2013-04-10  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
732
733         [WK2] Build warning in didReceiveMessage() generated by messages.py
734         https://bugs.webkit.org/show_bug.cgi?id=112513
735
736         Reviewed by Anders Carlsson.
737
738         Legacy receiver makes -Wunused-parameter build warnings. This patch is to fix them.
739
740         * Scripts/webkit2/messages.py:
741         (generate_message_handler):
742
743 2013-04-10  Jaehun Lim  <ljaehun.lim@samsung.com>
744
745         [CMAKE] Build fix after StorageArea refactoring
746         https://bugs.webkit.org/show_bug.cgi?id=114398
747
748         Unreviewed build fix.
749
750         Change StorageAreaImpl.messages.in with StorageAreaMap.messages.in.
751         Add StorageAreaMap.cpp in CMakeLists.txt.
752
753         * CMakeLists.txt:
754
755 2013-04-10  Anders Carlsson  <andersca@apple.com>
756
757         Make StorageAreaImpl a wrapper around StorageAreaMap
758         https://bugs.webkit.org/show_bug.cgi?id=114404
759
760         Reviewed by Oliver Hunt.
761
762         Prepare for moving all the code that deals with local storage values to StorageAreaMap,
763         and make StorageAreaImpl a dumb wrapper that simply calls through to the map.
764
765         * WebProcess/Storage/StorageAreaImpl.cpp:
766         (WebKit::StorageAreaImpl::create):
767         (WebKit::StorageAreaImpl::StorageAreaImpl):
768         (WebKit::StorageAreaImpl::~StorageAreaImpl):
769         (WebKit::StorageAreaImpl::storageType):
770         (WebKit::StorageAreaImpl::length):
771         (WebKit::StorageAreaImpl::key):
772         (WebKit::StorageAreaImpl::getItem):
773         (WebKit::StorageAreaImpl::setItem):
774         (WebKit::StorageAreaImpl::contains):
775         * WebProcess/Storage/StorageAreaImpl.h:
776         (WebKit::StorageAreaImpl::storageAreaID):
777         * WebProcess/Storage/StorageAreaMap.cpp:
778         (WebKit::generateStorageMapID):
779         (WebKit::StorageAreaMap::create):
780         (WebKit::StorageAreaMap::StorageAreaMap):
781         (WebKit::StorageAreaMap::storageType):
782         (WebKit::StorageAreaMap::length):
783         (WebKit::StorageAreaMap::key):
784         (WebKit::StorageAreaMap::item):
785         (WebKit::StorageAreaMap::setItem):
786         (WebKit::StorageAreaMap::contains):
787         (WebKit::StorageAreaMap::didSetItem):
788         (WebKit::StorageAreaMap::dispatchStorageEvent):
789         * WebProcess/Storage/StorageAreaMap.h:
790         * WebProcess/Storage/StorageNamespaceImpl.cpp:
791         (WebKit::StorageNamespaceImpl::storageArea):
792         * WebProcess/Storage/StorageNamespaceImpl.h:
793         (StorageNamespaceImpl):
794
795 2013-04-10  Anders Carlsson  <andersca@apple.com>
796
797         Rename StorageManager messages to refer to the StorageMap instead of the StorageArea
798         https://bugs.webkit.org/show_bug.cgi?id=114401
799
800         Reviewed by Ryosuke Niwa.
801
802         * UIProcess/Storage/StorageManager.cpp:
803         (WebKit::StorageManager::createStorageMap):
804         (WebKit::StorageManager::destroyStorageMap):
805         (WebKit::StorageManager::setItem):
806         * UIProcess/Storage/StorageManager.h:
807         * UIProcess/Storage/StorageManager.messages.in:
808         * WebProcess/Storage/StorageAreaImpl.cpp:
809         (WebKit::StorageAreaImpl::StorageAreaImpl):
810         (WebKit::StorageAreaImpl::~StorageAreaImpl):
811
812 2013-04-10  Benjamin Poulain  <bpoulain@apple.com>
813
814         Mass remove all the empty directories
815
816         Rubberstamped by Ryosuke Niwa.
817
818         * Platform/CoreIPC/gtk: Removed.
819         * Platform/CoreIPC/qt: Removed.
820         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32: Removed.
821         * PluginProcess/EntryPoint/mac/XPCService/PluginService.64: Removed.
822         * PluginProcess/gtk: Removed.
823         * Shared/API/c/win: Removed.
824         * Shared/Plugins/Netscape/win: Removed.
825         * Shared/cg/win: Removed.
826         * Shared/win: Removed.
827         * UIProcess/API/C/win: Removed.
828         * UIProcess/API/gtk/webkit: Removed.
829         * UIProcess/Launcher/win: Removed.
830         * UIProcess/Plugins/gtk: Removed.
831         * UIProcess/Plugins/win: Removed.
832         * UIProcess/texmap: Removed.
833         * UIProcess/win: Removed.
834         * WebProcess/Authentication/mac: Removed.
835         * WebProcess/Cookies/efl: Removed.
836         * WebProcess/Cookies/gtk: Removed.
837         * WebProcess/Downloads/cf/win: Removed.
838         * WebProcess/Downloads/cfnet: Removed.
839         * WebProcess/Downloads/curl: Removed.
840         * WebProcess/Downloads/efl: Removed.
841         * WebProcess/Downloads/gtk: Removed.
842         * WebProcess/Downloads/mac: Removed.
843         * WebProcess/Downloads/qt: Removed.
844         * WebProcess/Downloads/soup: Removed.
845         * WebProcess/FullScreen/gtk: Removed.
846         * WebProcess/FullScreen/mac: Removed.
847         * WebProcess/FullScreen/qt: Removed.
848         * WebProcess/FullScreen/win: Removed.
849         * WebProcess/InjectedBundle/API/c/win: Removed.
850         * WebProcess/InjectedBundle/win: Removed.
851         * WebProcess/KeyValueStorage: Removed.
852         * WebProcess/Network/CustomProtocols/mac: Removed.
853         * WebProcess/Plugins/Netscape/gtk: Removed.
854         * WebProcess/Plugins/Netscape/win: Removed.
855         * WebProcess/WebCoreSupport/win: Removed.
856         * WebProcess/WebPage/LayerTreeCoordinator: Removed.
857         * WebProcess/WebPage/ca/mac: Removed.
858         * WebProcess/WebPage/ca/win: Removed.
859         * WebProcess/WebPage/win: Removed.
860         * WebProcess/win: Removed.
861         * qt/Resources: Removed.
862
863 2013-04-10  Jaehun Lim  <ljaehun.lim@samsung.com>
864
865         [CMAKE] Build fix after r148147, r148148
866         https://bugs.webkit.org/show_bug.cgi?id=114395
867
868         Unreviewed build fix.
869
870         Use StorageAreaImpl, StorageNamespaceImpl instead of StorageAreaProxy, StorageNamespaceProxy.
871
872         * CMakeLists.txt:
873
874 2013-04-10  Anders Carlsson  <andersca@apple.com>
875
876         Add a stubbed out StorageAreaMap class
877         https://bugs.webkit.org/show_bug.cgi?id=114392
878
879         Reviewed by Andreas Kling.
880
881         The intention is that StorageAreaMap is going to take over responsibility for storing the storage values in the
882         web process, as well as dispatching events. A StorageAreaMap will be shared between multiple StorageAreaImpl objects,
883         for example if multiple frames with the same origin use local storage.
884
885         * DerivedSources.make:
886         * UIProcess/Storage/StorageManager.cpp:
887         (WebKit::StorageManager::StorageArea::dispatchEvents):
888         (WebKit::StorageManager::setItem):
889         * WebKit2.xcodeproj/project.pbxproj:
890         * WebProcess/Storage/StorageAreaImpl.cpp:
891         (WebKit::StorageAreaImpl::StorageAreaImpl):
892         (WebKit::StorageAreaImpl::~StorageAreaImpl):
893         * WebProcess/Storage/StorageAreaMap.cpp: Added.
894         (WebKit):
895         (WebKit::StorageAreaMap::create):
896         (WebKit::StorageAreaMap::StorageAreaMap):
897         (WebKit::StorageAreaMap::~StorageAreaMap):
898         (WebKit::StorageAreaMap::didSetItem):
899         (WebKit::StorageAreaMap::dispatchStorageEvent):
900         * WebProcess/Storage/StorageAreaMap.h: Added.
901         (WebKit):
902         (StorageAreaMap):
903         * WebProcess/Storage/StorageAreaMap.messages.in: Renamed from Source/WebKit2/WebProcess/Storage/StorageAreaImpl.messages.in.
904
905 2013-04-10  Anders Carlsson  <andersca@apple.com>
906
907         Rename StorageAreaProxy to StorageAreaImpl.
908
909         Rubber-stamped by Beth Dakin.
910
911         * DerivedSources.make:
912         * UIProcess/Storage/StorageManager.cpp:
913         (WebKit::StorageManager::StorageArea::dispatchEvents):
914         (WebKit::StorageManager::setItem):
915         * WebKit2.xcodeproj/project.pbxproj:
916         * WebProcess/Storage/StorageAreaImpl.cpp: Renamed from Source/WebKit2/WebProcess/Storage/StorageAreaProxy.cpp.
917         * WebProcess/Storage/StorageAreaImpl.h: Renamed from Source/WebKit2/WebProcess/Storage/StorageAreaProxy.h.
918         * WebProcess/Storage/StorageAreaImpl.messages.in: Renamed from Source/WebKit2/WebProcess/Storage/StorageAreaProxy.messages.in.
919         * WebProcess/Storage/StorageNamespaceImpl.cpp:
920         (WebKit::StorageNamespaceImpl::storageArea):
921         * WebProcess/Storage/StorageNamespaceImpl.h:
922         (WebKit):
923         (StorageNamespaceImpl):
924
925 2013-04-10  Anders Carlsson  <andersca@apple.com>
926
927         Rename StorageNamespaceProxy to StorageNamespaceImpl.
928
929         Rubber-stamped by Beth Dakin.
930
931         * WebKit2.xcodeproj/project.pbxproj:
932         * WebProcess/Storage/StorageAreaProxy.cpp:
933         (WebKit::StorageAreaProxy::create):
934         (WebKit::StorageAreaProxy::StorageAreaProxy):
935         * WebProcess/Storage/StorageAreaProxy.h:
936         (StorageAreaProxy):
937         * WebProcess/Storage/StorageNamespaceImpl.cpp: Renamed from Source/WebKit2/WebProcess/Storage/StorageNamespaceProxy.cpp.
938         * WebProcess/Storage/StorageNamespaceImpl.h: Renamed from Source/WebKit2/WebProcess/Storage/StorageNamespaceProxy.h.
939         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
940         (WebKit::WebPlatformStrategies::sessionStorageNamespace):
941
942 2013-04-10  Tim Horton  <timothy_horton@apple.com>
943
944         [wk2] Un-pollute TCADA methods with "PageOverlayLayerMap::iterator end"
945         https://bugs.webkit.org/show_bug.cgi?id=114387
946
947         Reviewed by Simon Fraser.
948
949         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
950         (WebKit::TiledCoreAnimationDrawingArea::updatePreferences):
951         (WebKit::TiledCoreAnimationDrawingArea::paintContents):
952         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
953         (WebKit::TiledCoreAnimationDrawingArea::setExposedRect):
954         (WebKit::TiledCoreAnimationDrawingArea::mainFrameScrollabilityChanged):
955         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
956         (WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
957
958 2013-04-10  Tim Horton  <timothy_horton@apple.com>
959
960         [wk2] REGRESSION: Find highlight does not update when the view is resized
961         https://bugs.webkit.org/show_bug.cgi?id=114382
962         <rdar://problem/13599797>
963
964         Reviewed by Simon Fraser.
965
966         Invalidate the page overlays from TiledCoreAnimationDrawingArea::updateGeometry.
967         This will have no effect if the page overlay hasn't previously asked to be painted
968         (as drawsContent will remain false on the layer).
969
970         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
971         (TiledCoreAnimationDrawingArea): Add invalidateAllPageOverlays.
972         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
973         (WebKit::TiledCoreAnimationDrawingArea::invalidateAllPageOverlays): Factor this out of didChangeScrollOffsetForAnyFrame.
974         (WebKit::TiledCoreAnimationDrawingArea::didChangeScrollOffsetForAnyFrame): Call invalidateAllPageOverlays.
975         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry): Call invalidateAllPageOverlays.
976
977 2013-04-10  Beth Dakin  <bdakin@apple.com>
978
979         FindBanner matches are offset when the WKView has a header or footer
980         https://bugs.webkit.org/show_bug.cgi?id=114314
981         -and corresponding-
982         <rdar://problem/13522434>
983
984         Reviewed by Simon Fraser.
985
986         When calculating the matching rects, also adjust to the scroll offset that is  
987         relative to the Document.
988         * WebProcess/WebPage/FindController.cpp:
989         (WebKit::FindController::rectsForTextMatches):
990
991 2013-04-10  Tobias Mueller  <tobiasmue@gnome.org>
992
993         Fixed build failure in Plugin.h: FloatPoint was not in namespace WebCore
994
995         make[1]: *** Waiting for unfinished jobs....
996         In file included from Source/WebKit2/PluginProcess/PluginCreationParameters.h:31:0,
997                          from Source/WebKit2/PluginProcess/PluginCreationParameters.cpp:27:
998         ./Source/WebKit2/WebProcess/Plugins/Plugin.h:268:58: error: 'FloatPoint' in namespace 'WebCore' does not name a type
999         ./Source/WebKit2/WebProcess/Plugins/Plugin.h:268:77: error: ISO C++ forbids declaration of 'parameter' with no type [-fpermissive]
1000         cc1plus: warning: unrecognized command line option "-Wno-c++11-extensions" [enabled by default]
1001         make[1]: *** [Source/WebKit2/PluginProcess/libwebkit2gtk_3_0_la-PluginCreationParameters.lo] Error 1
1002
1003         It now passes that make target.
1004
1005         https://bugs.webkit.org/show_bug.cgi?id=111862
1006
1007         Reviewed by Darin Adler.
1008
1009         * WebProcess/Plugins/Plugin.h:
1010         (WebCore): Added FloatPoint to the WebCore namespace
1011
1012 2013-04-08  Anders Carlsson  <andersca@apple.com>
1013
1014         Remove unneeded headers from FrameLoader.h
1015         https://bugs.webkit.org/show_bug.cgi?id=114223
1016
1017         Reviewed by Geoffrey Garen.
1018
1019         Include HistoryController.h from WebCore.
1020
1021         * WebProcess/Plugins/PDF/SimplePDFPlugin.h:
1022         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1023         * WebProcess/WebPage/WebPage.cpp:
1024
1025 2013-04-09  Geoffrey Garen  <ggaren@apple.com>
1026
1027         Removed bitrotted TimeoutChecker code
1028         https://bugs.webkit.org/show_bug.cgi?id=114336
1029
1030         Reviewed by Alexey Proskuryakov.
1031
1032         This mechanism hasn't worked for a while.
1033
1034         MarkL is working on a new version of this feature with a distinct
1035         implementation.
1036
1037         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
1038         (WebKit::NPJSObject::construct):
1039         (WebKit::NPJSObject::invoke):
1040         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
1041         (WebKit::NPRuntimeObjectMap::evaluate):
1042
1043 2013-04-09  Mark Rowe  <mrowe@apple.com>
1044
1045         <rdar://problem/13617144> WKNavigationData needs to expose the destination of the navigation
1046
1047         Introduce WKNavigationDataCopyNavigationDestinationURL to access the destination of the navigation.
1048
1049         Reviewed by Dan Bernstein.
1050
1051         * UIProcess/API/C/WKNavigationData.cpp:
1052         (WKNavigationDataCopyURL): Add a note about returning the URL from the original request for sake of
1053         backwards-compatibility.
1054         (WKNavigationDataCopyNavigationDestinationURL): Return the URL from our underlying WebNavigationDataStore.
1055         * UIProcess/API/C/WKNavigationData.h:
1056         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1057         (WebKit::WebFrameLoaderClient::updateGlobalHistory): Store the current URL in to the WebNavigationDataStore
1058         object. WKNavigationData can retrieve the value that we were previously storing here via the originalRequest.
1059
1060 2013-04-09  Mark Rowe  <mrowe@apple.com>
1061
1062         <rdar://problem/13617104> WKPageCopySessionState needs to provide more context to the filter callback
1063
1064         Introduce a new value type for WKPageSessionStateFilterCallback that represents the passing
1065         of whole WKBackForwardListItemRefs to the filter callback. This allows clients to consider
1066         more than the original URL of the item when filtering entries from the session state.
1067
1068         Reviewed by Darin Adler.
1069
1070         * UIProcess/API/C/WKPage.cpp:
1071         (WKPageGetSessionBackForwardListItemValueType): Return a static string representing our new value type.
1072         * UIProcess/API/C/WKPage.h:
1073         * UIProcess/cf/WebBackForwardListCF.cpp:
1074         (WebKit::WebBackForwardList::createCFDictionaryRepresentation): Call the filter function with each of the
1075         possible value types in turn, respecting the first false value, if any, that is returned.
1076
1077 2013-04-10  Anton Obzhirov  <a.obzhirov@samsung.com>
1078
1079         [GTK] Add support for Page Visibility
1080         https://bugs.webkit.org/show_bug.cgi?id=97324
1081
1082         Reviewed by Sam Weinig.
1083
1084         Added new unittest to test page visibility using GTK Widget visibility API.
1085
1086         * UIProcess/API/gtk/tests/TestWebKitWebView.cpp:
1087         (testWebViewPageVisibility):
1088         (beforeAll):
1089         * UIProcess/API/gtk/tests/WebViewTest.cpp:
1090         (WebViewTest::showInWindow):
1091         * UIProcess/API/gtk/tests/WebViewTest.h:
1092
1093 2013-04-10  Zan Dobersek  <zdobersek@igalia.com>
1094
1095         REGRESSION (r146518): WebKit2APITests/TestInspector is failing
1096         https://bugs.webkit.org/show_bug.cgi?id=113281
1097
1098         Reviewed by Darin Adler.
1099
1100         Changes to the WebInspectorProxy opening processing in r146518 caused the change in how the GTK-specific
1101         WebInspectorProxy code operates, specifically the 'bring-to-front' signal is not emitted anymore when opening the
1102         inspector due to the WebInspectorProxy::bringToFront method now only bringing the inspector window to front if it exists
1103         and opening it (and thus unable to bring it to front) otherwise.
1104
1105         Closing of the inspector through the didClose method is now done immediately after sending the WebInspector::Close()
1106         message to the WebProcess rather than waiting for the WebProcess to communicate back the order of closing. Due to this
1107         the relevant code in the test cases had to be changed to not run the loop but rather just check that the closing was
1108         successful.
1109
1110         (InspectorTest::InspectorTest): Remove the initialization of the now redundant m_quitOnBringToFront member variable.
1111         (InspectorTest::bringToFront): Quit the loop without checking the removed member variable.
1112         (InspectorTest::closed): Do not quit the loop as it is not run anymore.
1113         (InspectorTest::showIdle): A helper method that asynchronously calls the webkit_web_inspector_show method, removing some
1114         unnecessary complexity about under what exact circumstances to quit the loop in open-window/bring-to-front callbacks.
1115         (InspectorTest::show): Replaces the showAndWaitUntilFinished method, adding an idle invocation of the showIdle helper
1116         method and running the loop.
1117         (InspectorTest::close): Formerly closeAndWaitUntilClosed, now does not run the loop anymore as there's no need for it.
1118         (testInspectorDefault): Only the window opening event is now expected upon showing the inspector for the first time.
1119         Adjusting callsites to use InspectorTest::show and InspectorTest::close instead of
1120         InspectorTest::showAndWaitUntilFinished and InspectorTest::showAndWaitUntilFinished.
1121         (CustomInspectorTest::destroyWindow): Formerly destroyWindowAndWaitUntilClosed, the closing is not asynchronous anymore
1122         so the loop is not run.
1123         (testInspectorManualAttachDetach): Only the window opening event is now expected upon showing the inspector for the first time.
1124         Adjusting callsites to use InspectorTest::show and InspectorTest::close instead of
1125         InspectorTest::showAndWaitUntilFinished and InspectorTest::showAndWaitUntilFinished.
1126         (testInspectorCustomContainerDestroyed): Adjusting callsites to use InspectorTest::show and CustomInspectorTest::destroyWindow
1127         instead of InspectorTest::showAndWaitUntilFinished and CustomInspectorTest::destroyWindowAndWaitUntilClosed.
1128         * UIProcess/WebInspectorProxy.cpp:
1129         (WebKit::WebInspectorProxy::show): When showing a connected WebInspectorProxy, call the bringToFront method which will
1130         open the inspector if it's not yet visible or bring it to the front otherwise. 
1131
1132 2013-04-10  Zan Dobersek  <zandobersek@gmail.com>
1133
1134         [GTK][WK2] Implement WebInspectorProxy::platformInspectedWindowWidth
1135         https://bugs.webkit.org/show_bug.cgi?id=113498
1136
1137         Reviewed by Martin Robinson.
1138
1139         The method was introduced in r147004.
1140
1141         * UIProcess/API/gtk/tests/TestInspector.cpp: Specify the gMinimumAttachedInspectorWidth variable, reflecting the value
1142         of WebInspectorProxy::minimumAttachedWidth. Use it as the width to which the inspected view should be resized in
1143         InspectorTest::resizeViewAndAttach.
1144         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
1145         (WebKit::WebInspectorProxy::platformInspectedWindowHeight): Use the gtk_widget_get_allocated_height method to return the
1146         widget height.
1147         (WebKit::WebInspectorProxy::platformInspectedWindowWidth): Newly implemented, similarly uses the
1148         gtk_widget_get_allocated_width method to return the widget width.
1149
1150 2013-04-09  Antoine Quint  <graouts@apple.com>
1151
1152         WKFrameIsDisplayingMarkupDocument should return true for Web Archives
1153         https://bugs.webkit.org/show_bug.cgi?id=114291
1154
1155         Reviewed by Dean Jackson.
1156
1157         Also return true for the Web Archive MIME type since a Web Archive
1158         is displaying a markup document by nature.
1159
1160         * UIProcess/WebFrameProxy.cpp:
1161         (WebKit::WebFrameProxy::isDisplayingMarkupDocument):
1162
1163 2013-04-09  Anders Carlsson  <andersca@apple.com>
1164
1165         REGRESSION (r147454): Youtube annotation links to new window broken
1166         https://bugs.webkit.org/show_bug.cgi?id=114242
1167         <rdar://problem/13609940>
1168
1169         Reviewed by Beth Dakin.
1170
1171         Set the current user gesture to "DefinitelyProcessingNewUserGesture" if popups are allowed.
1172
1173         * WebProcess/Plugins/PluginView.cpp:
1174         (WebKit::PluginView::performFrameLoadURLRequest):
1175
1176 2013-04-09  Anders Carlsson  <andersca@apple.com>
1177
1178         If we fail to decode a message name, pass the message length as the name
1179         https://bugs.webkit.org/show_bug.cgi?id=114305
1180         <rdar://problem/13605703>
1181
1182         Reviewed by Sam Weinig.
1183
1184         * Platform/CoreIPC/ArgumentDecoder.h:
1185         (CoreIPC::ArgumentDecoder::length):
1186         * Platform/CoreIPC/Connection.cpp:
1187         (CoreIPC::Connection::processIncomingMessage):
1188
1189 2013-04-08  Dean Jackson  <dino@apple.com>
1190
1191         Don't create another plugin process for restarted plugins
1192         https://bugs.webkit.org/show_bug.cgi?id=114233
1193
1194         Reviewed by Geoff Garen.
1195
1196         A snapshotting plugin starts in a separate process from
1197         regular plugins. This can be a little confusing to users
1198         because they might see two plugin processes. We can set
1199         the minimum life and timeout on the snapshotting process
1200         to much smaller values, since the process doesn't need
1201         to live that long. This will reduce some potential
1202         confusion. Also, since there is another plugin process
1203         running real plugins, it should be paged in if it needs
1204         to restart.
1205
1206         There was, however, a bug in the process management. A
1207         restarted plugin received a special PluginProcess::Type,
1208         so that it could cross fade into the page nicely. This
1209         caused it to start a *third* plugin process. Instead
1210         mark a restarted flag directly on the PluginProxy and
1211         revert back to two process types.
1212
1213         * PluginProcess/PluginProcess.h: Remove TypeRestartedProcess.
1214
1215         * UIProcess/Plugins/PluginProcessProxy.cpp: Add two new
1216             timeout values for snapshotting processes.
1217         (WebKit::PluginProcessProxy::didFinishLaunching): Chose which
1218             of the timeout pairs to use.
1219
1220         * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
1221         (WebKit::PluginProxy::pluginLayer): Don't look at the process type, instead
1222             look at the process flag to see if we are restarted.
1223         * WebProcess/Plugins/PluginProxy.cpp:
1224         (WebKit::PluginProxy::create): Copy the new flag into constructor.
1225         (WebKit::PluginProxy::PluginProxy): Remember the flag.
1226         * WebProcess/Plugins/PluginProxy.h: Add a new m_restartedProcess flag.
1227
1228         * WebProcess/WebPage/WebPage.cpp:
1229         (WebKit::WebPage::createPlugin): When we are creating the proxy, separate
1230             the concept of snapshotting and restarting.
1231
1232 2013-04-09  Tim Horton  <timothy_horton@apple.com>
1233
1234         [wk2] IconDatabase images should be decoded in the WebProcess
1235         https://bugs.webkit.org/show_bug.cgi?id=112524
1236         <rdar://problem/10133914>
1237
1238         Reviewed by Oliver Hunt.
1239
1240         In the interests of keeping decoding of data coming in from the greater Internet
1241         in the WebProcess, move decoding of favicons from the UIProcess to the WebProcess.
1242
1243         * UIProcess/WebIconDatabase.cpp:
1244         (WebKit::WebIconDatabase::setIconBitmapForIconURL):
1245         Receive a ShareableBitmap handle from the WebProcess instead of a DataReference.
1246         Use the new setIconBitmapForIconURL IconDatabase method.
1247
1248         * UIProcess/WebIconDatabase.h:
1249         (WebIconDatabase):
1250         Rename setIconDataForIconURL to setIconBitmapForIconURL.
1251
1252         * UIProcess/WebIconDatabase.messages.in: Ditto.
1253
1254         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
1255         (WebKit::WebIconDatabaseProxy::setIconDataForIconURL):
1256         In the WebProcess, decode the incoming icon and draw it into a ShareableBitmap.
1257
1258 2013-04-09  Raphael Kubo da Costa  <raphael.kubo.da.costa@intel.com>
1259
1260         [EFL] Declare TEST_THEME_DIR in a single place.
1261         https://bugs.webkit.org/show_bug.cgi?id=114285
1262
1263         Reviewed by Anders Carlsson.
1264
1265         * PlatformEfl.cmake: Remove definition of `TEST_THEME_DIR', which is
1266         now defined in OptionsEfl.cmake.
1267
1268 2013-04-09  Rafael Brandao  <rafael.lobo@openbossa.org>
1269
1270         [CoordinatedGraphics] serviceScriptedAnimations expects time in seconds
1271         https://bugs.webkit.org/show_bug.cgi?id=112582
1272
1273         Reviewed by Andreas Kling.
1274
1275         We've been exposing different time unit for requestAnimationFrame because
1276         of wrong conversion before serviceScriptedAnimations function calls.
1277         Fixed it to use seconds instead of milliseconds.
1278
1279         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1280         (WebKit::CoordinatedLayerTreeHost::syncDisplayState): Remove unnecessary conversion.
1281
1282 2013-04-09  Michael Brüning  <michael.bruning@digia.com>
1283
1284         [Qt][WK2] Remove obsolete QtWebPageFindClient forward declaration from qquickwebview_p.h.
1285         https://bugs.webkit.org/show_bug.cgi?id=114284
1286
1287         Reviewed by Andreas Kling.
1288
1289         The class QtWebPageFindClient was removed in r142073 when the functionality
1290         was folded into QQuickWebViewPrivate.
1291
1292         * UIProcess/API/qt/qquickwebview_p.h:
1293         (WebKit):
1294
1295 2013-04-09  Michael Brüning  <michael.bruning@digia.com>
1296
1297         Fix GTK WebKit2 build after r148005.
1298         https://bugs.webkit.org/show_bug.cgi?id=114270
1299
1300         Reviewed by Andreas Kling.
1301
1302         Fix GTK build break that went through the buildbot undetected.
1303
1304         * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
1305         (webkit_file_chooser_request_get_selected_files):
1306
1307 2013-04-09  Michael Brüning  <michael.bruning@digia.com>
1308
1309         [Qt][WK2] Remove direct references to WebPageProxy from QQuickWebPage.
1310         https://bugs.webkit.org/show_bug.cgi?id=112850
1311
1312         Reviewed by Andreas Kling.
1313
1314         Removes direct references to WebPageProxy from QQuickWebPage and prepares the
1315         class for the move to QRawWebView. The access to the device scale factor and
1316         CoordinatedGraphicsScene is provided through QQuickWebViewPrivate, and therefore
1317         accessors to these properties are temporarily added. Eventually, this access will
1318         be provided through QRawWebView when the move is complete.
1319
1320         This also moves the pointer to QtWebPageEventHandler from QQuickWebPagePrivate
1321         to QQuickWebViewPrivate as it is mainly used from there.
1322
1323         * UIProcess/API/qt/qquickwebpage.cpp:
1324         (QQuickWebPagePrivate::QQuickWebPagePrivate):
1325         (QQuickWebPagePrivate::paint):
1326         (QQuickWebPage::updatePaintNode):
1327         * UIProcess/API/qt/qquickwebpage_p.h:
1328         * UIProcess/API/qt/qquickwebpage_p_p.h:
1329         (QQuickWebPagePrivate):
1330         * UIProcess/API/qt/qquickwebview.cpp:
1331         (QQuickWebViewPrivate::initialize):
1332         (QQuickWebViewPrivate::handleMouseEvent):
1333         (QQuickWebViewPrivate::processDidCrash):
1334         (QQuickWebViewPrivate::coordinatedGraphicsScene):
1335         (QQuickWebViewPrivate::deviceScaleFactor):
1336         (QQuickWebViewPrivate::setIntrinsicDeviceScaleFactor):
1337         (QQuickWebViewFlickablePrivate::onComponentComplete):
1338         (QQuickWebView::keyPressEvent):
1339         (QQuickWebView::keyReleaseEvent):
1340         (QQuickWebView::inputMethodEvent):
1341         (QQuickWebView::focusInEvent):
1342         (QQuickWebView::itemChange):
1343         (QQuickWebView::touchEvent):
1344         (QQuickWebView::wheelEvent):
1345         (QQuickWebView::hoverEnterEvent):
1346         (QQuickWebView::hoverMoveEvent):
1347         (QQuickWebView::hoverLeaveEvent):
1348         (QQuickWebView::dragMoveEvent):
1349         (QQuickWebView::dragEnterEvent):
1350         (QQuickWebView::dragLeaveEvent):
1351         (QQuickWebView::dropEvent):
1352         * UIProcess/API/qt/qquickwebview_p_p.h:
1353         (WebCore):
1354         (WebKit):
1355         (QQuickWebViewPrivate):
1356
1357 2013-04-09  Michael Brüning  <michael.bruning@digia.com>
1358
1359         [Qt][WK2] Use C API to enable Navigator Qt Object.
1360         https://bugs.webkit.org/show_bug.cgi?id=112810
1361
1362         Reviewed by Andreas Kling.
1363
1364         Replace the direct reference to the WebPageProxy with use of
1365         C API.
1366
1367         * UIProcess/API/qt/qquickwebview.cpp:
1368         (QQuickWebViewPrivate::setNavigatorQtObjectEnabled):
1369
1370 2013-04-09  Michael Brüning  <michael.bruning@digia.com>
1371
1372         [WK2] Add C API to copy selected files from WebOpenPanelParameters.
1373         https://bugs.webkit.org/show_bug.cgi?id=112339
1374
1375         Reviewed by Andreas Kling.
1376
1377         Replaces the existing WebOpenPanelParameters::selectedFileNames() method
1378         to return a copy of the selected file names and exposes it through the
1379         C API. This is done in order to reduce the direct use of WebKit2 internal
1380         classes. The implementation is very similar to the one in 
1381         WebOpenPanelParameters::acceptMIMETypes().
1382
1383         This also updates the GTK port, which is the other user of selectedFileNames.
1384
1385         * Shared/WebOpenPanelParameters.cpp:
1386         (WebKit::WebOpenPanelParameters::selectedFileNames):
1387         (WebKit):
1388         * Shared/WebOpenPanelParameters.h:
1389         (WebOpenPanelParameters):
1390         * UIProcess/API/C/WKOpenPanelParameters.cpp:
1391         (WKOpenPanelParametersCopySelectedFileNames):
1392         * UIProcess/API/C/WKOpenPanelParameters.h:
1393         * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
1394         (webkit_file_chooser_request_get_selected_files):
1395         * UIProcess/qt/QtWebPageUIClient.cpp:
1396         (WebKit::QtWebPageUIClient::runOpenPanel):
1397
1398 2013-04-09  Jinwoo Song  <jinwoo7.song@samsung.com>
1399
1400         [WK2] Remove build warnings for unused parameters
1401         https://bugs.webkit.org/show_bug.cgi?id=114234
1402
1403         Reviewed by Andreas Kling.
1404
1405         Fix build warnings -Wunused-parameter.
1406
1407         * UIProcess/Storage/StorageManager.cpp:
1408         (WebKit::StorageManager::SessionStorageNamespace::cloneTo):
1409         * UIProcess/WebContext.cpp:
1410         (WebKit::WebContext::requestNetworkingStatistics):
1411         (WebKit::WebContext::pluginInfoStoreDidLoadPlugins):
1412         * WebProcess/Storage/StorageAreaProxy.cpp:
1413         (WebKit::StorageAreaProxy::removeItem):
1414         (WebKit::StorageAreaProxy::clear):
1415         (WebKit::StorageAreaProxy::dispatchSessionStorageEvent):
1416         (WebKit::StorageAreaProxy::dispatchLocalStorageEvent):
1417         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1418         (WebKit::CoordinatedLayerTreeHost::didUninstallPageOverlay):
1419         * WebProcess/WebPage/WebPage.cpp:
1420         (WebKit::WebPage::didFinishLoad):
1421         * WebProcess/WebProcess.cpp:
1422         (WebKit::WebProcess::shouldPlugInAutoStartFromOrigin):
1423
1424 2013-04-09  Thiago Marcos P. Santos  <thiago.santos@intel.com>
1425
1426         [WK2] Drop WebProcess capabilities on Linux using seccomp filters
1427         https://bugs.webkit.org/show_bug.cgi?id=89875
1428
1429         Reviewed by Maciej Stachowiak.
1430
1431         Introduce the foundations of the SeccompFilter-based sandbox. The
1432         hardening of the WebProcess (and potentially PluginProcess, etc)
1433         works by a combination of the two things:
1434
1435         - Blocking syscalls that are not used, reducing the size of the attack
1436         surface.
1437         - Trapping sensitive syscalls and delegating the execution of these
1438         syscalls to a separated trusted process subject to a set of policies.
1439
1440         The initial implementation traps the open()-family of syscalls on WebKit
1441         EFL's and Qt's WebProcess, but it could be easily used by any Linux port,
1442         since the code is suppose to be Linux-compliant. The list of syscalls handled
1443         by the broker process should definitely grow as we mature the
1444         implementation. Other syscalls needs to be handled to get this sandbox
1445         fully functional, like unlink(), mkdir(), etc.
1446
1447         The broker process should be initialized as early as possible on the
1448         sandboxed process main() function, because it only does a fork(), which
1449         is cheap on Linux. That also aims to minimize the resident memory footprint
1450         of the broker process.
1451
1452         Opening of files for upload and saving downloads is not supported yet,
1453         since it should be handled to the UIProcess in a similar fashion as
1454         the Mac port does.
1455
1456         * PlatformEfl.cmake:
1457         * Shared/linux/SeccompFilters/OpenSyscall.cpp: Added.
1458         (WebKit):
1459         (WebKit::OpenSyscall::createFromOpenatContext):
1460         (WebKit::OpenSyscall::createFromCreatContext):
1461         (WebKit::OpenSyscall::OpenSyscall):
1462         (WebKit::OpenSyscall::setResult):
1463         (WebKit::OpenSyscall::execute):
1464         (WebKit::OpenSyscall::encode):
1465         (WebKit::OpenSyscall::decode):
1466         (WebKit::OpenSyscallResult::OpenSyscallResult):
1467         (WebKit::OpenSyscallResult::~OpenSyscallResult):
1468         (WebKit::OpenSyscallResult::encode):
1469         (WebKit::OpenSyscallResult::decode):
1470         * Shared/linux/SeccompFilters/OpenSyscall.h: Added.
1471         (CoreIPC):
1472         (WebKit):
1473         (OpenSyscall):
1474         (WebKit::OpenSyscall::setPath):
1475         (WebKit::OpenSyscall::setFlags):
1476         (WebKit::OpenSyscall::setMode):
1477         (OpenSyscallResult):
1478         (WebKit::OpenSyscallResult::fd):
1479         (WebKit::OpenSyscallResult::errorNumber):
1480         * Shared/linux/SeccompFilters/SeccompBroker.cpp: Added.
1481         (WebKit):
1482         (SeccompBrokerClient):
1483         (WebKit::sendMessage):
1484         (WebKit::receiveMessage):
1485         (WebKit::SIGSYSHandler):
1486         (WebKit::registerSIGSYSHandler):
1487         (WebKit::SeccompBrokerClient::shared):
1488         (WebKit::SeccompBrokerClient::SeccompBrokerClient):
1489         (WebKit::SeccompBrokerClient::~SeccompBrokerClient):
1490         (WebKit::SeccompBrokerClient::dispatch):
1491         (WebKit::SeccompBrokerClient::handleIfOpeningOnlineCPUCount):
1492         (WebKit::SeccompBroker::launchProcess):
1493         (WebKit::SeccompBroker::initialize):
1494         (WebKit::SeccompBroker::runLoop):
1495         * Shared/linux/SeccompFilters/SeccompBroker.h: Added.
1496         (WebKit):
1497         (SeccompBroker):
1498         (WebKit::SeccompBroker::setSyscallPolicy):
1499         (WebKit::SeccompBroker::SeccompBroker):
1500         * Shared/linux/SeccompFilters/SeccompFilters.cpp: Added.
1501         (WebKit):
1502         (WebKit::SeccompFilters::SeccompFilters):
1503         (WebKit::SeccompFilters::~SeccompFilters):
1504         (WebKit::SeccompFilters::addRule):
1505         (WebKit::SeccompFilters::initialize):
1506         * Shared/linux/SeccompFilters/SeccompFilters.h: Added.
1507         (WebKit):
1508         (SeccompFilters):
1509         (WebKit::SeccompFilters::context):
1510         (WebKit::SeccompFilters::platformInitialize):
1511         * Shared/linux/SeccompFilters/SigactionSyscall.cpp: Added.
1512         (WebKit):
1513         (WebKit::SigactionSyscall::createFromContext):
1514         * Shared/linux/SeccompFilters/SigactionSyscall.h: Added.
1515         (WebKit):
1516         (SigactionSyscall):
1517         * Shared/linux/SeccompFilters/SigprocmaskSyscall.cpp: Added.
1518         (WebKit):
1519         (WebKit::SigprocmaskSyscall::createFromContext):
1520         * Shared/linux/SeccompFilters/SigprocmaskSyscall.h: Added.
1521         (WebKit):
1522         (SigprocmaskSyscall):
1523         * Shared/linux/SeccompFilters/Syscall.cpp: Added.
1524         (WebKit):
1525         (WebKit::Syscall::createFromContext):
1526         (WebKit::Syscall::createFromDecoder):
1527         (WebKit::Syscall::Syscall):
1528         (WebKit::SyscallResult::createFromDecoder):
1529         (WebKit::SyscallResult::SyscallResult):
1530         * Shared/linux/SeccompFilters/Syscall.h: Added.
1531         (CoreIPC):
1532         (WebKit):
1533         (Syscall):
1534         (WebKit::Syscall::~Syscall):
1535         (WebKit::Syscall::type):
1536         (WebKit::Syscall::setContext):
1537         (WebKit::Syscall::context):
1538         (SyscallResult):
1539         (WebKit::SyscallResult::~SyscallResult):
1540         (WebKit::SyscallResult::type):
1541         * Shared/linux/SeccompFilters/SyscallPolicy.cpp: Added.
1542         (WebKit):
1543         (WebKit::removeTrailingSlash):
1544         (WebKit::SyscallPolicy::hasPermissionForPath):
1545         (WebKit::SyscallPolicy::addFilePermission):
1546         (WebKit::SyscallPolicy::addDirectoryPermission):
1547         (WebKit::SyscallPolicy::addDefaultWebProcessPolicy):
1548         * Shared/linux/SeccompFilters/SyscallPolicy.h: Added.
1549         (WebKit):
1550         (SyscallPolicy):
1551         * Target.pri:
1552         * WebKit2.pri:
1553         * WebProcess/efl/SeccompFiltersWebProcessEfl.cpp: Added.
1554         (WebKit):
1555         (WebKit::SeccompFiltersWebProcessEfl::SeccompFiltersWebProcessEfl):
1556         (WebKit::SeccompFiltersWebProcessEfl::platformInitialize):
1557         * WebProcess/efl/SeccompFiltersWebProcessEfl.h: Added.
1558         (WebKit):
1559         (SeccompFiltersWebProcessEfl):
1560         * WebProcess/qt/SeccompFiltersWebProcessQt.cpp: Added.
1561         (WebKit):
1562         (WebKit::SeccompFiltersWebProcessQt::SeccompFiltersWebProcessQt):
1563         (WebKit::SeccompFiltersWebProcessQt::platformInitialize):
1564         * WebProcess/qt/SeccompFiltersWebProcessQt.h: Added.
1565         (WebKit):
1566         (SeccompFiltersWebProcessQt):
1567         * WebProcess/qt/WebProcessQt.cpp:
1568         (WebKit::WebProcess::platformInitializeWebProcess):
1569         * WebProcess/soup/WebProcessSoup.cpp:
1570         (WebKit::WebProcess::platformInitializeWebProcess):
1571
1572 2013-04-08  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
1573
1574         [WK2][EFL] Mark not implemented methods in TextCheckerEfl.
1575         https://bugs.webkit.org/show_bug.cgi?id=112261
1576
1577         Reviewed by Anders Carlsson.
1578
1579         There's no need to call client's methods in TextCheckerEfl.cpp if they are not
1580         implemented. Mark them as not implemented until we provide proper implementation.
1581
1582         * UIProcess/efl/TextCheckerEfl.cpp:
1583         (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
1584         (WebKit::TextChecker::setGrammarCheckingEnabled):
1585         (WebKit::TextChecker::grammarCheckingEnabledStateChanged):
1586         (WebKit::TextChecker::checkGrammarOfString):
1587         (WebKit::TextChecker::spellingUIIsShowing):
1588         (WebKit::TextChecker::toggleSpellingUIIsShowing):
1589         (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
1590         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
1591
1592 2013-04-08  Benjamin Poulain  <benjamin@webkit.org>
1593
1594         Remove HTML Notification
1595         https://bugs.webkit.org/show_bug.cgi?id=114231
1596
1597         Reviewed by Ryosuke Niwa.
1598
1599         * Configurations/FeatureDefines.xcconfig:
1600
1601 2013-04-08  Tim Horton  <timothy_horton@apple.com>
1602
1603         Don't run primary plugin detection if plugin snapshotting is off
1604         https://bugs.webkit.org/show_bug.cgi?id=114222
1605         <rdar://problem/13603988>
1606
1607         Reviewed by Dean Jackson.
1608
1609         * WebProcess/WebPage/WebPage.cpp:
1610         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
1611
1612 2013-04-08  Patrick Gansterer  <paroga@webkit.org>
1613
1614         [WIN] Remove WebKit2 source code
1615         https://bugs.webkit.org/show_bug.cgi?id=114096
1616
1617         Reviewed by Anders Carlsson.
1618
1619         Remove conditional includes for the windows platform.
1620
1621         * Shared/API/c/WKBase.h:
1622         * UIProcess/API/C/WKAPICast.h:
1623
1624 2013-04-08  Geoffrey Garen  <ggaren@apple.com>
1625
1626         Stop #include-ing all of JavaScriptCore in every DOM-related file
1627         https://bugs.webkit.org/show_bug.cgi?id=114220
1628
1629         Reviewed by Sam Weinig.
1630
1631         * Shared/WebCoreArgumentCoders.cpp:
1632         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
1633
1634 2013-04-08  Brady Eidson  <beidson@apple.com>
1635
1636         Web/Plugin process deadlock initializing async plugins.
1637         <rdar://problem/13525232> and https://bugs.webkit.org/show_bug.cgi?id=114217
1638
1639         Reviewed by Anders Carlsson.
1640
1641        The "Async initialization complete" messages probably don't have to be synchronous.
1642
1643         * PluginProcess/WebProcessConnection.cpp:
1644         (WebKit::WebProcessConnection::createPluginAsynchronously): Notify of initialization success/failure asynchronously.
1645         * WebProcess/Plugins/PluginProxy.messages.in: 
1646
1647 2013-04-08  Anders Carlsson  <andersca@apple.com>
1648
1649         Add an async version of ResourceHandle::didReceiveResponse
1650         https://bugs.webkit.org/show_bug.cgi?id=114215
1651
1652         Reviewed by Sam Weinig.
1653
1654         * NetworkProcess/NetworkResourceLoader.cpp:
1655         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
1656         Send the message and then call continueDidReceiveResponse.
1657
1658 2013-04-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1659
1660         [GTK] Build Platform as a separate static library
1661         https://bugs.webkit.org/show_bug.cgi?id=114164
1662
1663         Reviewed by Martin Robinson.
1664
1665         This way we reduce a bit the amount of files compiled twice
1666         because of the plugin process.
1667
1668         * GNUmakefile.am:
1669         * GNUmakefile.list.am:
1670         * Platform/gtk/WorkQueueGtk.cpp: Remove unused header.
1671         * Platform/unix/SharedMemoryUnix.cpp: Ditto.
1672
1673 2013-04-08  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
1674
1675         [WK2][EFL] WebView: Add callbacks to the WKViewClient to remove direct access to page viewport controller
1676         https://bugs.webkit.org/show_bug.cgi?id=110741
1677
1678         Reviewed by Anders Carlsson.
1679
1680         Provided WKViewClient with didRequestScroll, didRenderFrame and didCompletePageTransition
1681         callbacks so that direct access from WebView to page viewport controller is avoided.
1682
1683         Implementation of callbacks is also added to keep the current EFL WK2 functionality.
1684
1685         * UIProcess/API/C/efl/WKView.h:
1686         * UIProcess/efl/PageLoadClientEfl.cpp:
1687         (WebKit::PageLoadClientEfl::didCommitLoadForFrame):
1688
1689             Moved here code from deleted WebView::didCommitLoad.
1690
1691         * UIProcess/efl/ViewClientEfl.cpp:
1692         (WebKit::ViewClientEfl::didChangeContentsPosition):
1693         (WebKit):
1694         (WebKit::ViewClientEfl::didRenderFrame):
1695         (WebKit::ViewClientEfl::didCompletePageTransition):
1696         (WebKit::ViewClientEfl::ViewClientEfl):
1697         * UIProcess/efl/ViewClientEfl.h:
1698         (ViewClientEfl):
1699         * UIProcess/efl/WebView.cpp:
1700         (WebKit::WebView::pageDidRequestScroll):
1701         (WebKit::WebView::didRenderFrame):
1702         (WebKit::WebView::pageTransitionViewportReady):
1703         * UIProcess/efl/WebViewClient.cpp:
1704         (WebKit::WebViewClient::didChangeContentsPosition):
1705         (WebKit):
1706         (WebKit::WebViewClient::didRenderFrame):
1707         (WebKit::WebViewClient::didCompletePageTransition):
1708         * UIProcess/efl/WebViewClient.h:
1709         (WebCore):
1710
1711 2013-04-08  Andras Becsi  <andras.becsi@digia.com>
1712
1713         [Qt][WK2] WebView's interactive property is not fully respected
1714         https://bugs.webkit.org/show_bug.cgi?id=113066
1715
1716         Reviewed by Jocelyn Turcotte.
1717
1718         WK2 sign-off by Benjamin Poulain.
1719
1720         The QML WebView inherits the "interactive" property from Flickable
1721         which is true by default, and disables the interaction with the
1722         Flickable if set to false.
1723         Resulting from the design of the WebView panning and flicking is
1724         disabled by Flickable but to be consistent we also need to disable
1725         double-tap gestures and pinch gestures since they would trigger
1726         scale and position changes.
1727
1728         * UIProcess/qt/PageViewportControllerClientQt.cpp:
1729         (WebKit::PageViewportControllerClientQt::pinchGestureStarted):
1730         (WebKit::PageViewportControllerClientQt::pinchGestureRequestUpdate):
1731         (WebKit::PageViewportControllerClientQt::pinchGestureEnded):
1732         * UIProcess/qt/QtWebPageEventHandler.cpp:
1733         (WebKit::QtWebPageEventHandler::handleDoubleTapEvent):
1734
1735 2013-04-07  David Kilzer  <ddkilzer@apple.com>
1736
1737         Remove the rest of SVG_DOM_OBJC_BINDINGS
1738         <http://webkit.org/b/114112>
1739
1740         Reviewed by Geoffrey Garen.
1741
1742         * Configurations/FeatureDefines.xcconfig:
1743         - Remove ENABLE_SVG_DOM_OBJC_BINDINGS macro.
1744
1745 2013-04-06  Geoffrey Garen  <ggaren@apple.com>
1746
1747         Try to fix the WebKit2 build.
1748
1749         * NetworkProcess/NetworkResourceLoader.cpp:
1750         (WebKit):
1751         * NetworkProcess/NetworkResourceLoader.h:
1752         (NetworkResourceLoader): Removed a defunct function.
1753
1754 2013-04-05  Ed Bartosh  <bartosh@gmail.com>
1755
1756         [WK2] --no-tiled-backing-store build fails because FloatPoint is not declared
1757         https://bugs.webkit.org/show_bug.cgi?id=113618
1758
1759         Reviewed by Simon Fraser.
1760
1761         * WebProcess/Plugins/Plugin.h: Forward declared FloatPoint
1762
1763 2013-04-05  Geoffrey Garen  <ggaren@apple.com>
1764
1765         Made USE(JSC) unconditional
1766         https://bugs.webkit.org/show_bug.cgi?id=114058
1767
1768         Reviewed by Anders Carlsson.
1769
1770         * Shared/linux/WebMemorySamplerLinux.cpp:
1771         (WebKit::WebMemorySampler::sampleWebKit):
1772         * config.h:
1773
1774 2013-04-05  Ed Bartosh  <bartosh@gmail.com>
1775
1776         [EFL] --no-tiled-backing-store build fails because of not used #if USE(ACCELERATED_COMPOSITING)
1777         https://bugs.webkit.org/show_bug.cgi?id=113627
1778
1779         Reviewed by Simon Fraser.
1780
1781         Wrapped code with #if USE(ACCELERATED_COMPOSITING) to make it compilable
1782         with --no-tiled-backing-store build option:
1783         * UIProcess/API/C/efl/WKView.cpp:
1784         * UIProcess/API/efl/EvasGLContext.cpp:
1785         * UIProcess/API/efl/EvasGLContext.h:
1786         * UIProcess/API/efl/EvasGLSurface.cpp:
1787         * UIProcess/API/efl/EvasGLSurface.h:
1788         * UIProcess/API/efl/EwkView.cpp:
1789         (EwkView::EwkView):
1790         (EwkView::displayTimerFired):
1791         (EwkView::takeSnapshot):
1792         * UIProcess/API/efl/EwkView.h:
1793         (WebKit):
1794         (EwkView):
1795         * UIProcess/API/efl/SnapshotImageGL.cpp:
1796         * UIProcess/API/efl/SnapshotImageGL.h:
1797         * UIProcess/PageViewportController.cpp:
1798         * UIProcess/PageViewportController.h:
1799         * UIProcess/efl/PageViewportControllerClientEfl.cpp:
1800         * UIProcess/efl/ViewClientEfl.cpp:
1801         (WebKit::ViewClientEfl::didChangeContentsSize):
1802         * UIProcess/efl/WebView.cpp:
1803         (WebKit::WebView::didCommitLoad):
1804         (WebKit::WebView::updateViewportSize):
1805         (WebKit::WebView::didChangeViewportProperties):
1806         (WebKit::WebView::pageDidRequestScroll):
1807         (WebKit::WebView::didRenderFrame):
1808         (WebKit::WebView::pageTransitionViewportReady):
1809
1810 2013-04-05  Ed Bartosh  <bartosh@gmail.com>
1811
1812         [EFL][WK2] --no-tiled-backing-store build fails because of not used #if USE(COORDINATED_GRAPHICS)
1813         https://bugs.webkit.org/show_bug.cgi?id=113629
1814
1815         Reviewed by Simon Fraser.
1816
1817         Wrapped code related to coordinated graphics with #if USE(COORDINATED_GRAPHICS)
1818         * UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.cpp:
1819         * UIProcess/efl/WebView.cpp:
1820         (WebKit::WebView::initialize):
1821         (WebKit):
1822         (WebKit::WebView::paintToCairoSurface):
1823         (WebKit::WebView::updateViewportSize):
1824
1825 2013-04-05  Timothy Hatcher  <timothy@apple.com>
1826
1827         Allow the Web Inspector to use WebSQL.
1828
1829         This fixes an exception on load in the Safari Web Inspector.
1830
1831         https://webkit.org/b/114040
1832         rdar://problem/13581422
1833
1834         Reviewed by Anders Carlsson.
1835
1836         * UIProcess/mac/WebInspectorProxyMac.mm:
1837         (WebKit::exceededDatabaseQuota): Added.
1838         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Hook up exceededDatabaseQuota.
1839
1840 2013-04-04  Brady Eidson  <beidson@apple.com>
1841
1842         Add SPI to get a copy of the context menu at a given point.
1843         <rdar://problem/13450908> and https://bugs.webkit.org/show_bug.cgi?id=113958
1844
1845         Reviewed by Andy Estes.
1846
1847         Add the new accessor: 
1848         * WebProcess/WebPage/WebPage.cpp:
1849         (WebKit::WebPage::contextMenuAtPoint):
1850         * WebProcess/WebPage/WebPage.h:
1851
1852         Expose the new SPI:
1853         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1854         (WKBundlePageCopyContextMenuAtPoint):
1855         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
1856
1857 2013-04-05  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
1858
1859         [WK2][EFL] WebView should own page position and scale factor
1860         https://bugs.webkit.org/show_bug.cgi?id=111075
1861
1862         Reviewed by Andreas Kling.
1863
1864         View content position and content scale factor should belong to WebView
1865         rather than to EwkView as it decreases EwkView usage inside EFL-agnostic
1866         WebView and improves WebView encapsulation.
1867
1868         * UIProcess/API/C/efl/WKView.cpp:
1869         (WKViewGetContentScaleFactor):
1870         (WKViewSetContentScaleFactor):
1871
1872             New WKView API was added to set and get content scale factor.
1873             The view content scale factor is not the same as page scale factor:
1874             it always applies to content but not necessarily applies to the page.
1875             The view content scale factor is calculated by viewport controller
1876             and applies immediately for painting in UI process. Page scale factor
1877             is updated later after the frame is rendered to accomplish the pending
1878             scale change.
1879
1880         (WKViewGetContentPosition):
1881         (WKViewSetContentPosition):
1882
1883             New WKView API was added to set and get content position.
1884             Content position is set in UI units.
1885
1886         * UIProcess/API/C/efl/WKView.h:
1887         * UIProcess/API/efl/EwkView.cpp:
1888         (EwkView::EwkView):
1889         * UIProcess/API/efl/EwkView.h:
1890         (EwkView):
1891         * UIProcess/efl/PageViewportControllerClientEfl.cpp:
1892         (WebKit::PageViewportControllerClientEfl::setViewportPosition):
1893         (WebKit::PageViewportControllerClientEfl::setPageScaleFactor):
1894         * UIProcess/efl/WebView.cpp:
1895         (WebKit::WebView::WebView):
1896         (WebKit::WebView::paintToCairoSurface):
1897         (WebKit::WebView::transformToScene):
1898         (WebKit::WebView::updateViewportSize):
1899         (WebKit::WebView::pageDidRequestScroll):
1900         * UIProcess/efl/WebView.h:
1901         (WebKit::WebView::setContentScaleFactor):
1902         (WebKit::WebView::contentScaleFactor):
1903         (WebView):
1904         (WebKit::WebView::setContentPosition):
1905         (WebKit::WebView::contentPosition):
1906
1907 2013-04-05  Alberto Garcia  <agarcia@igalia.com>
1908
1909         [GTK][WK2] WebKitLoaderClient: add missing initializers
1910         https://bugs.webkit.org/show_bug.cgi?id=112961
1911
1912         Reviewed by Carlos Garcia Campos.
1913
1914         There are two new attributes: pluginLoadPolicy and pluginDidFail.
1915
1916         * UIProcess/API/gtk/WebKitLoaderClient.cpp:
1917         (attachLoaderClientToView):
1918
1919 2013-04-05  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
1920
1921         [WK2][EFL] Encapsulate view states set-up within WebView
1922         https://bugs.webkit.org/show_bug.cgi?id=110877
1923
1924         Reviewed by Benjamin Poulain.
1925
1926         View states set-up is encapsulated within WebView. This change
1927         reduces both usage of EwkView inside WebView class and usage of
1928         WebPageProxy inside EwkView class.
1929
1930         New WKView API was added so that EwkView can define whether or not
1931         the view is visible and focused.
1932
1933         * UIProcess/API/C/efl/WKView.cpp:
1934         (WKViewIsFocused):
1935         (WKViewSetIsFocused):
1936         (WKViewIsVisible):
1937         (WKViewSetIsVisible):
1938         * UIProcess/API/C/efl/WKView.h:
1939         * UIProcess/API/efl/EwkView.cpp:
1940         (::handleEvent):
1941         (EwkView::handleEvasObjectShow):
1942         (EwkView::handleEwkViewFocusIn):
1943         (EwkView::handleEwkViewFocusOut):
1944         * UIProcess/API/efl/EwkView.h:
1945         * UIProcess/efl/WebView.cpp:
1946         (WebKit::WebView::WebView):
1947         (WebKit::WebView::setFocused):
1948         (WebKit):
1949         (WebKit::WebView::setVisible):
1950         (WebKit::WebView::isViewFocused):
1951         (WebKit::WebView::isViewVisible):
1952         * UIProcess/efl/WebView.h:
1953         (WebKit::WebView::isFocused):
1954         (WebView):
1955         (WebKit::WebView::isVisible):
1956
1957 2013-04-04  KwangYong Choi  <ky0.choi@samsung.com>
1958
1959         [EFL][WK2] Add support for getting page contents as string
1960         https://bugs.webkit.org/show_bug.cgi?id=106752
1961
1962         Reviewed by Andreas Kling.
1963
1964         Modified ewk_view_page_contents_get() API to get page contents as string.
1965         EWK_PAGE_CONTENTS_TYPE_STRING is added to Ewk_Page_Contents_Type.
1966         Now, we can use both EWK_PAGE_CONTENTS_TYPE_MHTML and EWK_PAGE_CONTENTS_TYPE_STRING
1967         for getting page contents.
1968
1969         * UIProcess/API/efl/ewk_view.cpp:
1970         (Ewk_Page_Contents_Context):
1971         (ewkViewPageContentsAsMHTMLCallback):
1972         (ewkViewPageContentsAsStringCallback):
1973         (ewk_view_page_contents_get):
1974         * UIProcess/API/efl/ewk_view.h:
1975         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
1976         (PageContentsAsMHTMLCallback):
1977         (PageContentsAsStringCallback):
1978         (TEST_F):
1979
1980 2013-04-04  Christophe Dumez  <ch.dumez@sisa.samsung.com>
1981
1982         [Cairo] Stop passing raw pointers to BitmapImage::create()
1983         https://bugs.webkit.org/show_bug.cgi?id=113945
1984
1985         Reviewed by Martin Robinson.
1986
1987         Pass a smart pointer in to BitmapImage::create() instead of a raw one
1988         for the cairo surface. The factory method prototype was updated for
1989         cairo in r147643.
1990
1991         * Shared/cairo/ShareableBitmapCairo.cpp:
1992         (WebKit::ShareableBitmap::createImage):
1993
1994 2013-04-03  Dean Jackson  <dino@apple.com>
1995
1996         Expose settings to disable plugin snapshotting autostart and primary detection
1997         https://bugs.webkit.org/show_bug.cgi?id=113918
1998
1999         Reviewed by Tim Horton.
2000
2001         Three new settings: snapshotAllPlugIns, primaryPlugInSnapshotDetectionEnabled and
2002         autostartOriginPlugInSnapshottingEnabled.
2003         These are exposed via WKPreferences (WebKit2 only, since that's the only port actively
2004         using the feature).
2005
2006         * Shared/WebPreferencesStore.h: Add macros for new settings.
2007         * UIProcess/API/C/WKPreferences.cpp: Getters and setters for new settings.
2008         (WKPreferencesSetSnapshotAllPlugIns):
2009         (WKPreferencesGetSnapshotAllPlugIns):
2010         (WKPreferencesSetAutostartOriginPlugInSnapshottingEnabled):
2011         (WKPreferencesGetAutostartOriginPlugInSnapshottingEnabled):
2012         (WKPreferencesSetPrimaryPlugInSnapshotDetectionEnabled):
2013         (WKPreferencesGetPrimaryPlugInSnapshotDetectionEnabled):
2014         * UIProcess/API/C/WKPreferencesPrivate.h:
2015         * WebProcess/WebPage/WebPage.cpp:
2016         (WebKit::WebPage::updatePreferences): Forward settings updates.
2017         (WebKit::WebPage::addPluginView): Don't run primary plugin detection if the setting is false.
2018         (WebKit::WebPage::didFinishLoad): Ditto.
2019
2020 2013-04-04  Christophe Dumez  <ch.dumez@sisa.samsung.com>
2021
2022         [Cairo] Fix canvas drawing of SVG-based patterns and remove NativeImageCairo
2023         https://bugs.webkit.org/show_bug.cgi?id=113929
2024
2025         Reviewed by Martin Robinson.
2026
2027         Update code now that PassNativeImagePtr is now a typedef to PassRefPtr<cairo_surface_t>
2028         instead of NativeImageCairo*.
2029
2030         * Shared/gtk/ArgumentCodersGtk.cpp:
2031         (CoreIPC::decodeImage):
2032         * UIProcess/API/C/cairo/WKIconDatabaseCairo.cpp:
2033         (WKIconDatabaseTryGetCairoSurfaceForURL):
2034         * UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
2035         (getIconSurfaceSynchronously):
2036
2037 2013-04-04  Sze Howe Koh  <szehowe.koh@gmail.com>
2038
2039         [Qt] docs: Fix module name format
2040         https://bugs.webkit.org/show_bug.cgi?id=113209
2041
2042         Reviewed by Jocelyn Turcotte.
2043
2044         Make QDoc-generated documentation follow the conventions at
2045         http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation
2046
2047         * UIProcess/API/qt/qquickwebview.cpp:
2048
2049 2013-04-04  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
2050
2051         [WK2][EFL] WebView should own view size
2052         https://bugs.webkit.org/show_bug.cgi?id=110753
2053
2054         Reviewed by Andreas Kling.
2055
2056         WebView owns view size. WKViewGetSize and WKViewSetSize API
2057         is exposed accordingly. Usage of EFL-specific ewkView inside
2058         toolkit-agnostic WebView class is reduced.
2059
2060         * UIProcess/API/C/efl/WKView.cpp:
2061         (WKViewGetSize):
2062         (WKViewSetSize):
2063         * UIProcess/API/C/efl/WKView.h:
2064         * UIProcess/API/efl/EwkView.cpp:
2065         (EwkView::setDeviceScaleFactor):
2066         (EwkView::size):
2067         (EwkView::deviceSize):
2068         (EwkView::scheduleUpdateDisplay):
2069         (EwkView::handleEvasObjectCalculate):
2070         * UIProcess/API/efl/EwkView.h:
2071         (EwkView):
2072         * UIProcess/efl/WebView.cpp:
2073         (WebKit::WebView::setSize):
2074         (WebKit):
2075         (WebKit::WebView::paintToCurrentGLContext):
2076         (WebKit::WebView::updateViewportSize):
2077         (WebKit::WebView::viewSize):
2078         (WebKit::WebView::dipSize):
2079         * UIProcess/efl/WebView.h:
2080         (WebView):
2081         (WebKit::WebView::size):
2082
2083 2013-04-03  Anders Carlsson  <andersca@apple.com>
2084
2085         Don't try to set the exception port for server connections
2086         https://bugs.webkit.org/show_bug.cgi?id=113910
2087         <rdar://problem/11248925>
2088
2089         Reviewed by Darin Adler.
2090
2091         Treat a SetExceptionPort message to the server connection as an invalid message.
2092
2093         * Platform/CoreIPC/mac/ConnectionMac.cpp:
2094         (CoreIPC::Connection::receiveSourceEventHandler):
2095
2096 2013-04-02  Mark Rowe  <mrowe@apple.com>
2097
2098         <http://webkit.org/b/113898> Eliminate some code duplication by introducing an array of handlers to register / unregister.
2099
2100         Reviewed by Antti Koivisto.
2101
2102         * UIProcess/mac/WebContextMac.mm:
2103         (OcclusionNotificationHandler): Structure containing the notification name, type and handler.
2104         (WebKit::registerOcclusionNotificationHandlers): Register all of the handlers in the array.
2105         (WebKit::unregisterOcclusionNotificationHandlers): Unregister all of the handlers in the array.
2106
2107 2013-04-02  Mark Rowe  <mrowe@apple.com>
2108
2109         Enable process suppression when no windows in the application have drawn recently.
2110         <http://webkit.org/b/113854> / <rdar://problem/13540351>
2111
2112         Reviewed by Darin Adler.
2113
2114         * UIProcess/mac/WebContextMac.mm:
2115         (WebKit::applicationWindowModificationsStarted): Note that modifications are no longer stopped.
2116         (WebKit::applicationWindowModificationsStopped): Note that modifications have stopped.
2117         (WebKit::registerOcclusionNotificationHandlers): Register handlers for the start and stop notifications.
2118         (WebKit::unregisterOcclusionNotificationHandlers): Unregister handlers for the start and stop notifications.
2119         (WebKit::WebContext::canEnableProcessSuppressionForNetworkProcess): Allow suppression if the application is occluded
2120         or the application has not drawn recently.
2121         (WebKit::WebContext::canEnableProcessSuppressionForWebProcess): Ditto.
2122         (WebKit::WebContext::canEnableProcessSuppressionForGlobalChildProcesses): Ditto.
2123
2124 2013-04-03  Dean Jackson  <dino@apple.com>
2125
2126         Cross fade into restarted plugin
2127         https://bugs.webkit.org/show_bug.cgi?id=113868
2128
2129         Reviewed by Tim Horton.
2130
2131         Add a new plugin process type that indicates this is a plugin that
2132         has been restarted from snapshotting. On Apple ports, this allows
2133         us to animate the appearance of the plugin so that it crossfades
2134         with the snapshot. Other ports will have to add their own fading.
2135
2136         * PluginProcess/PluginProcess.h: New Type: TypeRestartedProcess.
2137         * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
2138         (WebKit::PluginProxy::pluginLayer): When the plugin's CALayer is created, if it
2139             is a restarted plugin, add an opacity animation to fade it in.
2140         * WebProcess/WebPage/WebPage.cpp:
2141         (WebKit::WebPage::createPlugin): Mark restarted plugins with the new process type.
2142
2143 2013-04-03  Alexey Proskuryakov  <ap@apple.com>
2144
2145         <rdar://problem/13564588> Add a temporary workaround for a build failure.
2146
2147         Fix suggested by Mark Rowe.
2148
2149         * Shared/mac/ChildProcessMac.mm:
2150
2151 2013-04-03  Alexey Proskuryakov  <ap@apple.com>
2152
2153         [WK2] XMLHttpRequest upload events don't work with NetworkProcess
2154         https://bugs.webkit.org/show_bug.cgi?id=113887
2155
2156         Reviewed by Brady Eidson.
2157
2158         Just forward didSendData client call to WebProcess.
2159
2160         * NetworkProcess/NetworkResourceLoader.cpp:
2161         (WebKit::NetworkResourceLoader::didSendData):
2162         (WebKit::NetworkResourceLoader::didCancelAuthenticationChallenge): Tweaked a comment.
2163         * WebProcess/Network/WebResourceLoader.cpp:
2164         (WebKit::WebResourceLoader::didSendData):
2165         * WebProcess/Network/WebResourceLoader.h:
2166         * WebProcess/Network/WebResourceLoader.messages.in:
2167
2168 2013-04-02  Ryosuke Niwa  <rniwa@webkit.org>
2169
2170         Remove code for Mac 10.5 and earlier from WTF and WebKit2
2171         https://bugs.webkit.org/show_bug.cgi?id=113844
2172
2173         Reviewed by Benjamin Poulain.
2174
2175         Removed the code for 10.5 and removed if-def for 10.6.
2176
2177         * Shared/mac/PasteboardTypes.mm:
2178         (WebKit::PasteboardTypes::forEditing):
2179
2180 2013-04-02  Anders Carlsson  <andersca@apple.com>
2181
2182         Be more robust against empty message receiver names in incoming messages
2183         https://bugs.webkit.org/show_bug.cgi?id=113833
2184         <rdar://problem/13284433>
2185
2186         Reviewed by Beth Dakin.
2187
2188         Turns out that we either send or receive messages whose receiver names are empty. This leads to bad things when we try to look
2189         up the message receiver name in a hash map since the empty name is used to represent an empty hash map value.
2190
2191         * Platform/CoreIPC/Connection.cpp:
2192         (CoreIPC::Connection::addWorkQueueMessageReceiverOnConnectionWorkQueue):
2193         Sprinkle assertions.
2194
2195         (CoreIPC::Connection::processIncomingMessage):
2196         If the message receiver name is not valid, make sure to call didReceiveInvalidMessage on the client thread.
2197
2198         (CoreIPC::Connection::dispatchDidReceiveInvalidMessage):
2199         Add new helper function.
2200
2201 2013-04-02  Simon Cooper  <scooper@apple.com>
2202
2203         [Mac][WK2] Don’t let plug-ins use System V shared memory
2204         https://bugs.webkit.org/show_bug.cgi?id=113466
2205         <rdar://problem/13159030>
2206
2207         Reviewed, tweaked and landed by Alexey Proskuryakov.
2208
2209         Instead of allowing plug-ins to request System V shm, give them a
2210         temporary but usable alternative if they try to request it.
2211
2212         * PluginProcess/mac/PluginProcessShim.mm:
2213
2214 2013-04-02  Anders Carlsson  <andersca@apple.com>
2215
2216         Add WKContextSetInvalidMessageFunction
2217         https://bugs.webkit.org/show_bug.cgi?id=113820
2218         <rdar://problem/12679817>
2219
2220         Reviewed by Tim Horton.
2221
2222         * UIProcess/API/C/WKContext.cpp:
2223         (WKContextSetInvalidMessageFunction):
2224         Call WebContext::didReceiveInvalidMessage.
2225
2226         * UIProcess/API/C/WKContextPrivate.h:
2227         * UIProcess/WebContext.cpp:
2228         (WebKit::WebContext::setInvalidMessageCallback):
2229         Set the global variable.
2230
2231         (WebKit::WebContext::didReceiveInvalidMessage):
2232         Construct a message name string and call the invalid message callback.
2233
2234         * UIProcess/WebProcessProxy.cpp:
2235         (WebKit::WebProcessProxy::didReceiveInvalidMessage):
2236         Call WebContext::didReceiveInvalidMessage.
2237
2238 2013-04-02  Alexey Proskuryakov  <ap@apple.com>
2239
2240         [Mac] Remove WKCreateNSURLConnectionDelegateProxy
2241         https://bugs.webkit.org/show_bug.cgi?id=113810
2242
2243         Reviewed by Anders Carlsson.
2244
2245         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2246         (InitWebCoreSystemInterface):
2247
2248 2013-04-02  Alexey Proskuryakov  <ap@apple.com>
2249
2250         <rdar://problem/13551119> [WK2] Crashes in NetworkProcess when canceling loads
2251         https://bugs.webkit.org/show_bug.cgi?id=113803
2252
2253         Reviewed by Darin Adler.
2254
2255         * Shared/Downloads/mac/DownloadMac.mm: (WebKit::Download::startWithHandle):
2256         Just pass nil instead of proxy.
2257
2258 2013-04-02  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
2259
2260         [WK2] Remove repeating code in declaration of WK2 API classes
2261         https://bugs.webkit.org/show_bug.cgi?id=112782
2262
2263         Reviewed by Benjamin Poulain.
2264
2265         The following two lines of code had been repeated in every WK2 API
2266         object class:
2267         1) static const Type APIType = SomeAPIType;
2268         2) virtual Type type() const { return APIType; }
2269
2270         This patch introduces template class 'TypedAPIObject' inherited
2271         from WebKit::APIObject and it contains the common functionality. 
2272         So the new pattern is that API object classes are inherited from
2273         TypedAPIObject (rather than from WebKit::APIObject directly) passing
2274         the corresponding API object type as a template parameter.
2275
2276         The existing API object classes are modified accordingly to the
2277         proposed pattern.
2278
2279         * Shared/APIObject.h:
2280         (WebKit):
2281         (TypedAPIObject):
2282         (WebKit::TypedAPIObject::~TypedAPIObject):
2283         (WebKit::TypedAPIObject::TypedAPIObject):
2284         * Shared/ImmutableArray.h:
2285         (ImmutableArray):
2286         * Shared/ImmutableDictionary.h:
2287         (ImmutableDictionary):
2288         * Shared/WebArchive.h:
2289         (WebArchive):
2290         * Shared/WebArchiveResource.h:
2291         (WebArchiveResource):
2292         * Shared/WebBackForwardListItem.h:
2293         (WebBackForwardListItem):
2294         * Shared/WebBatteryStatus.h:
2295         (WebBatteryStatus):
2296         * Shared/WebCertificateInfo.h:
2297         * Shared/WebConnection.h:
2298         (WebConnection):
2299         * Shared/WebContextMenuItem.h:
2300         (WebContextMenuItem):
2301         * Shared/WebData.h:
2302         * Shared/WebError.h:
2303         (WebKit::WebError::errorCode):
2304         * Shared/WebGeolocationPosition.h:
2305         (WebGeolocationPosition):
2306         * Shared/WebGeometry.h:
2307         * Shared/WebGraphicsContext.h:
2308         (WebGraphicsContext):
2309         * Shared/WebHitTestResult.h:
2310         * Shared/WebImage.h:
2311         (WebImage):
2312         * Shared/WebNetworkInfo.h:
2313         (WebNetworkInfo):
2314         * Shared/WebNumber.h:
2315         * Shared/WebOpenPanelParameters.h:
2316         (WebOpenPanelParameters):
2317         * Shared/WebRenderLayer.h:
2318         * Shared/WebRenderObject.h:
2319         * Shared/WebSecurityOrigin.h:
2320         * Shared/WebSerializedScriptValue.h:
2321         (WebSerializedScriptValue):
2322         * Shared/WebString.h:
2323         * Shared/WebURL.h:
2324         * Shared/WebURLRequest.h:
2325         (WebURLRequest):
2326         * Shared/WebURLResponse.h:
2327         (WebURLResponse):
2328         * Shared/WebUserContentURLPattern.h:
2329         * Shared/mac/ObjCObjectGraph.h:
2330         * UIProcess/Authentication/AuthenticationChallengeProxy.h:
2331         (AuthenticationChallengeProxy):
2332         * UIProcess/Authentication/AuthenticationDecisionListener.h:
2333         (AuthenticationDecisionListener):
2334         * UIProcess/Authentication/WebCredential.h:
2335         (WebCredential):
2336         * UIProcess/Authentication/WebProtectionSpace.h:
2337         (WebProtectionSpace):
2338         * UIProcess/Downloads/DownloadProxy.h:
2339         (DownloadProxy):
2340         * UIProcess/GeolocationPermissionRequestProxy.h:
2341         (GeolocationPermissionRequestProxy):
2342         * UIProcess/Notifications/NotificationPermissionRequest.h:
2343         (NotificationPermissionRequest):
2344         * UIProcess/Notifications/WebNotification.h:
2345         (WebNotification):
2346         * UIProcess/Notifications/WebNotificationManagerProxy.h:
2347         (WebNotificationManagerProxy):
2348         * UIProcess/Plugins/WebPluginSiteDataManager.h:
2349         (WebPluginSiteDataManager):
2350         * UIProcess/WebApplicationCacheManagerProxy.h:
2351         (WebApplicationCacheManagerProxy):
2352         * UIProcess/WebBackForwardList.h:
2353         (WebBackForwardList):
2354         * UIProcess/WebBatteryManagerProxy.h:
2355         (WebBatteryManagerProxy):
2356         * UIProcess/WebContext.h:
2357         (WebContext):
2358         * UIProcess/WebCookieManagerProxy.h:
2359         (WebCookieManagerProxy):
2360         * UIProcess/WebDatabaseManagerProxy.h:
2361         (WebDatabaseManagerProxy):
2362         * UIProcess/WebEditCommandProxy.h:
2363         (WebEditCommandProxy):
2364         * UIProcess/WebFrameProxy.h:
2365         (WebFrameProxy):
2366         * UIProcess/WebGeolocationManagerProxy.h:
2367         (WebGeolocationManagerProxy):
2368         * UIProcess/WebGrammarDetail.h:
2369         (WebGrammarDetail):
2370         * UIProcess/WebIconDatabase.h:
2371         (WebIconDatabase):
2372         * UIProcess/WebInspectorProxy.h:
2373         (WebInspectorProxy):
2374         * UIProcess/WebKeyValueStorageManagerProxy.h:
2375         (WebKeyValueStorageManagerProxy):
2376         * UIProcess/WebMediaCacheManagerProxy.h:
2377         (WebMediaCacheManagerProxy):
2378         * UIProcess/WebNavigationData.h:
2379         (WebNavigationData):
2380         * UIProcess/WebNetworkInfoManagerProxy.h:
2381         (WebNetworkInfoManagerProxy):
2382         * UIProcess/WebOpenPanelResultListenerProxy.h:
2383         (WebOpenPanelResultListenerProxy):
2384         * UIProcess/WebPageGroup.h:
2385         (WebPageGroup):
2386         * UIProcess/WebPageProxy.h:
2387         (WebPageProxy):
2388         * UIProcess/WebPreferences.cpp:
2389         (WebKit::WebPreferences::WebPreferences):
2390         * UIProcess/WebPreferences.h:
2391         (WebPreferences):
2392         * UIProcess/WebResourceCacheManagerProxy.h:
2393         (WebResourceCacheManagerProxy):
2394         * UIProcess/WebTextChecker.h:
2395         (WebTextChecker):
2396         * UIProcess/WebVibrationProxy.h:
2397         (WebVibrationProxy):
2398         * UIProcess/efl/WebPopupItemEfl.h:
2399         (WebPopupItemEfl):
2400         * UIProcess/efl/WebView.h:
2401         * UIProcess/soup/WebSoupRequestManagerProxy.h:
2402         (WebSoupRequestManagerProxy):
2403         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
2404         (InjectedBundleNodeHandle):
2405         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h:
2406         (InjectedBundleRangeHandle):
2407         * WebProcess/InjectedBundle/InjectedBundle.h:
2408         (InjectedBundle):
2409         * WebProcess/InjectedBundle/InjectedBundleBackForwardList.h:
2410         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h:
2411         * WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.h:
2412         (InjectedBundleDOMWindowExtension):
2413         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h:
2414         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
2415         (InjectedBundleNavigationAction):
2416         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
2417         (InjectedBundleScriptWorld):
2418         * WebProcess/WebPage/PageOverlay.h:
2419         (PageOverlay):
2420         * WebProcess/WebPage/WebFrame.h:
2421         (WebFrame):
2422         * WebProcess/WebPage/WebInspector.h:
2423         (WebInspector):
2424         * WebProcess/WebPage/WebPage.h:
2425         (WebPage):
2426         * WebProcess/WebPage/WebPageGroupProxy.h:
2427         (WebPageGroupProxy):
2428
2429 2013-04-01  Timothy Hatcher  <timothy@apple.com>
2430
2431         Allow changing Web Inspector dock sides without undocking first.
2432
2433         https://webkit.org/b/113661
2434         rdar://problem/13543127
2435
2436         Reviewed by Joseph Pecoraro.
2437
2438         * UIProcess/WebInspectorProxy.cpp:
2439         (WebKit::WebInspectorProxy::createInspectorPage): Send AttachedBottom and
2440         AttachedRight messages so InspectorFrontendClientLocal knows which side we
2441         are attached.
2442
2443         (WebKit::WebInspectorProxy::canAttach): If we are already attached, allow
2444         attaching again to allow switching sides.
2445
2446 2013-04-01  Anders Carlsson  <andersca@apple.com>
2447
2448         Nor this! (Who reviewed this anyway!)
2449
2450         * WebProcess/Storage/StorageNamespaceProxy.cpp:
2451         (WebKit::StorageNamespaceProxy::storageArea):
2452
2453 2013-04-01  Anders Carlsson  <andersca@apple.com>
2454
2455         Didn't mean to commit this!
2456
2457         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2458
2459 2013-04-01  Alexey Proskuryakov  <ap@apple.com>
2460
2461         https://bugs.webkit.org/show_bug.cgi?id=113721
2462         <rdar://problem/13549181> REGRESSION (r146929): HTTP auth credentials not reused during session
2463
2464         Reviewed by Brady Eidson.
2465
2466         * NetworkProcess/NetworkResourceLoader.h:
2467         * NetworkProcess/NetworkResourceLoader.cpp:
2468         (WebKit::NetworkResourceLoader::shouldUseCredentialStorage): Added an override that
2469         we still need. It's not great, but causes no trouble for NetworkProcess.
2470         (WebKit::NetworkResourceLoader::shouldUseCredentialStorageAsync): Implement in
2471         terms of sync version to avoid duplicating logic.
2472
2473 2013-03-05  Anders Carlsson  <andersca@apple.com>
2474
2475         Apply changes from storage events locally
2476         https://bugs.webkit.org/show_bug.cgi?id=111502
2477
2478         Reviewed by Sam Weinig.
2479
2480         * WebProcess/Storage/StorageAreaProxy.cpp:
2481         (WebKit::StorageAreaProxy::StorageAreaProxy):
2482         Store the security origin as a member variable.
2483
2484         (WebKit::StorageAreaProxy::dispatchStorageEvent):
2485         Set the item and call the appropriate event dispatch function.
2486     
2487         (WebKit::StorageAreaProxy::dispatchSessionStorageEvent):
2488         (WebKit::StorageAreaProxy::dispatchLocalStorageEvent):
2489         Add stubs.
2490
2491         * WebProcess/Storage/StorageAreaProxy.h:
2492
2493 2013-04-01  Alexey Proskuryakov  <ap@apple.com>
2494
2495         <rdar://problem/13490123> Sandbox extension tracking is incorrect when restoring a session
2496         https://bugs.webkit.org/show_bug.cgi?id=113709
2497
2498         Reviewed by Anders Carlsson.
2499
2500         * WebProcess/WebPage/WebPage.cpp:
2501         (WebKit::WebPage::SandboxExtensionTracker::didStartProvisionalLoad): Added an assertion
2502         to catch extension tracking logic errors that could result in giving an extension to
2503         non-local pages.
2504         (WebKit::WebPage::SandboxExtensionTracker::didCommitProvisionalLoad): Just like
2505         below, clearing m_pendingProvisionalSandboxExtension appears incorrect, even though
2506         I am not aware of any scenarios where this happens in practice.
2507         (WebKit::WebPage::SandboxExtensionTracker::didFailProvisionalLoad): The load may
2508         be failing exactly because a new one cancels it, so we shouldn't be preventing
2509         the new one from using its extension.
2510
2511 2013-04-01  Brady Eidson  <beidson@apple.com>
2512
2513         SharedMemory release build hardening.
2514         <rdar://problem/13546860> and https://bugs.webkit.org/show_bug.cgi?id=113710
2515
2516         Reviewed by Anders Carlsson.
2517
2518         Successful creation of a memory entry with a size less than the size we requested should be treated
2519         as a failure to create the SharedMemory object.
2520
2521         * Platform/mac/SharedMemoryMac.cpp:
2522         (WebKit::SharedMemory::createFromVMBuffer): Early return if the port we get is bogus for our needs.
2523         (WebKit::SharedMemory::createHandle): Ditto.
2524         (WebKit::SharedMemory::create): Guarantee we pass valid input in to mach_vm_map.
2525
2526 2013-03-30  Csaba Osztrogonác  <ossy@webkit.org>
2527
2528         Unreviewed buildfix after r147260.
2529
2530         * WebProcess/qt/QtBuiltinBundlePage.cpp:
2531         (WebKit::QtBuiltinBundlePage::QtBuiltinBundlePage):
2532
2533 2013-03-29  Seokju Kwon  <seokju.kwon@gmail.com>
2534
2535         [EFL] Unreviewed build fix after r147251
2536         https://bugs.webkit.org/show_bug.cgi?id=113631
2537
2538         Unreviewed build fix.
2539
2540         Add NETWORK_PROCESS guard.
2541
2542         * UIProcess/WebResourceCacheManagerProxy.cpp:
2543         (WebKit::WebResourceCacheManagerProxy::clearCacheForAllOrigins):
2544
2545 2013-03-29  Brady Eidson  <beidson@apple.com>
2546
2547         Crash when "willSendRequest" causes the ResourceLoader to be cancelled.
2548         <rdar://problem/13531679> and https://bugs.webkit.org/show_bug.cgi?id=113616
2549
2550         Reviewed by Alexey Proskuryakov.
2551
2552         These callbacks to the WebCore ResourceLoader can cause the WebResourceLoader to be destroyed.
2553         A RefPtr<> protector fixes that.
2554
2555         Additionally we can invalidate the WebResourceLoader to avoid unnecessary callbacks to the NetworkProcess.
2556
2557         * WebProcess/Network/WebResourceLoadScheduler.cpp:
2558         (WebKit::WebResourceLoadScheduler::remove): Call detachFromCoreLoader() on a removed WebResourceLoader.
2559
2560         * WebProcess/Network/WebResourceLoader.cpp:
2561         (WebKit::WebResourceLoader::detachFromCoreLoader): Clear out the ResourceLoader pointer.
2562         (WebKit::WebResourceLoader::willSendRequest): Protect this, and don't message back to the NetworkProcess if its not needed.
2563         (WebKit::WebResourceLoader::canAuthenticateAgainstProtectionSpace): Ditto
2564         (WebKit::WebResourceLoader::didReceiveResource): Paranoid hardening - Protect this before delivering the data to the WebCore
2565           ResourceLoader, and null check it before delivering the "didFinishLoader" call.
2566         * WebProcess/Network/WebResourceLoader.h:
2567
2568 2013-03-29  Brady Eidson  <beidson@apple.com>
2569
2570         Should never send events to plugins waiting on asynchronous initialization.
2571         <rdar://problem/13538945> and https://bugs.webkit.org/show_bug.cgi?id=113612
2572
2573         Reviewed by Anders Carlsson.
2574
2575         Sending mouse and keyboard events to a plugin in the middle of asynchronous initialization is silly.
2576
2577         A quick audit of the sendSync() messages in PluginProxy suggests the following 8 can just have an early return:
2578
2579         * WebProcess/Plugins/PluginProxy.cpp:
2580         (WebKit::PluginProxy::handleMouseEvent):
2581         (WebKit::PluginProxy::handleWheelEvent):
2582         (WebKit::PluginProxy::handleMouseEnterEvent):
2583         (WebKit::PluginProxy::handleMouseLeaveEvent):
2584         (WebKit::PluginProxy::handleKeyboardEvent):
2585         (WebKit::PluginProxy::handleEditingCommand):
2586         (WebKit::PluginProxy::isEditingCommandEnabled):
2587         (WebKit::PluginProxy::handlesPageScaleFactor):
2588
2589 2013-03-29  Brady Eidson  <beidson@apple.com>
2590
2591         Should never send events to plugins waiting on asynchronous initialization.
2592         <rdar://problem/13538945> and https://bugs.webkit.org/show_bug.cgi?id=113612
2593
2594         Reviewed by Anders Carlsson.
2595
2596         Sending mouse and keyboard events to a plugin in the middle of asynchronous initialization is silly.
2597
2598         A quick audit of the sendSync() messages in PluginProxy suggests the following 8 can just have an early return:
2599
2600         * WebProcess/Plugins/PluginProxy.cpp:
2601         (WebKit::PluginProxy::handleMouseEvent):
2602         (WebKit::PluginProxy::handleWheelEvent):
2603         (WebKit::PluginProxy::handleMouseEnterEvent):
2604         (WebKit::PluginProxy::handleMouseLeaveEvent):
2605         (WebKit::PluginProxy::handleKeyboardEvent):
2606         (WebKit::PluginProxy::handleEditingCommand):
2607         (WebKit::PluginProxy::isEditingCommandEnabled):
2608         (WebKit::PluginProxy::handlesPageScaleFactor):
2609
2610 2013-03-29  Alexey Proskuryakov  <ap@apple.com>
2611
2612         Expose FeatureObserver data to WebKit clients
2613         https://bugs.webkit.org/show_bug.cgi?id=113613
2614
2615         Reviewed by Sam Weinig.
2616
2617         * Shared/APIClientTraits.cpp:
2618         * Shared/APIClientTraits.h:
2619         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2620         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2621         (WebKit::InjectedBundlePageLoaderClient::featuresUsedInPage):
2622         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
2623         Added a new injected bundle client call, featuresUsedInPage.
2624
2625         * WebProcess/WebPage/WebPage.cpp:
2626         (WebKit::WebPage::close):
2627         (WebKit::WebPage::didCommitLoad):
2628         (WebKit::WebPage::reportUsedFeatures):
2629         * WebProcess/WebPage/WebPage.h:
2630         Report features used in a page when navigating away, or when closing.
2631
2632 2013-03-29  Brady Eidson  <beidson@apple.com>
2633
2634         Crash when "willSendRequest" causes the ResourceLoader to be cancelled.
2635         <rdar://problem/13531679> and https://bugs.webkit.org/show_bug.cgi?id=113616
2636
2637         Reviewed by Alexey Proskuryakov.
2638
2639         These callbacks to the WebCore ResourceLoader can cause the WebResourceLoader to be destroyed.
2640         A RefPtr<> protector fixes that.
2641
2642         Additionally we can invalidate the WebResourceLoader to avoid unnecessary callbacks to the NetworkProcess.
2643
2644         * WebProcess/Network/WebResourceLoadScheduler.cpp:
2645         (WebKit::WebResourceLoadScheduler::remove): Call detachFromCoreLoader() on a removed WebResourceLoader.
2646
2647         * WebProcess/Network/WebResourceLoader.cpp:
2648         (WebKit::WebResourceLoader::detachFromCoreLoader): Clear out the ResourceLoader pointer.
2649         (WebKit::WebResourceLoader::willSendRequest): Protect this, and don't message back to the NetworkProcess if its not needed.
2650         (WebKit::WebResourceLoader::canAuthenticateAgainstProtectionSpace): Ditto
2651         (WebKit::WebResourceLoader::didReceiveResource): Paranoid hardening - Protect this before delivering the data to the WebCore
2652           ResourceLoader, and null check it before delivering the "didFinishLoader" call.
2653         * WebProcess/Network/WebResourceLoader.h:
2654
2655 2013-03-29  Brady Eidson  <beidson@apple.com>
2656
2657         Should never send events to plugins waiting on asynchronous initialization.
2658         <rdar://problem/13538945> and https://bugs.webkit.org/show_bug.cgi?id=113612
2659
2660         Reviewed by Anders Carlsson.
2661
2662         Sending mouse and keyboard events to a plugin in the middle of asynchronous initialization is silly.
2663
2664         A quick audit of the sendSync() messages in PluginProxy suggests the following 8 can just have an early return:
2665
2666         * WebProcess/Plugins/PluginProxy.cpp:
2667         (WebKit::PluginProxy::handleMouseEvent):
2668         (WebKit::PluginProxy::handleWheelEvent):
2669         (WebKit::PluginProxy::handleMouseEnterEvent):
2670         (WebKit::PluginProxy::handleMouseLeaveEvent):
2671         (WebKit::PluginProxy::handleKeyboardEvent):
2672         (WebKit::PluginProxy::handleEditingCommand):
2673         (WebKit::PluginProxy::isEditingCommandEnabled):
2674         (WebKit::PluginProxy::handlesPageScaleFactor):
2675
2676 2013-03-29  Brady Eidson  <beidson@apple.com>
2677
2678         "Empty cache..." clears the disk cache from each WebProcess.
2679         <rdar://problem/12456652> and https://bugs.webkit.org/show_bug.cgi?id=113603
2680
2681         Reviewed by Sam Weinig.
2682
2683         * NetworkProcess/NetworkProcess.cpp:
2684         (WebKit::NetworkProcess::NetworkProcess):
2685         (WebKit::NetworkProcess::terminate): Override ChildProcess::terminate to allow us to finish clearing the cache.
2686         * NetworkProcess/NetworkProcess.h:
2687
2688         * NetworkProcess/NetworkProcess.messages.in: Add the ClearCacheForAllOrigins message.
2689
2690         * NetworkProcess/mac/NetworkProcessMac.mm:
2691         (WebKit::NetworkProcess::clearCacheForAllOrigins): Clear the disk cache.
2692         (WebKit::NetworkProcess::platformTerminate): Wait for the clear to complete.
2693
2694         * UIProcess/WebResourceCacheManagerProxy.cpp:
2695         (WebKit::WebResourceCacheManagerProxy::clearCacheForAllOrigins): Message the network process, also.
2696
2697         * WebProcess/mac/WebProcessMac.mm:
2698         (WebKit::WebProcess::platformClearResourceCaches): Don't clear the disk cache if we use the network process.
2699
2700 2013-03-28  Brady Eidson  <beidson@apple.com>
2701
2702         We leak NetworkConnectionToWebProcess objects.
2703         <rdar://problem/13393118> and https://bugs.webkit.org/show_bug.cgi?id=113551
2704
2705         Reviewed by Anders Carlsson.
2706
2707         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2708         (WebKit::NetworkConnectionToWebProcess::didClose): Remove this from the global set
2709           of NetworkConnectionToWebProcess objects.
2710
2711 2013-03-28  Brady Eidson  <beidson@apple.com>
2712
2713         Resources are never revalidated/reloaded if a cached response exists on disk.
2714         <rdar://problem/13479890> and https://bugs.webkit.org/show_bug.cgi?id=113542
2715
2716         Reviewed by Alexey Proskuryakov.
2717
2718         Trying to get a cached resource in didReceiveResponse and then aborting the load
2719         meant we never performed any new loads.
2720
2721         We can check and see if the data is cached data inside didReceiveBuffer, instead.
2722
2723         * NetworkProcess/NetworkResourceLoader.cpp:
2724         (WebKit::NetworkResourceLoader::didReceiveResponse): Don't try for cached resources here.
2725         (WebKit::NetworkResourceLoader::didReceiveData): This callback should never be used.
2726         (WebKit::NetworkResourceLoader::didReceiveBuffer): Try to see if this data objected represents
2727           a file based mmaped buffer.
2728         * NetworkProcess/NetworkResourceLoader.h:
2729
2730         Refactor these utility functions to start from either a CFURLCachedResponse or a SharedBuffer:
2731         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
2732         (CFCachedURLResponseGetMemMappedData):
2733         (CFURLCacheIsMemMappedData):
2734         (WebKit::tryGetShareableHandleFromCFData):
2735         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromCFURLCachedResponse):
2736         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer):
2737
2738 2013-03-28  Tim Horton  <timothy_horton@apple.com>
2739
2740         [wk2] REGRESSION (r125500): WebFrameLoaderClient's active m_pluginView can be zeroed by PluginDocuments leaving the page cache
2741         https://bugs.webkit.org/show_bug.cgi?id=113430
2742         <rdar://problem/12729564>
2743
2744         Reviewed by Brady Eidson.
2745
2746         http://trac.webkit.org/changeset/147152 was wrong, and should have been
2747         (as the ChangeLog stated) testing the argument to redirectDataToPlugin,
2748         not the value of m_pluginView.
2749
2750         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2751         (WebKit::WebFrameLoaderClient::redirectDataToPlugin):
2752
2753 2013-03-28  Tim Horton  <timothy_horton@apple.com>
2754
2755         [wk2] REGRESSION (r125500): WebFrameLoaderClient's active m_pluginView can be zeroed by PluginDocuments leaving the page cache
2756         https://bugs.webkit.org/show_bug.cgi?id=113430
2757         <rdar://problem/12729564>
2758
2759         Reviewed by Brady Eidson.
2760
2761         Ignore redirectDataToPlugin(0), which is only called from PluginDocument::detach(),
2762         and only after r125500. Otherwise, PluginDocuments that are put into the page cache
2763         but leave later can clear a totally different and legitimate PluginView from the
2764         WebFrameLoaderClient, causing data to be lost and PluginDocument loads to stall.
2765
2766         This restores our behavior to the pre-r125500 state, which should be fine, as we
2767         clear WebFrameLoaderClient's m_pluginView when the load fails or finishes. This
2768         matches the changes made in r125500 for every platform other than Chromium and WebKit2.
2769
2770         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2771         (WebKit::WebFrameLoaderClient::redirectDataToPlugin):
2772
2773 2013-03-28  Tim Horton  <timothy_horton@apple.com>
2774
2775         PDFPlugin: shouldUsePDFPlugin can't use pdfLayerControllerClass() because it asserts if it's not available
2776         https://bugs.webkit.org/show_bug.cgi?id=113533
2777         <rdar://problem/13528720>
2778
2779         Reviewed by Simon Fraser.
2780
2781         * WebProcess/WebPage/WebPage.cpp:
2782         * WebProcess/WebPage/mac/WebPageMac.mm:
2783         (WebKit::WebPage::shouldUsePDFPlugin):
2784         Move shouldUsePDFPlugin to WebPageMac, where it belongs, and explicitly look up PDFLayerController
2785         instead of using pdfLayerControllerClass(), which ASSERT()s if it isn't available.
2786
2787 2013-03-28  Brady Eidson  <beidson@apple.com>
2788
2789         Reduce PluginProcess lifetime.
2790         <rdar://problem/12465479> and https://bugs.webkit.org/show_bug.cgi?id=113523
2791
2792         Reviewed by Sam Weinig.
2793
2794         Lower the minimum process lifetime from 30 minutes to 2 minutes.
2795         Lower the "shutdown after last plugin goes away" period from 10 minutes to 1 minute.
2796
2797         * UIProcess/Plugins/PluginProcessProxy.cpp:
2798
2799 2013-03-28  Zan Dobersek  <zdobersek@igalia.com>
2800
2801         [GTK] Build GTK-specific, non-layer-violating source code into WebCore-independent libPlatformGtk.la
2802         https://bugs.webkit.org/show_bug.cgi?id=112546
2803
2804         Reviewed by Martin Robinson.
2805
2806         * GNUmakefile.am: Reference the platform_webcore_cppflags and GTK, libsecret and libsoup dependencies' cflags amongst the
2807         libPlatformGtk2's CPPFLAGS.
2808         * Scripts/generate-forwarding-headers.pl: Remove the Platform framework from the list of the frameworks to be searched
2809         for forwarding headers, it's at the moment not necessary to be included.
2810         * Shared/gtk/ArgumentCodersGtk.cpp: Adjust the forwarding header for GtkVersioning.h that's been moved back under the
2811         WebCore framework.
2812         * Shared/gtk/WebEventFactory.cpp: Ditto.
2813         * UIProcess/API/gtk/WebKitWebViewBase.cpp: Ditto.
2814         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: Ditto.
2815
2816 2013-03-27  Tim Horton  <timothy_horton@apple.com>
2817
2818         Unreviewed Qt build fix after http://trac.webkit.org/changeset/147067.
2819
2820         * WebProcess/WebPage/WebPage.cpp:
2821
2822 2013-03-27  Tim Horton  <timothy_horton@apple.com>
2823
2824         PDFPlugin: Enable PDFPlugin only if its dependencies exist on the system
2825         https://bugs.webkit.org/show_bug.cgi?id=113372
2826         <rdar://problem/12685301>
2827
2828         Reviewed by Alexey Proskuryakov.
2829
2830         * Shared/mac/PDFKitImports.h: Wrap in #if PLATFORM(MAC).
2831         * WebProcess/WebPage/WebPage.cpp:
2832         (WebKit::WebPage::createPlugin): Use shouldUsePDFPlugin.
2833         (WebKit::WebPage::shouldUsePDFPlugin): If the PDFPlugin setting is enabled but PDFLayerController is not available, don't use PDFPlugin.
2834         * WebProcess/WebPage/WebPage.h:
2835         (WebPage): Add shouldUsePDFPlugin
2836         * WebProcess/WebPage/mac/WebPageMac.mm:
2837         (WebKit::WebPage::platformPreferencesDidChange): Use shouldUsePDFPlugin.
2838
2839 2013-03-27  Sam Weinig  <sam@webkit.org>
2840
2841         [WebKit2] Need SPI to determine whether a plug-in is blocked
2842         https://bugs.webkit.org/show_bug.cgi?id=113463
2843
2844         Reviewed by Anders Carlsson.
2845
2846         Add new SPI, WKContextCopyPlugInInfoForBundleIdetifier, to get data about a plug-in,
2847         including whether it is blocked by x-protect.
2848
2849         * UIProcess/WebLoaderClient.cpp:
2850         * UIProcess/API/C/WKAPICast.h:
2851         (WebKit::toWKPluginLoadPolicy):
2852         (WebKit::toPluginModuleLoadPolicy):
2853         Move to a shared location.
2854
2855         * UIProcess/API/C/mac/WKContextPrivateMac.h:
2856         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
2857         (WKContextIsPlugInUpdateAvailable):
2858         (WKPlugInInfoPathKey):
2859         (WKPlugInInfoBundleIdentifierKey):
2860         (WKPlugInInfoVersionKey):
2861         (WKPlugInInfoLoadPolicyKey):
2862         (WKPlugInInfoUpdatePastLastBlockedVersionIsKnownAvailableKey):
2863         (WKContextCopyPlugInInfoForBundleIdetifier):
2864         Add new SPI and dictionary keys.
2865
2866         * UIProcess/Plugins/PluginInfoStore.cpp:
2867         (WebKit::PluginInfoStore::findPluginWithBundleIdentifer):
2868         * UIProcess/Plugins/PluginInfoStore.h:
2869         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
2870         (WebKit::PluginInfoStore::findPluginWithBundleIdentifer):
2871         Add function to lookup plug-ins by bundle identifier.
2872
2873 2013-03-27  Beth Dakin  <bdakin@apple.com>
2874
2875         WKBundlePagePrivateMac.h is not being exported
2876         https://bugs.webkit.org/show_bug.cgi?id=113470
2877         -and corresponding-
2878         <rdar://problem/13522909>
2879
2880         Reviewed by Sam Weinig.
2881
2882         Mark it as private instead of project.
2883         * WebKit2.xcodeproj/project.pbxproj:
2884
2885 2013-03-26  Beth Dakin  <bdakin@apple.com>
2886
2887         Need WK2 API to give a WebView a header and footer
2888         https://bugs.webkit.org/show_bug.cgi?id=113352
2889         -and corresponding-
2890         <rdar://problem/13383835>
2891
2892         Reviewed by Simon Fraser.
2893
2894         New API allows setting and getting layers for a header and footer.
2895
2896         * WebKit2.xcodeproj/project.pbxproj:
2897         * WebProcess/InjectedBundle/API/c/mac: Added.
2898         * WebProcess/InjectedBundle/API/c/mac/WKBundlePagePrivateMac.h: Added.
2899         * WebProcess/InjectedBundle/API/c/mac/WKBundlePagePrivateMac.mm: Added.
2900         (WKBundlePageGetHeaderLayer):
2901         (WKBundlePageSetHeaderLayer):
2902         (WKBundlePageGetFooterLayer):
2903         (WKBundlePageSetFooterLayer):
2904         * WebProcess/WebPage/WebPage.h:
2905         (WebPage):
2906         * WebProcess/WebPage/mac/WebPageMac.mm:
2907         (WebKit::WebPage::setTopOverhangImage):
2908         (WebKit::WebPage::setBottomOverhangImage):
2909         (WebKit):
2910         (WebKit::WebPage::getHeaderLayer):
2911         (WebKit::WebPage::setHeaderLayerWithHeight):
2912         (WebKit::WebPage::getFooterLayer):
2913         (WebKit::WebPage::setFooterLayerWithHeight):
2914
2915 2013-03-27  Jer Noble  <jer.noble@apple.com>
2916
2917         Going full screen and cancelling gets system into a weird state
2918         https://bugs.webkit.org/show_bug.cgi?id=113445
2919
2920         Reviewed by Eric Carlson.
2921
2922         Replace an array of BOOL member variables to track full screen state with a single enum, and
2923         add state tracking for the "waiting to enter" and "waiting to exit" states. Use this new,
2924         more specific enum to be more stringent about the state when responding to WebProcess
2925         messages. Also only set the placeholder view's target once in full screen mode.
2926
2927         * UIProcess/mac/WKFullScreenWindowController.h:
2928         * UIProcess/mac/WKFullScreenWindowController.mm:
2929         (-[WKFullScreenWindowController isFullScreen]): Yes when in full screen, entering full screen,
2930             or waiting to enter full screen.
2931         (-[WKFullScreenWindowController cancelOperation:]): Only requestExitFullScreen() if a watchdog
2932             has not already been made active.
2933         (-[WKFullScreenWindowController enterFullScreen:]): Use the new state variable.
2934         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:WebCore::finalFrame:WebCore::]): Ditto.
2935         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Ditto. Set the placeholder target.
2936         (-[WKFullScreenWindowController exitFullScreen]): Ditto. Clear the placeholder target.
2937         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:WebCore::finalFrame:WebCore::]): Ditto.
2938         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]): Ditto.
2939         (-[WKFullScreenWindowController performClose:]): Ditto.
2940         (-[WKFullScreenWindowController close]): Ditto.
2941         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]): Ditto.
2942
2943 2013-03-27  Brady Eidson  <beidson@apple.com>
2944
2945         Blind attempt at fixing the release build.
2946
2947         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
2948         (WebKit::NetworkResourceLoader::willCacheResponseAsync):
2949
2950 2013-03-27  Brady Eidson  <beidson@apple.com>
2951
2952         Mem mapped resource data improvements.
2953         <rdar://problem/13196481> and https://bugs.webkit.org/show_bug.cgi?id=113422
2954
2955         Reviewed by Alexey Proskuryakov (and looked over by Geoff Garen).
2956
2957         Remove timer-based approach support code:
2958         * NetworkProcess/NetworkResourceLoader.cpp:
2959         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
2960         (WebKit::NetworkResourceLoader::abortInProgressLoad):
2961         (WebKit::NetworkResourceLoader::didFinishLoading):
2962         * NetworkProcess/NetworkResourceLoader.h:
2963
2964         Add an object to encapsulate monitoring a resource going in to the disk cache.
2965         It listens for a callback on the cached response indicating it is disk backed
2966         and also sets a timeout so we don't keep the monitor alive and waiting forever.
2967         * NetworkProcess/mac/DiskCacheMonitor.h: Added.
2968         (WebKit::DiskCacheMonitor::destinationID):
2969         (WebKit::DiskCacheMonitor::connectionToWebProcess):
2970         (WebKit::DiskCacheMonitor::resourceRequest):
2971         * NetworkProcess/mac/DiskCacheMonitor.mm: Added.
2972         (CFCachedURLResponseSetBecameFileBackedCallBackBlock):
2973         (WebKit::monitorFileBackingStoreCreation):
2974         (WebKit::DiskCacheMonitor::DiskCachingMonitor):
2975         (WebKit::DiskCacheMonitor::connection):
2976
2977         Refactoring and monitor certain cached responses:
2978         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
2979         (CFCachedURLResponseGetMemMappedData):
2980         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromCFURLCachedResponse): Use CFCachedURLResponseGetMemMappedData
2981           to explicitly get an mem-mapped data object.
2982         (WebKit::NetworkResourceLoader::tryGetShareableHandleForResource):
2983         (WebKit::NetworkResourceLoader::willCacheResponseAsync): If the resource is over the minimum
2984           size then set up a disk caching monitor.
2985
2986         * WebKit2.xcodeproj/project.pbxproj:
2987
2988 2013-03-26  Timothy Hatcher  <timothy@apple.com>
2989
2990         Add support for dock-to-right of the Web Inspector in the Mac port.
2991
2992         Unfortunately this requires Safari changes, so it is disabled in the nightly builds.
2993
2994         https://webkit.org/b/113341
2995         rdar://problem/10368152
2996
2997         Reviewed by Joseph Pecoraro.
2998
2999         * Resources/Dock.pdf: Removed.
3000         * Resources/DockBottom.pdf: Added.
3001         * Resources/DockRight.pdf: Added.
3002         * Shared/WebPreferencesStore.h:
3003         * UIProcess/WebInspectorProxy.cpp:
3004         (WebKit::WebInspectorProxy::WebInspectorProxy):
3005         (WebKit::WebInspectorProxy::attachBottom):
3006         (WebKit::WebInspectorProxy::attachRight):
3007         (WebKit::WebInspectorProxy::attach):
3008         (WebKit::WebInspectorProxy::detach):
3009         (WebKit::WebInspectorProxy::setAttachedWindowWidth):
3010         (WebKit::WebInspectorProxy::createInspectorPage):
3011         (WebKit::WebInspectorProxy::canAttach):
3012         * UIProcess/WebInspectorProxy.h:
3013         (WebInspectorProxy):
3014         * UIProcess/WebInspectorProxy.messages.in:
3015         * UIProcess/mac/WebInspectorProxyMac.mm:
3016         (-[WKWebInspectorProxyObjCAdapter attachRight:]):
3017         (-[WKWebInspectorProxyObjCAdapter attachBottom:]):
3018         (-[WKWebInspectorWindow _cursorForResizeDirection:]):
3019         (-[WKWebInspectorWindow _customTitleFrame]):
3020         (WebKit::createDockButton):
3021         (WebKit::WebInspectorProxy::createInspectorWindow):
3022         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3023         (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
3024         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
3025         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
3026         (WebKit::WebInspectorProxy::platformAttach):
3027         (WebKit::WebInspectorProxy::platformDetach):
3028         (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight):
3029         (WebKit::WebInspectorProxy::platformSetAttachedWindowWidth):
3030         * WebKit2.xcodeproj/project.pbxproj:
3031         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
3032         (WebKit::WebInspectorFrontendClient::attachWindow):
3033         (WebKit::WebInspectorFrontendClient::setAttachedWindowWidth):
3034         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.h:
3035         (WebInspectorFrontendClient):
3036         * WebProcess/WebPage/WebInspector.cpp:
3037         (WebKit::WebInspector::attachBottom):
3038         (WebKit::WebInspector::attachRight):
3039         (WebKit::WebInspector::setAttachedWindowWidth):
3040         (WebKit::WebInspector::attachedBottom):
3041         (WebKit::WebInspector::attachedRight):
3042         (WebKit::WebInspector::detached):
3043         * WebProcess/WebPage/WebInspector.h:
3044         (WebInspector):
3045         * WebProcess/WebPage/WebInspector.messages.in:
3046
3047 2013-03-27  Kondapally Kalyan  <kalyan.kondapally@intel.com>
3048
3049         [CoordGfx] Support to share GraphicsSurface flags with client.
3050         https://bugs.webkit.org/show_bug.cgi?id=112982
3051
3052         Reviewed by Noam Rosenthal.
3053
3054         Covered by existing WebGL tests.
3055
3056         This patch adds support to pass GraphicsSurface flags
3057         during it's client creation.
3058
3059         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
3060         (CoreIPC::::encode):
3061         (CoreIPC::::decode):
3062
3063 2013-03-26  Hayato Ito  <hayato@chromium.org>
3064
3065         Allow ShadowContents in HitTests by default.
3066         https://bugs.webkit.org/show_bug.cgi?id=113171
3067
3068         Reviewed by Dimitri Glazkov.
3069
3070         * WebProcess/WebPage/WebFrame.cpp:
3071         (WebKit::WebFrame::hitTest):
3072         * WebProcess/WebPage/WebPage.cpp:
3073         (WebKit::WebPage::highlightPotentialActivation):
3074         (WebKit::WebPage::findZoomableAreaForPoint):
3075         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
3076         * WebProcess/WebPage/mac/WebPageMac.mm:
3077         (WebKit::WebPage::shouldDelayWindowOrderingEvent):
3078         (WebKit::WebPage::acceptsFirstMouse):
3079
3080 2013-03-26  Tim Horton  <timothy_horton@apple.com>
3081
3082         [ca] Tell CA to clean up unused resources if a given WebProcess won't be drawing
3083         https://bugs.webkit.org/show_bug.cgi?id=107539
3084         <rdar://problem/13032692>
3085
3086         Reviewed by Simon Fraser.
3087
3088         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3089         (InitWebCoreSystemInterface): Update WebCoreSystemInterface.
3090         * WebProcess/WebPage/WebPage.cpp:
3091         (WebKit::WebPage::WebPage): Initially move the Page out of the window if necessary;
3092         Page defaults to in-window, which is wrong in many cases - we depend on
3093         Page::isInWindow being accurate to decide whether WebPage::setIsInWindow is actually
3094         a state change or not.
3095         (WebKit::WebPage::setIsInWindow):
3096         * WebProcess/WebProcess.cpp: Inform WebProcess when we go on/off screen.
3097         (WebKit::WebProcess::WebProcess):
3098         (WebKit::WebProcess::pageDidMoveOnscreen): Keep track of the number of on-screen pages in this process.
3099         (WebKit::WebProcess::pageWillMoveOffscreen): If the number of on-screen pages drops to zero,  clean up unused rendering resources.
3100         * WebProcess/WebProcess.h:
3101
3102 2013-03-26  Dean Jackson  <dino@apple.com>
3103
3104         When a primary plugin is restarted, also start similar plugins
3105         https://bugs.webkit.org/show_bug.cgi?id=113265
3106
3107         Reviewed by Tim Horton.
3108
3109         Remember the origin of the primary plugin, so that we can
3110         autostart anything that is similar.
3111
3112         * WebProcess/WebCoreSupport/WebPlugInClient.cpp:
3113         (WebKit::WebPlugInClient::WebPlugInClient): Keep a pointer to the WebPage.
3114         (WebKit::WebPlugInClient::shouldAutoStartFromOrigin): Pass the page onto the process.
3115         * WebProcess/WebCoreSupport/WebPlugInClient.h:
3116         (WebPlugInClient): New member variable for the WebPage we were created with.
3117         * WebProcess/WebPage/WebPage.cpp:
3118         (WebKit::WebPage::determinePrimarySnapshottedPlugIn): Remember the origin information
3119             for the primary plugin.
3120         (WebKit::WebPage::matchesPrimaryPlugIn): Returns true if we're seeing something that
3121             looks like the primary plugin.
3122         * WebProcess/WebPage/WebPage.h: New method matchesPrimaryPlugIn.
3123         * WebProcess/WebProcess.cpp:
3124         (WebKit::WebProcess::shouldPlugInAutoStartFromOrigin): Check if the page thinks this is
3125             the primary plugin.
3126         * WebProcess/WebProcess.h: Accept a reference to the page in shouldPlugInAutoStartFromOrigin.
3127
3128 2013-03-26  Alexey Proskuryakov  <ap@apple.com>
3129
3130         Follow-up to:
3131         <rdar://problem/13194263> Crashes in NetworkProcess due to threading issues
3132         https://bugs.webkit.org/show_bug.cgi?id=113256
3133
3134         Reviewed by Mark Rowe.
3135
3136         * NetworkProcess/NetworkResourceLoader.h: Added some forgotten OVERRIDEs.
3137
3138 2013-03-26  Alexey Proskuryakov  <ap@apple.com>
3139
3140         <rdar://problem/13194263> Crashes in NetworkProcess due to threading issues
3141         https://bugs.webkit.org/show_bug.cgi?id=113256
3142
3143         Reviewed by Brady Eidson.
3144
3145         Use asynchronous version of ResourceHandle/ResourceHandleClient in NetworkProcess.
3146         We now run WebCore code on main thread, so we can't block it.
3147
3148         * DerivedSources.make:
3149         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3150         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
3151         * NetworkProcess/NetworkResourceLoader.messages.in: Added.
3152         * WebKit2.xcodeproj/project.pbxproj:
3153         Made NetworkResourceLoader a message receiver. Messages that used to be sync are
3154         now async, and responses need to be sent to the loader.
3155
3156         * NetworkProcess/NetworkResourceLoader.cpp:
3157         (WebKit::NetworkResourceLoader::willSendRequestAsync): This now happens on main
3158         thread, and thus cannot be sync.
3159         (WebKit::NetworkResourceLoader::continueWillSendRequest): Notify the resource
3160         handle once a response is ready.
3161         (WebKit::NetworkResourceLoader::didSendData): Removed unnecessary WebCore prefixes.
3162         (WebKit::NetworkResourceLoader::didReceiveCachedMetadata): Ditto.
3163         (WebKit::NetworkResourceLoader::wasBlocked):  Ditto.
3164         (WebKit::NetworkResourceLoader::cannotShowURL): Ditto.
3165         (WebKit::NetworkResourceLoader::shouldUseCredentialStorageAsync): This function
3166         doesn't call through to WebProcess, so we can keep it synchronous. But we still
3167         need to implement the async version, since that's what ResourceHandle calls.
3168         (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
3169         Made async.
3170         (WebKit::NetworkResourceLoader::continueCanAuthenticateAgainstProtectionSpace):
3171         Notify ResourceHandle when response is ready.
3172         (WebKit::NetworkResourceLoader::didReceiveDataArray): Removed unnecessary WebCore prefixes.
3173         (WebKit::NetworkResourceLoader::willCacheResponseAsync): This matches default
3174         implementation, but we are overriding everything to make it clearer what's missing.
3175         (WebKit::NetworkResourceLoader::willStopBufferingData): Removed unnecessary WebCore prefixes.
3176
3177         * NetworkProcess/NetworkResourceLoader.h: Updated to use async client methods.
3178         Keep ResourceRequest around while handling willSendRequest, as we need the original
3179         to recombine the request. Removed CFNet version of willCacheResponse for now,
3180         as we are not using it yet.
3181
3182         * Shared/Authentication/AuthenticationManager.cpp: Assert that methods touching
3183         a global HashMap all run on main thread. Changed generateAuthenticationChallengeID()
3184         to use regular increment, as there is no need to run it from a secondary thread.
3185
3186         * WebProcess/Network/NetworkProcessConnection.cpp:
3187         (WebKit::NetworkProcessConnection::didReceiveSyncMessage): We no longer have any
3188         sync messages.
3189
3190         * WebProcess/Network/WebResourceLoader.h:
3191         * WebProcess/Network/WebResourceLoader.cpp:
3192         (WebKit::WebResourceLoader::willSendRequest):
3193         (WebKit::WebResourceLoader::canAuthenticateAgainstProtectionSpace):
3194         * WebProcess/Network/WebResourceLoader.messages.in:
3195         Changed to use async messages.
3196
3197 2013-03-26  Tim Horton  <timothy_horton@apple.com>
3198
3199         [wk2] Don't send intrinsic content size updates more than once per runloop
3200         https://bugs.webkit.org/show_bug.cgi?id=113258
3201         <rdar://problem/13492038>
3202
3203         Reviewed by Simon Fraser.
3204
3205         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3206         (WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
3207         Only start the zero-delay timer if it's not already active.
3208
3209 2013-03-26  Tony Chang  <tony@chromium.org>
3210
3211         Autogenerate the scrollAnimatorEnabled setting in Settings.in
3212         https://bugs.webkit.org/show_bug.cgi?id=113253
3213
3214         Reviewed by James Robinson.
3215
3216         * WebProcess/WebPage/WebPage.cpp:
3217         (WebKit::WebPage::setUseFixedLayout): Update call to WebCore to use setScrollAnimatorEnabled(bool).
3218         (WebKit::WebPage::updatePreferences): Update call to WebCore to use setScrollAnimatorEnabled(bool).
3219
3220 2013-03-26  Andras Becsi  <andras.becsi@digia.com>
3221
3222         [Qt][WK2] Fails to start QtWebProcess.exe if installed in a path containing spaces
3223         https://bugs.webkit.org/show_bug.cgi?id=113328
3224
3225         Reviewed by Jocelyn Turcotte.
3226
3227         Downstream bugreport: https://bugreports.qt-project.org/browse/QTBUG-30249
3228
3229         We use QProcess::start() with a commandline string to start the web process
3230         and the string is treated by QProcess as a whitespace delimeted list of the
3231         command and the arguments, thus we have to escape the path to the process
3232         binaries so that if the path contains spaces we still run the appropriate
3233         command.
3234
3235         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
3236         (WebKit::ProcessLauncher::launchProcess):
3237
3238 2013-03-26  Andras Becsi  <andras.becsi@digia.com>
3239
3240         [Qt][WK2] QML WebView asserts when double clicking a link
3241         https://bugs.webkit.org/show_bug.cgi?id=113329
3242
3243         Reviewed by Jocelyn Turcotte.
3244
3245         Downstream bugreport: https://bugreports.qt-project.org/browse/QTBUG-30288
3246
3247         Remove an erroneous assert which is no longer valid if
3248         mouse gestures are enabled.
3249
3250         * UIProcess/qt/QtWebPageEventHandler.cpp:
3251         (WebKit::QtWebPageEventHandler::handleInputEvent):
3252
3253 2013-03-26  Tim Horton  <timothy_horton@apple.com>
3254
3255         [wk2] Don't send intrinsic content size updates more than once per runloop
3256         https://bugs.webkit.org/show_bug.cgi?id=113258
3257         <rdar://problem/13492038>
3258
3259         Reviewed by Anders Carlsson.
3260
3261         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3262         (TiledCoreAnimationDrawingArea):
3263         Add a zero-delay timer for intrinsic content size updates.
3264         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3265         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
3266         Add a zero-delay timer for intrinsic content size updates.
3267         (WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
3268         Start our new one-shot zero-delay timer.
3269         (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeTimerFired):
3270         Inform the WebPage that the intrinsic content size has changed.
3271
3272 2013-03-26  Simon Cooper  <scooper@apple.com>
3273
3274         bundle-ids need to be sanitized before using them in filesystem paths
3275         https://bugs.webkit.org/show_bug.cgi?id=113030
3276         <rdar://problem/13300254>
3277
3278         Reviewed by Alexey Proskuryakov.
3279
3280         When choosing / looking for a specialized Sandbox for a Plugin the
3281         bundle-id needs to be sanitized before using it to construct a
3282         filesystem name to look up. The “/“ character should not be allowed
3283         and transformed into something else, in this case a “:”
3284
3285         * PluginProcess/mac/PluginProcessMac.mm:
3286         (WebKit::loadSandboxProfile):
3287
3288 2013-03-26  Zeno Albisser  <zeno@webkit.org>
3289
3290         [Qt] UIProcess should initialize WebCoreSystemInterface.
3291         https://bugs.webkit.org/show_bug.cgi?id=113300
3292
3293         The WebCoreSystemInterface is necessary to detect supported
3294         mime types on Mac OS. In particular it is needed for download
3295         support.
3296         This patch fixes in particular the previously failing
3297         Qt API qmltest WebViewDownload::test_downloadRequest.
3298         The test was crashing when using QTKit, because functions
3299         in WebCoreSystemInterface could not be resolved on the UIProcess side.
3300
3301         Reviewed by Jocelyn Turcotte.
3302
3303         * UIProcess/qt/WebContextQt.cpp:
3304         (WebKit::WebContext::platformInitializeWebProcess):
3305
3306 2013-03-25  Kent Tamura  <tkent@chromium.org>
3307
3308         Rename ENABLE_INPUT_TYPE_DATETIME
3309         https://bugs.webkit.org/show_bug.cgi?id=113254
3310
3311         Reviewed by Kentaro Hara.
3312
3313         Rename ENABLE_INPUT_TYPE_DATETIME to ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE.
3314         Actually I'd like to remove the code, but we shouldn't remove it yet
3315         because we shipped products with it on some platforms.
3316
3317         * Configurations/FeatureDefines.xcconfig:
3318
3319 2013-03-25  Dean Jackson  <dino@apple.com>
3320
3321         Cleanup plugin snapshotting autostart decision making
3322         https://bugs.webkit.org/show_bug.cgi?id=113231
3323
3324         Reviewed by Tim Horton.
3325
3326         Two major changes to the way snapshotting plugins may autostart.
3327
3328         The first is that previously WebCore was keeping a hash that
3329         represented the combination of page origin, plugin origin and
3330         mime type. WebKit was responsible for deciding if that particular
3331         hash should autostart. Now, WebKit keeps the hash, and WebCore
3332         just asks us whether the combination of origins and mimetype
3333         should start immediately. You can see this change the in WebPluginClient
3334         and WebProcess APIs.
3335
3336         The second change is that we now keep two types of structures
3337         around to decide whether a plugin should autostart. One is the
3338         existing page + plugin origin combination. The other is simply
3339         the plugin origin, which allows plugins from major providers
3340         to autostart no matter what page they were embedded on.
3341
3342         * Shared/WebProcessCreationParameters.cpp:
3343         (WebKit::WebProcessCreationParameters::encode): Encode the new parameter.
3344         (WebKit::WebProcessCreationParameters::decode): Decode the new parameter.
3345         * Shared/WebProcessCreationParameters.h: Also keep a list of strings around.
3346
3347         * UIProcess/API/C/WKContext.cpp:
3348         (WKContextSetPlugInAutoStartOrigins): The C API to send the list of plugin
3349             origins over to the context.
3350         * UIProcess/API/C/WKContext.h:
3351
3352         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
3353         (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash): Renamed from addAutoStartOrigin.
3354             No functional change other than new names for members.
3355         (WebKit::PlugInAutoStartProvider::autoStartOriginHashesCopy): Ditto.
3356         (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy): Ditto.
3357         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTable): Ditto.
3358         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsArray): New method that converts the
3359             incoming ImmutableArray into a Vector of Strings.
3360         (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction): Rename for new members.
3361         * UIProcess/Plugins/PlugInAutoStartProvider.h: Renaming member variables. Adding
3362             some typedefs to clean up code.
3363         (WebKit::PlugInAutoStartProvider::autoStartOrigins): New accessor.
3364
3365         * UIProcess/WebContext.cpp:
3366         (WebKit::WebContext::createNewWebProcess): Renaming, and copy the new parameter into the process creation.
3367         (WebKit::WebContext::addPlugInAutoStartOriginHash): Renaming.
3368         (WebKit::WebContext::setPlugInAutoStartOriginHashes): Renaming.
3369         (WebKit::WebContext::setPlugInAutoStartOrigins): New method.
3370         * UIProcess/WebContext.h: Adds the new setPlugInAutoStartOrigin method.
3371
3372         * WebProcess/Plugins/PluginView.cpp:
3373         (WebKit::PluginView::didInitializePlugin): Drive-by fix that was attempting to restart plugins
3374             that were in the process of restarting.
3375         (WebKit::PluginView::pluginDidReceiveUserInteraction): Temporarily suspend update of
3376             expiration time if the user interacts with a plugin.
3377
3378         * WebProcess/WebCoreSupport/WebPlugInClient.cpp:
3379         (WebKit::WebPlugInClient::shouldAutoStartFromOrigin): Renaming.
3380         (WebKit::WebPlugInClient::didStartFromOrigin): Ditto.
3381         * WebProcess/WebCoreSupport/WebPlugInClient.h: Renaming.
3382
3383         * WebProcess/WebProcess.cpp: Drive-by - noticed that we forgot to count seconds in
3384             a timeout threshold.
3385         (WebKit::WebProcess::initializeWebProcess): Also add the list of origins when we initialize.
3386         (WebKit::addCaseFoldedCharacters): Copied from WebCore - adds a String to a hash input.
3387         (WebKit::hashForPlugInOrigin): Copied from WebCore - hashing function.
3388         (WebKit::WebProcess::isPlugInAutoStartOriginHash): Renaming.
3389         (WebKit::WebProcess::shouldPlugInAutoStartFromOrigin): Check the list of pure origins first. If
3390             that fails, fall back to the hash list of pairs.
3391         (WebKit::WebProcess::plugInDidStartFromOrigin): Renaming.
3392         (WebKit::WebProcess::didAddPlugInAutoStartOriginHash): Ditto.
3393         (WebKit::WebProcess::resetPlugInAutoStartOriginHashes): Ditto.
3394         (WebKit::WebProcess::plugInDidReceiveUserInteraction): Ditto.
3395         * WebProcess/WebProcess.h: Renaming some methods, but also adding the input of the new
3396             origin-only list.
3397
3398         * WebProcess/WebProcess.messages.in: Renaming a message.
3399
3400 2013-03-25  Maxim Ermilov  <maxim.ermilov@canonical.com>
3401
3402         [Qt] Qml WebKit needs preferences to change security knobs
3403         https://bugs.webkit.org/show_bug.cgi?id=111979
3404
3405         Reviewed by Jocelyn Turcotte.
3406
3407         * UIProcess/API/qt/qwebpreferences.cpp:
3408         (QWebPreferencesPrivate::testAttribute):
3409         (QWebPreferencesPrivate::setAttribute):
3410         (QWebPreferences::universalAccessFromFileURLsAllowed):
3411         (QWebPreferences::setUniversalAccessFromFileURLsAllowed):
3412         (QWebPreferences::fileAccessFromFileURLsAllowed):
3413         (QWebPreferences::setFileAccessFromFileURLsAllowed):
3414         * UIProcess/API/qt/qwebpreferences_p.h:
3415         * UIProcess/API/qt/qwebpreferences_p_p.h:
3416
3417 2013-03-23  Geoffrey Garen  <ggaren@apple.com>
3418
3419         Added a setting for whether JavaScript markup is enabled
3420         https://bugs.webkit.org/show_bug.cgi?id=112999
3421
3422         Rolled out a line from r146664 that was left over from before I adopted
3423         the Settings.in way of adding a new setting.
3424
3425         Reviewed by Ryosuke Niwa.
3426
3427         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3428         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): No need
3429         to initialize / override -- Settings.in settings do this automatically.
3430
3431         Also, dydx noticed that this line of code had a typo, and was totaly wrong.
3432
3433 2013-03-21  Kiran Muppala  <cmuppala@apple.com>
3434
3435         Add runtime setting for hidden page DOM timer throttling and CSS animation suspension
3436         https://bugs.webkit.org/show_bug.cgi?id=112308
3437
3438         Reviewed by Gavin Barraclough.
3439
3440         Add private preference for enabling/disabling hidden page DOM timer
3441         throttling and CSS animation suspension.  The preference should be
3442         enabled by default only on Mac, where WebKit2 is a private API and
3443         hence compatibility is less of a issue.
3444
3445         * Shared/WebPreferencesStore.h:
3446         * UIProcess/API/C/WKPreferences.cpp:
3447         (WKPreferencesSetHiddenPageDOMTimerThrottlingEnabled):
3448         (WKPreferencesGetHiddenPageDOMTimerThrottlingEnabled):
3449         (WKPreferencesSetHiddenPageCSSAnimationSuspensionEnabled):
3450         (WKPreferencesGetHiddenPageCSSAnimationSuspensionEnabled):
3451         * UIProcess/API/C/WKPreferencesPrivate.h:
3452         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3453         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Allow
3454         WebKitTestRunner to override hiddenPageDOMTimerThrottlingEnabled.
3455         * WebProcess/WebPage/WebPage.cpp:
3456         (WebKit::WebPage::updatePreferences):
3457
3458 2013-03-22  Tim Horton  <timothy_horton@apple.com>
3459
3460         Plugin Snapshotting: Auto-start dominant plugins
3461         https://bugs.webkit.org/show_bug.cgi?id=113111
3462         <rdar://problem/13475726>
3463
3464         Reviewed by Dean Jackson.
3465
3466         * WebProcess/Plugins/PluginView.cpp:
3467         (WebKit::PluginView::didInitializePlugin):
3468         (WebKit::PluginView::paint):
3469         (WebKit::PluginView::invalidateRect):
3470         (WebKit::PluginView::isAcceleratedCompositingEnabled):
3471         Acknowledge the new "Restarting" DisplayState.
3472
3473 2013-03-21  Jer Noble  <jer.noble@apple.com>
3474
3475         After switching to another space and back, video races to catch up with audio
3476         https://bugs.webkit.org/show_bug.cgi?id=113006
3477
3478         Reviewed by Anders Carlsson.
3479
3480         Add an observer for the NSWorkspaceActiveSpaceDidChangeNotification notification, and trigger
3481         a visibility update when that notification is observed.
3482
3483         * UIProcess/API/mac/WKView.mm:
3484         (-[WKView dealloc]): Unregister the observer.
3485         (-[WKView _activeSpaceDidChange:]): Notify the view that its visibility may have changed.
3486         (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]): Add the observer.