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