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