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