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