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