3398bf9acfe765cb25227db0a84e7267923bae77
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2011-04-06  Siddharth Mathur  <siddharth.mathur@nokia.com>
2
3         Reviewed by Benjamin Poulain.
4
5         [Qt][WK2][Symbian] Remove use of stack arrays with variable size
6         https://bugs.webkit.org/show_bug.cgi?id=57877
7         
8         For better compiler portability, use new/delete for arrays when size
9         isn't known at compile time. Also fix one compiler warning about bitshift
10         operations on signed integers. 
11         * Platform/CoreIPC/qt/ConnectionQt.cpp: 
12         (CoreIPC::Connection::readyReadHandler): 
13         (CoreIPC::Connection::sendOutgoingMessage):
14
15 2011-04-06  Brian Weinstein  <bweinstein@apple.com>
16
17         Reviewed by Adam Roben.
18
19         WebKit2: Support Windows 7 Gestures
20         https://bugs.webkit.org/show_bug.cgi?id=49824
21         <rdar://problem/8689728>
22         
23         Port code from WebKit1 -> WebKit2 to handle Windows 7 gestures.
24         
25         The UIProcess gets a WM_GESTURENOTIFY message, it sends a sync message to the WebProcess to ask
26         if we should allow panning. The WebProcess checks if we're in a scrollable area, and the mouse
27         isn't over a scrollbar.
28
29         The UIProcess then gets a WM_GESTURE message, and if it is a pan gesture, it sends a message to
30         the WebProcess to scroll by the amount fingers have moved since the last WM_GESTURE messeage. The
31         X and Y are reversed because panning up -> moving the page down, and vice versa.
32
33         * UIProcess/WebPageProxy.cpp:
34         (WebKit::WebPageProxy::gestureWillBegin): Send a sync message to the WebProcess
35             to initialize the gesture. The WebProcess returns whether or not we can start a pan
36             gesture from where we are.
37         (WebKit::WebPageProxy::gestureDidScroll): Send a message to the WebProcess to scroll by
38             pan gesture.
39         (WebKit::WebPageProxy::gestureDidEnd): Send a message to the WebProcess that the gesture has ended.
40         * UIProcess/WebPageProxy.h:
41         * UIProcess/win/WebView.cpp:
42         (WebKit::WebView::wndProc): Add WM_GESTURE and WM_GESTURENOTIFY handlers.
43         (WebKit::WebView::WebView): Initialize two new variables.
44         (WebKit::WebView::onGestureNotify): Figure out which gestures we should support based on where
45             the gesture is beginning.
46         (WebKit::WebView::onGesture): Support starting a gesture, ending a gesture, and panning.
47         * UIProcess/win/WebView.h:
48         * WebProcess/WebPage/WebPage.h:
49         * WebProcess/WebPage/WebPage.messages.in: Add messages needed for gestures.
50         * WebProcess/WebPage/win/WebPageWin.cpp:
51         (WebKit::WebPage::gestureWillBegin): Set the node that the gesture started on (so we 
52             know which layer to scroll if the user pans), and determine whether or not we should allow
53             panning. If the page can't scroll, or the user is on a scrollbar, disallow panning.
54         (WebKit::WebPage::gestureDidScroll): Scroll the enclosing layer of the element the gesture
55             started on.
56         (WebKit::WebPage::gestureDidEnd): Clear the node the gesture started on.
57
58 2011-04-06  Jeff Miller  <jeffm@apple.com>
59
60         Reviewed by Adam Roben.
61
62         Add WKStringGetCharactersPtr() and WKStringGetLength() to WebKit2 C API
63         https://bugs.webkit.org/show_bug.cgi?id=57989
64         
65         Note that WKChar, which is returned by WKStringGetCharactersPtr(), is defined the same way we define JSChar in JSStringRef.h.
66
67         * Shared/API/c/WKString.cpp:
68         (WKStringGetLength): Added.
69         (WKStringGetCharactersPtr): Added.
70         * Shared/API/c/WKString.h: Define WKChar and added WKStringGetLength() and WKStringGetCharactersPtr().
71         * Shared/WebString.h:
72         (WebKit::WebString::length): Added.
73         (WebKit::WebString::characters): Added.
74
75 2011-04-06  Anders Carlsson  <andersca@apple.com>
76
77         Reviewed by Oliver Hunt.
78
79         Dock stays in front of Hulu.com full screen video output
80         https://bugs.webkit.org/show_bug.cgi?id=57988
81         <rdar://problem/9216260>
82
83         Instead of using -[NSMenu setMenuBarVisible:] to toggle full screen, use
84         -[NSApp setPresentationOptions:]. Also, make the UI process the front most app before
85         setting the presentation options when exiting full screen, otherwise the dock won't
86         be restored correctly.
87
88         * PluginProcess/mac/PluginProcessShim.mm:
89         Remove some shim functions that aren't needed.
90
91         * UIProcess/Plugins/PluginProcessProxy.cpp:
92         (WebKit::PluginProcessProxy::PluginProcessProxy):
93         Initialize m_preFullscreenAppPresentationOptions.
94
95         * UIProcess/Plugins/PluginProcessProxy.h:
96         Add m_preFullscreenAppPresentationOptions.
97
98         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
99         (WebKit::PluginProcessProxy::enterFullscreen):
100         Change the presentation options for the app.
101
102         (WebKit::PluginProcessProxy::exitFullscreen):
103         Restore the presentation options.
104
105 2011-04-06  Mark Rowe  <mrowe@apple.com>
106
107         Reviewed by Darin Adler.
108
109         Expose the original URL of a WKBackForwardListItem.
110
111         Needed for <rdar://problem/9074651>.
112
113         * UIProcess/API/C/WKBackForwardListItem.cpp:
114         (WKBackForwardListItemCopyOriginalURL):
115         * UIProcess/API/C/WKBackForwardListItem.h:
116
117 2011-04-06  Brady Eidson  <beidson@apple.com>
118
119         Reviewed by Anders Carlsson.
120
121         https://bugs.webkit.org/show_bug.cgi?id=57973 and https://bugs.webkit.org/show_bug.cgi?id=57973
122         WK2 icon database should be able to get a CGImage of a specific size
123
124         * UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
125         (WKIconDatabaseTryGetCGImageForURL): Change this API to take a requested size, and find the first matching
126           CGImage in the icon.
127         * UIProcess/API/C/cg/WKIconDatabaseCG.h:
128
129 2011-04-06  Jessie Berlin  <jberlin@apple.com>
130
131         Reviewed by Anders Carlsson.
132
133         WebKit2: Implement TextChecker on Windows
134         https://bugs.webkit.org/show_bug.cgi?id=57862
135
136         Part 2: Implement uniqueSpellDocumentTag and closeSpellDocumentWithTag.
137
138         * UIProcess/API/C/win/WKTextChecker.h:
139         * UIProcess/win/TextCheckerWin.cpp:
140         (WebKit::TextChecker::uniqueSpellDocumentTag):
141         (WebKit::TextChecker::closeSpellDocumentWithTag):
142         * UIProcess/win/WebTextCheckerClient.cpp:
143         (WebKit::WebTextCheckerClient::uniqueSpellDocumentTag):
144         (WebKit::WebTextCheckerClient::closeSpellDocumentWithTag):
145         * UIProcess/win/WebTextCheckerClient.h:
146
147 2011-04-06  Robert Sesek  <rsesek@chromium.org>
148
149         Reviewed by Alexey Proskuryakov.
150
151         Move code duplicated between the WebKit/mac and WebKit2 down to WebCore because Chromium will need it too
152         https://bugs.webkit.org/show_bug.cgi?id=54969
153
154         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
155         (WebKit::WebEditorClient::respondToChangedSelection): Moved duplicated code to WebCore
156         * WebProcess/WebPage/mac/WebPageMac.mm: Moved duplicated code to WebCore
157         (WebKit::WebPage::getMarkedRange):
158         (WebKit::WebPage::getSelectedRange):
159         (WebKit::WebPage::characterIndexForPoint):
160         (WebKit::WebPage::performDictionaryLookupAtLocation):
161
162 2011-04-06  Chang Shu  <cshu@webkit.org>
163
164         Reviewed by Darin Adler.
165
166         WebKitTestRunner needs layoutTestController.pageNumberForElementById
167         https://bugs.webkit.org/show_bug.cgi?id=42329
168
169         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
170         (WKBundlePageNumberForElementById):
171         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
172         * WebProcess/InjectedBundle/InjectedBundle.cpp:
173         (WebKit::InjectedBundle::pageNumberForElementById):
174         * WebProcess/InjectedBundle/InjectedBundle.h:
175
176 2011-04-05  Enrica Casucci  <enrica@apple.com>
177
178         Reviewed by Darin Adler.
179
180         REGRESSION: Drag & Drop Gmail Attachments doesn't work.
181         https://bugs.webkit.org/show_bug.cgi?id=57909
182         <rdar://problem/9103220>
183
184         Added _hitTest method to support drag and drop when the drag types cannot be matched.
185         This is the case for elements that do not place content
186         in the drag pasteboard automatically when the drag start (i.e. dragging a DIV element).
187                
188         * UIProcess/API/mac/WKView.mm:
189         (-[WKView _hitTest:dragTypes:]): Added.
190
191 2011-04-06  Csaba Osztrogonác  <ossy@webkit.org>
192
193         Reviewed by Darin Adler.
194
195         Fix using UNUSED_PARAM introduced in r82907
196         https://bugs.webkit.org/show_bug.cgi?id=57940
197
198         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
199         (WebKit::WebResourceCacheManager::clearCacheForOrigin):
200
201 2011-04-06  Jessie Berlin  <jberlin@apple.com>
202
203         Reviewed by Anders Carlsson.
204
205         WebKit2: Implement TextChecker on Windows
206         https://bugs.webkit.org/show_bug.cgi?id=57862
207
208         Part 1: Get and set the state.
209
210         * Shared/API/c/win/WKBaseWin.h:
211         * Shared/APIObject.h:
212         * UIProcess/API/C/win/WKAPICastWin.h:
213  
214         * UIProcess/API/C/win/WKTextChecker.cpp: Added.
215         (WKTextCheckerSetClient):
216         (WKTextCheckerContinuousSpellCheckingEnabledStateChanged):
217         (WKTextCheckerGrammarCheckingEnabledStateChanged):
218         * UIProcess/API/C/win/WKTextChecker.h: Added.
219  
220         * UIProcess/TextChecker.h:
221         * UIProcess/win/TextCheckerWin.cpp:
222         (WebKit::TextChecker::state):
223         Do the initalization for the state only once so that it is not necessary to call the client
224         every time the state is requested.
225         (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
226         Call the client.
227         (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
228         Update the state and tell the client.
229         (WebKit::TextChecker::setGrammarCheckingEnabled):
230         Ditto.
231         (WebKit::TextChecker::continuousSpellCheckingEnabledStateChanged):
232         Update the state.
233         (WebKit::TextChecker::grammarCheckingEnabledStateChanged):
234         Update the state.
235
236         * UIProcess/win/WebTextChecker.cpp: Added.
237         (WebKit::WebTextChecker::shared):
238         Make the WebTextChecker available globally.
239         (WebKit::WebTextChecker::WebTextChecker):
240         (WebKit::WebTextChecker::setClient):
241         (WebKit::updateStateForAllWebProcesses):
242         (WebKit::WebTextChecker::continuousSpellCheckingEnabledStateChanged):
243         Tell the TextChecker that the state has changed, and then tell the
244         WebProcessProxies to send the new state to the WebProcesses.
245         (WebKit::WebTextChecker::grammarCheckingEnabledStateChanged):
246         Ditto.
247         * UIProcess/win/WebTextChecker.h: Added.
248         (WebKit::WebTextChecker::client):
249         (WebKit::WebTextChecker::type):
250
251         * UIProcess/win/WebTextCheckerClient.cpp: Added.
252         (WebKit::WebTextCheckerClient::continuousSpellCheckingAllowed):
253         (WebKit::WebTextCheckerClient::continuousSpellCheckingEnabled):
254         (WebKit::WebTextCheckerClient::setContinuousSpellCheckingEnabled):
255         (WebKit::WebTextCheckerClient::grammarCheckingEnabled):
256         (WebKit::WebTextCheckerClient::setGrammarCheckingEnabled):
257         * UIProcess/win/WebTextCheckerClient.h: Added.
258  
259         * win/WebKit2.vcproj:
260         Add WKTextChecker.h/.cpp, WebTextChecker.h/.cpp, and WebTextCheckerClient.h/.cpp.
261         * win/WebKit2Generated.make:
262         Copy over WKTextChecker.h.
263
264 2011-04-05  Chang Shu  <cshu@webkit.org>
265
266         Reviewed by Darin Adler.
267
268         WebKitTestRunner needs layoutTestController.numberOfPages
269         https://bugs.webkit.org/show_bug.cgi?id=42694
270
271         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
272         (WKBundleNumberOfPages):
273         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
274         * WebProcess/InjectedBundle/InjectedBundle.cpp:
275         (WebKit::InjectedBundle::numberOfPages):
276         * WebProcess/InjectedBundle/InjectedBundle.h:
277
278 2011-04-05  Darin Adler  <darin@apple.com>
279
280         Reviewed by Alexey Proskuryakov.
281
282         [Mac] WebKit2: Escape key does not stop page loads when focus is on the web page
283         https://bugs.webkit.org/show_bug.cgi?id=57893
284         <rdar://problem/9130486>
285
286         * UIProcess/API/mac/PageClientImpl.h: Added executeSavedCommandBySelector.
287         * UIProcess/API/mac/PageClientImpl.mm: Renamed internal Objective-C classes to use
288         the WebKit2 Objective-C class prefix, WK, rather than the WebKit1 Objective-C class
289         prefix, Web. Removed some unneeded explicit WebKit namespace prefixes.
290         (-[WKEditCommandObjC initWithWebEditCommandProxy:]): Removed unneeded WebKit
291         namespace prefix.
292         (-[WKEditCommandObjC command]): Ditto.
293         (-[WKEditorUndoTargetObjC undoEditing:]): Updated for new class name.
294         (-[WKEditorUndoTargetObjC redoEditing:]): Ditto.
295         (WebKit::PageClientImpl::PageClientImpl): Ditto.
296         (WebKit::PageClientImpl::registerEditCommand): Ditto.
297         (WebKit::PageClientImpl::executeSavedCommandBySelector): Added.
298
299         * UIProcess/API/mac/WKView.mm: Renamed internal Objective-C categories to use the
300         WebKit2 Objective-C prefix, WK, rather than the WebKit1 Objective-C prefix, Web,
301         or no prefix at all. Tweaked use of extern "C" a little.
302         (-[WKView doCommandBySelector:]): Tweaked the comment.
303         (-[WKView _executeSavedCommandBySelector:]): Added. For use when command is not handled
304         by WebCore.
305         (-[WKResponderChainSink initWithResponderChain:]): Added. Based on the
306         WebResponderChainSink class in WebKit1.
307         (-[WKResponderChainSink detach]): Added.
308         (-[WKResponderChainSink didReceiveUnhandledCommand]): Added.
309         (-[WKResponderChainSink noResponderFor:]): Added.
310         (-[WKResponderChainSink doCommandBySelector:]): Added.
311         (-[WKResponderChainSink tryToPerform:with:]): Added.
312
313         * UIProcess/API/mac/WKViewInternal.h: Added declaration of _executeSavedCommandBySelector:
314         method. Also removed unneeded includes.
315
316         * UIProcess/PageClient.h: Added executeSavedCommandBySelector.
317         * UIProcess/WebPageProxy.h: Added executeSavedCommandBySelector.
318         * UIProcess/WebPageProxy.messages.in: Added ExecuteSavedCommandBySelector.
319
320         * UIProcess/mac/WebFullScreenManagerProxyMac.mm: Updated includes.
321
322         * UIProcess/mac/WebPageProxyMac.mm:
323         (WebKit::WebPageProxy::executeSavedCommandBySelector): Added.
324
325         * WebProcess/WebPage/mac/WebPageMac.mm:
326         (WebKit::WebPage::executeKeypressCommandsInternal): Send the synchronous
327         ExecuteSavedCommandBySelector message when a command is not handled by WebCore.
328
329 2011-04-05  Anders Carlsson  <andersca@apple.com>
330
331         Reviewed by Alexey Proskuryakov.
332
333         Some plug-in content is displayed upside down in Unity plug-in
334         https://bugs.webkit.org/show_bug.cgi?id=57895
335         <rdar://problem/9212003>
336
337         Create the flipped geometry layer in the web process instead of the plug-in process,
338         which matches what we do in WebKit1.
339
340         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
341         (WebKit::NetscapePlugin::platformPostInitialize):
342         * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
343         (WebKit::PluginProxy::pluginLayer):
344
345 2011-04-05  Anders Carlsson  <andersca@apple.com>
346
347         Reviewed by Darin Adler.
348
349         Assertion failure when navigating quickly between file URLs
350         https://bugs.webkit.org/show_bug.cgi?id=57884
351         <rdar://problem/9080559>
352
353         Remove bogus assertion. The pending provisional sandbox extension can be
354         non-null if the current provisional load fails because we're about to load a new
355         page that also has a sandbox extension.
356
357         * WebProcess/WebPage/WebPage.cpp:
358         (WebKit::WebPage::SandboxExtensionTracker::didFailProvisionalLoad):
359
360 2011-04-05  Anders Carlsson  <andersca@apple.com>
361
362         Reviewed by Adam Roben.
363
364         Grant the web process access to ~/Library/Preferences/com.apple.universalaccess.plist
365         https://bugs.webkit.org/show_bug.cgi?id=57879
366
367         The web process needs access to the unviersal access preferences to determine if full keyboard
368         access is enabled. I've filed <rdar://problem/9237619> which tracks reading this preference in the UI
369         process and sending it over to the web process whenever it changes.
370
371         * WebProcess/com.apple.WebProcess.sb:
372
373 2011-04-05  Dean Jackson  <dino@apple.com>
374
375         Reviewed by Simon Fraser.
376
377         Add parentheses around && within || to avoid clang warning.
378
379         * WebProcess/WebPage/DrawingAreaImpl.cpp:
380         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
381
382 2011-04-05  Anders Carlsson  <andersca@apple.com>
383
384         Reviewed by Adam Roben.
385
386         Add two more entries to the sandbox profile
387         https://bugs.webkit.org/show_bug.cgi?id=57875
388
389         Allow read-access to /Library/Dictionaries since WebCore::nextBreakablePosition
390         ends up calling into ICU which accesses the dictionary.
391
392         Allow Mach access to com.apple.networkd since it's used by CFNetwork.
393
394         * WebProcess/com.apple.WebProcess.sb:
395
396 2011-04-05  Anders Carlsson  <andersca@apple.com>
397
398         Reviewed by Oliver Hunt.
399
400         Invalidate callbacks if the WebPageProxy is no longer valid
401         https://bugs.webkit.org/show_bug.cgi?id=57873
402         <rdar://problem/9059717>
403
404         Audit all function calls that take callbacks and make sure to invalidate the callbacks
405         if the web page is no longer valid.
406
407         * UIProcess/WebPageProxy.cpp:
408         (WebKit::WebPageProxy::runJavaScriptInMainFrame):
409         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
410         (WebKit::WebPageProxy::getSourceForFrame):
411         (WebKit::WebPageProxy::getContentsAsString):
412         (WebKit::WebPageProxy::getSelectionOrContentsAsString):
413         (WebKit::WebPageProxy::getMainResourceDataOfFrame):
414         (WebKit::WebPageProxy::getResourceDataFromFrame):
415         (WebKit::WebPageProxy::getWebArchiveOfFrame):
416         (WebKit::WebPageProxy::forceRepaint):
417         (WebKit::WebPageProxy::computePagesForPrinting):
418         (WebKit::WebPageProxy::drawRectToPDF):
419         (WebKit::WebPageProxy::drawPagesToPDF):
420
421 2011-04-05  Adam Roben  <aroben@apple.com>
422
423         Disable accelerated compositing on Windows machines that don't support it
424
425         This includes machines without the necessary graphics hardware, and machines without
426         WebKitQuartzCoreAdditions (like the Windows 7 Release (WebKit2 Tests) bots).
427
428         Fixes <http://webkit.org/b/57870> REGRESSION (r82960): Lots of tests crashing in
429         DrawingAreaImpl::enterAcceleratedCompositingMode on Windows 7 Release (WebKit2 Tests)
430
431         Reviewed by Anders Carlsson.
432
433         * WebProcess/WebPage/LayerTreeHost.h:
434         (WebKit::LayerTreeHost::supportsAcceleratedCompositing): Added. On platforms other than
435         Windows, this always returns true.
436
437         * WebProcess/WebPage/WebPage.cpp:
438         (WebKit::WebPage::updatePreferences): Only enable accelerated compositing-related
439         preferences if the machine supports accelerated compositing.
440
441         * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp:
442         (WebKit::LayerTreeHostCAWin::supportsAcceleratedCompositing): Added. Creates a view, asks it
443         if it can draw, and returns the result.
444
445         * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h: Added supportsAcceleratedCompositing.
446
447         * WebProcess/WebPage/win/LayerTreeHostWin.cpp: Added.
448         (WebKit::LayerTreeHost::supportsAcceleratedCompositing): Added. Calls through to
449         LayerTreeHostCAWin in configurations that support that class. Otherwise just returns false.
450
451         * win/WebKit2.vcproj: Added LayerTreeHostWin.cpp. Let VS reorder some other files.
452
453 2011-04-05  Adam Roben  <aroben@apple.com>
454
455         Make accelerated compositing work in WebKit2 on Windows
456
457         LayerTreeHostCAWin uses WKCACFView to render each frame to an image, then has
458         DrawingAreaImpl send that image over to the UI process (just like it does for
459         non-accelerated rendering). It's unfortunate that this requires reading every frame back
460         from the GPU into system memory. More efficient solutions can be explored in the future.
461
462         Fixes <http://webkit.org/b/45567>.
463
464         Reviewed by Anders Carlsson.
465
466         * DerivedSources.make: Added $(WebKit2) to the VPATH so that DerivedSources.make can be
467         found when used as a target dependency. Added rules to generate a HeaderDetection.h file on
468         Windows. If we can find WebKitQuartzCoreAdditions headers, we define HAVE_WKQCA in
469         HeaderDetection.h.
470
471         * WebProcess/WebPage/DrawingAreaImpl.cpp:
472         (WebKit::DrawingAreaImpl::setLayerHostNeedsDisplay):
473         * WebProcess/WebPage/DrawingAreaImpl.h:
474         Added setLayerHostNeedsDisplay. Lets the layer host tell the DrawingAreaImpl that it has a
475         new frame to render. This should only be called by layer hosts that participate in
476         DrawingAreaImpl's display mechanism.
477
478         * WebProcess/WebPage/LayerTreeHost.cpp:
479         (WebKit::LayerTreeHost::create): Only try to instantiate LayerTreeHostCAWin if we have
480         WebKitQuartzCoreAdditions, since it depends on that library.
481
482         * WebProcess/WebPage/WebPage.cpp:
483         (WebKit::WebPage::updatePreferences): Removed code that forced accelerated compositing to be
484         disabled on Windows.
485
486         * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp:
487         (WebKit::registerDummyWindowClass): Registers the window class we use for the dummy window.
488         (WebKit::createDummyWindow): Creates the dummy window we pass to WKCACFView so that D3D can
489         determine the display mode, etc. (The window is never shown on screen.)
490         (WebKit::LayerTreeHostCAWin::LayerTreeHostCAWin): Initialize new members.
491         (WebKit::LayerTreeHostCAWin::platformInitialize): Create our dummy window and view and
492         associate the two. We set ourselves as the view's context's user data so that
493         PlatformCALayer can get our AbstractCACFLayerTreeHost pointer as needed.
494         (WebKit::LayerTreeHostCAWin::invalidate): Cancel any pending flushes, tear down our view,
495         and destroy the dummy window if no other layer host is using it.
496         (WebKit::LayerTreeHostCAWin::scheduleLayerFlush): Ask LayerChangesFlusher to call us back
497         soon to perform the flush.
498         (WebKit::LayerTreeHostCAWin::participatesInDisplay): Added. Returns true, since we render
499         each frame to an image.
500         (WebKit::LayerTreeHostCAWin::needsDisplay): Added. Returns true if it's now time to
501         displayReturns true if it's now time to display.
502         (WebKit::LayerTreeHostCAWin::timeUntilNextDisplay): Added. Returns how many seconds remain
503         before we need to display again.
504         (WebKit::size): Added. Helper function to get the size of a WKCACFImage.
505         (WebKit::toShareableBitmap): Added. Helper function to convert a WKCACFImage to a
506         ShareableBitmap.
507         (WebKit::LayerTreeHostCAWin::display): Added. Renders the next frame to an image and stuffs
508         the image into the UpdateInfo struct.
509         (WebKit::LayerTreeHostCAWin::sizeDidChange): Added. Tells the view about the new size.
510         (WebKit::LayerTreeHostCAWin::forceRepaint): Added. Flushes any pending changes to the view.
511         (WebKit::LayerTreeHostCAWin::contextDidChangeCallback): Added. WKCACFView calls this
512         whenever any changes made to the view or its layer tree have been flushed. Just calls
513         through to contextDidChange.
514         (WebKit::LayerTreeHostCAWin::contextDidChange): Added. Tells layers that they've started
515         animating, and tells the DrawingAreaImpl that we need to display again.
516         (WebKit::LayerTreeHostCAWin::rootLayer): Added. Gets the root layer's PlatformCALayer.
517         (WebKit::LayerTreeHostCAWin::addPendingAnimatedLayer): Added. Stores the layer so that we
518         can tell it animations have started the next time we get a contextDidChange callback.
519         (WebKit::LayerTreeHostCAWin::layerTreeDidChange): Added. Schedules a flush, unless we're
520         already in the process of flushing. This code came from WebCore::WKCACFViewLayerTreeHost.
521         (WebKit::LayerTreeHostCAWin::flushPendingLayerChangesNow): Added. Performs the flush. This
522         code was adapted from WebCore::WKCACFViewLayerTreeHost.
523
524         * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h: Wrapped this whole header in HAVE(WKQCA),
525         since this class only works when WebKitQuartzCoreAdditions is available. Added a bunch of
526         new members.
527
528 2011-04-04  Adam Roben  <aroben@apple.com>
529
530         Add a way for LayerTreeHost to participate in DrawingAreaImpl's normal display mechanism
531
532         When LayerTreeHost participates in display, it renders each frame into a bitmap.
533         DrawingAreaImpl sends the bitmap to the UI process in an Update message, just like in
534         non-accelerated compositing mode. The UI process never knows that accelerated compositing is
535         going on. (When LayerTreeHost does not participate in display, as on Mac, it is responsible
536         for getting bits from the web process to the UI process.)
537
538         No LayerTreeHost uses this mechanism (yet). This patch should cause no change in behavior.
539
540         Fixes <http://webkit.org/b/57792> LayerTreeHost needs a way to render frames to a bitmap
541
542         Reviewed by Anders Carlsson.
543
544         * WebProcess/WebPage/DrawingAreaImpl.cpp:
545         (WebKit::DrawingAreaImpl::forceRepaint): If the layer tree host participates in display,
546         perform a display (like in the non-accelerated case).
547         (WebKit::DrawingAreaImpl::layerHostDidFlushLayers): Don't send an
548         EnterAcceleratedCompositing message to the UI process if the layer tree host participates in
549         display. In that case, the UI process doesn't even need to know we're using accelerated
550         compositing in the web process.
551         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState): Go through the normal display
552         mechanism if we have a layer tree host that participates in display.
553         (WebKit::DrawingAreaImpl::didUpdate): Don't ignore DidUpdate messages when we have a layer
554         tree host that participates in display.
555         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode): If the new layer tree host
556         participates in display, let the display timer continue to run and continue to expect
557         DidUpdate messages so that we don't interrupt the normal display mechanism. We still clear
558         out m_dirtyRegion, m_scrollRect, and m_scrollOffset, though, because the layer tree host is
559         still responsible for keeping track of those things even when it participates in display.
560         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): If the outgoing layer tree host
561         was participating in display, just send another Update message instead of an
562         ExitAcceleratedCompositing message, since the UI process never even knew we were using
563         accelerated compositing.
564         (WebKit::DrawingAreaImpl::displayTimerFired): If we have a layer tree host that's
565         participating in display, ask it when it next needs to display when scheduling our timer.
566
567         (WebKit::DrawingAreaImpl::scheduleDisplay):
568         (WebKit::DrawingAreaImpl::display):
569         If we have a layer tree host that's participating in display, it will keep track of its own
570         dirty region, so ask it if it needs display rather than checking our own dirty region.
571
572         (WebKit::DrawingAreaImpl::display): If we have a layer tree host that's participating in
573         display, don't bail out. Instead, tell it to display rather than asking the page to paint.
574         Moved the setting of updateInfo.viewSize earlier so that it will be set even when the layer
575         tree host is displaying. Other changes are just due to indentation.
576
577         * WebProcess/WebPage/LayerTreeHost.h:
578         (WebKit::LayerTreeHost::participatesInDisplay):
579         (WebKit::LayerTreeHost::needsDisplay):
580         (WebKit::LayerTreeHost::timeUntilNextDisplay):
581         (WebKit::LayerTreeHost::display):
582         Stubbed out these functions. Derived classes can override them to participate in display.
583
584 2011-04-04  MORITA Hajime  <morrita@google.com>
585
586         Reviewed by Ryosuke Niwa.
587
588         [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
589         https://bugs.webkit.org/show_bug.cgi?id=56085
590         
591         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
592         (WebKit::WebEditorClient::requestCheckingOfString):
593         * WebProcess/WebCoreSupport/WebEditorClient.h:
594         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
595         (WebKit::WebEditorClient::checkTextOfParagraph):
596
597 2011-04-05  Alejandro G. Castro  <alex@igalia.com>
598
599         Another compilation fix after r82929 horrible patch merge.
600
601         * UIProcess/WebPageProxy.messages.in:
602
603 2011-04-05  Alejandro G. Castro  <alex@igalia.com>
604
605         Fix compilation error after r82929.
606
607         * WebProcess/WebPage/WebPage.h:
608
609 2011-04-05  Amruth Raj  <amruthraj@motorola.com>, Ravi Phaneendra Kasibhatla  <ravi.kasibhatla@motorola.com> and Alejandro G. Castro  <alex@igalia.com>
610
611         Reviewed by Martin Robinson.
612
613         [GTK] Implement WebPage class for WebKit2
614         https://bugs.webkit.org/show_bug.cgi?id=54230
615
616         Added functions to handle the generation of commands from the
617         keycodes.
618
619         * GNUmakefile.am:
620         * Scripts/webkit2/messages.py:
621         * UIProcess/PageClient.h:
622         * UIProcess/WebPageProxy.h:
623         * UIProcess/WebPageProxy.messages.in:
624         * UIProcess/gtk/WebPageProxyGtk.cpp:
625         (WebKit::WebPageProxy::getEditorCommandsForKeyEvent):
626         * UIProcess/gtk/WebView.cpp:
627         (WebKit::backspaceCallback):
628         (WebKit::selectAllCallback):
629         (WebKit::cutClipboardCallback):
630         (WebKit::copyClipboardCallback):
631         (WebKit::pasteClipboardCallback):
632         (WebKit::toggleOverwriteCallback):
633         (WebKit::popupMenuCallback):
634         (WebKit::showHelpCallback):
635         (WebKit::deleteFromCursorCallback):
636         (WebKit::moveCursorCallback):
637         (WebKit::WebView::WebView):
638         (WebKit::WebView::getEditorCommandsForKeyEvent):
639         * UIProcess/gtk/WebView.h:
640         (WebKit::WebView::addPendingEditorCommand):
641         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
642         * WebProcess/WebCoreSupport/WebEditorClient.h:
643         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: Added.
644         (WebKit::WebEditorClient::getEditorCommandsForKeyEvent):
645         (WebKit::WebEditorClient::executePendingEditorCommands):
646         (WebKit::WebEditorClient::handleKeyboardEvent):
647         (WebKit::WebEditorClient::handleInputMethodKeydown):
648         * WebProcess/WebPage/WebPage.cpp:
649         * WebProcess/WebPage/WebPage.h:
650         * WebProcess/WebPage/gtk/WebPageGtk.cpp: Added.
651         (WebKit::WebPage::platformInitialize):
652         (WebKit::WebPage::platformPreferencesDidChange):
653         (WebKit::scroll):
654         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
655         (WebKit::WebPage::platformHasLocalDataForURL):
656         (WebKit::WebPage::cachedResponseMIMETypeForURL):
657         (WebKit::WebPage::platformCanHandleRequest):
658
659 2011-04-05  Csaba Osztrogonác  <ossy@webkit.org>
660
661         Remove duplicate API from WKContext
662         <rdar://problem/8727879>
663         https://bugs.webkit.org/show_bug.cgi?id=57815
664
665         Unreviewed buildfix after r82906.
666
667         Add UNUSED_PARAM to resourceCachesToClear, because
668         it is only used within #if USE(CFURLCACHE) guard.
669
670         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
671         (WebKit::WebResourceCacheManager::clearCacheForOrigin):
672
673 2011-04-04  Sam Weinig  <sam@webkit.org>
674
675         Reviewed by Brian Weinstein.
676
677         Remove duplicate API from WKContext
678         <rdar://problem/8727879>
679         https://bugs.webkit.org/show_bug.cgi?id=57815
680
681         - Remove WKContextClearResourceCaches and WKContextClearApplicationCache in favor
682           of their more modern counterparts WKResourceCacheManagerClearCacheForAllOrigins
683           and WKApplicationCacheManagerDeleteAllEntries.
684
685         - Expand clearing functionality of WKResourceCacheManager by adding type of resources
686           to clear.
687
688         * Shared/WebProcessCreationParameters.cpp:
689         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
690         (WebKit::WebProcessCreationParameters::encode):
691         (WebKit::WebProcessCreationParameters::decode):
692         * Shared/WebProcessCreationParameters.h:
693         Remove clearing bools.
694
695         * UIProcess/API/C/WKAPICast.h:
696         (WebKit::toResourceCachesToClear):
697         Update for new name of enum.
698
699         * UIProcess/API/C/WKContext.cpp:
700         * UIProcess/API/C/WKContext.h:
701         Remove WKContextClearResourceCaches and WKContextClearApplicationCache.
702
703         * UIProcess/API/C/WKResourceCacheManager.cpp:
704         (WKResourceCacheManagerClearCacheForOrigin):
705         (WKResourceCacheManagerClearCacheForAllOrigins):
706         * UIProcess/API/C/WKResourceCacheManager.h:
707         Add WKResourceCachesToClear enum and use it in the clearing functions.
708
709         * UIProcess/WebContext.cpp:
710         (WebKit::WebContext::WebContext):
711         (WebKit::WebContext::ensureWebProcess):
712         * UIProcess/WebContext.h:
713         * WebProcess/WebProcess.messages.in:
714         Remove clearing functions and setting of bools for clear on launch.
715
716         * UIProcess/WebFullScreenManagerProxy.cpp:
717         Remove unnecessary #include.
718
719         * UIProcess/WebResourceCacheManagerProxy.cpp:
720         (WebKit::WebResourceCacheManagerProxy::clearCacheForOrigin):
721         (WebKit::WebResourceCacheManagerProxy::clearCacheForAllOrigins):
722         * UIProcess/WebResourceCacheManagerProxy.h:
723         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
724         (WebKit::WebResourceCacheManager::clearCacheForOrigin):
725         (WebKit::WebResourceCacheManager::clearCacheForAllOrigins):
726         * WebProcess/ResourceCache/WebResourceCacheManager.h:
727         * WebProcess/ResourceCache/WebResourceCacheManager.messages.in:
728         Add enum parameter describing what type of caches to clear.
729
730         * WebProcess/WebProcess.cpp:
731         (WebKit::WebProcess::initializeWebProcess):
732         (WebKit::WebProcess::clearResourceCaches):
733         * WebProcess/WebProcess.h:
734         No longer need to use opaque type now that it is not a message receiver.
735
736 2011-04-04  David Kilzer  <ddkilzer@apple.com>
737
738         <http://webkit.org/b/57384> CFNetwork and WebCore load priorities should match
739
740         Reviewed by Alexey Proskuryakov.
741
742         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
743         (InitWebCoreSystemInterface): Added initialization for
744         wkSetHTTPPipeliningMaximumPriority().
745
746 2011-04-04  Anders Carlsson  <andersca@apple.com>
747
748         Reviewed by Darin Adler.
749
750         Send NPCocoaEventFlagsChanged events
751         https://bugs.webkit.org/show_bug.cgi?id=57811
752         <rdar://problem/9215600>
753
754         * Shared/WebEvent.h:
755         (WebKit::WebEvent::capsLockKey):
756         Add CapsLock modifier and getter.
757
758         * Shared/mac/WebEventFactory.mm:
759         (WebKit::modifiersForEvent):
760         Check for NSAlphaShiftKeyMask and set the CapsLockKey modifier.
761
762         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
763         (WebKit::modifierFlags):
764         Check for CapsLockKey and set NSAlphaShiftKeyMask.
765
766         (WebKit::isFlagsChangedEvent):
767         Return whether a given event is a Cocoa flags changed event.
768
769         (WebKit::initializeKeyboardEvent):
770         If this is a flags changed event, set the event type to NPCocoaEventFlagsChanged.
771
772 2011-04-04  Anders Carlsson  <andersca@apple.com>
773
774         Reviewed by Darin Adler.
775
776         Don't discard the backing stores of WKViews in the key window
777         https://bugs.webkit.org/show_bug.cgi?id=57808
778         <rdar://problem/9110793>
779         <rdar://problem/9194284>
780         <rdar://problem/9222216>
781
782         * UIProcess/DrawingAreaProxy.h:
783         (WebKit::DrawingAreaProxy::setBackingStoreIsDiscardable):
784         Add empty stub.
785
786         * UIProcess/DrawingAreaProxyImpl.cpp:
787         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
788         Initialize m_isBackingStoreDiscardable to true.
789
790         (WebKit::DrawingAreaProxyImpl::setBackingStoreIsDiscardable):
791         Set m_isBackingStoreDiscardable and schedule or stop the discard backing store timer.
792
793         (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon):
794         Don't start the timer if m_isBackingStoreDiscardable is false.
795
796         * UIProcess/DrawingAreaProxyImpl.h:
797         Add m_isBackingStoreDiscardable.
798
799         * UIProcess/WebPageProxy.cpp:
800         (WebKit::WebPageProxy::viewStateDidChange):
801         Mark the backing store as discardable if the view is hidden or if the containing window
802         is not active.
803
804 2011-04-04  Jade Han  <jade.han@nokia.com>
805
806         Reviewed by Csaba Osztrogonác.
807
808         Symbian build fix.
809         https://bugs.webkit.org/show_bug.cgi?id=54977
810
811         * config.h:
812
813 2011-04-04  Brady Eidson  <beidson@apple.com>
814
815         Rubberstamped by Adam Roben.
816
817         Add WKIconDatabase* headers to the WebKit2 export for Windows:
818         * win/WebKit2Generated.make:
819
820 2011-04-04  Anders Carlsson  <andersca@apple.com>
821
822         Reviewed by Dan Bernstein.
823
824         Get rid of WebContext::process() in more places
825         https://bugs.webkit.org/show_bug.cgi?id=57787
826
827         Migrate calls to WebContext::process() over to sendToAllProcesses and
828         sendToAllProcessesRelaunchingThemIfNecessary.
829
830         Add FIXMEs for things that need to be fixed in order to support multiple web processes.
831                 
832         * UIProcess/Downloads/DownloadProxy.cpp:
833         (WebKit::DownloadProxy::cancel):
834         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
835         (WebKit::WebPluginSiteDataManager::getSitesWithData):
836         (WebKit::WebPluginSiteDataManager::clearSiteData):
837         * UIProcess/VisitedLinkProvider.cpp:
838         (WebKit::VisitedLinkProvider::pendingVisitedLinksTimerFired):
839         * UIProcess/WebApplicationCacheManagerProxy.cpp:
840         (WebKit::WebApplicationCacheManagerProxy::getApplicationCacheOrigins):
841         (WebKit::WebApplicationCacheManagerProxy::deleteEntriesForOrigin):
842         (WebKit::WebApplicationCacheManagerProxy::deleteAllEntries):
843         * UIProcess/WebCookieManagerProxy.cpp:
844         (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
845         (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
846         * UIProcess/WebDatabaseManagerProxy.cpp:
847         (WebKit::WebDatabaseManagerProxy::getDatabasesByOrigin):
848         (WebKit::WebDatabaseManagerProxy::getDatabaseOrigins):
849         (WebKit::WebDatabaseManagerProxy::deleteDatabaseWithNameForOrigin):
850         (WebKit::WebDatabaseManagerProxy::deleteDatabasesForOrigin):
851         (WebKit::WebDatabaseManagerProxy::deleteAllDatabases):
852         (WebKit::WebDatabaseManagerProxy::setQuotaForOrigin):
853         * UIProcess/WebGeolocationManagerProxy.cpp:
854         (WebKit::WebGeolocationManagerProxy::providerDidChangePosition):
855         (WebKit::WebGeolocationManagerProxy::providerDidFailToDeterminePosition):
856         * UIProcess/WebIconDatabase.cpp:
857         (WebKit::WebIconDatabase::getLoadDecisionForIconURL):
858         (WebKit::WebIconDatabase::didFinishURLImport):
859         * UIProcess/WebKeyValueStorageManagerProxy.cpp:
860         (WebKit::WebKeyValueStorageManagerProxy::getKeyValueStorageOrigins):
861         (WebKit::WebKeyValueStorageManagerProxy::deleteEntriesForOrigin):
862         (WebKit::WebKeyValueStorageManagerProxy::deleteAllEntries):
863         * UIProcess/WebMediaCacheManagerProxy.cpp:
864         (WebKit::WebMediaCacheManagerProxy::getHostnamesWithMediaCache):
865         (WebKit::WebMediaCacheManagerProxy::clearCacheForHostname):
866         (WebKit::WebMediaCacheManagerProxy::clearCacheForAllHostnames):
867         * UIProcess/WebResourceCacheManagerProxy.cpp:
868         (WebKit::WebResourceCacheManagerProxy::getCacheOrigins):
869         (WebKit::WebResourceCacheManagerProxy::clearCacheForOrigin):
870         (WebKit::WebResourceCacheManagerProxy::clearCacheForAllOrigins):
871
872 2011-04-04  Alexey Proskuryakov  <ap@apple.com>
873
874         Reviewed by Dan Bernstein.
875
876         REGRESSION (WebKit2): Caps-Lock indicator sometimes doesn't appear in WebKit2
877         https://bugs.webkit.org/show_bug.cgi?id=51230
878         <rdar://problem/8780989>
879
880         <rdar://problem/9015250> REGRESSION (WebKit2): Key events not fired for modifier keys
881
882         * UIProcess/API/mac/WKView.mm:
883         (-[WKView flagsChanged:]): Ported from WebHTMLView.
884         (-[WKView _interpretKeyEvent:withCachedTextInputState:savingCommandsTo:WebCore::]):
885         AppKit isn't happy about attempts to interpret NSFlagsChanged, but WK2 lacked the check.
886
887 2011-04-04  Steve Falkenburg  <sfalken@apple.com>
888
889         Reviewed by Adam Roben.
890
891         Remove unused AnalyzeWithLargeStack code from Windows build files
892         https://bugs.webkit.org/show_bug.cgi?id=57771
893         
894         This was used for us to build with prefast automatically,
895         but it is out-of-date and hasn't been used for some time.
896         Removing completely for now.
897
898         * win/WebKitPreBuild.cmd:
899
900 2011-04-04  Anders Carlsson  <andersca@apple.com>
901
902         Attempt to fix the Windows build.
903
904         * UIProcess/win/WebContextWin.cpp:
905         (WebKit::WebContext::setShouldPaintNativeControls):
906
907 2011-04-04  Anders Carlsson  <andersca@apple.com>
908
909         Reviewed by Adam Roben.
910
911         Make it easier to send a message to all processes in a context
912         https://bugs.webkit.org/show_bug.cgi?id=57776
913
914         Add WebContext::sendToAllProcesses and WebContext::sendToAllProcessesRelaunchingThemIfNecessary
915         as a first step towards getting rid of WebContext::process() and getting rid of a class of crashers
916         where WebContext::process() is null.
917
918         * UIProcess/WebContext.cpp:
919         (WebKit::WebContext::initializeHistoryClient):
920         (WebKit::WebContext::languageChanged):
921         (WebKit::WebContext::setAlwaysUsesComplexTextCodePath):
922         (WebKit::WebContext::registerURLSchemeAsEmptyDocument):
923         (WebKit::WebContext::registerURLSchemeAsSecure):
924         (WebKit::WebContext::setDomainRelaxationForbiddenForURLScheme):
925         (WebKit::WebContext::setCacheModel):
926         (WebKit::WebContext::setDefaultRequestTimeoutInterval):
927         (WebKit::WebContext::clearResourceCaches):
928         (WebKit::WebContext::clearApplicationCache):
929         (WebKit::WebContext::setEnhancedAccessibility):
930         (WebKit::WebContext::startMemorySampler):
931         Use sendToAllProcesses.
932
933         (WebKit::WebContext::stopMemorySampler):
934         Use sendToAllProcesses. This is a slight policy change where we now create a sandbox extension even
935         if there's no process around. Since this is a debugging tool it seems OK to do this.
936
937         * UIProcess/WebContext.h:
938         Get rid of hasValidProcess.
939
940         (WebKit::WebContext::sendToAllProcesses):
941         If we have a process and we can send messages to it, then do so.
942
943         (WebKit::WebContext::sendToAllProcessesRelaunchingThemIfNecessary):
944         Relaunch the web process and send the message.
945
946         * UIProcess/WebCookieManagerProxy.cpp:
947         (WebKit::WebCookieManagerProxy::deleteCookiesForHostname):
948         (WebKit::WebCookieManagerProxy::deleteAllCookies):
949         (WebKit::WebCookieManagerProxy::startObservingCookieChanges):
950         (WebKit::WebCookieManagerProxy::stopObservingCookieChanges):
951         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
952         Use sendToAllProcesses and sendToAllProcessesRelaunchingThemIfNecessary.
953
954 2011-04-04  Adam Roben  <aroben@apple.com>
955
956         Move a teensy bit of non-Mac-specific code up to LayerTreeHostCA
957
958         Fixes <http://webkit.org/b/57774> LayerTreeHostCA should know how to flip the root layer
959
960         Reviewed by Anders Carlsson.
961
962         * WebProcess/WebPage/ca/LayerTreeHostCA.cpp:
963         (WebKit::LayerTreeHostCA::initialize): Cross-platformized and moved some code here...
964
965         * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm:
966         (WebKit::LayerTreeHostCAMac::platformInitialize): ...from here.
967
968 2011-04-01  Enrica Casucci  <enrica@apple.com>
969
970         Reviewed by Darin Adler.
971
972         WK2: Reproducible crash when dragging out of or over Safari window.
973         https://bugs.webkit.org/show_bug.cgi?id=57654
974         <rdar://problem/9139755>
975         
976         AppKit does not retain the owner given to the pasteboard, therefore we
977         need to give the ownership of the retained pointer to NSPasteboard.
978         Also, dragImage will release the NSFilePromiseDragSource object, therefore
979         we retain it before calling dragImage to be able to control its lifetime.
980         
981         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
982         (WebKit::WebDragClient::declareAndWriteDragImage): Passing ownership
983         of the pointer to AppKit when providing the owner pointer to the NSPasteboard
984         object.
985         * WebProcess/WebPage/mac/WebPageMac.mm:
986         (WebKit::WebPage::platformDragEnded): Retaining the NSFilePromiseDragSource
987         since dragImage will release it.
988
989 2011-03-30  Jer Noble  <jer.noble@apple.com>
990
991         Reviewed by Dan Bernstein.
992
993         WebKit2: No "open in preview" contextual menu item for PDFs
994         https://bugs.webkit.org/show_bug.cgi?id=57527
995
996         Add support for opening a PDF in the associated application from the
997         context menu.
998
999         * UIProcess/API/mac/PDFViewController.mm:
1000         (_applicationInfoForMIMEType): Added, copied from WebKit/WebPDFView.mm
1001         (-[WKPDFView _openWithFinder:]): Added.
1002         (-[WKPDFView hitTest:]): Added, copied from WebKit/WebPDFView.mm.
1003         (-[WKPDFView menuForEvent:]): Added, adapted from WebKit/WebPDFVie.mm.
1004         (-[WKPDFView validateUserInterfaceItem:]): Added.
1005
1006 2011-04-04  Chang Shu  <cshu@webkit.org>
1007
1008         Reviewed by Darin Adler.
1009
1010         WebKitTestRunner needs layoutTestController.setAllowFileAccessFromFileURLs
1011         https://bugs.webkit.org/show_bug.cgi?id=57572
1012
1013         * Shared/WebPreferencesStore.cpp:
1014         (WebKit::WebPreferencesStore::decode):
1015         (WebKit::WebPreferencesStore::overrideAllowFileAccessFromFileURLsForTestRunner):
1016         * Shared/WebPreferencesStore.h:
1017         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1018         (WKBundleSetAllowFileAccessFromFileURLs):
1019         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1020         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1021         (WebKit::InjectedBundle::setAllowFileAccessFromFileURLs):
1022         * WebProcess/InjectedBundle/InjectedBundle.h:
1023
1024 2011-04-04  Brady Eidson  <beidson@apple.com>
1025
1026         Reviewed by Darin Adler.
1027
1028         https://bugs.webkit.org/show_bug.cgi?id=57683
1029         Flesh out WK2 Icon Database API
1030
1031         For now the new API will add a client interface where the WK1 version used NSNotifications.
1032
1033         If we decide we'd like the granularity of specific callback functions later, 
1034         they can easily be added on.
1035
1036         Project file nonsense:
1037         * GNUmakefile.am:
1038         * WebKit2.pro:
1039         * WebKit2.xcodeproj/project.pbxproj:
1040         * win/WebKit2.vcproj:
1041
1042         Add a WKIconDatabaseClient and some new API:
1043         * UIProcess/API/C/WKIconDatabase.cpp:
1044         (WKIconDatabaseSetIconDatabaseClient):
1045         (WKIconDatabaseRemoveAllIcons):
1046         (WKIconDatabaseCheckIntegrityBeforeOpening):
1047         * UIProcess/API/C/WKIconDatabase.h:
1048         * UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
1049         (WKIconDatabaseTryGetCGImageForURL): Renamed to "try" for subtle clarification.
1050         * UIProcess/API/C/cg/WKIconDatabaseCG.h:
1051
1052         Implementations for the new APIs:
1053         * UIProcess/WebIconDatabase.cpp:
1054         (WebKit::WebIconDatabase::retainIconForPageURL): Remove excessive logging.
1055         (WebKit::WebIconDatabase::releaseIconForPageURL): Ditto.
1056         (WebKit::WebIconDatabase::imageForPageURL):
1057         (WebKit::WebIconDatabase::removeAllIcons):
1058         (WebKit::WebIconDatabase::checkIntegrityBeforeOpening):
1059         (WebKit::WebIconDatabase::initializeIconDatabaseClient):
1060         (WebKit::WebIconDatabase::didImportIconURLForPageURL): Dispatch a client callback,
1061           much like the WK1 API uses notifications.
1062         (WebKit::WebIconDatabase::didImportIconDataForPageURL): Ditto.
1063         (WebKit::WebIconDatabase::didChangeIconForPageURL): Ditto.
1064         (WebKit::WebIconDatabase::didRemoveAllIcons): Ditto.
1065         * UIProcess/WebIconDatabase.h:
1066         * UIProcess/WebIconDatabaseClient.cpp: Added.
1067         (WebKit::WebIconDatabaseClient::didChangeIconForPageURL):
1068         (WebKit::WebIconDatabaseClient::didRemoveAllIcons):
1069         * UIProcess/WebIconDatabaseClient.h: Added.
1070
1071 2011-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1072
1073         Reviewed by Martin Robinson.
1074
1075         [GTK] Main loop sources are leaked in RunLoopGtk
1076         https://bugs.webkit.org/show_bug.cgi?id=57618
1077
1078         * Platform/RunLoop.h:
1079         (RunLoop::TimerBase::isRepeating):
1080         * Platform/gtk/RunLoopGtk.cpp:
1081         (RunLoop::~RunLoop): Make sure main loop is currently running
1082         before calling g_main_loop_quit(), RunLoop::stop() might have been
1083         called.
1084         (RunLoop::wakeUp): Use an idle source with default priority
1085         instead of a timeout one with a 0 interval.
1086         (RunLoop::TimerBase::clearTimerSource): New method to clear the
1087         timer.
1088         (RunLoop::TimerBase::destroyNotifyCallback): Destroy notify
1089         callback called when the source is destroyed to clear the timer.
1090         (RunLoop::TimerBase::timerFiredCallback): Use the same callback for
1091         repeating and no repeating timers.
1092         (RunLoop::TimerBase::start): g_source_attach() increments the
1093         source reference counter, so use GRefPtr to make sure the source
1094         is freed.
1095         (RunLoop::TimerBase::stop): Use clearTimerSource().
1096
1097 2011-04-03  Dan Bernstein  <mitz@apple.com>
1098
1099         Build fix.
1100
1101         * Shared/DictionaryPopupInfo.cpp:
1102         (WebKit::DictionaryPopupInfo::encode):
1103         (WebKit::DictionaryPopupInfo::decode):
1104         * Shared/DictionaryPopupInfo.h:
1105
1106 2011-04-03  Dan Bernstein  <mitz@apple.com>
1107
1108         Reviewed by Maciej Stachowiak.
1109
1110         <rdar://problem/9227839> REGRESSION: Reproducible crash in Snow Leopard when trying to show the Dictionary panel or application
1111         https://bugs.webkit.org/show_bug.cgi?id=57739
1112
1113         * Shared/DictionaryPopupInfo.cpp:
1114         (WebKit::DictionaryPopupInfo::encode): Do not encode the options dictionary on Snow Leopard.
1115         (WebKit::DictionaryPopupInfo::decode): Do not decode the options dictionary on Snow Leopard.
1116         * Shared/DictionaryPopupInfo.h: Removed the options member variable on Snow Leopard.
1117         * Shared/Plugins/PluginQuirks.h:
1118         * WebProcess/WebPage/mac/WebPageMac.mm:
1119         (WebKit::WebPage::performDictionaryLookupForRange): Do not set the options member variable on
1120         Snow Leopard.
1121
1122 2011-04-02  Sam Weinig  <sam@webkit.org>
1123
1124         Reviewed by Beth Dakin.
1125
1126         https://bugs.webkit.org/show_bug.cgi?id=57605
1127         Frame::pageScaleFactor() should not affect getBoundingClientRect() or 
1128         getClientRects()
1129         -and corresponding-
1130         <rdar://problem/9194541>
1131
1132         Add DRT support for the scaleWebView SPI.
1133         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1134         (WKBundlePageSetScaleAtOrigin):
1135         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
1136
1137 2011-04-02  Sam Weinig  <sam@webkit.org>
1138
1139         Reviewed by Oliver Hunt.
1140
1141         "Search in Spotlight" broken in WebKit2
1142         https://bugs.webkit.org/show_bug.cgi?id=57712
1143
1144         Proxy spotlight searching to the UIProcess.
1145
1146         * UIProcess/WebPageProxy.messages.in:
1147         Add new message. Re-organize messages to put all mac specific ones together.
1148
1149         * UIProcess/WebPageProxy.h:
1150         * UIProcess/mac/WebPageProxyMac.mm:
1151         (WebKit::WebPageProxy::speak):
1152         (WebKit::WebPageProxy::searchWithSpotlight):
1153         Moved code to trigger spotlight here. Use WTF::String -> NSString conversion function
1154         instead of relying on the built in conversion since it doesn't always work in the UIProcess.
1155
1156         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
1157         (WebKit::WebContextMenuClient::searchWithSpotlight):
1158         Post message to the UIProcess to do the searching.
1159
1160 2011-04-02  Jeff Miller  <jeffm@apple.com>
1161
1162         Reviewed by Dan Bernstein.
1163
1164         WebKit2: Specify the certificate store in WKBundleSetClientCertificate()
1165         https://bugs.webkit.org/show_bug.cgi?id=57707
1166
1167         Include the name of the system certificate store that the client certificate came from in WKBundleSetClientCertificate().
1168
1169         The PCCERT_CONTEXT for the client certificate we create from the message from the UI process doesn't contain enough information to actually use it in a request, we need to get the real certificate from the certificate store (which is typically the "MY" store).
1170
1171         * WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.cpp:
1172         (WKBundleSetClientCertificate): Add certificateSystemStoreName to parameters.
1173         * WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.h: Add certificateSystemStoreName to WKBundleSetClientCertificate() parameters.
1174         * WebProcess/InjectedBundle/InjectedBundle.h: Add certificateSystemStoreName to setClientCertificate() parameters.
1175         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:
1176         (WebKit::InjectedBundle::setClientCertificate): Read the real certificate from the certificate store.
1177
1178 2011-04-02  Sam Weinig  <sam@webkit.org>
1179
1180         Reviewed by Dan Bernstein.
1181
1182         Implement WKBundleFrameHasHorizontalScrollbar/WKBundleFrameHasVerticalScrollbar
1183         <rdar://problem/9225772>
1184         https://bugs.webkit.org/show_bug.cgi?id=57709
1185
1186         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1187         (WKBundleFrameHasHorizontalScrollbar):
1188         (WKBundleFrameHasVerticalScrollbar):
1189         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
1190         * WebProcess/WebPage/WebFrame.cpp:
1191         (WebKit::WebFrame::hasHorizontalScrollbar):
1192         (WebKit::WebFrame::hasVerticalScrollbar):
1193         * WebProcess/WebPage/WebFrame.h:
1194
1195 2011-04-01  Jon Lee  <jonlee@apple.com>
1196
1197         Reviewed by Darin Adler.
1198
1199         WebKit2: Type-to-select doesn't work in open <select> menu (53023)
1200         https://bugs.webkit.org/show_bug.cgi?id=53023
1201         <rdar://problem/8907678>
1202
1203         * UIProcess/WebPageProxy.h:
1204         * UIProcess/WebPageProxy.messages.in: adding new setPopupMenuSelectedIndex message for windows platform
1205         * UIProcess/win/WebPageProxyWin.cpp:
1206         (WebKit::WebPageProxy::setPopupMenuSelectedIndex):
1207         * UIProcess/win/WebPopupMenuProxyWin.h: moving setFocusedIndex() into public method
1208         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
1209         (WebKit::WebPopupMenu::updateFromElement): send message back to UIProcess to update the selected element
1210
1211 2011-04-01  Alexey Proskuryakov  <ap@apple.com>
1212
1213         Reviewed by Darin Adler.
1214
1215         REGRESSION: Assertion failure when executing a complex custom key binding
1216         https://bugs.webkit.org/show_bug.cgi?id=57681
1217
1218         Also completes a fix for
1219         <rdar://problem/9063782> WebKit2: Text fields in Safari don't honor custom key bindings
1220
1221         * UIProcess/API/mac/WKView.mm: (-[WKView hasMarkedText]): There is no need to execute saved
1222         commands when they can't possibly change the result.
1223
1224 2011-04-01  Brian Weinstein  <bweinstein@apple.com>
1225
1226         Reviewed by Anders Carlsson.
1227
1228         Crash when calling WebPageProxy::setMemoryCacheClientCallsEnabled with an invalid Web Process
1229         https://bugs.webkit.org/show_bug.cgi?id=57680
1230         <rdar://problem/9202909>
1231
1232         * UIProcess/WebPageProxy.cpp:
1233         (WebKit::WebPageProxy::setMemoryCacheClientCallsEnabled): Add an isValid check before sending
1234             the message.
1235
1236 2011-03-31  Jer Noble  <jer.noble@apple.com>
1237
1238         Reviewed by Dan Bernstein.
1239
1240         WebKit2: Save as PDF in Safari provides Untitled as default file name
1241         https://bugs.webkit.org/show_bug.cgi?id=57529
1242
1243         Set the NSPrintOperation's jobTitle to the printing frame's title.
1244
1245         * UIProcess/API/mac/WKView.mm:
1246         (-[WKView printOperationWithPrintInfo:forFrame:]):
1247
1248 2011-04-01  Jer Noble  <jer.noble@apple.com>
1249
1250         Reviewed by Darin Adler.
1251
1252         WebKit2: Link from PDF opens in a new tab instead of in the same tab
1253         https://bugs.webkit.org/show_bug.cgi?id=57528
1254
1255         Notify the WebProcess that a link has been clicked so that the normal policy
1256         lookup can occur.
1257
1258         * Shared/WebEvent.cpp:
1259         (WebKit::WebEvent::WebEvent): Initialize ivars in the default constructor.
1260         * Shared/WebEvent.h: Add WebEvent::NoType to Type enum.
1261         * Shared/WebMouseEvent.cpp: 
1262         (WebKit::WebMouseEvent::WebMouseEvent): Ditto.
1263         * UIProcess/API/mac/PDFViewController.mm:
1264         (-[WKPDFView PDFViewWillClickOnLink:withURL:]): Handle the delegate
1265             function and override the PDFView default behavior.
1266         * UIProcess/WebPageProxy.cpp:
1267         (WebKit::WebPageProxy::didReceiveEvent): Handle the new WebEvent::NoType enum.
1268         (WebKit::WebPageProxy::linkClicked): Added.  Send event through to WebPage.
1269         * UIProcess/WebPageProxy.h:
1270         * WebProcess/WebPage/WebPage.cpp:
1271         (WebKit::WebPage::linkClicked): Added.  Call loadFrameRequest().
1272         * WebProcess/WebPage/WebPage.h:
1273         * WebProcess/WebPage/WebPage.messages.in: Added LinkClicked.
1274
1275 2011-04-01  Sam Weinig  <sam@webkit.org>
1276
1277         Reviewed by Adam "Keyword Slasher" Roben.
1278
1279         Remove unnecessary static keyword.
1280
1281         * UIProcess/API/cpp/WKRetainPtr.h:
1282         (WebKit::adoptWK):
1283
1284 2011-04-01  Sam Weinig  <sam@webkit.org>
1285
1286         Reviewed by Adam Roben.
1287
1288         Add adoptWK to WKRetainPtr.h
1289         https://bugs.webkit.org/show_bug.cgi?id=57670
1290
1291         * UIProcess/API/cpp/WKRetainPtr.h:
1292         (WebKit::adoptWK):
1293         Add shared implementation of adoptWK. Previously both WebKitTestRunner
1294         and TestWebKitAPI had separate versions of it.
1295
1296 2011-04-01  Anders Carlsson  <andersca@apple.com>
1297
1298         Reviewed by Sam Weinig.
1299
1300         Shockwave plug-in doesn't accept mouse events
1301         https://bugs.webkit.org/show_bug.cgi?id=57653
1302         <rdar://problem/8483273>
1303
1304         Add a missing break.
1305
1306         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1307         (WebKit::NetscapePlugin::convertPoint):
1308
1309 2011-04-01  Sam Weinig  <sam@webkit.org>
1310
1311         Reviewed by Anders Carlsson.
1312
1313         WebKitTestRunner needs layoutTestController.shadowRoot
1314         https://bugs.webkit.org/show_bug.cgi?id=57661
1315
1316         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
1317         (WKBundleNodeHandleGetRenderRect):
1318         (WKBundleNodeHandleGetElementBounds):
1319         (WKBundleNodeHandleCopyElementShadowRoot):
1320         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
1321         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1322         (WebKit::InjectedBundleNodeHandle::elementShadowRoot):
1323         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
1324         Add accessor for the shadowRoot of an element in the bundle.
1325
1326 2011-04-01  Alexey Proskuryakov  <ap@apple.com>
1327
1328         Reviewed by Darin Adler.
1329
1330         Make WebKit2 text input handling more like WebKit1
1331         https://bugs.webkit.org/show_bug.cgi?id=57649
1332
1333         We now send more sync messages from UI process to Web process for NSTextInput protocol
1334         methods. Some of the exchanges are avoided by pre-calculating the responses before asking
1335         UI process to interpret key events, and also with each sync message sent during
1336         interpretation, and which could change the state.
1337
1338         * Platform/CoreIPC/HandleMessage.h: (CoreIPC::callMemberFunction): Added a missing
1339         specialization for a function with 6 arguments and 2 returned values.
1340
1341         * Scripts/webkit2/messages.py: Added TextInputState to struct list.
1342
1343         * Shared/WebCoreArgumentCoders.h: Fixed a bug in CompositionUnderline encoding, which only
1344         encoded a part of Color field, and didn't match decoder.
1345
1346         * Shared/mac/TextInputState.h: Added. This is state that's needed for IM machinery and that
1347         we don't want to send sync messages for. This is similar to SelectionState, but the latter
1348         is only updated asynchronously, and is thus less reliable.
1349
1350         * UIProcess/API/mac/PageClientImpl.h: We don't "intercept", we "interpret".
1351
1352         * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::interpretKeyEvent): Pass
1353         current text input state, and don't expect anything input method related in return, as input
1354         methods are now sync.
1355
1356         * UIProcess/API/mac/WKView.mm:
1357         (-[WKView doCommandBySelector:]):
1358         (-[WKView insertText:]):
1359         (-[WKView keyDown:]):
1360         (-[WKView _executeSavedKeypressCommands]):
1361         (-[WKView inputContext]):
1362         (-[WKView selectedRange]):
1363         (-[WKView hasMarkedText]):
1364         (-[WKView unmarkText]):
1365         (-[WKView setMarkedText:selectedRange:]):
1366         (-[WKView markedRange]):
1367         (-[WKView attributedSubstringFromRange:]):
1368         (-[WKView characterIndexForPoint:]):
1369         (-[WKView firstRectForCharacterRange:]):
1370         (-[WKView _interpretKeyEvent:withCachedTextInputState:savingCommandsTo:WebCore::]):
1371         * UIProcess/API/mac/WKViewInternal.h:
1372         * UIProcess/PageClient.h:
1373         * UIProcess/WebPageProxy.h:
1374         * UIProcess/WebPageProxy.messages.in:
1375         * UIProcess/mac/WebPageProxyMac.mm:
1376         (WebKit::WebPageProxy::setComposition):
1377         (WebKit::WebPageProxy::confirmComposition):
1378         (WebKit::WebPageProxy::insertText):
1379         (WebKit::WebPageProxy::getSelectedRange):
1380         (WebKit::WebPageProxy::executeKeypressCommands):
1381         (WebKit::WebPageProxy::interpretQueuedKeyEvent):
1382         * WebKit2.xcodeproj/project.pbxproj:
1383         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
1384         (WebKit::WebEditorClient::handleKeyboardEvent):
1385         (WebKit::WebEditorClient::handleInputMethodKeydown):
1386         * WebProcess/WebPage/WebPage.cpp:
1387         (WebKit::WebPage::WebPage):
1388         * WebProcess/WebPage/WebPage.h:
1389         (WebKit::WebPage::viewFrameInWindowCoordinates):
1390         * WebProcess/WebPage/WebPage.messages.in:
1391         * WebProcess/WebPage/mac/WebPageMac.mm:
1392         (WebKit::createSelectorExceptionMap):
1393         (WebKit::commandNameForSelectorName):
1394         (WebKit::currentTextInputState):
1395         (WebKit::frameForEvent):
1396         (WebKit::WebPage::executeKeypressCommandsInternal):
1397         (WebKit::WebPage::handleEditingKeyboardEvent):
1398         (WebKit::WebPage::setComposition):
1399         (WebKit::WebPage::confirmComposition):
1400         (WebKit::WebPage::insertText):
1401         (WebKit::WebPage::getSelectedRange):
1402         (WebKit::convertToRange):
1403         (WebKit::WebPage::executeKeypressCommands):
1404         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
1405         Rewrote to be more like WebKit1.
1406
1407 2011-04-01  Chang Shu  <cshu@webkit.org>
1408
1409         Reviewed by Darin Adler.
1410
1411         WebKitTestRunner needs layoutTestController.setDatabaseQuota
1412         https://bugs.webkit.org/show_bug.cgi?id=57568
1413
1414         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1415         (WKBundleSetDatabaseQuota):
1416         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1417         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1418         (WebKit::InjectedBundle::setDatabaseQuota):
1419         * WebProcess/InjectedBundle/InjectedBundle.h:
1420         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
1421
1422 2011-04-01  Timothy Hatcher  <timothy@apple.com>
1423
1424         Make momentum scroll event latching work in WebKit2 on Mac.
1425
1426         <rdar://problem/8751861>
1427
1428         Reviewed by Darin Adler.
1429
1430         * Shared/mac/WebEventFactory.mm:
1431         (WebKit::momentumPhaseForEvent): Return a phase on older Mac system by using WKGetNSEventMomentumPhase.
1432         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1433         (InitWebCoreSystemInterface): Remove IsLatchingWheelEvent, add GetNSEventMomentumPhase.
1434
1435 2011-04-01  Alexey Proskuryakov  <ap@apple.com>
1436
1437         Reviewed by Anders Carlsson.
1438
1439         Assertion failure (type == event.type()) after a web process crash
1440         https://bugs.webkit.org/show_bug.cgi?id=56228
1441         <rdar://problem/8806106>
1442
1443         This partially un-confuses the UI process about key processing state after a web process
1444         crash. It may not be pefect yet - sending a KeyUp to a new process that never saw a KeyDown
1445         seems weird.
1446
1447         * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::processDidCrash):
1448
1449 2011-04-01  Adam Roben  <aroben@apple.com>
1450
1451         Cairo build fix
1452
1453         * WebProcess/WebPage/LayerTreeHost.cpp: Only pull in the LayerTreeHostCA derived classes for
1454         PLATFORM(CA) ports.
1455
1456 2011-03-31  Adam Roben  <aroben@apple.com>
1457
1458         Split LayerTreeHostCA into a base class and derived Mac and Win classes
1459
1460         This will make it easier to customize the Mac and Windows implementations without adding too
1461         many #ifdefs.
1462
1463         Fixes <http://webkit.org/b/57606> Windows and Mac should use separate LayerTreeHost classes
1464
1465         Reviewed by Anders Carlsson.
1466
1467         * WebKit2.xcodeproj/project.pbxproj: Added LayerTreeHostCAMac.h.
1468
1469         * WebProcess/WebPage/LayerTreeHost.cpp:
1470         (WebKit::LayerTreeHost::create): Create a LayerTreeHostCAMac on Mac, and LayerTreeHostCAWin
1471         on Windows.
1472
1473         * WebProcess/WebPage/ca/LayerTreeHostCA.cpp:
1474         (WebKit::LayerTreeHostCA::LayerTreeHostCA): Moved some code from here...
1475         (WebKit::LayerTreeHostCA::initialize): ...to here. This function will be called after the
1476         constructor returns, and thus can safely call functions that are pure virtual in this class
1477         and its base class. We now pass our LayerTreeContext to platformInitialize so that our
1478         derived classes can initialize it.
1479         (WebKit::LayerTreeHostCA::~LayerTreeHostCA): Removed Mac-specific code.
1480
1481         (WebKit::LayerTreeHostCA::invalidate):
1482         (WebKit::LayerTreeHostCA::sizeDidChange):
1483         (WebKit::LayerTreeHostCA::forceRepaint):
1484         (WebKit::LayerTreeHostCA::didPerformScheduledLayerFlush):
1485         Removed platform* calls. Derived classes can just override these functions to do what they
1486         need.
1487
1488         * WebProcess/WebPage/ca/LayerTreeHostCA.h: Removed Mac-specific pieces. Made some functions
1489         virtual so that derived classes can override them.
1490
1491         * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h: Added.
1492
1493         * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm:
1494         (WebKit::LayerTreeHostCAMac::create): Create and initialize a host.
1495         (WebKit::LayerTreeHostCAMac::LayerTreeHostCAMac): Simple constructor.
1496         (WebKit::LayerTreeHostCAMac::~LayerTreeHostCAMac): Moved code here from LayerTreeHostCA
1497         destructor.
1498         (WebKit::LayerTreeHostCAMac::platformInitialize): Removed direct uses of LayerTreeHostCA
1499         data members.
1500
1501         (WebKit::LayerTreeHostCAMac::invalidate):
1502         (WebKit::LayerTreeHostCAMac::sizeDidChange):
1503         (WebKit::LayerTreeHostCAMac::forceRepaint):
1504         (WebKit::LayerTreeHostCAMac::didPerformScheduledLayerFlush):
1505         Renamed from platform*. Now call up to the base class.
1506
1507         (WebKit::LayerTreeHostCAMac::flushPendingLayerChangesRunLoopObserverCallback): Updated type.
1508
1509         * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp:
1510         (WebKit::LayerTreeHostCAWin::create): Create and initialize a host.
1511
1512         (WebKit::LayerTreeHostCAWin::LayerTreeHostCAWin):
1513         (WebKit::LayerTreeHostCAWin::~LayerTreeHostCAWin):
1514         (WebKit::LayerTreeHostCAWin::platformInitialize):
1515         (WebKit::LayerTreeHostCAWin::scheduleLayerFlush):
1516         Stubbed out.
1517
1518         * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h: Added.
1519
1520         * win/WebKit2.vcproj: Added LayerTreeHostCAWin.h
1521
1522         * win/WebKit2Apple.vsprops: Added WebProcess/WebPage/ca/win to the include path.
1523
1524 2011-03-31  Brent Fulgham  <bfulgham@webkit.org>
1525
1526         Unreviewed WinCairo build fix after r82632.
1527
1528         * UIProcess/DrawingAreaProxyImpl.cpp:
1529         (WebKit::DrawingAreaProxyImpl::visibilityDidChange):
1530
1531 2011-03-31  Adam Roben  <aroben@apple.com>
1532
1533         Add SharedMemory::adopt, which can take ownership of an existing file mapping object
1534
1535         Fixes <http://webkit.org/b/57599> Need a way to wrap an existing file mapping object in a
1536         SharedMemory
1537
1538         Reviewed by Anders Carlsson.
1539
1540         * Platform/SharedMemory.h: Added adopt.
1541
1542         * Platform/win/SharedMemoryWin.cpp:
1543         (WebKit::SharedMemory::create): Moved code to adopt the HANDLE from here...
1544         (WebKit::SharedMemory::adopt): ...to here.
1545
1546 2011-03-31  Chang Shu  <cshu@webkit.org>
1547
1548         Reviewed by Darin Adler.
1549
1550         WebKitTestRunner needs layoutTestController.clearAllDatabases
1551         https://bugs.webkit.org/show_bug.cgi?id=42540
1552
1553         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1554         (WKBundleClearAllDatabases):
1555         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1556         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1557         (WebKit::InjectedBundle::clearAllDatabases):
1558         * WebProcess/InjectedBundle/InjectedBundle.h:
1559         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
1560
1561 2011-03-31  Anders Carlsson  <andersca@apple.com>
1562
1563         Reviewed by Sam Weinig.
1564
1565         Add some more media related things to the sandbox profile.
1566
1567         * WebProcess/com.apple.WebProcess.sb:
1568
1569 2011-03-31  Anders Carlsson  <andersca@apple.com>
1570
1571         Reviewed by Dan Bernstein.
1572
1573         Tabbed pages redraw unnecessarily when activated
1574         https://bugs.webkit.org/show_bug.cgi?id=57589
1575         <rdar://problem/9218258>
1576
1577         * UIProcess/DrawingAreaProxyImpl.cpp:
1578         (WebKit::DrawingAreaProxyImpl::visibilityDidChange):
1579         If we become visible and have no backing store, make sure to call backingStoreStateDidChange
1580         so that the next time we're asked to paint we'll wait for something to paint.
1581
1582         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
1583         Remove now redundant call to backingStoreStateDidChange.
1584
1585 2011-03-31  Sam Weinig  <sam@webkit.org>
1586
1587         Reviewed by Anders Carlsson.
1588
1589         Sandbox violations when playing back HTML5 video on YouTube
1590         <rdar://problem/8950692>
1591
1592         * WebProcess/com.apple.WebProcess.sb:
1593
1594 2011-03-31  Darin Adler  <darin@apple.com>
1595
1596         Reviewed by Sam Weinig.
1597
1598         Implement mouseDown, mouseUp, and mouseMoveTo in WebKitTestRunner
1599         https://bugs.webkit.org/show_bug.cgi?id=57573
1600
1601         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1602         (WKBundlePageSimulateMouseDown): Added.
1603         (WKBundlePageSimulateMouseUp): Added.
1604         (WKBundlePageSimulateMouseMotion): Added.
1605         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: Added above functions.
1606         * WebProcess/WebPage/WebPage.cpp:
1607         (WebKit::WebPage::simulateMouseDown): Added.
1608         (WebKit::WebPage::simulateMouseUp): Added.
1609         (WebKit::WebPage::simulateMouseMotion): Added.
1610         * WebProcess/WebPage/WebPage.h: Added above functions.
1611
1612 2011-03-31  Sam Weinig  <sam@webkit.org>
1613
1614         Reviewed by Anders Carlsson.
1615
1616         Rename WebCore's UI_STRING to WEB_UI_STRING to not overlap with WebKit API
1617         https://bugs.webkit.org/show_bug.cgi?id=57582
1618
1619         * PluginProcess/mac/PluginProcessMac.mm:
1620         (WebKit::PluginProcess::platformInitialize):
1621         * UIProcess/mac/WebInspectorProxyMac.mm:
1622         (WebKit::WebInspectorProxy::platformInspectedURLChanged):
1623         * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm:
1624         * WebProcess/mac/WebProcessMac.mm:
1625         (WebKit::WebProcess::platformInitializeWebProcess):
1626
1627 2011-03-31  Adam Roben  <aroben@apple.com>
1628
1629         Specify both FILE_MAP_READ and FILE_MAP_WRITE when creating a read-write SharedMemory object
1630
1631         When passed to ::MapViewOfFile, FILE_MAP_WRITE implies FILE_MAP_READ, but other file mapping
1632         APIs don't work that way. This bug wasn't causing any problems in practice, but it would
1633         have prevented us from creating a DIB that wraps a SharedMemory object (which I noticed
1634         while working on another bug).
1635
1636         Fixes <http://webkit.org/b/57576> File mappings used by read-write SharedMemory objects
1637         aren't correctly marked as read-write after being sent over a CoreIPC::Connection
1638
1639         Reviewed by Brian Weinstein.
1640
1641         * Platform/win/SharedMemoryWin.cpp:
1642         (WebKit::accessRights): Specify FILE_MAP_READ in addition to FILE_MAP_WRITE for read-write
1643         SharedMemory.
1644
1645 2011-03-31  Adam Roben  <aroben@apple.com>
1646
1647         Quote the executable path we pass to ::CreateProcessW
1648
1649         This will ensure that spaces in the path will be interpreted correctly.
1650
1651         Fixes <http://webkit.org/b/57569> Web process sometimes fails to launch when there are
1652         spaces in its path
1653
1654         Reviewed by Steve Falkenburg.
1655
1656         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
1657         (WebKit::ProcessLauncher::launchProcess): Surround the executable path in quotes.
1658
1659 2011-03-31  Alexey Proskuryakov  <ap@apple.com>
1660
1661         Patch by John Harvey, reviewed and tweaked by me.
1662
1663         <rdar://problem/8644403> Should notify TSM that plug-ins would show a bottom input window for marked text.
1664
1665         * UIProcess/API/mac/WKTextInputWindowController.mm:
1666         (-[WKTextInputPanel _interpretKeyEvent:string:]):
1667
1668 2011-03-31  Anders Carlsson  <andersca@apple.com>
1669
1670         Reviewed by John Sullivan, Darin Adler, Dan Bernstein and Sam Weinig.
1671
1672         If a user doesn't have a Database/LocalStorage directory, it can't be created (sandbox violations)
1673         https://bugs.webkit.org/show_bug.cgi?id=57561
1674         <rdar://problem/9127411>
1675
1676         Ensure that any readwrite sandbox directories actually exist before entering the sandbox.
1677
1678         * WebProcess/mac/WebProcessMac.mm:
1679         (WebKit::appendReadwriteSandboxDirectory):
1680
1681 2011-03-31  John Sullivan  <sullivan@apple.com>
1682
1683         Reviewed by Darin Adler and Adam Roben.
1684
1685         <rdar://problem/9214824> Find client not told when WKPageCountStringMatches exceeds maximum
1686         https://bugs.webkit.org/show_bug.cgi?id=57552
1687
1688         * WebProcess/WebPage/FindController.cpp:
1689         (WebKit::FindController::countStringMatches):
1690         Use the same technique as findString() to report kWKMoreThanMaximumMatchCount when appropriate.
1691         (WebKit::FindController::findString):
1692         Convert numeric_limits::max() to max() - 1 to avoid overflow case.
1693
1694 2011-03-31  Evan Martin  <evan@chromium.org>
1695
1696         Reviewed by Eric Seidel.
1697
1698         <title> should support dir attribute
1699         https://bugs.webkit.org/show_bug.cgi?id=50961
1700
1701         Update to new FrameLoaderClient interface.
1702
1703         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1704         (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle):
1705         (WebKit::WebFrameLoaderClient::setTitle):
1706         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1707
1708 2011-03-31  Balazs Kelemen  <kbalazs@webkit.org>
1709
1710         Reviewed by Csaba Osztrogonác.
1711
1712         [WK2] Introduce an option for no NPAPI support
1713         https://bugs.webkit.org/show_bug.cgi?id=55828
1714
1715         Stub out NPAPI support for platform and OS combinations that are
1716         not supported yet. Ancestor patch was made by Laszlo Gombos.
1717
1718         * GNUmakefile.am: Add NetscapePluginModuleNone.cpp and NetscapePluginNone.cpp
1719         to the build system.
1720
1721         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
1722         Remove the sanity check because from now all combinations that
1723         don't have an explicitly set plugin architecture fall into
1724         the PLUGIN_ARCHITECTURE(UNSUPPORTED) category and has a stubbed
1725         implementation.
1726
1727         * Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp: Added.
1728         Stubbed implementation.
1729         (WebKit::NetscapePluginModule::getPluginInfo):
1730         (WebKit::NetscapePluginModule::determineQuirks):
1731
1732         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp: Guard with
1733         PLUGIN_ARCHITECTURE(X11).
1734
1735         * WebKit2.pro: Add NetscapePluginModuleNone.cpp and NetscapePluginNone.cpp
1736         to the build system.
1737
1738         * WebProcess/Plugins/Netscape/NetscapePluginNone.cpp: Added.
1739         Stubbed implementation
1740         (WebKit::NetscapePlugin::platformPostInitialize):
1741         (WebKit::NetscapePlugin::platformDestroy):
1742         (WebKit::NetscapePlugin::platformInvalidate):
1743         (WebKit::NetscapePlugin::platformGeometryDidChange):
1744         (WebKit::NetscapePlugin::platformPaint):
1745         (WebKit::NetscapePlugin::platformHandleMouseEvent):
1746         (WebKit::NetscapePlugin::platformHandleWheelEvent):
1747         (WebKit::NetscapePlugin::platformSetFocus):
1748         (WebKit::NetscapePlugin::platformHandleMouseEnterEvent):
1749         (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent):
1750         (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
1751
1752         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: Guard with
1753         PLUGIN_ARCHITECTURE(X11)
1754
1755         * config.h: Introduce PLUGIN_ARCHITECTURE(UNSUPPORTED) as another
1756         option. Make platform and OS combinations that are not supported
1757         yet fall into this. Don't use Q_WS_X11 to test the window system
1758         for Qt because it is not defined without including <QtGlobal>.
1759         No clue about how could it work so far.
1760
1761 2011-03-31  Vamshikrishna.Yellenki  <vamshi@motorola.com> and Alejandro G. Castro  <alex@igalia.com>
1762
1763         Reviewed by Martin Robinson.
1764
1765         Implement MiniBrowser for Gtk port.
1766         https://bugs.webkit.org/show_bug.cgi?id=48512
1767
1768         * Shared/API/c/gtk/WKBaseGtk.h: Add the stdbool.h include.
1769
1770 2011-03-30  Dan Bernstein  <mitz@apple.com>
1771
1772         Reviewed by Maciej Stachowiak.
1773
1774         <rdar://problem/9005982> Flash of white when a WKView with composited content moves on-screen
1775         https://bugs.webkit.org/show_bug.cgi?id=57522
1776
1777         * UIProcess/DrawingAreaProxyImpl.cpp:
1778         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode): Invalidate the current
1779         backing store state, so that we get an update as soon as the page enters compositing mode
1780         next.
1781         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1782         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState): Added a call to
1783         LayerTreeHost::forceRepaint() in order to flush and synchronize the layers
1784         before sending the update message to the UI process.
1785
1786 2011-03-30  Sam Weinig  <sam@webkit.org>
1787
1788         Reviewed by Anders Carlsson.
1789
1790         Sandbox violations if you navigate a file URL via something other than a click
1791         <rdar://problem/9016086>
1792         https://bugs.webkit.org/show_bug.cgi?id=57519
1793
1794         * WebProcess/WebPage/WebPage.cpp:
1795         (WebKit::shouldReuseCommittedSandboxExtension):
1796         Remove unnecessary restriction on extension reuse. Any type of file to file navigation
1797         should be allowed.
1798
1799 2011-03-30  Anders Carlsson  <andersca@apple.com>
1800
1801         Reviewed by Sam Weinig.
1802
1803         Clean up the sandbox parameter code
1804         https://bugs.webkit.org/show_bug.cgi?id=57518
1805
1806         * Shared/WebProcessCreationParameters.h:
1807         Make nsURLCachePath and uiProcessBundleResourcePath Strings to match the other paths we send over.
1808
1809         * UIProcess/mac/WebContextMac.mm:
1810         (WebKit::WebContext::platformInitializeWebProcess):
1811         nsURLCachePath and uiProcessBundleResourcePath are now Strings.
1812
1813         * WebProcess/mac/WebProcessMac.mm:
1814         (WebKit::appendSandboxParameterPathInternal):
1815         (WebKit::appendReadwriteConfDirectory):
1816         (WebKit::appendReadonlySandboxDirectory):
1817         (WebKit::appendReadwriteSandboxDirectory):
1818         (WebKit::initializeSandbox):
1819         Make it more clear whether the directories we're adding are readonly or readwrite. No functionality change.
1820         
1821         (WebKit::WebProcess::platformInitializeWebProcess):
1822         nsURLCachePath is now a string.
1823
1824 2011-03-30  Anders Carlsson  <andersca@apple.com>
1825
1826         Reviewed by Sam Weinig.
1827
1828         Downloading a file fails due to a sandbox violation if the destination path is a symlink
1829         https://bugs.webkit.org/show_bug.cgi?id=57517
1830         <rdar://problem/8943865>
1831
1832         Make sure to resolve any symlinks in the given path when creating a sandbox extension handle.
1833         Note that we can't use realpath or -[NSString stringByResolvingSymlinksInPath], because those calls
1834         will fail if the pointed to file doesn't exist.
1835
1836         * Shared/mac/SandboxExtensionMac.mm:
1837         (WebKit::resolveSymlinksInPath):
1838         New function that resolves all the symlinks in the given path.
1839
1840         (WebKit::SandboxExtension::createHandle):
1841         Call resolveSymlinksInPath on the resulting path.
1842
1843 2011-03-30  Steve Falkenburg  <sfalken@apple.com>
1844
1845         Reviewed by Adam Roben.
1846
1847         Share most vsprops between Release and Production builds in releaseproduction.vsprops
1848         https://bugs.webkit.org/show_bug.cgi?id=57508
1849
1850         * win/WebKit2Production.vsprops:
1851         * win/WebKit2Release.vsprops:
1852         * win/WebKit2ReleaseCairoCFLite.vsprops:
1853         * win/WebKit2WebProcessProduction.vsprops:
1854         * win/WebKit2WebProcessRelease.vsprops:
1855         * win/WebKit2WebProcessReleaseCairoCFLite.vsprops:
1856
1857 2011-03-30  Ivan Krstić  <ike@apple.com>
1858
1859         Reviewed by Oliver Hunt.
1860
1861         Ensure consistent, readable working directory for WebProcess before entering sandbox
1862         <rdar://problem/8951176>
1863
1864         * WebProcess/mac/WebProcessMac.mm:
1865         (WebKit::WebProcess::platformInitializeWebProcess):
1866
1867 2011-03-30  Sam Weinig  <sam@webkit.org>
1868
1869         Reviewed by Brady Eidson.
1870
1871         WebKit2: Attempting to view css file from url causes it to download
1872         <rdar://problem/9102611>
1873         https://bugs.webkit.org/show_bug.cgi?id=57501
1874
1875         * UIProcess/WebPageProxy.cpp:
1876         (WebKit::WebPageProxy::canShowMIMEType):
1877         Match WebKit1 by allowing any MIME type that starts with "text/"
1878         except the ones we explicitly blacklist.
1879
1880 2011-03-30  Steve Falkenburg  <sfalken@apple.com>
1881
1882         Reviewed by Adam Roben.
1883
1884         Update Windows production build logic for new production configurations
1885         https://bugs.webkit.org/show_bug.cgi?id=57494
1886
1887         * win/WebKit2.make:
1888         * win/WebKit2Production.vsprops:
1889         * win/WebKit2WebProcessProduction.vsprops:
1890
1891 2011-03-30  Steve Falkenburg  <sfalken@apple.com>
1892
1893         Reviewed by Adam Roben.
1894
1895         Rename Windows configuration Release_LTCG to Production for clarity
1896         https://bugs.webkit.org/show_bug.cgi?id=57465
1897
1898         * win/WebKit2.submit.sln:
1899         * win/WebKit2.vcproj:
1900         * win/WebKit2Generated.vcproj:
1901         * win/WebKit2Production.vsprops: Copied from Source/WebKit2/win/WebKit2ReleaseLTCG.vsprops.
1902         * win/WebKit2ReleaseLTCG.vsprops: Removed.
1903         * win/WebKit2WebProcess.vcproj:
1904         * win/WebKit2WebProcessProduction.vsprops: Copied from Source/WebKit2/win/WebKit2WebProcessReleaseLTCG.vsprops.
1905         * win/WebKit2WebProcessReleaseLTCG.vsprops: Removed.
1906
1907 2011-03-30  Jer Noble  <jer.noble@apple.com>
1908
1909         Reviewed by Dan Bernstein.
1910
1911         WebKit2: WebProcess is using 89%, while viewing a PDF
1912         https://bugs.webkit.org/show_bug.cgi?id=57471
1913
1914         Break a never ending display/update cycle between the UIProcess and the WebProcess
1915         by clearing the dirty region when a page has a custom representation (like a PDF).
1916         Also, avoid the issue where possible by not setting the dirty region in the same case.
1917
1918         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1919         (WebKit::DrawingAreaImpl::setNeedsDisplay): Bail early if mainFrameHasCustomRepresentation().
1920         (WebKit::DrawingAreaImpl::scroll): Ditto.
1921         (WebKit::DrawingAreaImpl::display): Both bail early and clear m_dirtyRegion if 
1922             mainFrameHasCustomRepresentation().
1923
1924 2011-03-30  Sam Weinig  <sam@webkit.org>
1925
1926         Fix Snow Leopard build.
1927
1928         * UIProcess/mac/WebContextMenuProxyMac.mm:
1929         (WebKit::WebContextMenuProxyMac::showContextMenu):
1930
1931 2011-03-30  Sam Weinig  <sam@webkit.org>
1932
1933         Reviewed by Anders Carlsson.
1934
1935         WebKit2 contextual menu looks different than the rest of the OS
1936         <rdar://problem/9172935>
1937         https://bugs.webkit.org/show_bug.cgi?id=57475
1938
1939         * UIProcess/mac/WebContextMenuProxyMac.mm:
1940         (WebKit::WebContextMenuProxyMac::showContextMenu):
1941         Use correct SPI for showing a context menu. The dummy view is also
1942         not necessary, so remove it.
1943
1944 2011-03-30  Anders Carlsson  <andersca@apple.com>
1945
1946         Reviewed by Sam Weinig.
1947
1948         Crash when NPN_Evaluate removes the plug-in frame
1949         https://bugs.webkit.org/show_bug.cgi?id=57474
1950         <rdar://problem/9191396>
1951
1952         Get a reference to the frame since it can be nulled out if running the JavaScript code
1953         causes the plug-in's containing frame to be removed from the frame tree.
1954
1955         * WebProcess/Plugins/PluginView.cpp:
1956         (WebKit::PluginView::evaluate):
1957
1958 2011-03-30  Sam Weinig  <sam@webkit.org>
1959
1960         Reviewed by Anders Carlsson.
1961
1962         Add default localization strategy that can be shared by WebKit1 and WebKit2
1963         https://bugs.webkit.org/show_bug.cgi?id=57406
1964
1965         * Shared/WebLocalizableStrings.h: Removed.
1966         Removed in favor of using WebCore/LocalizedStrings.h directly.
1967
1968         * PluginProcess/mac/PluginProcessMac.mm:
1969         * UIProcess/API/mac/WKView.mm:
1970         * UIProcess/mac/WebInspectorProxyMac.mm:
1971         * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm:
1972         * WebProcess/mac/WebProcessMac.mm:
1973         Use WebCore/LocalizedStrings.h directly.
1974
1975         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1976         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1977         Remove localization strategy override in favor of using new default implementation.
1978
1979         * GNUmakefile.am:
1980         * WebKit2.pro:
1981         * WebKit2.xcodeproj/project.pbxproj:
1982         * win/WebKit2.vcproj:
1983         Remove WebLocalizableStrings.h
1984
1985 2011-03-30  Anders Carlsson  <andersca@apple.com>
1986
1987         Reviewed by Adam Roben.
1988
1989         Assertion failure in plug-in process when calling WKPluginSiteDataManagerGetSitesWithData
1990         https://bugs.webkit.org/show_bug.cgi?id=57468
1991         <rdar://problem/9199089>
1992
1993         Call decrementLoadCount from removeWebProcessConnection instead of startShutdownTimerIfNecessary,
1994         otherwise we'll get a load count underflow when a connection is never created.
1995
1996         * PluginProcess/PluginProcess.cpp:
1997         (WebKit::PluginProcess::removeWebProcessConnection):
1998         (WebKit::PluginProcess::createWebProcessConnection):
1999         (WebKit::PluginProcess::startShutdownTimerIfNecessary):
2000
2001 2011-03-30  Jessie Berlin  <jberlin@apple.com>
2002
2003         Reviewed by Anders Carlsson.
2004
2005         WebKit2: Make sure to try to terminate the Web Process when any work that might require the
2006         Web Process to be relaunched is done
2007         https://bugs.webkit.org/show_bug.cgi?id=57462
2008
2009         For the ManagerProxies in the UIProcess, only return true from shouldTerminate if there are
2010         no more callbacks waiting to be invoked.
2011
2012         For the the Managers in the WebProcess, call WebProcess::shared().terminateIfPossible() when
2013         any work called for by a ManagerProxy function that called relaunchProcessIfNecessary is
2014         finished.
2015
2016         * UIProcess/WebContext.cpp:
2017         (WebKit::WebContext::shouldTerminate):
2018         Check with each of the ManagerProxies.
2019
2020         * UIProcess/WebApplicationCacheManagerProxy.cpp:
2021         (WebKit::WebApplicationCacheManagerProxy::shouldTerminate):
2022         * UIProcess/WebApplicationCacheManagerProxy.h:
2023         * UIProcess/WebCookieManagerProxy.cpp:
2024         (WebKit::WebCookieManagerProxy::shouldTerminate):
2025         * UIProcess/WebCookieManagerProxy.h:
2026         * UIProcess/WebDatabaseManagerProxy.cpp:
2027         (WebKit::WebDatabaseManagerProxy::shouldTerminate):
2028         * UIProcess/WebDatabaseManagerProxy.h:
2029         * UIProcess/WebKeyValueStorageManagerProxy.cpp:
2030         (WebKit::WebKeyValueStorageManagerProxy::shouldTerminate):
2031         * UIProcess/WebKeyValueStorageManagerProxy.h:
2032         * UIProcess/WebMediaCacheManagerProxy.cpp:
2033         (WebKit::WebMediaCacheManagerProxy::shouldTerminate):
2034         * UIProcess/WebMediaCacheManagerProxy.h:
2035         * UIProcess/WebResourceCacheManagerProxy.cpp:
2036         (WebKit::WebResourceCacheManagerProxy::shouldTerminate):
2037         * UIProcess/WebResourceCacheManagerProxy.h:
2038
2039         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp:
2040         (WebKit::WebApplicationCacheManager::getApplicationCacheOrigins):
2041         (WebKit::WebApplicationCacheManager::deleteEntriesForOrigin):
2042         (WebKit::WebApplicationCacheManager::deleteAllEntries):
2043         * WebProcess/Cookies/WebCookieManager.cpp:
2044         (WebKit::WebCookieManager::getHostnamesWithCookies):
2045         (WebKit::WebCookieManager::deleteCookiesForHostname):
2046         (WebKit::WebCookieManager::deleteAllCookies):
2047         (WebKit::WebCookieManager::startObservingCookieChanges):
2048         (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
2049         (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy):
2050         * WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp:
2051         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
2052         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
2053         (WebKit::WebKeyValueStorageManager::deleteAllEntries):
2054         * WebProcess/MediaCache/WebMediaCacheManager.cpp:
2055         (WebKit::WebMediaCacheManager::getHostnamesWithMediaCache):
2056         (WebKit::WebMediaCacheManager::clearCacheForHostname):
2057         (WebKit::WebMediaCacheManager::clearCacheForAllHostnames):
2058         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
2059         (WebKit::WebResourceCacheManager::getCacheOrigins):
2060         (WebKit::WebResourceCacheManager::clearCacheForOrigin):
2061         (WebKit::WebResourceCacheManager::clearCacheForAllOrigins):
2062         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
2063         (WebKit::WebDatabaseManager::getDatabasesByOrigin):
2064         (WebKit::WebDatabaseManager::getDatabaseOrigins):
2065         (WebKit::WebDatabaseManager::deleteDatabaseWithNameForOrigin):
2066         (WebKit::WebDatabaseManager::deleteDatabasesForOrigin):
2067         (WebKit::WebDatabaseManager::deleteAllDatabases):
2068         (WebKit::WebDatabaseManager::setQuotaForOrigin):
2069
2070 2011-03-30  Adam Roben  <aroben@apple.com>
2071
2072         Mac build fix after r82442
2073
2074         * WebProcess/Plugins/PluginProxy.cpp:
2075         (WebKit::PluginProxy::geometryDidChange): Added a missing argument.
2076
2077 2011-03-29  Adam Roben  <aroben@apple.com>
2078
2079         Add a way to specify that a ShareableBitmap has no alpha channel
2080
2081         Before this patch, all ShareableBitmaps had an alpha channel. With this patch, all
2082         ShareableBitmaps *still* have an alpha channel. But now there's a way to specify you don't
2083         want one (which will be used in the future)!
2084
2085         Fixes <http://webkit.org/b/57388> Need a way to specify that a ShareableBitmap has no alpha
2086         channel
2087
2088         Reviewed by Anders Carlsson.
2089
2090         * Shared/ShareableBitmap.cpp:
2091         (WebKit::ShareableBitmap::Handle::Handle): Moved here from the header file, and added
2092         initialization of m_flags.
2093
2094         (WebKit::ShareableBitmap::Handle::encode):
2095         (WebKit::ShareableBitmap::Handle::decode):
2096         Encode/decode m_flags.
2097
2098         (WebKit::ShareableBitmap::create):
2099         (WebKit::ShareableBitmap::createShareable):
2100         Pass along the new Flags argument.
2101
2102         (WebKit::ShareableBitmap::createHandle): Store our Flags on the Handle.
2103         (WebKit::ShareableBitmap::ShareableBitmap): Store the Flags in m_flags.
2104
2105         * Shared/ShareableBitmap.h: Added Flag, Flags, and m_flags, and added a Flags argument to
2106         some create functions.
2107
2108         * Shared/WebCoreArgumentCoders.cpp:
2109         (CoreIPC::encodeImage):
2110         * Shared/WebImage.cpp:
2111         (WebKit::WebImage::create):
2112         Specify that we want a bitmap that supports alpha to maintain current behavior.
2113
2114         * Shared/cg/ShareableBitmapCG.cpp:
2115         (WebKit::bitmapInfo): New helper function. Includes an alpha channel only if specified in
2116         the flags.
2117
2118         (WebKit::ShareableBitmap::createGraphicsContext):
2119         (WebKit::ShareableBitmap::makeCGImage):
2120         Use the new helper function.
2121
2122         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2123         (WebKit::NetscapePlugin::snapshot):
2124         * WebProcess/Plugins/PluginProxy.cpp:
2125         (WebKit::PluginProxy::geometryDidChange):
2126         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2127         (WebKit::convertImageToBitmap):
2128         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp:
2129         (WebKit::WebPopupMenu::setUpPlatformData):
2130         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2131         (WebKit::DrawingAreaImpl::display):
2132         * WebProcess/WebPage/FindController.cpp:
2133         (WebKit::FindController::updateFindIndicator):
2134         Specify that we want a bitmap that supports alpha to maintain current behavior.
2135
2136 2011-03-29  Adam Roben  <aroben@apple.com>
2137
2138         Add ShareableBitmap::Handle
2139
2140         This object is used for encoding/decoding a ShareableBitmap via CoreIPC. It currently just
2141         encapsulates a SharedMemory::Handle (which is what we were using previously) and the image's
2142         size (which means callers no longer need to deal with the size explicitly), but in the
2143         future could be used to store more information about the bitmap.
2144
2145         This should cause no behavior changes.
2146
2147         Fixes <http://webkit.org/b/57397> ShareableBitmap needs its own Handle type
2148
2149         Reviewed by Anders Carlsson.
2150
2151         * PluginProcess/PluginControllerProxy.cpp:
2152         (WebKit::PluginControllerProxy::geometryDidChange): No longer need to pass a size to create,
2153         since the Handle records the size.
2154         (WebKit::PluginControllerProxy::snapshot): No longer need the bufferSize argument, since the
2155         Handle records the size.
2156
2157         * PluginProcess/PluginControllerProxy.h:
2158         * PluginProcess/PluginControllerProxy.messages.in:
2159         Updated Handle types and removed unnecessary size argument to Snapshot.
2160
2161         * Shared/PlatformPopupMenuData.cpp:
2162         (WebKit::PlatformPopupMenuData::encode):
2163         (WebKit::PlatformPopupMenuData::decode):
2164         * Shared/PlatformPopupMenuData.h:
2165         Changed to use ShareableBitmap::Handle and removed m_backingStoreSize, which is now stored
2166         in the Handles.
2167
2168         * Shared/ShareableBitmap.cpp:
2169         (WebKit::ShareableBitmap::Handle::encode):
2170         (WebKit::ShareableBitmap::Handle::decode):
2171         Simple encode/decode functions.
2172
2173         (WebKit::ShareableBitmap::create): Get the size from the Handle instead of as a separate
2174         argument.
2175         (WebKit::ShareableBitmap::createHandle): Store our size in the Handle.
2176
2177         * Shared/ShareableBitmap.h: Added ShareableBitmap::Handle and made some functions use it.
2178
2179         * Shared/UpdateInfo.h: Changed to use ShareableBitmap::Handle.
2180
2181         * Shared/UserMessageCoders.h:
2182         (WebKit::UserMessageEncoder::baseEncode):
2183         (WebKit::UserMessageDecoder::baseDecode):
2184         * Shared/WebCoreArgumentCoders.cpp:
2185         (CoreIPC::encodeImage):
2186         (CoreIPC::decodeImage):
2187         Use the size stored in the Handle instead of encoding/decoding one separately.
2188
2189         * UIProcess/API/mac/PageClientImpl.h:
2190         * UIProcess/API/mac/PageClientImpl.mm:
2191         (WebKit::PageClientImpl::setDragImage):
2192         Removed the unnecessary imageSize argument. We can get it from the image itself.
2193
2194         * UIProcess/BackingStore.cpp:
2195         (WebKit::BackingStore::incorporateUpdate):
2196         * UIProcess/FindIndicator.cpp:
2197         (WebKit::FindIndicator::create):
2198         No longer need to pass a size when creating a ShareableBitmap from a Handle.
2199
2200         * UIProcess/FindIndicator.h: Changed to use ShareableBitmap::Handle.
2201
2202         * UIProcess/PageClient.h: Removed unnecessary imageSize argument from setDragImage.
2203
2204         * UIProcess/WebPageProxy.cpp:
2205         (WebKit::WebPageProxy::setFindIndicator):
2206         * UIProcess/WebPageProxy.h:
2207         * UIProcess/WebPageProxy.messages.in:
2208         * UIProcess/mac/WebPageProxyMac.mm:
2209         (WebKit::WebPageProxy::setDragImage):
2210         * WebProcess/Plugins/PluginProxy.cpp:
2211         (WebKit::PluginProxy::snapshot):
2212         (WebKit::PluginProxy::geometryDidChange):
2213         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2214         (WebKit::WebDragClient::startDrag):
2215         Changed to use ShareableBitmap::Handle and removed now-unnecessary size arguments (since we
2216         can get the size from the Handle).
2217
2218         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp:
2219         (WebKit::WebPopupMenu::setUpPlatformData): Don't need to store the backing store size in the
2220         data anymore; the Handles will make sure it reaches the other process.
2221
2222         * WebProcess/WebPage/FindController.cpp:
2223         (WebKit::FindController::updateFindIndicator):
2224         (WebKit::FindController::hideFindIndicator):
2225         Changed to use ShareableBitmap::Handle.
2226
2227 2011-03-30  Alejandro G. Castro  <alex@igalia.com>
2228
2229         Fix GTK build after r81980.
2230
2231         * GNUmakefile.am:
2232
2233 2011-03-29  Beth Dakin  <bdakin@apple.com>
2234
2235         Reviewed by Maciej Stachowiak.
2236
2237         Fix for https://bugs.webkit.org/show_bug.cgi?id=57408 
2238         webkit-min-device-pixel-ratio media query doesn't work post-SnowLeopard 
2239         -and corresponding-
2240         <rdar://problem/8665411>
2241
2242         * Shared/WebPageCreationParameters.cpp:
2243         (WebKit::WebPageCreationParameters::encode):
2244         (WebKit::WebPageCreationParameters::decode):
2245         * Shared/WebPageCreationParameters.h:
2246         * UIProcess/API/mac/PageClientImpl.h:
2247         * UIProcess/API/mac/PageClientImpl.mm:
2248         (WebKit::PageClientImpl::userSpaceScaleFactor):
2249         * UIProcess/API/qt/qwkpage_p.h:
2250         (QWKPagePrivate::userSpaceScaleFactor):
2251         * UIProcess/PageClient.h:
2252         * UIProcess/WebPageProxy.cpp:
2253         (WebKit::WebPageProxy::creationParameters):
2254         * UIProcess/gtk/WebView.h:
2255         (WebKit::WebView::userSpaceScaleFactor):
2256         * UIProcess/win/WebView.h:
2257         (WebKit::WebView::userSpaceScaleFactor):
2258         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2259         (WebKit::WebChromeClient::scaleFactor):
2260         * WebProcess/WebPage/WebPage.cpp:
2261         (WebKit::WebPage::WebPage):
2262         * WebProcess/WebPage/WebPage.h:
2263         (WebKit::WebPage::userSpaceScaleFactor):
2264
2265 2011-03-29  Brent Fulgham  <bfulgham@webkit.org>
2266
2267         Unreviewed WinCairo build fix.
2268
2269         Bring DownloadCurl implementation stubs in line with current
2270         CFNetwork API.
2271
2272         * WebProcess/Downloads/curl/DownloadCurl.cpp:
2273         (WebKit::Download::receivedCredential):
2274         (WebKit::Download::receivedRequestToContinueWithoutCredential):
2275         (WebKit::Download::receivedCancellation):
2276
2277 2011-03-29  Chris Fleizach  <cfleizach@apple.com>
2278
2279         Reviewed by Darin Adler.
2280
2281         AX: WK2: When creating the window remote token, use what's returned from accessibility
2282         https://bugs.webkit.org/show_bug.cgi?id=57398
2283
2284         This will allow a specific WKView to override what's used for the window attribute of the
2285         HTML elements.
2286
2287         * UIProcess/API/mac/WKView.mm:
2288         (-[WKView viewDidMoveToWindow]):
2289
2290 2011-03-29  Jeff Miller  <jeffm@apple.com>
2291
2292         Reviewed by Sam Weinig.
2293
2294         Make Windows-only InjectedBundle functions platform-specific
2295         https://bugs.webkit.org/show_bug.cgi?id=57385
2296         
2297         Added files for Windows-specific WKBundle functions.
2298         Removed stub wrappers for InjectedBundle::setHostAllowsAnyHTTPSCertificate() and InjectedBundle::setClientCertificate() from non-Windows platforms.
2299
2300         * WebProcess/InjectedBundle/API/c/WKBundle.cpp: Moved WKBundleSetHostAllowsAnyHTTPSCertificate() and WKBundleSetClientCertificate() to WKBundlePrivateWin.cpp.
2301         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: Moved WKBundleSetHostAllowsAnyHTTPSCertificate() and WKBundleSetClientCertificate() to WKBundlePrivateWin.h.
2302         * WebProcess/InjectedBundle/API/c/win: Added.
2303         * WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.cpp: Added.
2304         (WKBundleSetHostAllowsAnyHTTPSCertificate): Moved from WKBundle.cpp.
2305         (WKBundleSetClientCertificate): Moved from WKBundle.cpp.
2306         * WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.h: Added.
2307         * WebProcess/InjectedBundle/InjectedBundle.h: setHostAllowsAnyHTTPSCertificate() and setClientCertificate() are Windows-only.
2308         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp: Removed setHostAllowsAnyHTTPSCertificate() and setClientCertificate().
2309         * WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp: Removed setHostAllowsAnyHTTPSCertificate() and setClientCertificate().
2310         * WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp: Removed setHostAllowsAnyHTTPSCertificate() and setClientCertificate().
2311         * win/WebKit2.vcproj: Added WKBundlePrivateWin.cpp and WKBundlePrivateWin.h.
2312         * win/WebKit2Generated.make: Copy WKBundlePrivateWin.h.
2313
2314 2011-03-29  Anders Carlsson  <andersca@apple.com>
2315
2316         Fix Windows build.
2317
2318         * WebProcess/Downloads/cfnet/DownloadCFNet.cpp:
2319         (WebKit::Download::receivedCredential):
2320         (WebKit::Download::receivedRequestToContinueWithoutCredential):
2321         (WebKit::Download::receivedCancellation):
2322
2323 2011-03-29  Anders Carlsson  <andersca@apple.com>
2324
2325         Reviewed by Sam Weinig.
2326
2327         Downloads: Authentication support
2328         https://bugs.webkit.org/show_bug.cgi?id=57403
2329         <rdar://problem/8691166>
2330
2331         * UIProcess/API/C/WKContext.h:
2332         Add didReceiveAuthenticationChallenge callback.
2333
2334         * UIProcess/Downloads/DownloadProxy.cpp:
2335         (WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
2336         Call the download client.
2337
2338         * UIProcess/Downloads/DownloadProxy.messages.in:
2339         Add DidReceiveAuthenticationChallenge message.
2340
2341         * UIProcess/WebDownloadClient.cpp:
2342         (WebKit::WebDownloadClient::didReceiveAuthenticationChallenge):
2343         Call the client callback function.
2344
2345         * UIProcess/WebDownloadClient.h:
2346         * WebProcess/Authentication/AuthenticationManager.cpp:
2347         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
2348         Send the DidReceiveAuthenticationChallenge message to the download proxy.
2349
2350         (WebKit::AuthenticationManager::useCredentialForChallenge):
2351         (WebKit::AuthenticationManager::continueWithoutCredentialForChallenge):
2352         (WebKit::AuthenticationManager::cancelChallenge):
2353         If the authentication client is null, call the static download member functions.
2354
2355         * WebProcess/Authentication/AuthenticationManager.h:
2356         * WebProcess/Downloads/Download.cpp:
2357         (WebKit::Download::didReceiveAuthenticationChallenge):
2358         Call the authentication manager.
2359
2360         * WebProcess/Downloads/Download.h:
2361         * WebProcess/Downloads/mac/DownloadMac.mm:
2362         (WebKit::Download::receivedCredential):
2363         (WebKit::Download::receivedRequestToContinueWithoutCredential):
2364         (WebKit::Download::receivedCancellation):
2365         Call the right sender methods.
2366
2367         (-[WKDownloadAsDelegate download:didReceiveAuthenticationChallenge:]):
2368         (-[WKDownloadAsDelegate downloadShouldUseCredentialStorage:]):
2369         Call the right Download member functions.
2370
2371         * WebProcess/Downloads/qt/DownloadQt.cpp:
2372         (WebKit::Download::receivedCredential):
2373         (WebKit::Download::receivedRequestToContinueWithoutCredential):
2374         (WebKit::Download::receivedCancellation):
2375         * WebProcess/Downloads/soup/DownloadSoup.cpp:
2376         (WebKit::Download::receivedCredential):
2377         (WebKit::Download::receivedRequestToContinueWithoutCredential):
2378         (WebKit::Download::receivedCancellation):
2379         Add stubs.
2380
2381 2011-03-29  Anders Carlsson  <andersca@apple.com>
2382
2383         Reviewed by Sam Weinig.
2384
2385         AuthenticationChallengeProxy objects should be associated with processes, not pages
2386         https://bugs.webkit.org/show_bug.cgi?id=57401
2387
2388         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
2389         (WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy):
2390         (WebKit::AuthenticationChallengeProxy::~AuthenticationChallengeProxy):
2391         (WebKit::AuthenticationChallengeProxy::useCredential):
2392         (WebKit::AuthenticationChallengeProxy::cancel):
2393         * UIProcess/Authentication/AuthenticationChallengeProxy.h:
2394         (WebKit::AuthenticationChallengeProxy::create):
2395         * UIProcess/WebPageProxy.cpp:
2396         (WebKit::WebPageProxy::didReceiveAuthenticationChallenge):
2397
2398 2011-03-29  Sam Weinig  <sam@webkit.org>
2399
2400         Reviewed by Anders Carlsson.
2401
2402         Use LocalizedStrings.h as a bottleneck for localized strings instead of
2403         using UI_STRING.
2404
2405         * UIProcess/API/mac/WKView.mm:
2406         (-[WKView validateUserInterfaceItem:]):
2407         Call existing localization functions instead of using UI_STRING.
2408
2409         (-[WKView _getTextInputState:selectionEnd:underlines:]):
2410         Remove unnecessary WebCore:: prefix.
2411
2412 2011-03-29  Chang Shu  <cshu@webkit.org>
2413
2414         Reviewed by Kenneth Rohde Christiansen.
2415
2416         WebKitTestRunner needs layoutTestController.setAllowUniversalAccessFromFileURLs
2417         https://bugs.webkit.org/show_bug.cgi?id=42692
2418
2419         * Shared/WebPreferencesStore.cpp:
2420         (WebKit::WebPreferencesStore::decode):
2421         (WebKit::WebPreferencesStore::overrideAllowUniversalAccessFromFileURLsForTestRunner):
2422         * Shared/WebPreferencesStore.h:
2423         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2424         (WKBundleOverrideAllowUniversalAccessFromFileURLsForTestRunner):
2425         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
2426         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2427         (WebKit::InjectedBundle::overrideAllowUniversalAccessFromFileURLsForTestRunner):
2428         * WebProcess/InjectedBundle/InjectedBundle.h:
2429
2430 2011-03-29  Timothy Hatcher  <timothy@apple.com>
2431
2432         Update the order of the context menu to better match AppKit on Mac.
2433
2434         <rdar://problem/9054893>
2435
2436         Reviewed by John Sullivan.
2437
2438         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2439         (WebKit::WebPlatformStrategies::contextMenuItemTagLookUpInDictionary): Added argument for selected string.
2440         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2441
2442 2011-03-29  Jeff Miller  <jeffm@apple.com>
2443
2444         Fix formatting of WebKit2.vcproj after r82283.
2445
2446         * win/WebKit2.vcproj:
2447
2448 2011-03-29  Martin Robinson  <mrobinson@igalia.com>
2449
2450         [GTK] Build failed with ‘GDK_KEY_KP_Space’ was not declared in this scope
2451         https://bugs.webkit.org/show_bug.cgi?id=55314
2452
2453         Build fix for older versions of GTK+. Use the deprecated names for GDK key
2454         defines and include GtkVersioning.h to allow building on newer versions
2455         of GTK+.
2456
2457         * Shared/gtk/WebEventFactory.cpp:
2458         (WebKit::isGdkKeyCodeFromKeyPad): Update key defines.
2459
2460 2011-03-29  Steve Falkenburg  <sfalken@apple.com>
2461
2462         Reviewed by Darin Adler.
2463
2464         Use per-configuration vsprops in WebKit to avoid WebKitVSPropsRedirectionDir removal by MSVC IDE
2465         https://bugs.webkit.org/show_bug.cgi?id=57383
2466
2467         Visual Studio's IDE was removing instances of $(WebKitVSPropsRedirectionDir) from
2468         InheritedPropertySheet rules in our vcproj files when the vcproj was edited from within
2469         the IDE. To avoid this, add a separate vsprops file for each project configuration that
2470         contains the required inherited property sheets.
2471
2472         * win/WebKit2.vcproj:
2473         * win/WebKit2Debug.vsprops: Added.
2474         * win/WebKit2DebugAll.vsprops: Added.
2475         * win/WebKit2DebugCairoCFLite.vsprops: Added.
2476         * win/WebKit2Release.vsprops: Added.
2477         * win/WebKit2ReleaseCairoCFLite.vsprops: Added.
2478         * win/WebKit2ReleaseLTCG.vsprops: Added.
2479         * win/WebKit2WebProcess.vcproj:
2480         * win/WebKit2WebProcessDebug.vsprops: Added.
2481         * win/WebKit2WebProcessDebugAll.vsprops: Added.
2482         * win/WebKit2WebProcessDebugCairoCFLite.vsprops: Added.
2483         * win/WebKit2WebProcessRelease.vsprops: Added.
2484         * win/WebKit2WebProcessReleaseCairoCFLite.vsprops: Added.
2485         * win/WebKit2WebProcessReleaseLTCG.vsprops: Added.
2486
2487 2011-03-29  Jessie Berlin  <jberlin@apple.com>
2488
2489         Reviewed by Anders Carlsson.
2490
2491         WebKit2: The WebProcess should be relaunched if necessary when WebKit2 is asked for
2492         information about Cookies, Databases, Local Storage, etc.
2493         https://bugs.webkit.org/show_bug.cgi?id=57374
2494
2495         Instead of bailing when the WebProcess is not valid, call relaunchProcessIfNecessary().
2496
2497         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
2498         (WebKit::WebPluginSiteDataManager::getSitesWithData):
2499         (WebKit::WebPluginSiteDataManager::clearSiteData):
2500         * UIProcess/WebApplicationCacheManagerProxy.cpp:
2501         (WebKit::WebApplicationCacheManagerProxy::getApplicationCacheOrigins):
2502         (WebKit::WebApplicationCacheManagerProxy::deleteEntriesForOrigin):
2503         (WebKit::WebApplicationCacheManagerProxy::deleteAllEntries):
2504         * UIProcess/WebCookieManagerProxy.cpp:
2505         (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
2506         (WebKit::WebCookieManagerProxy::deleteCookiesForHostname):
2507         (WebKit::WebCookieManagerProxy::deleteAllCookies):
2508         (WebKit::WebCookieManagerProxy::startObservingCookieChanges):
2509         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
2510         (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
2511         * UIProcess/WebDatabaseManagerProxy.cpp:
2512         (WebKit::WebDatabaseManagerProxy::getDatabasesByOrigin):
2513         (WebKit::WebDatabaseManagerProxy::getDatabaseOrigins):
2514         (WebKit::WebDatabaseManagerProxy::deleteDatabaseWithNameForOrigin):
2515         (WebKit::WebDatabaseManagerProxy::deleteDatabasesForOrigin):
2516         (WebKit::WebDatabaseManagerProxy::deleteAllDatabases):
2517         (WebKit::WebDatabaseManagerProxy::setQuotaForOrigin):
2518         * UIProcess/WebKeyValueStorageManagerProxy.cpp:
2519         (WebKit::WebKeyValueStorageManagerProxy::getKeyValueStorageOrigins):
2520         (WebKit::WebKeyValueStorageManagerProxy::deleteEntriesForOrigin):
2521         (WebKit::WebKeyValueStorageManagerProxy::deleteAllEntries):
2522         * UIProcess/WebMediaCacheManagerProxy.cpp:
2523         (WebKit::WebMediaCacheManagerProxy::getHostnamesWithMediaCache):
2524         (WebKit::WebMediaCacheManagerProxy::clearCacheForHostname):
2525         (WebKit::WebMediaCacheManagerProxy::clearCacheForAllHostnames):
2526         * UIProcess/WebResourceCacheManagerProxy.cpp:
2527         (WebKit::WebResourceCacheManagerProxy::getCacheOrigins):
2528         (WebKit::WebResourceCacheManagerProxy::clearCacheForOrigin):
2529         (WebKit::WebResourceCacheManagerProxy::clearCacheForAllOrigins):
2530
2531 2011-03-29  Jeff Miller  <jeffm@apple.com>
2532
2533         Reviewed by Darin Adler.
2534
2535         WebKit2: Support setting the client certificate on Windows
2536         https://bugs.webkit.org/show_bug.cgi?id=57368
2537         
2538         Allow setting the client certificate for a host via the injected bundle.
2539         This requires the ability for Webkit2 Windows clients to create a WKCertificateInfo from a PCCERT_CONTEXT so they can send it to the web process.
2540
2541         * Shared/API/c/win/WKCertificateInfoWin.cpp:
2542         (WKCertificateInfoCreateWithCertificate): Added.
2543         * Shared/API/c/win/WKCertificateInfoWin.h: Added WKCertificateInfoCreateWithCertificate().
2544         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2545         (WKBundleSetClientCertificate): Added.
2546         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: Added WKBundleSetClientCertificate().
2547         * WebProcess/InjectedBundle/InjectedBundle.h: Added setClientCertificate().
2548         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
2549         (WebKit::InjectedBundle::setClientCertificate): Added, should never be called.
2550         * WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp:
2551         (WebKit::InjectedBundle::setClientCertificate): Added, should never be called.
2552         * WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp:
2553         (WebKit::InjectedBundle::setClientCertificate): Added, should never be called.
2554         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:
2555         (WebKit::InjectedBundle::setClientCertificate): Added.
2556
2557 2011-03-29  Timothy Hatcher  <timothy@apple.com>
2558
2559         Make WebKit2 work with update-webkit-localizable-strings.
2560
2561         https://webkit.org/b/57354
2562
2563         Reviewed by Sam Weinig.
2564
2565         * PluginProcess/mac/PluginProcessMac.mm: Remove UI_STRING macro. Use WebLocalizableStrings.h.
2566         * Shared/WebLocalizableStrings.h: Added.
2567         * UIProcess/API/mac/WKView.mm: Remove UI_STRING macro. Use WebLocalizableStrings.h.
2568         * UIProcess/mac/WebInspectorProxyMac.mm:
2569         (WebKit::WebInspectorProxy::platformInspectedURLChanged): Use UI_STRING. Remove FIXME.
2570         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: Remove UI_STRING macros.
2571         Use WebLocalizableStrings.h.
2572         * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm:
2573         (registerErrors): Remove UI_STRING macro. Use WebLocalizableStrings.h.
2574         * WebProcess/mac/WebProcessMac.mm:
2575         (WebKit::WebProcess::platformInitializeWebProcess): Use UI_STRING. Remove FIXME.
2576
2577         * GNUmakefile.am: Added Shared/WebLocalizableStrings.h.
2578         * WebKit2.pro: Ditto.
2579         * WebKit2.xcodeproj/project.pbxproj: Ditto.
2580         * win/WebKit2.vcproj: Ditto.
2581
2582 2011-03-29  Jeff Miller  <jeffm@apple.com>
2583
2584         Reviewed by Darin Adler.
2585
2586         CoreIPC::decodeResourceError() leaks a CFDataRef
2587         https://bugs.webkit.org/show_bug.cgi?id=57366
2588
2589         * Shared/win/WebCoreArgumentCodersWin.cpp:
2590         (CoreIPC::decodeResourceError): Don't leak the result of WebCore::copyCertificateToData(), since the ResourceError will retain it.
2591
2592 2011-03-29  Anders Carlsson  <andersca@apple.com>
2593
2594         Reviewed by Sam Weinig.
2595
2596         Allow the AppleConnect plug-in to use the QuickDraw drawing model
2597         https://bugs.webkit.org/show_bug.cgi?id=57365
2598         <rdar://problem/8712320>
2599
2600         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2601         (WebKit::NetscapePluginModule::determineQuirks):
2602         * Shared/Plugins/PluginQuirks.h:
2603         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2604         (WebKit::NetscapePlugin::platformPostInitialize):
2605
2606 2011-03-29  Darin Adler  <darin@apple.com>
2607
2608         Reviewed by Adam Roben.
2609
2610         WebKit2 bundle page needs to offer generated file hooks
2611         https://bugs.webkit.org/show_bug.cgi?id=57279
2612
2613         * WebProcess/InjectedBundle/API/c/WKBundlePage.h: Added shouldGenerateFileForUpload and
2614         generateFileForUpload callback pointers.
2615
2616         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
2617         (WebKit::InjectedBundlePageUIClient::shouldGenerateFileForUpload): Added.
2618         (WebKit::InjectedBundlePageUIClient::generateFileForUpload): Added.
2619         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h: Added functions above.
2620
2621         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2622         (WebKit::WebChromeClient::shouldReplaceWithGeneratedFileForUpload): Implemented by
2623         calling the functions above.
2624         (WebKit::WebChromeClient::generateReplacementFile): Ditto.
2625
2626 2011-03-29  Anders Carlsson  <andersca@apple.com>
2627
2628         Reviewed by Darin Adler.
2629
2630         Assertion failure in plug-in process with clang-built 32/64-bit WebKit2
2631         https://bugs.webkit.org/show_bug.cgi?id=57359
2632
2633         Don't use __alignof when encoding and decoding scalar types.
2634         
2635         Darwin 32-bit, double and unsigned long long are 4-byte aligned but on 64-bit they're
2636         8-byte aligned which causes problems when doing IPC between 32-bit and 64-bit processes.
2637         GCC is buggy and returns 8, but clang is correct and returns 4. Use sizeof instead which we know
2638         is equal to or greater than the alignment.
2639
2640         * Platform/CoreIPC/ArgumentDecoder.cpp:
2641         (CoreIPC::ArgumentDecoder::decodeBool):
2642         (CoreIPC::ArgumentDecoder::decodeUInt32):
2643         (CoreIPC::ArgumentDecoder::decodeUInt64):
2644         (CoreIPC::ArgumentDecoder::decodeInt32):
2645         (CoreIPC::ArgumentDecoder::decodeInt64):
2646         (CoreIPC::ArgumentDecoder::decodeFloat):
2647         (CoreIPC::ArgumentDecoder::decodeDouble):
2648         * Platform/CoreIPC/ArgumentEncoder.cpp:
2649         (CoreIPC::ArgumentEncoder::encodeBool):
2650         (CoreIPC::ArgumentEncoder::encodeUInt32):
2651         (CoreIPC::ArgumentEncoder::encodeUInt64):
2652         (CoreIPC::ArgumentEncoder::encodeInt32):
2653         (CoreIPC::ArgumentEncoder::encodeInt64):
2654         (CoreIPC::ArgumentEncoder::encodeFloat):
2655         (CoreIPC::ArgumentEncoder::encodeDouble):
2656
2657 2011-03-29  Brent Fulgham  <bfulgham@webkit.org>
2658
2659         Unreviewed build fix after r81928.
2660
2661         * win/WebKit2.vcproj: Don't build CG-specific icon routines
2662         for WinCairo port.
2663
2664 2011-03-29  Sam Weinig  <sam@webkit.org>
2665
2666         Reviewed by Anders Carlsson.
2667
2668         Reproducible crash running under libgmalloc, in -[WKView(Internal) removeTrackingRect:] --&gt; objc_assign_ivar_non_gc
2669         <rdar://problem/9193352>
2670         https://bugs.webkit.org/show_bug.cgi?id=57358
2671
2672         -[WKView removeTrackingRect] can be called from below -[WKView dealloc] after we have
2673         destroyed _data. So, nil out _data after releasing it and nil check it appropriately.
2674         
2675         * UIProcess/API/mac/WKView.mm:
2676         (-[WKView dealloc]):
2677         Nil out _data after releasing it.
2678
2679         (-[WKView removeTrackingRect:]):
2680         Add early return for nil _data.
2681
2682 2011-03-29  Jeff Miller  <jeffm@apple.com>
2683
2684         Reviewed by Jon Honeycutt.
2685
2686         Add WebCore::copyCertificateToData() on Windows
2687         https://bugs.webkit.org/show_bug.cgi?id=57296
2688         
2689         Remove duplicate code that implemented this functionality in WebCoreArgumentCodersWin.cpp and use WebCore::copyCertificateToData() instead. 
2690
2691         * Shared/win/WebCoreArgumentCodersWin.cpp:
2692         (CoreIPC::decodeResourceError): Use WebCore::copyCertificateToData().
2693
2694 2011-03-29  Balazs Kelemen  <kbalazs@webkit.org>
2695
2696         Unreviewed build fix (64 bit gcc).
2697
2698         GCC does not accept uint64_t formatted as %lli.
2699
2700         * UIProcess/WebIconDatabase.cpp:
2701         (WebKit::WebIconDatabase::getLoadDecisionForIconURL): Add explicit cast to long long.
2702
2703 2011-03-28  Maciej Stachowiak  <mjs@apple.com>
2704
2705         Reviewed by Dan Bernstein.
2706
2707         WKPageGetSourceForFrame and WKPageGetContentsAsString should throw an error in case of a race with page loading
2708         https://bugs.webkit.org/show_bug.cgi?id=57305
2709         <rdar://problem/8738060>, <rdar://problem/8780168>
2710
2711         * UIProcess/WebPageProxy.cpp:
2712         (WebKit::WebPageProxy::close): Clear m_loadDependentStringCallbackIDs
2713         (WebKit::WebPageProxy::getSourceForFrame): track the callback as load dependent
2714         (WebKit::WebPageProxy::getContentsAsString): ditto
2715         (WebKit::WebPageProxy::clearLoadDependentCallbacks): Invalidate all load dependent callbacks
2716         (WebKit::WebPageProxy::didCommitLoadForFrame): Call clearLoadDependentCallbacks
2717         (WebKit::WebPageProxy::didFailLoadForFrame): ditto
2718         (WebKit::WebPageProxy::stringCallback): Remove callback from load dependent set if appropriate
2719         (WebKit::WebPageProxy::processDidCrash): Clear m_loadDependentStringCallbackIDs
2720         * UIProcess/WebPageProxy.h: Add m_loadDependentStringCallbackIDs hash set.
2721
2722 2011-03-28  Patrick Gansterer  <paroga@webkit.org>
2723
2724         Reviewed by Darin Adler.
2725
2726         Use String instead of CString as return value of openTemporaryFile
2727         https://bugs.webkit.org/show_bug.cgi?id=55332
2728
2729         * Shared/WebMemorySampler.cpp:
2730         (WebKit::WebMemorySampler::initializeTempLogFile):
2731         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
2732         (WebKit::NetscapePluginStream::stop):
2733         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
2734
2735 2011-03-28  Brian Weinstein  <bweinstein@apple.com>
2736
2737         Reviewed by Jon Honeycutt.
2738
2739         WebKit2: Downloads started with DownloadCFNet::start never start
2740         https://bugs.webkit.org/show_bug.cgi?id=57268
2741
2742         * WebProcess/Downloads/cfnet/DownloadCFNet.cpp:
2743         (WebKit::Download::start): Call CFURLDownloadStart on the download we create.
2744
2745 2011-03-28  Anders Carlsson  <andersca@apple.com>
2746
2747         Fix Windows build.
2748
2749         * Shared/ShareableBitmap.h:
2750
2751 2011-03-28  Anders Carlsson  <andersca@apple.com>
2752
2753         Reviewed by Sam Weinig.
2754
2755         Beep when pressing a menu key equivalent when a plug-in has focus
2756         https://bugs.webkit.org/show_bug.cgi?id=57264
2757         <rdar://problem/8935597>
2758
2759         We don't want the WKTextInputWindowController inputContext to be involved in interpretKeyEvents.
2760
2761         * UIProcess/API/mac/WKView.mm:
2762         (-[WKView inputContext]):
2763
2764 2011-03-28  Anders Carlsson  <andersca@apple.com>
2765
2766         Reviewed by Sam Weinig.
2767
2768         CGImageRefs must hold a strong reference to underlying data
2769         https://bugs.webkit.org/show_bug.cgi?id=57263
2770         <rdar://problem/9146179>
2771
2772         Make paintBitmapContext use CGBitmapContextCreateImage, which creates a copy-on-write copy
2773         of the bitmap data. Also, add ShareableBitmap::makeCGImageCopy which does the same thing, and
2774         ShareableBitmap::makeCGImage in the cases where we know that the ShareableBitmap data will never change.
2775
2776         * Platform/cg/CGUtilities.cpp:
2777         (WebKit::paintImage):
2778         Factor image painting code out into a separate function.
2779
2780         (WebKit::paintBitmapContext):
2781         Call paintImage.
2782
2783         * Shared/API/c/cg/WKImageCG.cpp:
2784         (WKImagemakeCGImage):
2785         Use ShareableBitmap::makeCGImageCopy.
2786
2787         * Shared/ShareableBitmap.h:
2788         * Shared/cg/ShareableBitmapCG.cpp:
2789         (WebKit::ShareableBitmap::createGraphicsContext):
2790         (WebKit::ShareableBitmap::paint):
2791         (WebKit::ShareableBitmap::makeCGImageCopy):
2792         (WebKit::ShareableBitmap::makeCGImage):
2793         (WebKit::ShareableBitmap::releaseBitmapContextData):
2794         (WebKit::ShareableBitmap::releaseDataProviderData):
2795         Add makeCGImage and makeCGImageCopy.
2796
2797         * Shared/cg/WebCoreArgumentCodersCG.cpp:
2798         (CoreIPC::createImage):
2799         Use ShareableBitmap::makeCGImage.
2800         
2801         * UIProcess/API/mac/PageClientImpl.mm:
2802         (WebKit::PageClientImpl::setDragImage):
2803         Use ShareableBitmap::makeCGImage and plug a CGImageRef leak.
2804
2805 2011-03-28  Alexey Proskuryakov  <ap@apple.com>
2806
2807         Build fix.
2808
2809         * UIProcess/API/mac/WKView.mm: (-[WKView keyDown:]): It's not "event" in this function, it's
2810         "theEvent".
2811
2812 2011-03-28  Alexey Proskuryakov  <ap@apple.com>
2813
2814         Reviewed by Darin Adler.
2815
2816         https://bugs.webkit.org/show_bug.cgi?id=57260
2817         Clean up text input code a little
2818
2819         * UIProcess/API/mac/WKView.mm:
2820         (-[WKView doCommandBySelector:]): This NSTextInput protocol method lacked a LOG() call.
2821         (-[WKView keyDown:]): Added (possibly useless) event protection to match performKeyEquivalent:
2822         and also WebKit1.
2823
2824         * WebProcess/WebPage/mac/WebPageMac.mm: Removed an obsolete comment.
2825
2826 2011-03-28  Jeff Miller  <jeffm@apple.com>
2827
2828         Reviewed by Adam Roben.
2829
2830         ResourceError::certificate() should return a PCCERT_CONTEXT
2831         https://bugs.webkit.org/show_bug.cgi?id=57262
2832
2833         * Shared/win/PlatformCertificateInfo.cpp:
2834         (WebKit::PlatformCertificateInfo::PlatformCertificateInfo): Don't assert if no PCCERT_CONTEXT is specified.
2835         * Shared/win/WebCoreArgumentCodersWin.cpp:
2836         (CoreIPC::encodeResourceError): Removed unneeded code now that ResourceError::certificate() returns a PCCERT_CONTEXT.
2837
2838 2011-03-28  Jeff Miller  <jeffm@apple.com>
2839
2840         Rubber-stamped by Adam Roben.
2841
2842         Remove unused CFErrorRef.
2843
2844         * Shared/win/WebCoreArgumentCodersWin.cpp:
2845         (CoreIPC::encodeResourceError): Remove unused CFErrorRef.
2846
2847 2011-03-28  Jeff Miller  <jeffm@apple.com>
2848
2849         Reviewed by Adam Roben.
2850
2851         Include certificate when sending a WebCore::ResourceError to UI process on Windows
2852         https://bugs.webkit.org/show_bug.cgi?id=57195
2853         
2854         Add support for sending the certificate with the WebCore::ResourceError.
2855
2856         * Shared/win/WebCoreArgumentCodersWin.cpp:
2857         (CoreIPC::encodeResourceError): Encode certificate data.
2858         (CoreIPC::deallocCertContext): Added.
2859         (CoreIPC::createCertContextDeallocator): Added.
2860         (CoreIPC::copyCert): Added.
2861         (CoreIPC::decodeResourceError): Decode certificate data.
2862
2863 2011-03-27  Andy Estes  <aestes@apple.com>
2864
2865         Reviewed by Maciej Stachowiak.
2866
2867         Correctly get a plug-in's MIME type when it uses WebPluginMIMETypesFilename
2868         https://bugs.webkit.org/show_bug.cgi?id=57205
2869         
2870         If the plug-in's Info.plist uses WebPluginMIMETypesFilename to specify
2871         plug-in MIME types, WebKit has to check for a property list file in
2872         ~/Library/Preferences for the MIME type dictionary.
2873
2874         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2875         (WebKit::getMIMETypesFromPluginBundle): If the bundle's Info dictionary
2876         has the key WebPluginMIMETypesFilename, open the property list
2877         specified by that key's value and return the MIME type dictionary from
2878         there. Otherwise, return the MIME type dictionary specified by the key
2879         WebPluginMIMETypes.
2880         (WebKit::getPluginInfoFromPropertyLists): Call
2881         getMIMETypesFromPluginBundle().
2882
2883 2011-03-27  Jer Noble  <jer.noble@apple.com>
2884
2885         Reviewed by Maciej Stachowiak.
2886
2887         Full Screen: disable keyboard access by default
2888         https://bugs.webkit.org/show_bug.cgi?id=56684
2889
2890         Take into account whether keyboard access was requested when deciding whether full
2891         screen mode is supported.
2892
2893         * UIProcess/WebFullScreenManagerProxy.cpp:
2894         (WebKit::WebFullScreenManagerProxy::supportsFullScreen):
2895         * UIProcess/WebFullScreenManagerProxy.h:
2896         * UIProcess/WebFullScreenManagerProxy.messages.in:
2897         * WebProcess/FullScreen/WebFullScreenManager.cpp:
2898         (WebKit::WebFullScreenManager::supportsFullScreen):
2899         * WebProcess/FullScreen/WebFullScreenManager.h:
2900         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2901         (WebKit::WebChromeClient::supportsFullScreenForElement):
2902         * WebProcess/WebCoreSupport/WebChromeClient.h:
2903
2904 2011-03-27  Anders Carlsson  <andersca@apple.com>
2905
2906         Reviewed by Sam Weinig.
2907
2908         Dock doesn't come back after leaving fullscreen on Hulu
2909         https://bugs.webkit.org/show_bug.cgi?id=57189
2910         <rdar://problem/9192413>
2911
2912         Port some code over from the old WebKit1 plug-in host.
2913
2914         * PluginProcess/mac/PluginProcessShim.mm:
2915         (WebKit::shimShowMenuBar):
2916         (WebKit::shimHideMenuBar):
2917         (WebKit::shimIsMenuBarVisible):
2918
2919 2011-03-27  Anders Carlsson  <andersca@apple.com>
2920
2921         Reviewed by Sam Weinig.
2922
2923         Keep a strong reference to the connection to avoid crashes.
2924
2925         * Platform/CoreIPC/Connection.cpp:
2926
2927 2011-03-26  Jeff Miller  <jeffm@apple.com>
2928
2929         Reviewed by Sam Weinig.
2930
2931         WKErrorCopyCFError() doesn't actually return a copy of the CFErrorRef
2932         https://bugs.webkit.org/show_bug.cgi?id=57172
2933
2934         * Shared/API/c/cf/WKErrorCF.cpp:
2935         (WKErrorCopyCFError): Use RetainPtr<> and leakRef() to return a real copy.
2936
2937 2011-03-26  Maciej Stachowiak  <mjs@apple.com>
2938
2939         Revert inadvertently committed changes.
2940
2941         * WebProcess/com.apple.WebProcess.sb:
2942
2943 2011-03-26  Jer Noble  <jer.noble@apple.com>
2944
2945         Reviewed by Eric Carlson.
2946
2947         Enable the Full Screen API by default in WebKit/mac and WebKit2
2948         https://bugs.webkit.org/show_bug.cgi?id=56956
2949
2950         * Shared/WebPreferencesStore.h: Default the fullScreenEnabled preference to true.
2951
2952 2011-03-26  Jeff Miller  <jeffm@apple.com>
2953
2954         Reviewed by Steve Falkenburg.
2955
2956         Add PlatformCertificateInfo::PlatformCertificateInfo(PCCERT_CONTEXT) constructor on Windows
2957         https://bugs.webkit.org/show_bug.cgi?id=57152
2958         
2959         We're going to need to create a PlatformCertificateInfo with a single certificate on Windows to support client certificates.
2960         Also, stop relying on the fact that the Win32 API CertDuplicateCertificateContext() currently returns the same PCCERT_CONTEXT that you pass to it, since that may change in the future.
2961
2962         * Shared/win/PlatformCertificateInfo.cpp:
2963         (WebKit::PlatformCertificateInfo::PlatformCertificateInfo): Added PlatformCertificateInfo(PCCERT_CONTEXT) construtor. Use return value from CertDuplicateCertificateContext().
2964         (WebKit::PlatformCertificateInfo::operator=): Use return value from CertDuplicateCertificateContext().
2965         * Shared/win/PlatformCertificateInfo.h: Added PlatformCertificateInfo(PCCERT_CONTEXT) construtor.
2966
2967 2011-03-26  Anders Carlsson  <andersca@apple.com>
2968
2969         Reviewed by Sam Weinig.
2970
2971         Graphic corruption appeared with Silverlight contents while resizing window
2972         https://bugs.webkit.org/show_bug.cgi?id=57167
2973         <rdar://problem/9094052>
2974
2975         Pass DispatchMessageEvenWhenWaitingForSyncReply when sending GeometryDidChange messages since that will guarantee
2976         that those messages will be handled before PaintEntirePlugin messages which prevents the PaintEntirePlugin handler from
2977         painting into the wrong backing store.
2978
2979         * WebProcess/Plugins/PluginProxy.cpp:
2980         (WebKit::PluginProxy::geometryDidChange):
2981
2982 2011-03-26  Sam Weinig  <sam@webkit.org>
2983
2984         Reviewed by Anders Carlsson.
2985
2986         Web process considered unresponsive (SPOD shown) when displaying a JavaScript alert() as a result of a click
2987         <rdar://problem/9067557>
2988         https://bugs.webkit.org/show_bug.cgi?id=57166
2989
2990         * UIProcess/WebPageProxy.cpp:
2991         (WebKit::WebPageProxy::runJavaScriptAlert):
2992         (WebKit::WebPageProxy::runJavaScriptConfirm):
2993         (WebKit::WebPageProxy::runJavaScriptPrompt):
2994         Invalidate the responsiveness timer before calling out to the client.
2995
2996 2011-03-26  Anders Carlsson  <andersca@apple.com>
2997
2998         Reviewed by Sam Weinig.
2999
3000         ASSERTION FAILED: m_operationInProgress == NoOperation loading nytimes.com
3001         https://bugs.webkit.org/show_bug.cgi?id=57165
3002         <rdar://problem/9024311>
3003
3004         The assertion fired because during GC, the web process sends a synchronous NPObjectMessageReceiver::Deallocate
3005         message to the plug-in process. Since this is a synchronous message, the web process needs to process incoming synchronous
3006         messages. While waiting, we get an incoming PluginProxy::Evaluate message from the plug-in. This causes JavaScript to run
3007         during GC which is very bad.
3008
3009         The fix for this is to add a flag on the connection that will cause synchronous messages sent by the connection (in this case the
3010         plug-in process) to not be processed while the other side (the web process) is waiting for a synchronous reply _unless_ the connection
3011         is actually processing a synchronous message. (The last part is to avoid deadlocks).
3012
3013         Since the call to NPN_Evaluate by the plug-in (that ends up sending the PluginProxy::Evaluate message) comes from a run loop timer firing,
3014         it's OK to wait for it to be processed by the web process when it returns to the run loop.
3015
3016         * Platform/CoreIPC/Connection.cpp:
3017         (CoreIPC::Connection::Connection):
3018         Initialize m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage and m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount.
3019
3020         (CoreIPC::Connection::setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage):
3021         Set m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage.
3022
3023         (CoreIPC::Connection::sendMessage):
3024         Don't add the MessageID::DispatchMessageWhenWaitingForSyncReply flag when the right flags has been set on the connection, and it's not processing a synchronous message.
3025
3026         (CoreIPC::Connection::dispatchMessage):
3027         Increment and decrement m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount accordingly.
3028
3029         * PluginProcess/WebProcessConnection.cpp:
3030         (WebKit::WebProcessConnection::WebProcessConnection):
3031         Call setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage on the connection.
3032
3033 2011-03-26  Sam Weinig  <sam@webkit.org>
3034
3035         Rollout r82042 (If a user doesn't have a Database/LocalStorage directory, it can't be created (sandbox violations))
3036
3037         -[NSString stringByResolvingSymlinksInPath] does not do what we needed for paths within /private.
3038         This caused all SSL sites to stop working.
3039
3040         * WebProcess/mac/WebProcessMac.mm:
3041         (WebKit::appendSandboxParameterPath):
3042         (WebKit::initializeSandbox):
3043
3044 2011-03-26  Sam Weinig  <sam@webkit.org>
3045
3046         Reviewed by Anders Carlsson.
3047
3048         If a user doesn't have a Database/LocalStorage directory, it can't be created (sandbox violations)
3049         <rdar://problem/9127411>
3050         https://bugs.webkit.org/show_bug.cgi?id=57164
3051
3052         * WebProcess/mac/WebProcessMac.mm:
3053         (WebKit::appendSandboxParameterPath):
3054         (WebKit::initializeSandbox):
3055         Use -[NSString stringByResolvingSymlinksInPath] instead of realpath to ensure we can resolve
3056         symlinks even if the file/directory doesn't exist yet.
3057
3058 2011-03-26  Anders Carlsson  <andersca@apple.com>
3059
3060         Reviewed by Sam Weinig.
3061
3062         Factor processing of incoming sync replies out into processIncomingSyncReply
3063         https://bugs.webkit.org/show_bug.cgi?id=57161
3064
3065         * Platform/CoreIPC/Connection.cpp:
3066         (CoreIPC::Connection::sendSyncMessage):
3067         Pass DispatchMessageEvenWhenWaitingForSyncReply to sendMessage.
3068
3069         (CoreIPC::Connection::processIncomingSyncReply):
3070         Move code from processIncomingMessage to here.
3071
3072         (CoreIPC::Connection::processIncomingMessage):
3073         Call processIncomingSyncReply.
3074
3075 2011-03-26  Sam Weinig  <sam@webkit.org>
3076
3077         Reviewed by Anders Carlsson.
3078
3079         WebKit2: Assert in CoreIPC::typeFromCFTypeRef() when loading a site with an invalid certificate
3080         <rdar://problem/9188041>
3081         https://bugs.webkit.org/show_bug.cgi?id=57159
3082
3083         * Shared/cf/ArgumentCodersCF.cpp:
3084         (CoreIPC::typeFromCFTypeRef):
3085         (CoreIPC::encode):
3086         (CoreIPC::decode):
3087         * Shared/cf/ArgumentCodersCF.h:
3088         Add encoding/decoding for SecCertificateRef type.
3089
3090         * Shared/mac/PlatformCertificateInfo.mm:
3091         (WebKit::PlatformCertificateInfo::encode):
3092         (WebKit::PlatformCertificateInfo::decode):
3093         Use ArgumentCodersCF now that it knows how to encode/decode SecCertificateRefs.
3094
3095 2011-03-26  Anders Carlsson  <andersca@apple.com>
3096
3097         Reviewed by Sam Weinig.
3098
3099         Handle synchronous replies coming in out of order
3100         https://bugs.webkit.org/show_bug.cgi?id=57158
3101
3102         When processing an incoming reply, don't assume that it belongs to the last sent synchronous request.
3103         Instead, iterate over the m_pendingSyncReplies vector backwards looking for the corresponding request.
3104
3105         * Platform/CoreIPC/Connection.cpp:
3106         (CoreIPC::Connection::processIncomingMessage):
3107
3108 2011-03-26  Anders Carlsson  <andersca@apple.com>
3109
3110         Reviewed by Sam Weinig.
3111
3112         Fix a possible deadlock when two synchronous messages are sent at the same time
3113         https://bugs.webkit.org/show_bug.cgi?id=57155
3114
3115         Simplify code and fix a possible (although highly improbable) dead lock.
3116
3117         * Platform/CoreIPC/Connection.cpp:
3118         Make SyncMessageState atomically ref counted since it can be ref()'ed from the connection queue.
3119         Get rid of m_waitForSyncReplyCount and add m_didScheduleDispatchMessagesWork.
3120
3121         (CoreIPC::Connection::SyncMessageState::SyncMessageState):
3122         Initialize m_didScheduleDispatchMessagesWork to false.
3123
3124         (CoreIPC::Connection::SyncMessageState::processIncomingMessage):
3125         if m_didScheduleDispatchMessagesWork is false, schedule a call to dispatchMessageAndResetDidScheduleDispatchMessagesWork
3126         on the client run loop.
3127
3128         (CoreIPC::Connection::SyncMessageState::dispatchMessageAndResetDidScheduleDispatchMessagesWork):
3129         Dispatch messages and set m_didScheduleDispatchMessagesWork back to false.
3130
3131         (CoreIPC::Connection::sendSyncMessage):
3132         Remove calls to beginWaitForSyncReply and endWaitForSyncReply.
3133
3134 2011-03-25  Sam Weinig  <sam@webkit.org>
3135
3136         Reviewed by Adele Peterson.
3137
3138         WKPageLoadAlternateHTMLString doesn't re-spawn a dead WebProcess, but should
3139         <rdar://problem/9191493>
3140         https://bugs.webkit.org/show_bug.cgi?id=57134
3141
3142         Make all load functions respawn a dead WebProcess for consistency.
3143
3144         * UIProcess/WebPageProxy.cpp:
3145         (WebKit::WebPageProxy::loadHTMLString):
3146         Respawn a dead WebProcess.
3147
3148         (WebKit::WebPageProxy::loadAlternateHTMLString):
3149         Respawn a dead WebProcess.
3150
3151         (WebKit::WebPageProxy::loadPlainTextString):
3152         Respawn a dead WebProcess.
3153
3154         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
3155         * UIProcess/WebPageProxy.h:
3156         * UIProcess/WebPageProxy.messages.in:
3157         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3158         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
3159         * WebProcess/WebPage/WebPage.cpp:
3160         (WebKit::WebPage::loadAlternateHTMLString):
3161         Since we may no longer always have a main frame when calling WKPageLoadAlternateHTMLString,
3162         set the unreachable URL, if there is one, on provisional load.
3163
3164 2011-03-25  Anders Carlsson  <andersca@apple.com>
3165
3166         Reviewed by Sam Weinig.
3167
3168         PluginView's call to invalidateContentsAndWindow() in invalidateRect() is wrong for plug-ins which paint into compositing layers
3169         https://bugs.webkit.org/show_bug.cgi?id=57133
3170         <rdar://problem/9029442>
3171
3172         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
3173         (WebKit::NetscapePlugin::platformInvalidate):
3174         Return true under the Core Animation drawing model, since that prevents the plug-in from calling PluginController::invalidate.
3175
3176         * WebProcess/Plugins/PluginView.cpp:
3177         (WebKit::PluginView::invalidateRect):
3178         Don't call invalidateContentsAndWindow() if the plug-in has a Core Animation layer.
3179
3180 2011-03-25  Brady Eidson  <beidson@apple.com>
3181
3182         Reviewed by Sam Weinig.
3183
3184         <rdar://problem/8648311> and https://bugs.webkit.org/show_bug.cgi?id=56425
3185         WebKit2 IconDatabase and API
3186
3187         This gets a basic, usable API in place.
3188         Enhancements can come in other bugs as they're needed.
3189
3190         * UIProcess/API/C/WKIconDatabase.cpp:
3191         (WKIconDatabaseRetainIconForURL):
3192         (WKIconDatabaseReleaseIconForURL):
3193         (WKIconDatabaseEnableDatabaseCleanup):
3194         * UIProcess/API/C/WKIconDatabase.h:
3195         
3196         The first actual accessor for an "icon for a URL" is for a CGImageRef:
3197         * UIProcess/API/C/cg: Added.
3198         * UIProcess/API/C/cg/WKIconDatabaseCG.cpp: Added.
3199         (WKIconDatabaseGetCGImageForURL):
3200         * UIProcess/API/C/cg/WKIconDatabaseCG.h: Added.
3201         
3202         Expose relevant methods to support the above API:
3203         * UIProcess/WebIconDatabase.cpp:
3204         (WebKit::WebIconDatabase::WebIconDatabase): New IconDatabases will have cleanup disabled from the start,
3205           and require a single call to "enableDatabaseCleanup" to allow cleanup.
3206         (WebKit::WebIconDatabase::setDatabasePath):
3207         (WebKit::WebIconDatabase::enableDatabaseCleanup):
3208         (WebKit::WebIconDatabase::imageForPageURL):
3209         * UIProcess/WebIconDatabase.h:
3210         
3211         Project file stuff:
3212         * WebKit2.xcodeproj/project.pbxproj:
3213         * win/WebKit2.vcproj:
3214
3215 2011-03-25  Jeff Miller  <jeffm@apple.com>
3216
3217         Reviewed by Darin Adler.
3218
3219         Add CoreIPC::encodeResourceError() and CoreIPC::decodeResourceError() for all platforms
3220         https://bugs.webkit.org/show_bug.cgi?id=57125
3221         
3222         Currently, these are only implemented on the Mac, but we're going to need them for Windows as well, so we might as well make them always platform-specific.
3223         In this patch, just replicate the existing common non-Mac implementation in WebCoreArgumentCoders.h to platform-specific files.
3224
3225         * Shared/WebCoreArgumentCoders.h: Move non-Mac implementations of encodeResourceError() and decodeResourceError() to common files.
3226         * Shared/gtk/WebCoreArgumentCodersGtk.cpp:
3227         (CoreIPC::encodeResourceError): Added.
3228         (CoreIPC::decodeResourceError): Added.
3229         * Shared/qt/WebCoreArgumentCodersQt.cpp:
3230         (CoreIPC::encodeResourceError): Added.
3231         (CoreIPC::decodeResourceError): Added.
3232         * Shared/win/WebCoreArgumentCodersWin.cpp:
3233         (CoreIPC::encodeResourceError): Added.
3234         (CoreIPC::decodeResourceError): Added.
3235
3236 2011-03-25  Andy Estes  <aestes@apple.com>
3237
3238         Reviewed by Adele Peterson.
3239
3240         REGRESSION (r70748): latest nightly builds kills AC_QuickTime.js
3241         https://bugs.webkit.org/show_bug.cgi?id=49016
3242
3243         Update objectContentType() implementation to handle the
3244         shouldPreferPlugInsForImages flag.
3245
3246         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3247         (WebKit::WebFrameLoaderClient::objectContentType):
3248         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3249
3250 2011-03-25  Brent Fulgham  <bfulgham@webkit.org>
3251
3252         Unreviewed build correction.
3253
3254         Add stubs for WK2 cookie handling with cURL.
3255
3256         * WebProcess/Cookies/curl: Added.
3257         * WebProcess/Cookies/curl/WebCookieManagerCurl.cpp: Added.
3258         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
3259         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
3260         * win/WebKit2.vcproj:
3261
3262 2011-03-25  Steve Falkenburg  <sfalken@apple.com>
3263
3264         Reviewed by Brian Weinstein.
3265
3266         Microsoft Windows Presentation Foundation (WPF) plug-in complains about missing xpcom.dll
3267         https://bugs.webkit.org/show_bug.cgi?id=57119
3268         <rdar://problem/9054148>
3269
3270         This plug-in from Microsoft links against xpcom.dll, which is a Firefox-specific DLL
3271         not available in WebKit. The plug-in is fairly widespread, since it was included in
3272         a Windows Update push at one point.
3273
3274         * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
3275         (WebKit::PluginInfoStore::shouldUsePlugin): Blacklist npwpf.dll.
3276
3277 2011-03-25  Jessie Berlin  <jberlin@apple.com>
3278
3279         Reviewed by Anders Carlsson.
3280
3281         WebKit2: Need to be able to set and get the Cookie Storage Policy.
3282         https://bugs.webkit.org/show_bug.cgi?id=50780
3283
3284         Part 2: Make it possible to set the initial policy on Windows.
3285
3286         In WebKit1, we read the initial policy on Windows from WebPreferences at startup.
3287         Since that is not possible in WebKit2, make it possible to specify the initial policy
3288         as a creation parameter to the WebProcess.
3289
3290         * Shared/WebProcessCreationParameters.cpp:
3291         (WebKit::WebProcessCreationParameters::encode):
3292         Encode initialHTTPCookieAcceptPolicy on Windows.
3293         (WebKit::WebProcessCreationParameters::decode):
3294         Decode initialHTTPCookieAcceptPolicy on Windows.
3295         * Shared/WebProcessCreationParameters.h:
3296
3297         * UIProcess/API/C/win/WKContextPrivateWin.h:
3298         * UIProcess/API/C/win/WKContextWin.cpp:
3299         (WKContextSetInitialHTTPCookieAcceptPolicy):
3300         Call through to WebContext.
3301
3302         * UIProcess/WebContext.cpp:
3303         (WebKit::WebContext::WebContext):
3304         Give the initial policy a default of "Always".
3305         * UIProcess/WebContext.h:
3306         (WebKit::WebContext::setInitialHTTPCookieAcceptPolicy):
3307         * UIProcess/win/WebContextWin.cpp:
3308         (WebKit::WebContext::platformInitializeWebProcess):
3309         Set the initial policy on Windows.
3310
3311         * WebProcess/Cookies/WebCookieManager.h:
3312         Make setHTTPCookieAcceptPolicy public so that it can be called from WebProcessWin.
3313
3314         * WebProcess/win/WebProcessWin.cpp:
3315         (WebKit::WebProcess::platformInitializeWebProcess):
3316         Tell the WebCookieManager about the initial policy.
3317
3318 2011-03-25  Jessie Berlin  <jberlin@apple.com>
3319
3320         Reviewed by Sam Weinig.
3321
3322         WebKit2: Need to be able to set and get the Cookie Storage Policy.
3323         https://bugs.webkit.org/show_bug.cgi?id=50780
3324
3325         * Shared/HTTPCookieAcceptPolicy.h: Added.
3326
3327         * UIProcess/API/C/WKAPICast.h:
3328         (WebKit::toHTTPCookieAcceptPolicy):
3329         (WebKit::toAPI):
3330
3331         * UIProcess/API/C/WKCookieManager.cpp:
3332         (WKCookieManagerSetHTTPCookieAcceptPolicy):
3333         Call through to WebCookieManagerProxy.
3334         (WKCookieManagerGetHTTPCookieAcceptPolicy):
3335         Ditto.
3336         * UIProcess/API/C/WKCookieManager.h:
3337
3338         * UIProcess/WebCookieManagerProxy.cpp:
3339         (WebKit::WebCookieManagerProxy::invalidate):
3340         Invalidate the get http cookie accept policy callbacks.
3341         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
3342         Send a message to the Web Process with the new value.
3343         (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
3344         Keep track of the callback and send a message to the Web Process.
3345         (WebKit::WebCookieManagerProxy::didGetHTTPCookieAcceptPolicy):
3346         Invoke the callback.
3347         * UIProcess/mac/WebCookieManagerProxyMac.mm: Added.
3348         (WebKit::WebCookieManagerProxy::persistHTTPCookieAcceptPolicy):
3349         On Mac, also set the policy in the UI Process because the sandboxed Web Process cannot
3350         persist the policy.
3351         * UIProcess/WebCookieManagerProxy.h:
3352         * UIProcess/WebCookieManagerProxy.messages.in:
3353
3354         * WebKit2.pri:
3355         * WebKit2.pro:
3356         * WebKit2.xcodeproj/project.pbxproj:
3357         * win/WebKit2.vcproj:
3358         * win/WebKit2Common.vsprops:
3359
3360         * WebProcess/Cookies/WebCookieManager.cpp:
3361         (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
3362         Call platformSetHTTPCookieAcceptPolicy.
3363         (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy):
3364         Send the result of platformGetHTTPCookieAcceptPolicy to the UI Process.
3365         * WebProcess/Cookies/WebCookieManager.h:
3366         * WebProcess/Cookies/WebCookieManager.messages.in:
3367
3368         * WebProcess/Cookies/cf: Added.
3369         * WebProcess/Cookies/cf/WebCookieManagerCFNet.cpp: Added.
3370         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
3371         Set the policy on both the default cookie storage and any Private Browsing cookie storage.
3372         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
3373         * WebProcess/Cookies/mac: Added.
3374         * WebProcess/Cookies/mac/WebCookieManagerMac.mm: Added.
3375         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
3376         Set the policy on the default cookie storage and add a FIXME to set it on any Private
3377         Browsing cookie storage.
3378         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
3379
3380         * WebProcess/Cookies/gtk: Added.
3381         * WebProcess/Cookies/gtk/WebCookieManagerGtk.cpp: Added.
3382         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
3383         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
3384         * WebProcess/Cookies/qt: Added.
3385         * WebProcess/Cookies/qt/WebCookieManagerQt.cpp: Added.
3386         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
3387         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
3388
3389 2011-03-25  Brian Weinstein  <bweinstein@apple.com>
3390
3391         Reviewed by Alexey Proskuryakov.
3392
3393         REGRESSION(r79227): CFURLCache not initialized correctly in WebKit2
3394         https://bugs.webkit.org/show_bug.cgi?id=57109
3395         <rdar://problem/9184590>
3396         
3397         Check for a trailing Windows path separator, not a Unix path separator.
3398
3399         * UIProcess/win/WebContextWin.cpp:
3400         (WebKit::WebContext::platformInitializeWebProcess):
3401
3402 2011-03-25  Benjamin Poulain  <benjamin.poulain@nokia.com>
3403
3404         Reviewed by Andreas Kling.
3405
3406         [Qt] QtWebKit will not compile with QT_ASCII_CAST_WARNINGS enabled
3407         https://bugs.webkit.org/show_bug.cgi?id=57087
3408
3409         Use explicit conversion for string to avoid depending on the default codec
3410         installed by the user code.
3411
3412         * Platform/qt/SharedMemoryQt.cpp:
3413         (WebKit::SharedMemory::create):
3414         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
3415         (WebKit::initializeGTK):
3416         * UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp:
3417         (tst_QGraphicsWKView::loadEmptyPage):
3418         (tst_QGraphicsWKView::loadEmptyUrl):
3419         * UIProcess/API/qt/tests/qwkpage/tst_qwkpage.cpp:
3420         (tst_QWKPage::loadEmptyUrl):
3421         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
3422         (WebKit::ProcessLauncher::launchProcess):
3423         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
3424         (WebKit::getPluginDisplay):
3425         * WebProcess/qt/WebProcessMainQt.cpp:
3426         (WebKit::EnvHttpProxyFactory::initializeFromEnvironment):
3427         (WebKit::WebProcessMainQt):
3428
3429 2011-03-25  Brent Fulgham  <bfulgham@webkit.org>
3430
3431         Correct project file missing $(WebKitVSPropsRedirectionDir)s
3432         after r81924.
3433
3434         * win/WebKit2.vcproj: Restore lost $(WebKitVSPropsRedirectionDir)
3435
3436 2011-03-25  Alejandro G. Castro  <alex@igalia.com>
3437
3438         Reviewed by Martin Robinson.
3439
3440         [WK2] Consider .c files in the generate-forwarding-headers script
3441         https://bugs.webkit.org/show_bug.cgi?id=56680
3442
3443         * Scripts/generate-forwarding-headers.pl:
3444
3445 2011-03-24  Sheriff Bot  <webkit.review.bot@gmail.com>
3446
3447         Unreviewed, rolling out r81916 and r81917.
3448         http://trac.webkit.org/changeset/81916
3449         http://trac.webkit.org/changeset/81917
3450         https://bugs.webkit.org/show_bug.cgi?id=57071
3451
3452         broke a test on platforms that do not have QuickTime installed
3453         (Requested by estes on #webkit).
3454
3455         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3456         (WebKit::WebFrameLoaderClient::objectContentType):
3457         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3458
3459 2011-03-24  Brady Eidson  <beidson@apple.com>
3460
3461         Reviewed by Darin Adler.
3462
3463         https://bugs.webkit.org/show_bug.cgi?id=57069
3464         Add WKIconDatabase api to the project files, and expose accessor on WKContext.
3465
3466         Project file stuffs:
3467         * GNUmakefile.am:
3468         * WebKit2.xcodeproj/project.pbxproj:
3469         * win/WebKit2.vcproj:
3470
3471         * Shared/API/c/WKBase.h:
3472         * UIProcess/API/C/WKAPICast.h:
3473
3474         * UIProcess/API/C/WKContext.cpp:
3475         (WKContextGetIconDatabase):
3476         * UIProcess/API/C/WKContext.h:
3477
3478         * UIProcess/API/C/WKIconDatabase.cpp: Added.
3479         (WKIconDatabaseGetTypeID):
3480         * UIProcess/API/C/WKIconDatabase.h: Added.
3481
3482         * UIProcess/WebContext.h:
3483         (WebKit::WebContext::iconDatabase):
3484
3485 2011-03-24  Brent Fulgham  <bfulgham@webkit.org>
3486
3487         Build correction.
3488
3489         Disable the CA Layer stuff when building with Cairo.
3490
3491         * win/WebKit2.vcproj:
3492
3493 2011-03-24  Brady Eidson  <beidson@apple.com>
3494
3495         Reviewed by Sam Weinig.
3496
3497         https://bugs.webkit.org/show_bug.cgi?id=57058
3498         Hookup the UIProcess WebIconDatabase to a WebCore::IconDatabase as its implementation
3499
3500         * UIProcess/WebIconDatabase.cpp:
3501         (WebKit::WebIconDatabase::WebIconDatabase):
3502         (WebKit::WebIconDatabase::setDatabasePath): Create a new WebCore::IconDatabase and open it to this path.
3503         (WebKit::WebIconDatabase::retainIconForPageURL): Actually retain the url, using the impl.
3504         (WebKit::WebIconDatabase::releaseIconForPageURL): Actually release the url, using the impl.
3505         (WebKit::WebIconDatabase::setIconURLForPageURL): Actually set the url, using the impl.
3506         (WebKit::WebIconDatabase::setIconDataForIconURL): Actually set the data, using the impl.
3507         (WebKit::WebIconDatabase::getLoadDecisionForIconURL): Actually ask for a load decision to call back with.
3508         (WebKit::WebIconDatabase::performImport):
3509         (WebKit::WebIconDatabase::didImportIconURLForPageURL):
3510         (WebKit::WebIconDatabase::didImportIconDataForPageURL):
3511         (WebKit::WebIconDatabase::didChangeIconForPageURL):
3512         (WebKit::WebIconDatabase::didRemoveAllIcons):
3513         (WebKit::WebIconDatabase::didFinishURLImport): Notify all the pending callbacks what their load decisions
3514           are now that they're available.
3515         * UIProcess/WebIconDatabase.h:
3516
3517         Add an IconDatabase logging channel:
3518         * Platform/Logging.cpp:
3519         (WebKit::initializeLogChannelsIfNecessary):
3520         * Platform/Logging.h:
3521
3522         * UIProcess/WebContext.cpp:
3523         (WebKit::WebContext::setIconDatabasePath): Pass the new path on to the WebIconDatabase, possibly
3524           opening it.
3525         * UIProcess/WebContext.h:
3526
3527 2011-03-24  Andy Estes  <aestes@apple.com>
3528
3529         Reviewed by Darin Adler.
3530
3531         REGRESSION (r70748): latest nightly builds kills AC_QuickTime.js
3532         https://bugs.webkit.org/show_bug.cgi?id=49016
3533
3534         Update objectContentType() implementation to handle the
3535         shouldPreferPlugInsForImages flag.
3536
3537         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3538         (WebKit::WebFrameLoaderClient::objectContentType):
3539         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3540
3541 2011-03-24  Adam Roben  <aroben@apple.com>
3542
3543         Start compiling LayerTreeHostCA on Windows
3544
3545         Fixes <http://webkit.org/b/57060> WebKit2.vcproj should compile LayerTreeHostCA
3546
3547         Reviewed by Anders Carlsson.
3548
3549         * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp: Added.
3550         (WebKit::LayerTreeHostCA::platformInitialize):
3551         (WebKit::LayerTreeHostCA::scheduleLayerFlush):
3552         (WebKit::LayerTreeHostCA::platformInvalidate):
3553         (WebKit::LayerTreeHostCA::platformSizeDidChange):
3554         (WebKit::LayerTreeHostCA::platformForceRepaint):
3555         (WebKit::LayerTreeHostCA::platformDidPerformScheduledLayerFlush):
3556         Stubbed out.
3557
3558         * win/WebKit2.vcproj: Added new files. Let VS reorder existing files.
3559
3560         * win/WebKit2Apple.vsprops: Added WebProcess\WebPage\ca to the include path.
3561
3562 2011-03-24  Jer Noble  <jer.noble@apple.com>
3563
3564         Unreviewed build fix.
3565
3566         Remove reference to LayerTreeHostMac.h from WebFullScreenManagerMac.mm.
3567
3568         * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm:
3569
3570 2011-03-24  Adam Roben  <aroben@apple.com>
3571
3572         Split Mac-specific parts of LayerTreeHostCA into LayerTreeHostCAMac.mm
3573
3574         Fixes <http://webkit.org/b/57046> LayerTreeHostMac's code should be shareable with Windows
3575
3576         Reviewed by Anders Carlsson.
3577
3578         * WebKit2.xcodeproj/project.pbxproj:
3579
3580         * WebProcess/WebPage/ca/LayerTreeHostCA.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.mm.
3581         (WebKit::LayerTreeHostCA::LayerTreeHostCA): Moved some Mac-specific code to
3582         LayerTreeHostCAMac.mm.
3583         (WebKit::LayerTreeHostCA::~LayerTreeHostCA): Wrapped some Mac-specific code in
3584         PLATFORM(MAC).
3585
3586         (WebKit::LayerTreeHostCA::invalidate):
3587         (WebKit::LayerTreeHostCA::sizeDidChange):
3588         (WebKit::LayerTreeHostCA::forceRepaint):
3589         Moved some Mac-specific code to LayerTreeHostCAMac.mm.
3590
3591         (WebKit::LayerTreeHostCA::performScheduledLayerFlush): Renamed from
3592         flushPendingLayerChangesRunLoopObserverCallback. Moved some code from here...
3593         (WebKit::LayerTreeHostCA::didPerformScheduledLayerFlush): ...to here. Moved some
3594         Mac-specific code to LayerTreeHostCAMac.mm.
3595
3596         * WebProcess/WebPage/ca/LayerTreeHostCA.h: Added new functions, wrapped some Mac-specific
3597         declarations in PLATFORM(MAC).
3598
3599         * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm: Added.
3600         (WebKit::LayerTreeHostCA::platformInitialize):
3601         (WebKit::LayerTreeHostCA::scheduleLayerFlush):
3602         (WebKit::LayerTreeHostCA::platformInvalidate):
3603         (WebKit::LayerTreeHostCA::platformSizeDidChange):
3604         (WebKit::LayerTreeHostCA::platformForceRepaint):
3605         (WebKit::LayerTreeHostCA::flushPendingLayerChangesRunLoopObserverCallback):
3606         (WebKit::LayerTreeHostCA::platformDidPerformScheduledLayerFlush):
3607         Code was extracted from LayerTreeHostCA.cpp.
3608
3609 2011-03-24  Adam Roben  <aroben@apple.com>
3610
3611         Rename LayerTreeHostMac to LayerTreeHostCA
3612
3613         This is the first step toward sharing code with Windows.
3614
3615         Fixes <http://webkit.org/b/57051>.
3616
3617         Reviewed by Anders Carlsson.
3618
3619         * WebKit2.xcodeproj/project.pbxproj:
3620         * WebProcess/WebPage/LayerTreeHost.cpp:
3621         (WebKit::LayerTreeHost::create):
3622         Updated for rename.
3623
3624         * WebProcess/WebPage/ca/LayerTreeHostCA.h: Renamed from Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.h.
3625         * WebProcess/WebPage/ca/LayerTreeHostCA.mm: Renamed from Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.mm.
3626
3627 2011-03-17  Jer Noble  <jer.noble@apple.com>
3628
3629         Reviewed by Maciej Stachowiak.
3630
3631         WebKit2: Cancelling full screen early leaves full screen window up.
3632         https://bugs.webkit.org/show_bug.cgi?id=56589
3633
3634         No new tests, as WebKitTestRunner does not currently support the new Full Screen API.
3635
3636         Notify the UIProcess when it needs to tear down its layer hosting view, turn off
3637         the background layer when not in accelerated rendering mode and don't swap out 
3638         the web view unnecessarily 
3639
3640         * UIProcess/mac/WKFullScreenWindowController.mm:
3641         (-[WKFullScreenWindowController beganExitFullScreenAnimation]): Check before swapping _webView.
3642         (-[WKFullScreenWindowController enterAcceleratedCompositingMode:]): Add the _layerHostingView
3643             to the full screen window's animationView, not its contentsView.
3644         (-[WKFullScreenWindowController exitAcceleratedCompositingMode]): Hide the background layer.
3645         * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm:
3646         (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): If given a null rootLayer, tell
3647             the client to exit accelerated mode.
3648
3649 2011-03-24  Enrica Casucci  <enrica@apple.com>
3650
3651         Reviewed by Alexey Proskuryakov.
3652
3653         WebKit2:Services menu item to convert selected Simplified/Traditional Chinese Text is not working.
3654         https://bugs.webkit.org/show_bug.cgi?id=56975
3655         <rdar://problem/8915066>
3656         
3657         Adding missing entry point to support Mac OS X services in WebKit2.
3658
3659         * UIProcess/API/mac/WKView.mm:
3660         (-[WKView readSelectionFromPasteboard:]): Added.
3661         * UIProcess/WebPageProxy.h:
3662         * UIProcess/mac/WebPageProxyMac.mm:
3663         (WebKit::WebPageProxy::readSelectionFromPasteboard): Added.
3664         * WebProcess/WebPage/WebPage.h:
3665         * WebProcess/WebPage/WebPage.messages.in: Added synchronous
3666         message.
3667         * WebProcess/WebPage/mac/WebPageMac.mm:
3668         (WebKit::WebPage::readSelectionFromPasteboard): Added.
3669
3670 2011-03-24  Jia Pu  <jpu@apple.com>
3671
3672         Reviewed by Darin Adler.
3673
3674         Dismissed reversion suggestion is incorrectly learned.
3675         https://bugs.webkit.org/show_bug.cgi?id=57039
3676
3677         CorrectionPanel should always use [NSSpellChecker dismissCorrectionBubbleForView].
3678         [NSSpellChecker cancelCorrectionBubbleForView] is reserved for situation where correction panel
3679         is dismissed explicitly by ESC key or clicking the dimiss button. Misusing these causes
3680         incorrect automatic learning.
3681
3682         * UIProcess/mac/CorrectionPanel.mm:
3683         (WebKit::CorrectionPanel::dismissInternal):
3684
3685 2011-03-24  Brian Weinstein  <bweinstein@apple.com>
3686
3687         Reviewed by Adam Roben.
3688
3689         WebKit2: Add Trackpoint driver hack to support IBM trackpads
3690         https://bugs.webkit.org/show_bug.cgi?id=49830
3691         <rdar://problem/8705951>
3692
3693         Copy code from WebKit1 to WebKit2 to handle initializing fake scrollbars so 
3694         IBM machines with a trackpad send us WM_VSCROLL and WM_HSCROLL messages.
3695
3696         Listen for the WM_VSCROLL and WM_HSCROLL messages, and turn the values into
3697         ScrollDirection and ScrollGranularity, and send a scroll command to the
3698         WebProcess.
3699
3700         * UIProcess/WebPageProxy.cpp:
3701         (WebKit::WebPageProxy::scrollBy): Send a message to the WebProcess.
3702         * UIProcess/WebPageProxy.h:
3703         * UIProcess/win/WebView.cpp:
3704         (WebKit::WebView::wndProc): Add WM_VSCROLL and WM_HSCROLL message handling.
3705         (WebKit::WebView::initialize): Call shouldInitializeTrackPointHack.
3706         (WebKit::WebView::onHorizontalScroll): Turn wParam into a ScrollDirection and ScrollGranularity. 
3707         (WebKit::WebView::onVerticalScroll): Ditto.
3708         (WebKit::WebView::shouldInitializeTrackPointHack): Check the registry for keys that indicate
3709             the machine has a IBM Trackpoint driver.
3710         * UIProcess/win/WebView.h:
3711         * WebProcess/WebPage/WebPage.cpp:
3712         (WebKit::WebPage::scrollBy): Call scroll method.
3713         (WebKit::WebPage::scroll): Moved from WebPageMac and WebPageWin.
3714         (WebKit::WebPage::logicalScroll): Ditto.
3715         * WebProcess/WebPage/WebPage.h:
3716         * WebProcess/WebPage/WebPage.messages.in: Add a new scrollBy message. 
3717         * WebProcess/WebPage/mac/WebPageMac.mm: Remove scroll and logicalScroll, they are now in WebPage.cpp.
3718         * WebProcess/WebPage/win/WebPageWin.cpp: Ditto.
3719
3720 2011-03-24  Sam Weinig  <sam@webkit.org>
3721
3722         Reviewed by Darin Adler.
3723
3724         Dictionary text extraction is not correctly detecting word boundaries on bing.com
3725         <rdar://problem/9078569>
3726         https://bugs.webkit.org/show_bug.cgi?id=56995
3727
3728         * Shared/DictionaryPopupInfo.cpp:
3729         (WebKit::DictionaryPopupInfo::encode):
3730         (WebKit::DictionaryPopupInfo::decode):
3731         * Shared/DictionaryPopupInfo.h:
3732         Add options dictionary.
3733
3734         * UIProcess/API/mac/PageClientImpl.mm:
3735         (WebKit::PageClientImpl::didPerformDictionaryLookup):
3736         Add path that can pass options through.
3737
3738         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
3739         (WebKit::WebContextMenuClient::lookUpInDictionary):
3740         Use the new performDictionaryLookupForSelection which can extract context
3741         if supported.
3742
3743         * WebProcess/WebPage/WebPage.h:
3744         * WebProcess/WebPage/mac/WebPageMac.mm:
3745         (WebKit::characterRangeAtPositionForPoint):
3746         (WebKit::characterRangeAtPoint):
3747         Split functionality out of characterRangeAtPoint and into 
3748         characterRangeAtPositionForPoint to avoid doing duplicate work 
3749         if you already have the position.
3750
3751         (WebKit::isPositionInRange):
3752         (WebKit::shouldUseSelection):
3753         Add predicate to determine if we should use the selection instead
3754         of expanding to find the word we are over.
3755
3756         (WebKit::WebPage::performDictionaryLookupAtLocation):
3757         If available, use the surrounding paragraph as context to get better extraction
3758         and to get lexicographical information about the word. Also, clean up and use 
3759         editing APIs to make the code more concise and understandable.
3760
3761         (WebKit::WebPage::performDictionaryLookupForSelection):
3762         Use similar logic as in performDictionaryLookupAtLocation to extract additional
3763         details from a selection for use in the dictionary popup.
3764
3765         (WebKit::WebPage::performDictionaryLookupForRange):
3766         Pass options to WebProcess if available.
3767
3768 2011-03-24  Jon Lee  <jonlee@apple.com>
3769
3770         Reviewed by Darin Adler.
3771
3772         WebKit2: Tabbing from the last focused field to a non-webpage element leaves the selection in a weird state
3773         <rdar://problem/8553962>
3774
3775         * WebProcess/WebPage/WebPage.cpp:
3776         (WebKit::WebPage::setFocused): When the page loses focus, clear out any selection in the frame
3777
3778 2011-03-24  Brian Weinstein  <bweinstein@apple.com>
3779
3780         Rubber-stamped by Sam Weinig.
3781
3782         Fix a typo in the VK_LEFT case of performDefaultBehaviorForKeyEvent.
3783
3784         * WebProcess/WebPage/mac/WebPageMac.mm:
3785         (WebKit::WebPage::performDefaultBehaviorForKeyEvent): It should be a logical or,
3786             not a bitwise or.
3787
3788 2011-03-24  Jeff Miller  <jeffm@apple.com>
3789
3790         Fix typo - USE(CF_NETWORK) should be USE(CFNETWORK).
3791
3792         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:
3793         (WebKit::InjectedBundle::setHostAllowsAnyHTTPSCertificate): USE(CF_NETWORK) should be USE(CFNETWORK)
3794
3795 2011-03-23  Jia Pu  <jpu@apple.com>
3796
3797         Reviewed by Darin Adler.
3798
3799         Hook up new AppKit autocorrection UI with WK2.
3800         https://bugs.webkit.org/show_bug.cgi?id=56055
3801         <rdar://problem/8947463>
3802
3803         Please see WebCore/ChangeLog for detail.
3804
3805         The calls to AppKit are implemented in PageClientImpl. Other changes are necessary for the
3806         plumbing work.
3807
3808         * UIProcess/API/mac/PageClientImpl.h:
3809         * UIProcess/API/mac/PageClientImpl.mm:
3810         (WebKit::PageClientImpl::showCorrectionPanel):
3811         (WebKit::PageClientImpl::dismissCorrectionPanel):
3812         (WebKit::PageClientImpl::dismissCorrectionPanelSoon):
3813         (WebKit::PageClientImpl::recordAutocorrectionResponse):
3814         * UIProcess/API/mac/WKView.mm:
3815         (-[WKView spellCheckerDocumentTag]):
3816         (-[WKView handleCorrectionPanelResult:]):
3817         * UIProcess/API/mac/WKViewPrivate.h:
3818         * UIProcess/PageClient.h:
3819         * UIProcess/WebPageProxy.cpp:
3820         (WebKit::WebPageProxy::didCommitLoadForFrame):
3821         (WebKit::WebPageProxy::showCorrectionPanel):
3822         (WebKit::WebPageProxy::dismissCorrectionPanel):
3823         (WebKit::WebPageProxy::dismissCorrectionPanelSoon):
3824         (WebKit::WebPageProxy::recordAutocorrectionResponse):
3825         (WebKit::WebPageProxy::handleCorrectionPanelResult):
3826         * UIProcess/WebPageProxy.h:
3827         * UIProcess/WebPageProxy.messages.in:
3828         * UIProcess/mac/CorrectionPanel.h: Added.
3829         (WebKit::CorrectionPanel::isShowing):
3830         * UIProcess/mac/CorrectionPanel.mm: Added.
3831         (correctionBubbleType):
3832         (WebKit::CorrectionPanel::CorrectionPanel):
3833         (WebKit::CorrectionPanel::~CorrectionPanel):
3834         (WebKit::CorrectionPanel::show):
3835         (WebKit::CorrectionPanel::dismiss):
3836         (WebKit::CorrectionPanel::dismissSoon):
3837         (WebKit::CorrectionPanel::dismissInternal):
3838         (WebKit::CorrectionPanel::recordAutocorrectionResponse):
3839         * WebKit2.xcodeproj/project.pbxproj:
3840         * WebProcess/WebCoreSupport/WebEditorClient.h:
3841         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
3842         (WebKit::WebEditorClient::showCorrectionPanel):
3843         (WebKit::WebEditorClient::dismissCorrectionPanel):
3844         (WebKit::WebEditorClient::dismissCorrectionPanelSoon):
3845         (WebKit::WebEditorClient::recordAutocorrectionResponse):
3846         * WebProcess/WebPage/WebPage.cpp:
3847         (WebKit::WebPage::handleCorrectionPanelResult):
3848         * WebProcess/WebPage/WebPage.h:
3849         * WebProcess/WebPage/WebPage.messages.in:
3850
3851 2011-03-23  Brian Weinstein  <bweinstein@apple.com>
3852
3853         Reviewed by Maciej Stachowiak.
3854
3855         WebKit2: Need API to manage the Media Cache
3856         https://bugs.webkit.org/show_bug.cgi?id=56878
3857         <rdar://problem/9082503>
3858
3859         Call through to HTMLMediaElement functions to manage the WebCore media cache.
3860
3861         * WebProcess/MediaCache/WebMediaCacheManager.cpp:
3862         (WebKit::WebMediaCacheManager::getHostnamesWithMediaCache):
3863         (WebKit::WebMediaCacheManager::clearCacheForHostname):
3864         (WebKit::WebMediaCacheManager::clearCacheForAllHostnames):
3865
3866 2011-03-23  Jeff Miller  <jeffm@apple.com>
3867
3868         Reviewed by Darin Adler.
3869
3870         Add WKBundleSetHostAllowsAnyHTTPSCertificate() for Windows
3871         https://bugs.webkit.org/show_bug.cgi?id=56972
3872         
3873         This is the WebKit2 equivalent to the WebKit1 API IWebMutableURLRequest::setAllowsAnyHTTPSCertificate().
3874
3875         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3876         (WKBundleSetHostAllowsAnyHTTPSCertificate): Added.
3877         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: Added WKBundleSetHostAllowsAnyHTTPSCertificate().
3878         * WebProcess/InjectedBundle/InjectedBundle.h: Added setHostAllowsAnyHTTPSCertificate().
3879         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
3880         (WebKit::InjectedBundle::setHostAllowsAnyHTTPSCertificate): Added, should never be called.
3881         * WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp:
3882         (WebKit::InjectedBundle::setHostAllowsAnyHTTPSCertificate): Added, should never be called.
3883         * WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp:
3884         (WebKit::InjectedBundle::setHostAllowsAnyHTTPSCertificate): Added, should never be called.
3885         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:
3886         (WebKit::InjectedBundle::setHostAllowsAnyHTTPSCertificate): Added.
3887
3888 2011-03-23  Sam Weinig  <sam@webkit.org>
3889
3890         Reviewed by Anders Carlsson.
3891
3892         Roll out r81593 Need WebKit2 API for creating a page with a specific main frame name
3893
3894         This API is not necessary.
3895
3896         * Shared/WebPageCreationParameters.cpp:
3897         (WebKit::WebPageCreationParameters::encode):
3898         (WebKit::WebPageCreationParameters::decode):
3899         * Shared/WebPageCreationParameters.h:
3900         * UIProcess/API/mac/WKView.h:
3901         * UIProcess/API/mac/WKView.mm:
3902         (-[WKView initWithFrame:]):
3903         (-[WKView initWithFrame:contextRef:]):
3904         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
3905         * UIProcess/WebPageProxy.cpp:
3906         (WebKit::WebPageProxy::creationParameters):
3907         * UIProcess/WebPageProxy.h:
3908         * WebProcess/WebPage/WebFrame.cpp:
3909         (WebKit::WebFrame::createMainFrame):
3910         * WebProcess/WebPage/WebFrame.h:
3911         * WebProcess/WebPage/WebPage.cpp:
3912         (WebKit::WebPage::WebPage):
3913
3914 2011-03-23  Balazs Kelemen  <kbalazs@webkit.org>
3915
3916         Reviewed by Andreas Kling.
3917
3918         [WK2] Handle keyboard and mouse events on X11
3919         https://bugs.webkit.org/show_bug.cgi?id=56103
3920
3921         Propagate keyboard and mouse events to the plugin
3922         as XEvent's.
3923
3924         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
3925         (WebKit::initializeXEvent):
3926         (WebKit::xTimeStamp):
3927         (WebKit::xKeyModifiers):
3928         (WebKit::setCommonMouseEventFields):
3929         (WebKit::setXMotionEventFields):
3930         (WebKit::setXButtonEventFields):
3931         (WebKit::setXCrossingEventFields):
3932         (WebKit::NetscapePlugin::platformHandleMouseEvent):
3933         (WebKit::NetscapePlugin::platformHandleMouseEnterEvent):
3934         (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent):
3935         (WebKit::setXKeyEventFields):
3936         (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
3937
3938 2011-03-23  Anders Carlsson  <andersca@apple.com>
3939
3940         Reviewed by Sam Weinig.
3941
3942         Connection::SyncMessageState::processIncomingMessage should ignore whether the message is sync or not
3943         https://bugs.webkit.org/show_bug.cgi?id=56954
3944
3945         This is so we'll eventually be able to send sync messages that aren't processed immediately if the 
3946         destination is waiting for a reply to another synchronous message.
3947
3948         * Platform/CoreIPC/Connection.cpp:
3949         (CoreIPC::Connection::SyncMessageState::processIncomingMessage):
3950         Only check for the DispatchMessageWhenWaitingForSyncReply flag.
3951
3952         (CoreIPC::Connection::sendSyncMessage):
3953         Add both DispatchMessageWhenWaitingForSyncReply and SyncMessage to the message ID.
3954
3955         * Platform/CoreIPC/Connection.h:
3956         (CoreIPC::Connection::sendSync):        
3957         (CoreIPC::Connection::deprecatedSendSync):
3958         No need to add SyncMessage here anymore.
3959
3960 2011-03-23  Brian Weinstein  <bweinstein@apple.com>
3961
3962         Qt Build Fix.
3963
3964         * DerivedSources.pro:
3965
3966 2011-03-22  Brian Weinstein  <bweinstein@apple.com>
3967
3968         Reviewed by Darin Adler.
3969
3970         WebKit2: Need API to manage the Media Cache
3971         https://bugs.webkit.org/show_bug.cgi?id=56878
3972         <rdar://problem/9082503>
3973
3974         Project File Fun:
3975         * GNUmakefile.am:
3976         * WebKit2.pri:
3977         * WebKit2.pro:
3978         * WebKit2.xcodeproj/project.pbxproj:
3979         * win/WebKit2.vcproj:
3980         * win/WebKit2Common.vsprops:
3981         * win/WebKit2Generated.make:
3982         
3983         Derived Sources and API fun:
3984         * DerivedSources.make:
3985         * DerivedSources.pro:
3986         * Platform/CoreIPC/MessageID.h:
3987         * Shared/API/c/WKBase.h:
3988         * Shared/APIObject.h:
3989         * UIProcess/API/C/WKAPICast.h:
3990         
3991         * UIProcess/WebProcessProxy.cpp:
3992         (WebKit::WebProcessProxy::didReceiveMessage): Add a case for MediaCache messages.
3993         * WebProcess/WebProcess.cpp:
3994         (WebKit::WebProcess::didReceiveMessage): Ditto.
3995         
3996         * UIProcess/WebContext.cpp:
3997         (WebKit::WebContext::WebContext): Initialize the WebMediaCacheManagerProxy member variable.
3998         (WebKit::WebContext::~WebContext): Invalidate the WebMediaCacheManagerProxy.
3999         (WebKit::WebContext::disconnectProcess): Ditto.
4000         (WebKit::WebContext::didReceiveMessage): Add a case for MediaCache messages.
4001         * UIProcess/WebContext.h:
4002         (WebKit::WebContext::mediaCacheManagerProxy):
4003
4004         * UIProcess/API/C/WKContext.cpp:
4005         (WKContextGetMediaCacheManager): Returns the context's WebMediaCacheManager.
4006         * UIProcess/API/C/WKContext.h:
4007
4008         * UIProcess/API/C/WKMediaCacheManager.cpp: Added.
4009         (WKMediaCacheManagerGetTypeID): Returns the WebMediaCacheManagerProxy type.
4010         (WKMediaCacheManagerGetHostnamesWithMediaCache): Calls down to the WebMediaCacheManagerProxy.
4011         (WKMediaCacheManagerClearCacheForHostname): Ditto.
4012         (WKMediaCacheManagerClearCacheForAllHostnames): Ditto.
4013         * UIProcess/API/C/WKMediaCacheManager.h: Added.
4014
4015         * UIProcess/WebMediaCacheManagerProxy.cpp: Added.
4016         (WebKit::WebMediaCacheManagerProxy::create):
4017         (WebKit::WebMediaCacheManagerProxy::WebMediaCacheManagerProxy):
4018         (WebKit::WebMediaCacheManagerProxy::~WebMediaCacheManagerProxy):
4019         (WebKit::WebMediaCacheManagerProxy::invalidate):
4020         (WebKit::WebMediaCacheManagerProxy::didReceiveMessage):
4021         (WebKit::WebMediaCacheManagerProxy::getHostnamesWithMediaCache): Call through to the WebProcess.
4022         (WebKit::WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache): Process the WebProcess response,
4023             and call the callback.
4024         (WebKit::WebMediaCacheManagerProxy::clearCacheForHostname): Call through to the WebProcess.
4025         (WebKit::WebMediaCacheManagerProxy::clearCacheForAllHostnames): Call through to the WebProcess.
4026         * UIProcess/WebMediaCacheManagerProxy.h: Added.
4027         (WebKit::WebMediaCacheManagerProxy::clearContext):
4028         (WebKit::WebMediaCacheManagerProxy::type):
4029         * UIProcess/WebMediaCacheManagerProxy.messages.in: Added.
4030
4031         * WebProcess/MediaCache: Added.
4032         * WebProcess/MediaCache/WebMediaCacheManager.cpp: Added.
4033         (WebKit::WebMediaCacheManager::shared):
4034         (WebKit::WebMediaCacheManager::WebMediaCacheManager):
4035         (WebKit::WebMediaCacheManager::didReceiveMessage):
4036         (WebKit::WebMediaCacheManager::getHostnamesWithMediaCache): Added a FIXME to call through to WebCore.
4037         (WebKit::WebMediaCacheManager::clearCacheForHostname): Ditto.
4038         (WebKit::WebMediaCacheManager::clearCacheForAllHostnames): Ditto.
4039         * WebProcess/MediaCache/WebMediaCacheManager.h: Added.
4040         * WebProcess/MediaCache/WebMediaCacheManager.messages.in: Added.
4041
4042 2011-03-22  Brady Eidson  <beidson@apple.com>
4043
4044         Reviewed by Sam Weinig.
4045
4046         Add asynchronous load decision call to WebKit2 IconDatabase
4047         https://bugs.webkit.org/show_bug.cgi?id=56887
4048
4049         * UIProcess/WebIconDatabase.cpp:
4050         (WebKit::WebIconDatabase::getLoadDecisionForIconURL): In the future, get the actual load decision from the database.
4051           For now, always message "IconLoadNo" back to the WebProcess.
4052         * UIProcess/WebIconDatabase.h:
4053         * UIProcess/WebIconDatabase.messages.in:
4054         
4055         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
4056         (WebKit::WebIconDatabaseProxy::loadDecisionForIconURL): Message the UIProcess for the load decision.
4057         (WebKit::WebIconDatabaseProxy::receivedIconLoadDecision): Callback into WebCore with the received load decision.
4058         * WebProcess/IconDatabase/WebIconDatabaseProxy.h:
4059         * WebProcess/IconDatabase/WebIconDatabaseProxy.messages.in:
4060
4061 2011-03-23  Chris Fleizach  <cfleizach@apple.com>
4062
4063         Reviewed by Darin Adler.
4064
4065         REGRESSION: WK2: AX: PDF in Safari no longer accessible.
4066         https://bugs.webkit.org/show_bug.cgi?id=56849
4067
4068         The WKView needs to know when to return the WKPDFView and when to return
4069         the remote web process connection.
4070
4071         * UIProcess/API/mac/PDFViewController.h:
4072         (WebKit::PDFViewController::pdfView):
4073         * UIProcess/API/mac/WKView.mm:
4074         (-[WKView accessibilityFocusedUIElement]):
4075         (-[WKView accessibilityHitTest:]):
4076         (-[WKView accessibilityAttributeValue:]):
4077
4078 2011-03-21  Stephanie Lewis  <slewis@apple.com>
4079
4080         Reviewed by Simon Fraser.
4081
4082         https://bugs.webkit.org/show_bug.cgi?id=56798
4083         Wrap autorelease pools around calls that can have pathological memory growth on Membuster.  
4084         Only wrap the main runloop because some background threads are not expected to call into 
4085         objc and an autorelease pool could mask bugs.
4086