b3f73b6b5288e7965dd4e7b7a27b5d708ca59c9f
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2011-03-25  Brent Fulgham  <bfulgham@webkit.org>
2
3         Correct project file missing $(WebKitVSPropsRedirectionDir)s
4         after r81924.
5
6         * win/WebKit2.vcproj: Restore lost $(WebKitVSPropsRedirectionDir)
7
8 2011-03-25  Alejandro G. Castro  <alex@igalia.com>
9
10         Reviewed by Martin Robinson.
11
12         [WK2] Consider .c files in the generate-forwarding-headers script
13         https://bugs.webkit.org/show_bug.cgi?id=56680
14
15         * Scripts/generate-forwarding-headers.pl:
16
17 2011-03-24  Sheriff Bot  <webkit.review.bot@gmail.com>
18
19         Unreviewed, rolling out r81916 and r81917.
20         http://trac.webkit.org/changeset/81916
21         http://trac.webkit.org/changeset/81917
22         https://bugs.webkit.org/show_bug.cgi?id=57071
23
24         broke a test on platforms that do not have QuickTime installed
25         (Requested by estes on #webkit).
26
27         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
28         (WebKit::WebFrameLoaderClient::objectContentType):
29         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
30
31 2011-03-24  Brady Eidson  <beidson@apple.com>
32
33         Reviewed by Darin Adler.
34
35         https://bugs.webkit.org/show_bug.cgi?id=57069
36         Add WKIconDatabase api to the project files, and expose accessor on WKContext.
37
38         Project file stuffs:
39         * GNUmakefile.am:
40         * WebKit2.xcodeproj/project.pbxproj:
41         * win/WebKit2.vcproj:
42
43         * Shared/API/c/WKBase.h:
44         * UIProcess/API/C/WKAPICast.h:
45
46         * UIProcess/API/C/WKContext.cpp:
47         (WKContextGetIconDatabase):
48         * UIProcess/API/C/WKContext.h:
49
50         * UIProcess/API/C/WKIconDatabase.cpp: Added.
51         (WKIconDatabaseGetTypeID):
52         * UIProcess/API/C/WKIconDatabase.h: Added.
53
54         * UIProcess/WebContext.h:
55         (WebKit::WebContext::iconDatabase):
56
57 2011-03-24  Brent Fulgham  <bfulgham@webkit.org>
58
59         Build correction.
60
61         Disable the CA Layer stuff when building with Cairo.
62
63         * win/WebKit2.vcproj:
64
65 2011-03-24  Brady Eidson  <beidson@apple.com>
66
67         Reviewed by Sam Weinig.
68
69         https://bugs.webkit.org/show_bug.cgi?id=57058
70         Hookup the UIProcess WebIconDatabase to a WebCore::IconDatabase as its implementation
71
72         * UIProcess/WebIconDatabase.cpp:
73         (WebKit::WebIconDatabase::WebIconDatabase):
74         (WebKit::WebIconDatabase::setDatabasePath): Create a new WebCore::IconDatabase and open it to this path.
75         (WebKit::WebIconDatabase::retainIconForPageURL): Actually retain the url, using the impl.
76         (WebKit::WebIconDatabase::releaseIconForPageURL): Actually release the url, using the impl.
77         (WebKit::WebIconDatabase::setIconURLForPageURL): Actually set the url, using the impl.
78         (WebKit::WebIconDatabase::setIconDataForIconURL): Actually set the data, using the impl.
79         (WebKit::WebIconDatabase::getLoadDecisionForIconURL): Actually ask for a load decision to call back with.
80         (WebKit::WebIconDatabase::performImport):
81         (WebKit::WebIconDatabase::didImportIconURLForPageURL):
82         (WebKit::WebIconDatabase::didImportIconDataForPageURL):
83         (WebKit::WebIconDatabase::didChangeIconForPageURL):
84         (WebKit::WebIconDatabase::didRemoveAllIcons):
85         (WebKit::WebIconDatabase::didFinishURLImport): Notify all the pending callbacks what their load decisions
86           are now that they're available.
87         * UIProcess/WebIconDatabase.h:
88
89         Add an IconDatabase logging channel:
90         * Platform/Logging.cpp:
91         (WebKit::initializeLogChannelsIfNecessary):
92         * Platform/Logging.h:
93
94         * UIProcess/WebContext.cpp:
95         (WebKit::WebContext::setIconDatabasePath): Pass the new path on to the WebIconDatabase, possibly
96           opening it.
97         * UIProcess/WebContext.h:
98
99 2011-03-24  Andy Estes  <aestes@apple.com>
100
101         Reviewed by Darin Adler.
102
103         REGRESSION (r70748): latest nightly builds kills AC_QuickTime.js
104         https://bugs.webkit.org/show_bug.cgi?id=49016
105
106         Update objectContentType() implementation to handle the
107         shouldPreferPlugInsForImages flag.
108
109         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
110         (WebKit::WebFrameLoaderClient::objectContentType):
111         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
112
113 2011-03-24  Adam Roben  <aroben@apple.com>
114
115         Start compiling LayerTreeHostCA on Windows
116
117         Fixes <http://webkit.org/b/57060> WebKit2.vcproj should compile LayerTreeHostCA
118
119         Reviewed by Anders Carlsson.
120
121         * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp: Added.
122         (WebKit::LayerTreeHostCA::platformInitialize):
123         (WebKit::LayerTreeHostCA::scheduleLayerFlush):
124         (WebKit::LayerTreeHostCA::platformInvalidate):
125         (WebKit::LayerTreeHostCA::platformSizeDidChange):
126         (WebKit::LayerTreeHostCA::platformForceRepaint):
127         (WebKit::LayerTreeHostCA::platformDidPerformScheduledLayerFlush):
128         Stubbed out.
129
130         * win/WebKit2.vcproj: Added new files. Let VS reorder existing files.
131
132         * win/WebKit2Apple.vsprops: Added WebProcess\WebPage\ca to the include path.
133
134 2011-03-24  Jer Noble  <jer.noble@apple.com>
135
136         Unreviewed build fix.
137
138         Remove reference to LayerTreeHostMac.h from WebFullScreenManagerMac.mm.
139
140         * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm:
141
142 2011-03-24  Adam Roben  <aroben@apple.com>
143
144         Split Mac-specific parts of LayerTreeHostCA into LayerTreeHostCAMac.mm
145
146         Fixes <http://webkit.org/b/57046> LayerTreeHostMac's code should be shareable with Windows
147
148         Reviewed by Anders Carlsson.
149
150         * WebKit2.xcodeproj/project.pbxproj:
151
152         * WebProcess/WebPage/ca/LayerTreeHostCA.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.mm.
153         (WebKit::LayerTreeHostCA::LayerTreeHostCA): Moved some Mac-specific code to
154         LayerTreeHostCAMac.mm.
155         (WebKit::LayerTreeHostCA::~LayerTreeHostCA): Wrapped some Mac-specific code in
156         PLATFORM(MAC).
157
158         (WebKit::LayerTreeHostCA::invalidate):
159         (WebKit::LayerTreeHostCA::sizeDidChange):
160         (WebKit::LayerTreeHostCA::forceRepaint):
161         Moved some Mac-specific code to LayerTreeHostCAMac.mm.
162
163         (WebKit::LayerTreeHostCA::performScheduledLayerFlush): Renamed from
164         flushPendingLayerChangesRunLoopObserverCallback. Moved some code from here...
165         (WebKit::LayerTreeHostCA::didPerformScheduledLayerFlush): ...to here. Moved some
166         Mac-specific code to LayerTreeHostCAMac.mm.
167
168         * WebProcess/WebPage/ca/LayerTreeHostCA.h: Added new functions, wrapped some Mac-specific
169         declarations in PLATFORM(MAC).
170
171         * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm: Added.
172         (WebKit::LayerTreeHostCA::platformInitialize):
173         (WebKit::LayerTreeHostCA::scheduleLayerFlush):
174         (WebKit::LayerTreeHostCA::platformInvalidate):
175         (WebKit::LayerTreeHostCA::platformSizeDidChange):
176         (WebKit::LayerTreeHostCA::platformForceRepaint):
177         (WebKit::LayerTreeHostCA::flushPendingLayerChangesRunLoopObserverCallback):
178         (WebKit::LayerTreeHostCA::platformDidPerformScheduledLayerFlush):
179         Code was extracted from LayerTreeHostCA.cpp.
180
181 2011-03-24  Adam Roben  <aroben@apple.com>
182
183         Rename LayerTreeHostMac to LayerTreeHostCA
184
185         This is the first step toward sharing code with Windows.
186
187         Fixes <http://webkit.org/b/57051>.
188
189         Reviewed by Anders Carlsson.
190
191         * WebKit2.xcodeproj/project.pbxproj:
192         * WebProcess/WebPage/LayerTreeHost.cpp:
193         (WebKit::LayerTreeHost::create):
194         Updated for rename.
195
196         * WebProcess/WebPage/ca/LayerTreeHostCA.h: Renamed from Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.h.
197         * WebProcess/WebPage/ca/LayerTreeHostCA.mm: Renamed from Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.mm.
198
199 2011-03-17  Jer Noble  <jer.noble@apple.com>
200
201         Reviewed by Maciej Stachowiak.
202
203         WebKit2: Cancelling full screen early leaves full screen window up.
204         https://bugs.webkit.org/show_bug.cgi?id=56589
205
206         No new tests, as WebKitTestRunner does not currently support the new Full Screen API.
207
208         Notify the UIProcess when it needs to tear down its layer hosting view, turn off
209         the background layer when not in accelerated rendering mode and don't swap out 
210         the web view unnecessarily 
211
212         * UIProcess/mac/WKFullScreenWindowController.mm:
213         (-[WKFullScreenWindowController beganExitFullScreenAnimation]): Check before swapping _webView.
214         (-[WKFullScreenWindowController enterAcceleratedCompositingMode:]): Add the _layerHostingView
215             to the full screen window's animationView, not its contentsView.
216         (-[WKFullScreenWindowController exitAcceleratedCompositingMode]): Hide the background layer.
217         * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm:
218         (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): If given a null rootLayer, tell
219             the client to exit accelerated mode.
220
221 2011-03-24  Enrica Casucci  <enrica@apple.com>
222
223         Reviewed by Alexey Proskuryakov.
224
225         WebKit2:Services menu item to convert selected Simplified/Traditional Chinese Text is not working.
226         https://bugs.webkit.org/show_bug.cgi?id=56975
227         <rdar://problem/8915066>
228         
229         Adding missing entry point to support Mac OS X services in WebKit2.
230
231         * UIProcess/API/mac/WKView.mm:
232         (-[WKView readSelectionFromPasteboard:]): Added.
233         * UIProcess/WebPageProxy.h:
234         * UIProcess/mac/WebPageProxyMac.mm:
235         (WebKit::WebPageProxy::readSelectionFromPasteboard): Added.
236         * WebProcess/WebPage/WebPage.h:
237         * WebProcess/WebPage/WebPage.messages.in: Added synchronous
238         message.
239         * WebProcess/WebPage/mac/WebPageMac.mm:
240         (WebKit::WebPage::readSelectionFromPasteboard): Added.
241
242 2011-03-24  Jia Pu  <jpu@apple.com>
243
244         Reviewed by Darin Adler.
245
246         Dismissed reversion suggestion is incorrectly learned.
247         https://bugs.webkit.org/show_bug.cgi?id=57039
248
249         CorrectionPanel should always use [NSSpellChecker dismissCorrectionBubbleForView].
250         [NSSpellChecker cancelCorrectionBubbleForView] is reserved for situation where correction panel
251         is dismissed explicitly by ESC key or clicking the dimiss button. Misusing these causes
252         incorrect automatic learning.
253
254         * UIProcess/mac/CorrectionPanel.mm:
255         (WebKit::CorrectionPanel::dismissInternal):
256
257 2011-03-24  Brian Weinstein  <bweinstein@apple.com>
258
259         Reviewed by Adam Roben.
260
261         WebKit2: Add Trackpoint driver hack to support IBM trackpads
262         https://bugs.webkit.org/show_bug.cgi?id=49830
263         <rdar://problem/8705951>
264
265         Copy code from WebKit1 to WebKit2 to handle initializing fake scrollbars so 
266         IBM machines with a trackpad send us WM_VSCROLL and WM_HSCROLL messages.
267
268         Listen for the WM_VSCROLL and WM_HSCROLL messages, and turn the values into
269         ScrollDirection and ScrollGranularity, and send a scroll command to the
270         WebProcess.
271
272         * UIProcess/WebPageProxy.cpp:
273         (WebKit::WebPageProxy::scrollBy): Send a message to the WebProcess.
274         * UIProcess/WebPageProxy.h:
275         * UIProcess/win/WebView.cpp:
276         (WebKit::WebView::wndProc): Add WM_VSCROLL and WM_HSCROLL message handling.
277         (WebKit::WebView::initialize): Call shouldInitializeTrackPointHack.
278         (WebKit::WebView::onHorizontalScroll): Turn wParam into a ScrollDirection and ScrollGranularity. 
279         (WebKit::WebView::onVerticalScroll): Ditto.
280         (WebKit::WebView::shouldInitializeTrackPointHack): Check the registry for keys that indicate
281             the machine has a IBM Trackpoint driver.
282         * UIProcess/win/WebView.h:
283         * WebProcess/WebPage/WebPage.cpp:
284         (WebKit::WebPage::scrollBy): Call scroll method.
285         (WebKit::WebPage::scroll): Moved from WebPageMac and WebPageWin.
286         (WebKit::WebPage::logicalScroll): Ditto.
287         * WebProcess/WebPage/WebPage.h:
288         * WebProcess/WebPage/WebPage.messages.in: Add a new scrollBy message. 
289         * WebProcess/WebPage/mac/WebPageMac.mm: Remove scroll and logicalScroll, they are now in WebPage.cpp.
290         * WebProcess/WebPage/win/WebPageWin.cpp: Ditto.
291
292 2011-03-24  Sam Weinig  <sam@webkit.org>
293
294         Reviewed by Darin Adler.
295
296         Dictionary text extraction is not correctly detecting word boundaries on bing.com
297         <rdar://problem/9078569>
298         https://bugs.webkit.org/show_bug.cgi?id=56995
299
300         * Shared/DictionaryPopupInfo.cpp:
301         (WebKit::DictionaryPopupInfo::encode):
302         (WebKit::DictionaryPopupInfo::decode):
303         * Shared/DictionaryPopupInfo.h:
304         Add options dictionary.
305
306         * UIProcess/API/mac/PageClientImpl.mm:
307         (WebKit::PageClientImpl::didPerformDictionaryLookup):
308         Add path that can pass options through.
309
310         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
311         (WebKit::WebContextMenuClient::lookUpInDictionary):
312         Use the new performDictionaryLookupForSelection which can extract context
313         if supported.
314
315         * WebProcess/WebPage/WebPage.h:
316         * WebProcess/WebPage/mac/WebPageMac.mm:
317         (WebKit::characterRangeAtPositionForPoint):
318         (WebKit::characterRangeAtPoint):
319         Split functionality out of characterRangeAtPoint and into 
320         characterRangeAtPositionForPoint to avoid doing duplicate work 
321         if you already have the position.
322
323         (WebKit::isPositionInRange):
324         (WebKit::shouldUseSelection):
325         Add predicate to determine if we should use the selection instead
326         of expanding to find the word we are over.
327
328         (WebKit::WebPage::performDictionaryLookupAtLocation):
329         If available, use the surrounding paragraph as context to get better extraction
330         and to get lexicographical information about the word. Also, clean up and use 
331         editing APIs to make the code more concise and understandable.
332
333         (WebKit::WebPage::performDictionaryLookupForSelection):
334         Use similar logic as in performDictionaryLookupAtLocation to extract additional
335         details from a selection for use in the dictionary popup.
336
337         (WebKit::WebPage::performDictionaryLookupForRange):
338         Pass options to WebProcess if available.
339
340 2011-03-24  Jon Lee  <jonlee@apple.com>
341
342         Reviewed by Darin Adler.
343
344         WebKit2: Tabbing from the last focused field to a non-webpage element leaves the selection in a weird state
345         <rdar://problem/8553962>
346
347         * WebProcess/WebPage/WebPage.cpp:
348         (WebKit::WebPage::setFocused): When the page loses focus, clear out any selection in the frame
349
350 2011-03-24  Brian Weinstein  <bweinstein@apple.com>
351
352         Rubber-stamped by Sam Weinig.
353
354         Fix a typo in the VK_LEFT case of performDefaultBehaviorForKeyEvent.
355
356         * WebProcess/WebPage/mac/WebPageMac.mm:
357         (WebKit::WebPage::performDefaultBehaviorForKeyEvent): It should be a logical or,
358             not a bitwise or.
359
360 2011-03-24  Jeff Miller  <jeffm@apple.com>
361
362         Fix typo - USE(CF_NETWORK) should be USE(CFNETWORK).
363
364         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:
365         (WebKit::InjectedBundle::setHostAllowsAnyHTTPSCertificate): USE(CF_NETWORK) should be USE(CFNETWORK)
366
367 2011-03-23  Jia Pu  <jpu@apple.com>
368
369         Reviewed by Darin Adler.
370
371         Hook up new AppKit autocorrection UI with WK2.
372         https://bugs.webkit.org/show_bug.cgi?id=56055
373         <rdar://problem/8947463>
374
375         Please see WebCore/ChangeLog for detail.
376
377         The calls to AppKit are implemented in PageClientImpl. Other changes are necessary for the
378         plumbing work.
379
380         * UIProcess/API/mac/PageClientImpl.h:
381         * UIProcess/API/mac/PageClientImpl.mm:
382         (WebKit::PageClientImpl::showCorrectionPanel):
383         (WebKit::PageClientImpl::dismissCorrectionPanel):
384         (WebKit::PageClientImpl::dismissCorrectionPanelSoon):
385         (WebKit::PageClientImpl::recordAutocorrectionResponse):
386         * UIProcess/API/mac/WKView.mm:
387         (-[WKView spellCheckerDocumentTag]):
388         (-[WKView handleCorrectionPanelResult:]):
389         * UIProcess/API/mac/WKViewPrivate.h:
390         * UIProcess/PageClient.h:
391         * UIProcess/WebPageProxy.cpp:
392         (WebKit::WebPageProxy::didCommitLoadForFrame):
393         (WebKit::WebPageProxy::showCorrectionPanel):
394         (WebKit::WebPageProxy::dismissCorrectionPanel):
395         (WebKit::WebPageProxy::dismissCorrectionPanelSoon):
396         (WebKit::WebPageProxy::recordAutocorrectionResponse):
397         (WebKit::WebPageProxy::handleCorrectionPanelResult):
398         * UIProcess/WebPageProxy.h:
399         * UIProcess/WebPageProxy.messages.in:
400         * UIProcess/mac/CorrectionPanel.h: Added.
401         (WebKit::CorrectionPanel::isShowing):
402         * UIProcess/mac/CorrectionPanel.mm: Added.
403         (correctionBubbleType):
404         (WebKit::CorrectionPanel::CorrectionPanel):
405         (WebKit::CorrectionPanel::~CorrectionPanel):
406         (WebKit::CorrectionPanel::show):
407         (WebKit::CorrectionPanel::dismiss):
408         (WebKit::CorrectionPanel::dismissSoon):
409         (WebKit::CorrectionPanel::dismissInternal):
410         (WebKit::CorrectionPanel::recordAutocorrectionResponse):
411         * WebKit2.xcodeproj/project.pbxproj:
412         * WebProcess/WebCoreSupport/WebEditorClient.h:
413         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
414         (WebKit::WebEditorClient::showCorrectionPanel):
415         (WebKit::WebEditorClient::dismissCorrectionPanel):
416         (WebKit::WebEditorClient::dismissCorrectionPanelSoon):
417         (WebKit::WebEditorClient::recordAutocorrectionResponse):
418         * WebProcess/WebPage/WebPage.cpp:
419         (WebKit::WebPage::handleCorrectionPanelResult):
420         * WebProcess/WebPage/WebPage.h:
421         * WebProcess/WebPage/WebPage.messages.in:
422
423 2011-03-23  Brian Weinstein  <bweinstein@apple.com>
424
425         Reviewed by Maciej Stachowiak.
426
427         WebKit2: Need API to manage the Media Cache
428         https://bugs.webkit.org/show_bug.cgi?id=56878
429         <rdar://problem/9082503>
430
431         Call through to HTMLMediaElement functions to manage the WebCore media cache.
432
433         * WebProcess/MediaCache/WebMediaCacheManager.cpp:
434         (WebKit::WebMediaCacheManager::getHostnamesWithMediaCache):
435         (WebKit::WebMediaCacheManager::clearCacheForHostname):
436         (WebKit::WebMediaCacheManager::clearCacheForAllHostnames):
437
438 2011-03-23  Jeff Miller  <jeffm@apple.com>
439
440         Reviewed by Darin Adler.
441
442         Add WKBundleSetHostAllowsAnyHTTPSCertificate() for Windows
443         https://bugs.webkit.org/show_bug.cgi?id=56972
444         
445         This is the WebKit2 equivalent to the WebKit1 API IWebMutableURLRequest::setAllowsAnyHTTPSCertificate().
446
447         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
448         (WKBundleSetHostAllowsAnyHTTPSCertificate): Added.
449         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: Added WKBundleSetHostAllowsAnyHTTPSCertificate().
450         * WebProcess/InjectedBundle/InjectedBundle.h: Added setHostAllowsAnyHTTPSCertificate().
451         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
452         (WebKit::InjectedBundle::setHostAllowsAnyHTTPSCertificate): Added, should never be called.
453         * WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp:
454         (WebKit::InjectedBundle::setHostAllowsAnyHTTPSCertificate): Added, should never be called.
455         * WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp:
456         (WebKit::InjectedBundle::setHostAllowsAnyHTTPSCertificate): Added, should never be called.
457         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:
458         (WebKit::InjectedBundle::setHostAllowsAnyHTTPSCertificate): Added.
459
460 2011-03-23  Sam Weinig  <sam@webkit.org>
461
462         Reviewed by Anders Carlsson.
463
464         Roll out r81593 Need WebKit2 API for creating a page with a specific main frame name
465
466         This API is not necessary.
467
468         * Shared/WebPageCreationParameters.cpp:
469         (WebKit::WebPageCreationParameters::encode):
470         (WebKit::WebPageCreationParameters::decode):
471         * Shared/WebPageCreationParameters.h:
472         * UIProcess/API/mac/WKView.h:
473         * UIProcess/API/mac/WKView.mm:
474         (-[WKView initWithFrame:]):
475         (-[WKView initWithFrame:contextRef:]):
476         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
477         * UIProcess/WebPageProxy.cpp:
478         (WebKit::WebPageProxy::creationParameters):
479         * UIProcess/WebPageProxy.h:
480         * WebProcess/WebPage/WebFrame.cpp:
481         (WebKit::WebFrame::createMainFrame):
482         * WebProcess/WebPage/WebFrame.h:
483         * WebProcess/WebPage/WebPage.cpp:
484         (WebKit::WebPage::WebPage):
485
486 2011-03-23  Balazs Kelemen  <kbalazs@webkit.org>
487
488         Reviewed by Andreas Kling.
489
490         [WK2] Handle keyboard and mouse events on X11
491         https://bugs.webkit.org/show_bug.cgi?id=56103
492
493         Propagate keyboard and mouse events to the plugin
494         as XEvent's.
495
496         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
497         (WebKit::initializeXEvent):
498         (WebKit::xTimeStamp):
499         (WebKit::xKeyModifiers):
500         (WebKit::setCommonMouseEventFields):
501         (WebKit::setXMotionEventFields):
502         (WebKit::setXButtonEventFields):
503         (WebKit::setXCrossingEventFields):
504         (WebKit::NetscapePlugin::platformHandleMouseEvent):
505         (WebKit::NetscapePlugin::platformHandleMouseEnterEvent):
506         (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent):
507         (WebKit::setXKeyEventFields):
508         (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
509
510 2011-03-23  Anders Carlsson  <andersca@apple.com>
511
512         Reviewed by Sam Weinig.
513
514         Connection::SyncMessageState::processIncomingMessage should ignore whether the message is sync or not
515         https://bugs.webkit.org/show_bug.cgi?id=56954
516
517         This is so we'll eventually be able to send sync messages that aren't processed immediately if the 
518         destination is waiting for a reply to another synchronous message.
519
520         * Platform/CoreIPC/Connection.cpp:
521         (CoreIPC::Connection::SyncMessageState::processIncomingMessage):
522         Only check for the DispatchMessageWhenWaitingForSyncReply flag.
523
524         (CoreIPC::Connection::sendSyncMessage):
525         Add both DispatchMessageWhenWaitingForSyncReply and SyncMessage to the message ID.
526
527         * Platform/CoreIPC/Connection.h:
528         (CoreIPC::Connection::sendSync):        
529         (CoreIPC::Connection::deprecatedSendSync):
530         No need to add SyncMessage here anymore.
531
532 2011-03-23  Brian Weinstein  <bweinstein@apple.com>
533
534         Qt Build Fix.
535
536         * DerivedSources.pro:
537
538 2011-03-22  Brian Weinstein  <bweinstein@apple.com>
539
540         Reviewed by Darin Adler.
541
542         WebKit2: Need API to manage the Media Cache
543         https://bugs.webkit.org/show_bug.cgi?id=56878
544         <rdar://problem/9082503>
545
546         Project File Fun:
547         * GNUmakefile.am:
548         * WebKit2.pri:
549         * WebKit2.pro:
550         * WebKit2.xcodeproj/project.pbxproj:
551         * win/WebKit2.vcproj:
552         * win/WebKit2Common.vsprops:
553         * win/WebKit2Generated.make:
554         
555         Derived Sources and API fun:
556         * DerivedSources.make:
557         * DerivedSources.pro:
558         * Platform/CoreIPC/MessageID.h:
559         * Shared/API/c/WKBase.h:
560         * Shared/APIObject.h:
561         * UIProcess/API/C/WKAPICast.h:
562         
563         * UIProcess/WebProcessProxy.cpp:
564         (WebKit::WebProcessProxy::didReceiveMessage): Add a case for MediaCache messages.
565         * WebProcess/WebProcess.cpp:
566         (WebKit::WebProcess::didReceiveMessage): Ditto.
567         
568         * UIProcess/WebContext.cpp:
569         (WebKit::WebContext::WebContext): Initialize the WebMediaCacheManagerProxy member variable.
570         (WebKit::WebContext::~WebContext): Invalidate the WebMediaCacheManagerProxy.
571         (WebKit::WebContext::disconnectProcess): Ditto.
572         (WebKit::WebContext::didReceiveMessage): Add a case for MediaCache messages.
573         * UIProcess/WebContext.h:
574         (WebKit::WebContext::mediaCacheManagerProxy):
575
576         * UIProcess/API/C/WKContext.cpp:
577         (WKContextGetMediaCacheManager): Returns the context's WebMediaCacheManager.
578         * UIProcess/API/C/WKContext.h:
579
580         * UIProcess/API/C/WKMediaCacheManager.cpp: Added.
581         (WKMediaCacheManagerGetTypeID): Returns the WebMediaCacheManagerProxy type.
582         (WKMediaCacheManagerGetHostnamesWithMediaCache): Calls down to the WebMediaCacheManagerProxy.
583         (WKMediaCacheManagerClearCacheForHostname): Ditto.
584         (WKMediaCacheManagerClearCacheForAllHostnames): Ditto.
585         * UIProcess/API/C/WKMediaCacheManager.h: Added.
586
587         * UIProcess/WebMediaCacheManagerProxy.cpp: Added.
588         (WebKit::WebMediaCacheManagerProxy::create):
589         (WebKit::WebMediaCacheManagerProxy::WebMediaCacheManagerProxy):
590         (WebKit::WebMediaCacheManagerProxy::~WebMediaCacheManagerProxy):
591         (WebKit::WebMediaCacheManagerProxy::invalidate):
592         (WebKit::WebMediaCacheManagerProxy::didReceiveMessage):
593         (WebKit::WebMediaCacheManagerProxy::getHostnamesWithMediaCache): Call through to the WebProcess.
594         (WebKit::WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache): Process the WebProcess response,
595             and call the callback.
596         (WebKit::WebMediaCacheManagerProxy::clearCacheForHostname): Call through to the WebProcess.
597         (WebKit::WebMediaCacheManagerProxy::clearCacheForAllHostnames): Call through to the WebProcess.
598         * UIProcess/WebMediaCacheManagerProxy.h: Added.
599         (WebKit::WebMediaCacheManagerProxy::clearContext):
600         (WebKit::WebMediaCacheManagerProxy::type):
601         * UIProcess/WebMediaCacheManagerProxy.messages.in: Added.
602
603         * WebProcess/MediaCache: Added.
604         * WebProcess/MediaCache/WebMediaCacheManager.cpp: Added.
605         (WebKit::WebMediaCacheManager::shared):
606         (WebKit::WebMediaCacheManager::WebMediaCacheManager):
607         (WebKit::WebMediaCacheManager::didReceiveMessage):
608         (WebKit::WebMediaCacheManager::getHostnamesWithMediaCache): Added a FIXME to call through to WebCore.
609         (WebKit::WebMediaCacheManager::clearCacheForHostname): Ditto.
610         (WebKit::WebMediaCacheManager::clearCacheForAllHostnames): Ditto.
611         * WebProcess/MediaCache/WebMediaCacheManager.h: Added.
612         * WebProcess/MediaCache/WebMediaCacheManager.messages.in: Added.
613
614 2011-03-22  Brady Eidson  <beidson@apple.com>
615
616         Reviewed by Sam Weinig.
617
618         Add asynchronous load decision call to WebKit2 IconDatabase
619         https://bugs.webkit.org/show_bug.cgi?id=56887
620
621         * UIProcess/WebIconDatabase.cpp:
622         (WebKit::WebIconDatabase::getLoadDecisionForIconURL): In the future, get the actual load decision from the database.
623           For now, always message "IconLoadNo" back to the WebProcess.
624         * UIProcess/WebIconDatabase.h:
625         * UIProcess/WebIconDatabase.messages.in:
626         
627         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
628         (WebKit::WebIconDatabaseProxy::loadDecisionForIconURL): Message the UIProcess for the load decision.
629         (WebKit::WebIconDatabaseProxy::receivedIconLoadDecision): Callback into WebCore with the received load decision.
630         * WebProcess/IconDatabase/WebIconDatabaseProxy.h:
631         * WebProcess/IconDatabase/WebIconDatabaseProxy.messages.in:
632
633 2011-03-23  Chris Fleizach  <cfleizach@apple.com>
634
635         Reviewed by Darin Adler.
636
637         REGRESSION: WK2: AX: PDF in Safari no longer accessible.
638         https://bugs.webkit.org/show_bug.cgi?id=56849
639
640         The WKView needs to know when to return the WKPDFView and when to return
641         the remote web process connection.
642
643         * UIProcess/API/mac/PDFViewController.h:
644         (WebKit::PDFViewController::pdfView):
645         * UIProcess/API/mac/WKView.mm:
646         (-[WKView accessibilityFocusedUIElement]):
647         (-[WKView accessibilityHitTest:]):
648         (-[WKView accessibilityAttributeValue:]):
649
650 2011-03-21  Stephanie Lewis  <slewis@apple.com>
651
652         Reviewed by Simon Fraser.
653
654         https://bugs.webkit.org/show_bug.cgi?id=56798
655         Wrap autorelease pools around calls that can have pathological memory growth on Membuster.  
656         Only wrap the main runloop because some background threads are not expected to call into 
657         objc and an autorelease pool could mask bugs.
658
659         * Platform/mac/RunLoopMac.mm:
660         (RunLoop::performWork):
661         (RunLoop::TimerBase::timerFired):
662         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
663         (WebKit::LayerTreeHostMac::flushPendingLayerChangesRunLoopObserverCallback):
664
665 2011-03-22  Anders Carlsson  <andersca@apple.com>
666
667         Reviewed by Sam Weinig.
668
669         OBJECT element with DivX source is always downloaded
670         https://bugs.webkit.org/show_bug.cgi?id=56879
671
672         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
673         (WebKit::getPluginInfoFromPropertyLists):
674         Always try to split every element in the "WebPluginExtensions" array, since the DivX plug-in
675         specifies multiple file extensions in a single element.
676         
677         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
678         (WebKit::pluginSupportsExtension):
679         Add a new helper function.
680
681         (WebKit::WebFrameLoaderClient::objectContentType):
682         If we can't find the MIME for an extension, explicitly check if there's a plugin that claims to
683         handle the given extension.
684
685 2011-03-22  Brady Eidson  <beidson@apple.com>
686
687         Reviewed by Sam Weinig.
688
689         Rename the synchronous icon database messages to be prefixed with "synchronous"
690
691         * UIProcess/WebIconDatabase.cpp:
692         (WebKit::WebIconDatabase::synchronousIconDataForPageURL):
693         (WebKit::WebIconDatabase::synchronousIconURLForPageURL):
694         (WebKit::WebIconDatabase::synchronousIconDataKnownForIconURL):
695         (WebKit::WebIconDatabase::synchronousLoadDecisionForIconURL):
696         * UIProcess/WebIconDatabase.h:
697         * UIProcess/WebIconDatabase.messages.in:
698
699         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
700         (WebKit::WebIconDatabaseProxy::synchronousIconForPageURL):
701
702 2011-03-22  Sam Weinig  <sam@webkit.org>
703
704         Rubber-stamped by Anders Carlsson.
705
706         Loading a new tab does not dismiss Lookup
707         <rdar://problem/9138391> 
708
709         * UIProcess/API/mac/WKView.mm:
710         (-[WKView viewDidMoveToWindow]):
711         Hide the dictionary popup when moving the WKView out of a window.
712
713 2011-03-22  Anders Carlsson  <andersca@apple.com>
714
715         Reviewed by Sam Weinig.
716
717         Microsoft Silverlight playback shows artifacts
718         https://bugs.webkit.org/show_bug.cgi?id=56863
719         <rdar://problem/9103136>
720
721         * PluginProcess/PluginControllerProxy.cpp:
722         (WebKit::PluginControllerProxy::paint):
723         If the plug-in is transparent, clear the dirty rect before painting.
724
725         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
726         (WebKit::NetscapePluginModule::determineQuirks):
727         Add the MakeTransparentIfBackgroundAttributeExists quirk for Silverlight plug-ins.
728
729         * Shared/Plugins/PluginQuirks.h:
730         Add MakeTransparentIfBackgroundAttributeExists quirk.
731
732         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
733         (WebKit::NPN_SetValue):
734         Handle NPPVpluginTransparentBool.
735
736         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
737         (WebKit::NetscapePlugin::NetscapePlugin):
738         Initialize m_isTransparent to false.
739
740         (WebKit::NetscapePlugin::setIsTransparent):
741         Set m_isTransparent.
742
743         (WebKit::NetscapePlugin::initialize):
744         If the plug-in has the MakeTransparentIfBackgroundAttributeExists quirk, make it transparent
745         if there's a 'background' attribute.
746
747         (WebKit::NetscapePlugin::isTransparent):
748         Add getter.
749
750         * WebProcess/Plugins/Plugin.h:
751         Add isTransparent().
752
753         * WebProcess/Plugins/PluginProxy.cpp:
754         (WebKit::PluginProxy::paint):
755         Always copy the plug-in backing store to the plug-in proxy backing store.
756
757         (WebKit::PluginProxy::isTransparent):
758         Add getter that should never be called.
759
760         (WebKit::PluginProxy::update):
761         Always copy the plug-in backing store to the plug-in proxy backing store.
762
763 2011-03-22  Anders Carlsson  <andersca@apple.com>
764
765         Reviewed by Sam Weinig.
766
767         Crash when calling PluginProxy::evaluate on a destroyed plug-in
768         https://bugs.webkit.org/show_bug.cgi?id=56848
769         <rdar://problem/9168975>
770
771         Return early if the NPObject doesn't exist anymore.
772
773         * WebProcess/Plugins/PluginProxy.cpp:
774         (WebKit::PluginProxy::evaluate):
775
776 2011-03-22  Sam Weinig  <sam@webkit.org>
777
778         Reviewed by Adam Roben.
779
780         WebKit2: Cannot make a selection past the end of the visible page (no autoscrolling)
781         <rdar://problem/8823874>
782         https://bugs.webkit.org/show_bug.cgi?id=56847
783
784         * Shared/mac/WebEventFactory.mm:
785         (WebKit::currentMouseButton):
786         (WebKit::mouseButtonForEvent):
787         Add mouse button for mouseEnter/Exit events. [NSEvent buttonNumber] doesn't seem to give the right result
788         for these events, but getting the currentMouseButton does work.
789
790 2011-03-21  Brady Eidson  <beidson@apple.com>
791
792         Fix Mac release builds after https://bugs.webkit.org/show_bug.cgi?id=56783
793
794         * Platform/mac/Logging.mac.mm:
795
796 2011-03-21  Brady Eidson  <beidson@apple.com>
797
798         Reviewed by Brian Weinstein.
799
800         https://bugs.webkit.org/show_bug.cgi?id=56783
801         Actually hook up WebKit2 logging on Mac.
802
803         * Platform/Logging.cpp:
804         (WebKit::initializeLogChannel):
805         * Platform/Logging.h:
806         * Platform/mac/Logging.mac.mm: Added.
807         (WebKit::initializeLogChannel):
808  
809        * UIProcess/WebContext.cpp:
810         (WebKit::WebContext::WebContext): Initialize logging if necessary.
811
812         * WebKit2.xcodeproj/project.pbxproj:
813
814 2011-03-21  Alexey Proskuryakov  <ap@apple.com>
815
816         Reviewed by Darin Adler.
817
818         REGRESSION (r81269): WebKit2 gets into an infinite recursion after an unhandled command key
819         https://bugs.webkit.org/show_bug.cgi?id=56782
820         <rdar://problem/9151993>
821
822         * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::doneWithKeyEvent):
823         Factored out code for resending an event and moved it to WKView.
824
825         * UIProcess/API/mac/WKView.mm:
826         (-[WKView performKeyEquivalent:]): Don't zero out _keyDownEventBeingResent, it's easier
827         to just do that in _resendKeyDownEvent:.
828         (-[WKView keyDown:]): Ditto.
829         (-[WKView _resendKeyDownEvent:]): Moved from PageClientImpl.mm. Added an assertion that we
830         are not already resending an event - it would be too confusing if we ever had to do that,
831         but looks like this never happens.
832
833         * UIProcess/API/mac/WKViewInternal.h: Exposed _resendKeyDownEvent.
834
835 2011-03-21  Anders Carlsson  <andersca@apple.com>
836
837         Reviewed by Sam Weinig.
838
839         QT plug-in fails to load contextual menu
840         https://bugs.webkit.org/show_bug.cgi?id=56777
841         <rdar://problem/8979033>
842
843         Open a Carbon resource map and make it the current map when calling NP_Initialize.
844
845         * Platform/Module.cpp:
846         (WebKit::Module::Module):
847         Initialize m_bundleResourceMap to -1.
848
849         * Platform/Module.h:
850         Add m_bundleResourceMap.
851
852         * Platform/mac/ModuleMac.mm:
853         (WebKit::Module::unload):
854         Close the resource map.
855
856         (WebKit::Module::bundleResourceMap):
857         Open a resource map if necessary.
858
859         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
860         (WebKit::NetscapePluginModule::tryLoad):
861         Get the resource map and make it current before calling NP_Initialize.
862
863 2011-03-21  Anders Carlsson  <andersca@apple.com>
864
865         Reviewed by Sam Weinig.
866
867         Plug-in process crashes if it fails to load a plug-in module
868         https://bugs.webkit.org/show_bug.cgi?id=56775
869
870         * PluginProcess/PluginControllerProxy.cpp:
871         (WebKit::PluginControllerProxy::initialize):
872         If NetscapePlugin::create returns null, call removePluginControllerProxy with a null plug-in.
873
874         * PluginProcess/WebProcessConnection.cpp:
875         (WebKit::WebProcessConnection::removePluginControllerProxy):
876         Remove an incorrect assertion. Don't invalidate the remote object map if the plug-in is null.
877
878 2011-03-21  Anders Carlsson  <andersca@apple.com>
879
880         Reviewed by Sam Weinig.
881
882         QT plug-in loads controller at top of movie not bottom
883         https://bugs.webkit.org/show_bug.cgi?id=56764
884         <rdar://problem/8979037>
885
886         Create a layer with geometryFlipped set and add the plug-in layer as a sublayer,
887         matching WebKit1.
888
889         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
890         (WebKit::NetscapePlugin::platformPostInitialize):
891
892 2011-03-21  Sam Weinig  <sam@webkit.org>
893
894         Reviewed by Anders Carlsson.
895
896         WebKit2 needs preferences to change security knobs
897         https://bugs.webkit.org/show_bug.cgi?id=56762
898
899         Add preferences for WebSecurityEnabled, UniversalAccessFromFileURLsAllowed
900         and FileAccessFromFileURLsAllowed.
901
902         * Shared/WebPreferencesStore.h:
903         * UIProcess/API/C/WKPreferences.cpp:
904         (WKPreferencesSetWebSecurityEnabled):
905         (WKPreferencesGetWebSecurityEnabled):
906         (WKPreferencesSetUniversalAccessFromFileURLsAllowed):
907         (WKPreferencesGetUniversalAccessFromFileURLsAllowed):
908         (WKPreferencesSetFileAccessFromFileURLsAllowed):
909         (WKPreferencesGetFileAccessFromFileURLsAllowed):
910         * UIProcess/API/C/WKPreferencesPrivate.h:
911         * WebProcess/WebPage/WebPage.cpp:
912         (WebKit::WebPage::updatePreferences):
913
914 2011-03-21  Sam Weinig  <sam@webkit.org>
915
916         Reviewed by Anders Carlsson.
917
918         Remove old DrawingArea and LayerHostingView code from WKView.
919
920         * UIProcess/API/mac/WKView.mm:
921         (-[WKView drawRect:]):
922         (-[WKView hitTest:]):
923         (-[WKView WebKit::]):
924
925 2011-03-21  Sam Weinig  <sam@webkit.org>
926
927         Reviewed by Anders Carlsson.
928
929         Need WebKit2 API for creating a page with a specific main frame name
930         https://bugs.webkit.org/show_bug.cgi?id=56759
931
932         * Shared/WebPageCreationParameters.cpp:
933         (WebKit::WebPageCreationParameters::encode):
934         (WebKit::WebPageCreationParameters::decode):
935         * Shared/WebPageCreationParameters.h:
936         Add mainFrameName to creation parameters.
937
938         * UIProcess/API/mac/WKView.h:
939         * UIProcess/API/mac/WKView.mm:
940         (-[WKView initWithFrame:]):
941         (-[WKView initWithFrame:contextRef:]):
942         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
943         (-[WKView initWithFrame:contextRef:pageGroupRef:mainFrameName:]):
944         Add new initializer which takes a main frame name.
945
946         * UIProcess/WebPageProxy.cpp:
947         (WebKit::WebPageProxy::setMainFrameName):
948         (WebKit::WebPageProxy::creationParameters):
949         * UIProcess/WebPageProxy.h:
950         Store the main frame name for initialization/re-initialization.
951
952         * WebProcess/WebPage/WebFrame.cpp:
953         (WebKit::WebFrame::createMainFrame):
954         * WebProcess/WebPage/WebFrame.h:
955         * WebProcess/WebPage/WebPage.cpp:
956         (WebKit::WebPage::WebPage):
957         Pass the name to main frame creation.
958
959 2011-03-20  Bill Budge  <bbudge@chromium.org>
960
961         Reviewed by Adam Barth.
962
963         Rename ThreadSafeShared to ThreadSafeRefCounted
964         https://bugs.webkit.org/show_bug.cgi?id=56714
965
966         No new tests. Exposes no new functionality.
967
968         * Platform/CoreIPC/Connection.h:
969         * Platform/WorkQueue.h:
970         * Platform/win/WorkQueueWin.cpp:
971         * UIProcess/Launcher/ProcessLauncher.h:
972         * UIProcess/Launcher/ThreadLauncher.h:
973
974 2011-03-19  Anton D'Auria  <adauria@apple.com>
975
976         Reviewed by Alexey Proskuryakov.
977
978         ApplicationCacheGroup is not obsolete after being deleted via ApplicationCacheStorage::deleteEntriesForOrigin
979         https://bugs.webkit.org/show_bug.cgi?id=56415
980
981         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp: calling ApplicationCacheGroup::deleteCacheGroupsForOrigin
982         instead of ApplicationCacheStorage::deleteEntriesForOrigin.
983         (WebKit::WebApplicationCacheManager::deleteEntriesForOrigin):
984
985 2011-03-18  Sam Weinig  <sam@webkit.org>
986
987         Attempt to fix the WinCairo build.
988
989         * win/WebKit2.vcproj:
990
991 2011-03-18  Anders Carlsson  <andersca@apple.com>
992
993         Reviewed by Dan Bernstein.
994
995         Empty gray page after going back from a PDF
996         https://bugs.webkit.org/show_bug.cgi?id=56694
997         <rdar://problem/8811854>
998
999         Update m_frameHasCustomRepresentation when loading a page that's in the page cache.
1000
1001         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1002         (WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame):
1003
1004 2011-03-18  Anders Carlsson  <andersca@apple.com>
1005
1006         Reviewed by Sam Weinig.
1007
1008         Crash when sending a sync message ends up invalidating the connection
1009         https://bugs.webkit.org/show_bug.cgi?id=56686
1010         <rdar://problem/9048781>
1011
1012         Guard against a null client.
1013
1014         * Platform/CoreIPC/Connection.cpp:
1015         (CoreIPC::Connection::sendSyncMessage):
1016
1017 2011-03-18  Balazs Kelemen  <kbalazs@webkit.org>
1018
1019         Reviewed by Benjamin Poulain.
1020
1021         [Qt][WK2] Need a way to debug the web process after the UI process dies
1022         https://bugs.webkit.org/show_bug.cgi?id=56116
1023
1024         Allow the web process to outlive it's parent process
1025         in debug builds if the QT_WEBKIT_KEEP_ALIVE_WEB_PROCESS
1026         environment variable is set.
1027
1028         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
1029         (WebKit::QtWebProcess::setupChildProcess): Used getenv
1030         since the prctl call is already in a Linux-only block
1031         and the implementation in this file is a candidate
1032         for sharing across ports in the future.
1033
1034 2011-03-18  Darin Adler  <darin@apple.com>
1035
1036         Reviewed by Anders Carlsson.
1037
1038         Command-period does not stop load when page has focus in WebKit2
1039         https://bugs.webkit.org/show_bug.cgi?id=56601
1040
1041         * UIProcess/API/mac/WKView.mm:
1042         (-[WKView doCommandBySelector:]): If called outside interpretKeyEvents,
1043         call through to super.
1044         (-[WKView insertText:]): Assert that we are inside interpretKeyEvents.
1045         (-[WKView unmarkText]): Ditto.
1046         (-[WKView setMarkedText:selectedRange:]): Ditto.
1047         (-[WKView _interceptKeyEvent:]): Set a flag to indicate we are inside
1048         interpretKeyEvents for use by the above.
1049
1050 2011-03-18  Brady Eidson  <beidson@apple.com>
1051
1052         Reviewed by Sam Weinig.
1053
1054         https://bugs.webkit.org/show_bug.cgi?id=56425
1055         More groundwork for WebKit2 IconDatabase
1056
1057         -Update the synchronous method names to be prefixed with "synchronous."
1058         -Add empty implementations for the asynchronous accessors.
1059
1060         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
1061         (WebKit::WebIconDatabaseProxy::setEnabled):
1062         (WebKit::WebIconDatabaseProxy::synchronousIconForPageURL):
1063         (WebKit::WebIconDatabaseProxy::synchronousIconURLForPageURL):
1064         (WebKit::WebIconDatabaseProxy::synchronousIconDataKnownForIconURL):
1065         (WebKit::WebIconDatabaseProxy::synchronousLoadDecisionForIconURL):
1066         (WebKit::WebIconDatabaseProxy::supportsAsynchronousMode):
1067         (WebKit::WebIconDatabaseProxy::loadDecisionForIconURL):
1068         (WebKit::WebIconDatabaseProxy::iconDataForIconURL):
1069         * WebProcess/IconDatabase/WebIconDatabaseProxy.h:
1070
1071 2011-03-18  Alejandro G. Castro  <alex@igalia.com>
1072
1073         Reviewed by Martin Robinson.
1074
1075         Fixed compilation after r80925.
1076
1077         * GNUmakefile.am:
1078         * UIProcess/gtk/WebFullScreenManagerProxyGtk.cpp: Added.
1079         (WebKit::WebFullScreenManagerProxy::enterFullScreen):
1080         (WebKit::WebFullScreenManagerProxy::exitFullScreen):
1081         (WebKit::WebFullScreenManagerProxy::beganEnterFullScreenAnimation):
1082         (WebKit::WebFullScreenManagerProxy::finishedEnterFullScreenAnimation):
1083         (WebKit::WebFullScreenManagerProxy::beganExitFullScreenAnimation):
1084         (WebKit::WebFullScreenManagerProxy::finishedExitFullScreenAnimation):
1085         (WebKit::WebFullScreenManagerProxy::enterAcceleratedCompositingMode):
1086         (WebKit::WebFullScreenManagerProxy::exitAcceleratedCompositingMode):
1087         (WebKit::WebFullScreenManagerProxy::getFullScreenRect):
1088         * WebProcess/FullScreen/gtk/WebFullScreenManagerGtk.cpp: Added.
1089         (WebKit::WebFullScreenManagerGtk::WebFullScreenManagerGtk):
1090         (WebKit::WebFullScreenManager::create):
1091         (WebKit::WebFullScreenManagerGtk::setRootFullScreenLayer):
1092         (WebKit::WebFullScreenManagerGtk::beginEnterFullScreenAnimation):
1093         (WebKit::WebFullScreenManagerGtk::beginExitFullScreenAnimation):
1094         * WebProcess/FullScreen/gtk/WebFullScreenManagerGtk.h: Added.
1095
1096 2011-03-18  Alejandro G. Castro  <alex@igalia.com>
1097
1098         Unreviewed, fixed compilation after r81208.
1099
1100         * GNUmakefile.am:
1101
1102 2011-03-18  John Sullivan  <sullivan@apple.com>
1103
1104         Reviewed by Dan Bernstein.
1105
1106         https://bugs.webkit.org/show_bug.cgi?id=56645
1107         Assertion fires when hidden Find-on-Page matches are encountered in WebKit2
1108
1109         * WebProcess/WebPage/FindController.cpp:
1110         (WebKit::FindController::updateFindIndicator):
1111         Bail out if the selection rect is empty, before trying to generate an appropriately-sized
1112         bitmap. (Previously it was bailing out afterwards, but encountering an assertion in debug
1113         builds along the way.)
1114
1115 2011-03-18  Mark Rowe  <mrowe@apple.com>
1116
1117         Rubber-stamped by Jon Honeycutt.
1118
1119         <rdar://problem/9153929> PluginProcess fails to launch due to PluginProcessShim.dylib building for 64-bit only
1120
1121         Fix a bogus change from r81392 that made PluginProcessShim.xcconfig import DebugRelease.xcconfig.
1122         As its name suggests, DebugRelease.xcconfig is only applicable for the debug and release configurations.
1123         It overrides the valid build architectures and also restricts the build to only the active architecture.
1124         
1125         * Configurations/PluginProcessShim.xcconfig: Import BaseTarget.xcconfig instead. This is what
1126         each target-specific .xcconfig file should import.
1127
1128 2011-03-17  Mark Rowe  <mrowe@apple.com>
1129
1130         Fix the build.
1131
1132         * WebKit2.xcodeproj/project.pbxproj:
1133
1134 2011-03-17  Anders Carlsson  <andersca@apple.com>
1135
1136         Reviewed by Sam Weinig.
1137
1138         Implement PluginProcessProxy::setFullscreenWindowIsShowing
1139         https://bugs.webkit.org/show_bug.cgi?id=56618
1140
1141         * UIProcess/Plugins/PluginProcessProxy.cpp:
1142         (WebKit::PluginProcessProxy::PluginProcessProxy):
1143         Initialize m_fullscreenWindowIsShowing.
1144
1145         (WebKit::PluginProcessProxy::didClose):
1146         if m_fullscreenWindowIsShowing is true, call exitFullscreen.
1147
1148         * UIProcess/Plugins/PluginProcessProxy.h:
1149         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1150         (WebKit::PluginProcessProxy::getPluginProcessSerialNumber):
1151         Add helper function for getting a PSN for the plug-in process.
1152
1153         (WebKit::PluginProcessProxy::makePluginProcessTheFrontProcess):
1154         Make the plug-in process the front process.
1155
1156         (WebKit::PluginProcessProxy::makeUIProcessTheFrontProcess):
1157         Make the current process (the UI process) the front process.
1158
1159         (WebKit::PluginProcessProxy::setFullscreenWindowIsShowing):
1160         Call enterFullscreen or exitFullscreen.
1161
1162         (WebKit::PluginProcessProxy::enterFullscreen):
1163         Make the plug-in process the front process and hide the menu bar.
1164
1165         (WebKit::PluginProcessProxy::exitFullscreen):
1166         Show the menu bar and if necessary make the UI process the front process.
1167
1168         (WebKit::PluginProcessProxy::endModal):
1169         call makeUIProcessTheFrontProcess.
1170
1171         (WebKit::PluginProcessProxy::applicationDidBecomeActive):
1172         Call makePluginProcessTheFrontProcess.
1173
1174 2011-03-17  Adam Roben  <aroben@apple.com>
1175
1176         Make bidi text in <select> menus in WebKit2 on Windows match WebKit1
1177
1178         Fixes <http://webkit.org/b/56614> 3 <select> bidi tests failing on Windows 7 Release
1179         (WebKit2 Tests)
1180
1181         Reviewed by Sam Weinig.
1182
1183         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1184         (WebKit::WebChromeClient::selectItemWritingDirectionIsNatural):
1185         (WebKit::WebChromeClient::selectItemAlignmentFollowsMenuWritingDirection):
1186         On Windows, return the same values we return in WebKit1.
1187
1188 2011-03-17  Anders Carlsson  <andersca@apple.com>
1189
1190         Reviewed by Sam Weinig.
1191
1192         Implement PluginProcessProxy::setModalWindowIsShowing
1193         https://bugs.webkit.org/show_bug.cgi?id=56615
1194
1195         * UIProcess/Plugins/PluginProcessProxy.cpp:
1196         (WebKit::PluginProcessProxy::PluginProcessProxy):
1197         Initialize m_modalWindowIsShowing.
1198
1199         (WebKit::PluginProcessProxy::didClose):
1200         If m_modalWindowIsShowing is true, we must call endModal.
1201
1202         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1203         (-[WKPlaceholderModalWindow _wantsUserAttention]):
1204         Add a WKPlaceholderModalWindow.
1205
1206         (WebKit::PluginProcessProxy::setModalWindowIsShowing):
1207         Call beginModal or endModal depending on whether we're showing a modal window or not.
1208
1209         (WebKit::PluginProcessProxy::beginModal):
1210         Create a fake window and start a nested run loop. Listen for NSApplicationWillBecomeActiveNotification notifications.
1211
1212         (WebKit::PluginProcessProxy::endModal):
1213         Tear down the window and the run loop.
1214
1215         (WebKit::PluginProcessProxy::applicationDidBecomeActive):
1216         Make sure that the plug-in process is frontmost.
1217
1218 2011-03-17  Jeff Miller  <jeffm@apple.com>
1219
1220         Reviewed by Adam Roben.
1221
1222         Web page shouldn't swallow alt-key combinations on Windows
1223         https://bugs.webkit.org/show_bug.cgi?id=56612
1224         
1225         Make Alt+Left Arrow and Alt+Right Arrow go back and forward, but make
1226         sure any alt-key combinations bubble up to the client.
1227
1228         * WebProcess/WebPage/win/WebPageWin.cpp:
1229         (WebKit::WebPage::performDefaultBehaviorForKeyEvent): Make Alt+Left Arrow and Alt+Right Arrow go back and forward, ignore any other alt-key combinations.
1230
1231 2011-03-17  Anders Carlsson  <andersca@apple.com>
1232
1233         Reviewed by Sam Weinig.
1234
1235         Send SetModalWindowIsShowing and SetFullscreenWindowIsShowing messages to the UI process
1236         https://bugs.webkit.org/show_bug.cgi?id=56610
1237
1238         * PluginProcess/mac/PluginProcessMac.mm:
1239         (WebKit::FullscreenWindowTracker::FullscreenWindowTracker):
1240         Add fullscreen window tracker class.
1241
1242         (WebKit::rectCoversAnyScreen):
1243         Return whether the given rect covers any screen.
1244
1245         (WebKit::windowCoversAnyScreen):
1246         Return whether the given window covers any screen.
1247
1248         (WebKit::FullscreenWindowTracker::windowShown):
1249         If we're showing a fullscreen window, call PluginProcess::setFullscreenWindowIsShowing.
1250
1251         (WebKit::FullscreenWindowTracker::windowHidden):
1252         If we're hiding the last fullscreen window, call PluginProcess::setFullscreenWindowIsShowing.
1253
1254         (WebKit::cocoaWindowShown):
1255         (WebKit::cocoaWindowHidden):
1256         (WebKit::carbonWindowShown):
1257         (WebKit::carbonWindowHidden):
1258         Call the window tracking functions.
1259
1260         (WebKit::setModal):
1261         Call PluginProcess::setModalWindowIsShowing.
1262
1263         (WebKit::PluginProcess::setModalWindowIsShowing):
1264         (WebKit::PluginProcess::setFullscreenWindowIsShowing):
1265         Send CoreIPC messages.
1266
1267         * UIProcess/Plugins/PluginProcessProxy.h:
1268         * UIProcess/Plugins/PluginProcessProxy.messages.in:
1269         Add new messages.
1270
1271         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1272         (WebKit::PluginProcessProxy::setModalWindowIsShowing):
1273         (WebKit::PluginProcessProxy::setFullscreenWindowIsShowing):
1274         Add stubs.
1275
1276 2011-03-17  Sam Weinig  <sam@webkit.org>
1277
1278         Reviewed by Brady Eidson.
1279
1280         Allow passing a certificate chain as a user message
1281         <rdar://problem/8951709>
1282         https://bugs.webkit.org/show_bug.cgi?id=56605
1283
1284         * Shared/API/c/mac/WKCertificateInfoMac.h:
1285         * Shared/API/c/mac/WKCertificateInfoMac.mm:
1286         (WKCertificateInfoCreateWithCertficateChain):
1287         Added. Creates a WKCertificate from a certificate chain.
1288
1289         * Shared/UserMessageCoders.h:
1290         (WebKit::UserMessageEncoder::baseEncode):
1291         (WebKit::UserMessageDecoder::baseDecode):
1292         Add encoding/decoding of WebCertificateInfo.
1293
1294 2011-03-17  Anders Carlsson  <andersca@apple.com>
1295
1296         Reviewed by Sam Weinig.
1297
1298         Add PluginProcessShim hooks for when windows are shown and hidden
1299         https://bugs.webkit.org/show_bug.cgi?id=56597
1300
1301         * Configurations/PluginProcessShim.xcconfig:
1302         Add HEADER_SEARCH_PATHS so we can find WebKitSystemInterface.h.
1303
1304         * PluginProcess/mac/PluginProcessMac.mm:
1305         (WebKit::cocoaWindowShown):
1306         (WebKit::cocoaWindowHidden):
1307         (WebKit::carbonWindowShown):
1308         (WebKit::carbonWindowHidden):
1309         (WebKit::setModal):
1310         (WebKit::PluginProcess::initializeShim):
1311         Add empty stubs.
1312
1313         * PluginProcess/mac/PluginProcessShim.h:
1314         * PluginProcess/mac/PluginProcessShim.mm:
1315         (WebKit::beginModal):
1316         (WebKit::endModal):
1317         Keep a modal count and call setModal accordingly.
1318
1319         (WebKit::shim_NSApplication_RunModalForWindow):
1320         (WebKit::shimModalDialog):
1321         (WebKit::shimAlert):
1322         Call beginModal/endModal.
1323
1324         (WebKit::shimShowWindow):
1325         (WebKit::shimHideWindow):
1326         Call the shim functions.
1327         
1328         (WebKit::WebKitPluginProcessShimInitialize):
1329         Listen for notifications and call the necessary shim functions.
1330
1331         * WebKit2.xcodeproj/project.pbxproj:
1332         Link the plug-in process shim with AppKit and QuartzCore and WKSI.
1333
1334 2011-03-17  Jeff Miller  <jeffm@apple.com>
1335
1336         Use a consistent set of file patterns in the svn:ignore property for all .xcodeproj directories, specifically:
1337         
1338         *.mode*
1339         *.pbxuser
1340         *.perspective*
1341         project.xcworkspace
1342         xcuserdata
1343
1344         * WebKit2.xcodeproj: Modified property svn:ignore.
1345
1346 2011-03-17  Sam Weinig  <sam@webkit.org>
1347
1348         Reviewed by Anders Carlsson.
1349
1350         WKErrors need the PeerCertificateChain for certificate errors
1351         <rdar://problem/8951784>
1352         https://bugs.webkit.org/show_bug.cgi?id=56592
1353
1354         * Shared/WebCoreArgumentCoders.h:
1355         Special case encoding/decoding of ResourceErrors for the mac.
1356
1357         * Shared/mac/PlatformCertificateInfo.h:
1358         * Shared/mac/PlatformCertificateInfo.mm:
1359         (WebKit::PlatformCertificateInfo::PlatformCertificateInfo):
1360         Add constructor that take the PeerCertificateChain as CFArrayRef.
1361
1362         * Shared/mac/WebCoreArgumentCodersMac.mm:
1363         (CoreIPC::encodeResourceError):
1364         (CoreIPC::decodeResourceError):
1365         Add encode/decode for ResourceError using the underlying NSError
1366         and encoding/decoding as much of the userInfo as we know how to.
1367         Right now this includes all string values and the PeerCertificateChain.
1368
1369 2011-03-17  John Sullivan  <sullivan@apple.com>
1370
1371         Reviewed by Adam Roben.
1372
1373         https://bugs.webkit.org/show_bug.cgi?id=56574
1374         Dealloc'ing a WKView can leave a stale reference to it in NSWindow
1375
1376         * UIProcess/API/mac/WKView.mm:
1377         (-[WKView viewWillMoveToWindow:]):
1378         Clear the outgoing window's growBoxOwner if it is this view.
1379
1380 2011-03-17  Anders Carlsson  <andersca@apple.com>
1381
1382         Rubber-stamped by John Sullivan.
1383
1384         Rename PluginProcessShim.cpp to PluginProcessShim.mm.
1385
1386         * PluginProcess/mac/PluginProcessShim.cpp: Removed.
1387         * PluginProcess/mac/PluginProcessShim.mm: Copied from PluginProcess/mac/PluginProcessShim.cpp.
1388         * WebKit2.xcodeproj/project.pbxproj:
1389
1390 2011-03-17  Anders Carlsson  <andersca@apple.com>
1391
1392         Reviewed by Darin Adler.
1393
1394         Invalidate all NPObjects for a plug-in when that plug-in is destroyed
1395         https://bugs.webkit.org/show_bug.cgi?id=56511
1396         <rdar://problem/8993491>
1397
1398         Before this change, we would invalidate NPObjectProxy objects and delete NPObjectMessageReceiver
1399         objects when the last plug-in of a certain type was destroyed. Doing so caused us to hold on to memory
1400         which we don't need, and could also lead to crashes if the NPObjectMessageReceiver would get a message and
1401         tried to invoke it on a already deallocated NPObject.
1402
1403         * PluginProcess/PluginControllerProxy.cpp:
1404         (WebKit::PluginControllerProxy::initialize):
1405         If we fail to initialize, call removePluginControllerProxy instead of having WebProcessConnection do so.
1406
1407         (WebKit::PluginControllerProxy::destroy):
1408         Pass the plug-in to removePluginControllerProxy.
1409
1410         * PluginProcess/WebProcessConnection.cpp:
1411         (WebKit::WebProcessConnection::removePluginControllerProxy):
1412         Call NPRemoteObjectMap::pluginDestroyed when the plug-in has been destroyed.
1413
1414         (WebKit::WebProcessConnection::createPlugin):
1415         Don't call removePluginControllerProxy if the plug-in fails to initialize. PluginControllerProxy::initialize now
1416         takes care of doing this.
1417
1418         * Shared/Plugins/NPObjectMessageReceiver.cpp:
1419         (WebKit::NPObjectMessageReceiver::NPObjectMessageReceiver):
1420         (WebKit::NPObjectMessageReceiver::~NPObjectMessageReceiver):
1421         * Shared/Plugins/NPObjectMessageReceiver.h:
1422         Remove m_shouldReleaseObjectWhenInvalidating, we now know that no NPObjects will have been deallocated
1423         by the time the NPObjectMessageReceiver is destroyed.
1424
1425         (WebKit::NPObjectMessageReceiver::plugin):
1426         Add getter.
1427         
1428         * Shared/Plugins/NPObjectProxy.h:
1429         (WebKit::NPObjectProxy::plugin):
1430         Add getter.
1431         
1432         * Shared/Plugins/NPRemoteObjectMap.cpp:
1433         (WebKit::NPRemoteObjectMap::NPRemoteObjectMap):
1434         Remove m_isInvalidating.
1435
1436         (WebKit::NPRemoteObjectMap::npObjectProxyDestroyed):
1437         Simplify code.
1438
1439         (WebKit::NPRemoteObjectMap::pluginDestroyed):
1440         Rename invalidate to pluginDestroyed. Only invalidate/delete objects that belong to the given plug-in.
1441
1442         * Shared/Plugins/NPRemoteObjectMap.h:
1443         Remove m_isInvalidating.
1444         
1445         * WebProcess/Plugins/PluginProcessConnection.cpp:
1446         (WebKit::PluginProcessConnection::removePluginProxy):
1447         Call NPRemoteObjectMap::pluginDestroyed when the plug-in has been destroyed.
1448
1449 2011-03-17  Oleg Romashin  <oleg.romashin@nokia.com>
1450
1451         Reviewed by Anders Carlsson.
1452
1453         Teach WebKit2 messages.py generator to ifdef headers include
1454         which are related to ifdef-ed methods/types
1455         https://bugs.webkit.org/show_bug.cgi?id=55658
1456
1457         * Scripts/webkit2/messages.py:
1458         * Scripts/webkit2/messages_unittest.py:
1459
1460 2011-03-16  Joseph Pecoraro  <joepeck@webkit.org>
1461
1462         Reviewed by Kenneth Rohde Christiansen.
1463
1464         Viewport no longer allows an auto value for "user-scalable"
1465         https://bugs.webkit.org/show_bug.cgi?id=55416
1466
1467         Make the default value for userScalable be true.
1468
1469         * UIProcess/API/qt/qwkpage.cpp:
1470         (QWKPage::viewportAttributesForSize):
1471
1472 2011-03-16  Anders Carlsson  <andersca@apple.com>
1473
1474         Reviewed by Dan Bernstein.
1475
1476         NPObjectProxy and NPObjectMessageReceiver objects should know their Plugin object
1477         https://bugs.webkit.org/show_bug.cgi?id=56506
1478
1479         * PluginProcess/PluginControllerProxy.cpp:
1480         (WebKit::PluginControllerProxy::windowScriptNPObject):
1481         (WebKit::PluginControllerProxy::pluginElementNPObject):
1482         (WebKit::PluginControllerProxy::evaluate):
1483         (WebKit::PluginControllerProxy::getPluginScriptableNPObject):
1484         * Shared/Plugins/NPObjectMessageReceiver.cpp:
1485         (WebKit::NPObjectMessageReceiver::create):
1486         (WebKit::NPObjectMessageReceiver::NPObjectMessageReceiver):
1487         (WebKit::NPObjectMessageReceiver::invoke):
1488         (WebKit::NPObjectMessageReceiver::invokeDefault):
1489         (WebKit::NPObjectMessageReceiver::getProperty):
1490         (WebKit::NPObjectMessageReceiver::setProperty):
1491         (WebKit::NPObjectMessageReceiver::construct):
1492         * Shared/Plugins/NPObjectMessageReceiver.h:
1493         * Shared/Plugins/NPObjectProxy.cpp:
1494         (WebKit::NPObjectProxy::create):
1495         (WebKit::NPObjectProxy::NPObjectProxy):
1496         (WebKit::NPObjectProxy::invalidate):
1497         (WebKit::NPObjectProxy::initialize):
1498         (WebKit::NPObjectProxy::invoke):
1499         (WebKit::NPObjectProxy::invokeDefault):
1500         (WebKit::NPObjectProxy::getProperty):
1501         (WebKit::NPObjectProxy::setProperty):
1502         (WebKit::NPObjectProxy::construct):
1503         * Shared/Plugins/NPObjectProxy.h:
1504         * Shared/Plugins/NPRemoteObjectMap.cpp:
1505         (WebKit::NPRemoteObjectMap::createNPObjectProxy):
1506         (WebKit::NPRemoteObjectMap::registerNPObject):
1507         (WebKit::NPRemoteObjectMap::npVariantToNPVariantData):
1508         (WebKit::NPRemoteObjectMap::npVariantDataToNPVariant):
1509         * Shared/Plugins/NPRemoteObjectMap.h:
1510         * WebProcess/Plugins/PluginProxy.cpp:
1511         (WebKit::PluginProxy::pluginScriptableNPObject):
1512         (WebKit::PluginProxy::getWindowScriptNPObject):
1513         (WebKit::PluginProxy::getPluginElementNPObject):
1514         (WebKit::PluginProxy::evaluate):
1515
1516 2011-03-16  Beth Dakin  <bdakin@apple.com>
1517
1518         Reviewed by Darin Adler.
1519
1520         Fix for https://bugs.webkit.org/show_bug.cgi?id=54987 Crash beneath 
1521         WebPageProxy::viewWillStartLiveResize when resizing window after web process 
1522         crashed
1523         -and corresponding-
1524         <rdar://problem/9037685>
1525
1526         Just need simple isValid() checks here. 
1527         * UIProcess/WebPageProxy.cpp:
1528         (WebKit::WebPageProxy::initializeUIClient):
1529         (WebKit::WebPageProxy::viewWillStartLiveResize):
1530         (WebKit::WebPageProxy::viewWillEndLiveResize):
1531
1532 2011-03-16  Damian Kaleta  <dkaleta@apple.com>
1533
1534         Reviewed by Kevin Decker.
1535
1536         Add a user default that will force all plugins to opt in to non-executable data
1537         https://bugs.webkit.org/show_bug.cgi?id=56487
1538         <rdar://problem/9109095>
1539
1540         * UIProcess/Plugins/PluginProcessProxy.cpp:
1541         (WebKit::PluginProcessProxy::PluginProcessProxy):
1542         * UIProcess/Plugins/PluginProcessProxy.h:
1543         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1544         (WebKit::PluginProcessProxy::pluginNeedsExecutableHeap):
1545
1546 2011-03-16  Chris Fleizach  <cfleizach@apple.com>
1547
1548         Reviewed by Darin Adler.
1549
1550         WK2: Need to propagate enhanced accessibility flag from UI -> web process
1551         https://bugs.webkit.org/show_bug.cgi?id=56379
1552
1553         Support sending the enhanced accessibility flag between processes.
1554
1555         * UIProcess/WebContext.cpp:
1556         (WebKit::WebContext::~WebContext):
1557         (WebKit::WebContext::setEnhancedAccessibility):
1558         * UIProcess/WebContext.h:
1559         * UIProcess/gtk/WebContextGtk.cpp:
1560         (WebKit::WebContet::platformInvalidateContext):
1561         * UIProcess/mac/WebContextMac.mm:
1562         (WebKit::WebContext::platformInitializeWebProcess):
1563         (WebKit::WebContext::platformInvalidateContext):
1564         * UIProcess/qt/WebContextQt.cpp:
1565         (WebKit::WebContext::platformInvalidateContext):
1566         * UIProcess/win/WebContextWin.cpp:
1567         (WebKit::WebContext::platformInvalidateContext):
1568         * WebProcess/WebProcess.cpp:
1569         (WebKit::WebProcess::setEnhancedAccessibility):
1570         * WebProcess/WebProcess.h:
1571         * WebProcess/WebProcess.messages.in:
1572
1573 2011-03-15  Oliver Hunt  <oliver@apple.com>
1574
1575         Reviewed by Geoffrey Garen.
1576
1577         Make Structure creation require a JSGlobalData
1578         https://bugs.webkit.org/show_bug.cgi?id=56438
1579
1580         Mechanical change to make all Structure creation use a JSGlobalData&.
1581
1582         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
1583         (WebKit::JSNPMethod::JSNPMethod):
1584         * WebProcess/Plugins/Netscape/JSNPMethod.h:
1585         (WebKit::JSNPMethod::createStructure):
1586         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1587         (WebKit::JSNPObject::JSNPObject):
1588         * WebProcess/Plugins/Netscape/JSNPObject.h:
1589         (WebKit::JSNPObject::createStructure):
1590
1591 2011-03-16  Alexey Proskuryakov  <ap@apple.com>
1592
1593         Reviewed by Dan Bernstein.
1594
1595         WebKit2: Sometimes Command-[ opens a new tab and loads the back page in it
1596         https://bugs.webkit.org/show_bug.cgi?id=56477
1597         <rdar://problem/8806664>
1598
1599         * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::doneWithKeyEvent):
1600         Set NSApplication current event when re-dispatching a key event that returned from the web
1601         process unhandled. That way, code that looks at current event modifiers won't be confused.
1602
1603 2011-03-16  Sam Weinig  <sam@webkit.org>
1604
1605         Reviewed by Adam Roben.
1606
1607         Add WebKit2 API to figure out if an input or textarea was edited
1608         https://bugs.webkit.org/show_bug.cgi?id=56474
1609
1610         Expose WKBundleNodeHandleGetHTMLInputElementLastChangeWasUserEdit and
1611         WKBundleNodeHandleGetHTMLTextAreaElementLastChangeWasUserEdit. Next time,
1612         I will work on giving these functions longer names.
1613
1614         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
1615         (WKBundleNodeHandleGetHTMLInputElementLastChangeWasUserEdit):
1616         (WKBundleNodeHandleGetHTMLTextAreaElementLastChangeWasUserEdit):
1617         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
1618         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1619         (WebKit::InjectedBundleNodeHandle::htmlInputElementLastChangeWasUserEdit):
1620         (WebKit::InjectedBundleNodeHandle::htmlTextAreaElementLastChangeWasUserEdit):
1621         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
1622
1623 2011-03-16  Brady Eidson  <beidson@apple.com>
1624
1625         Reviewed by Adam Roben.
1626
1627         https://bugs.webkit.org/show_bug.cgi?id=56467
1628         IconDatabase-related crash seen in WK2 tests
1629
1630         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
1631         (WebKit::WebIconDatabaseProxy::setIconDataForIconURL): The IconLoader might set a null data for an icon, so handle that case.
1632
1633 2011-03-16  Benjamin Poulain  <benjamin.poulain@nokia.com>
1634
1635         Reviewed by Kenneth Rohde Christiansen.
1636
1637         [Qt][WK2] Loading an empty URL crashes
1638         https://bugs.webkit.org/show_bug.cgi?id=55501
1639
1640         A null WKURLRef is created in the API of WebKit 2 when converting a null string. The code
1641         of WKPageLoadURL assume the WKPageRef is not null which causes crashes if it is.
1642
1643         This patch uses the converter toWTFString() to pass from WKPageRef to WTFString. This converter
1644         ensure the returned string is a valid null string.
1645
1646         Tested through the Qt API tests.
1647
1648         * UIProcess/API/C/WKPage.cpp:
1649         (WKPageLoadURL):
1650         * UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp:
1651         (tst_QGraphicsWKView::loadEmptyUrl):
1652         * UIProcess/API/qt/tests/qwkpage/qwkpage.pro: Added.
1653         * UIProcess/API/qt/tests/qwkpage/tst_qwkpage.cpp: Added.
1654         (tst_QWKPage::init):
1655         (tst_QWKPage::cleanup):
1656         (tst_QWKPage::loadEmptyUrl):
1657         * UIProcess/API/qt/tests/tests.pro:
1658
1659 2011-03-15  Brady Eidson  <beidson@apple.com>
1660
1661         Reviewed by Sam Weinig.
1662
1663         https://bugs.webkit.org/show_bug.cgi?id=56425
1664         WebKit2 icon database.
1665
1666         Project file paperwork:
1667         * DerivedSources.make:
1668         * DerivedSources.pro:
1669         * GNUmakefile.am:
1670         * WebKit2.pri:
1671         * WebKit2.pro:
1672         * WebKit2.xcodeproj/project.pbxproj:
1673         * win/WebKit2.vcproj:
1674         * win/WebKit2Common.vsprops:
1675         * Scripts/webkit2/messages.py: Special-case capitalization for messages that start with "URL" to be lowercased
1676           to "url" instead of "uRL".
1677
1678         Add messaging-related stuff:
1679         * Platform/CoreIPC/MessageID.h:
1680         * UIProcess/WebIconDatabase.messages.in: Added.
1681         * WebProcess/IconDatabase/WebIconDatabaseProxy.messages.in: Added.
1682         * UIProcess/WebProcessProxy.cpp:
1683         (WebKit::WebProcessProxy::didReceiveMessage):
1684         (WebKit::WebProcessProxy::didReceiveSyncMessage):
1685
1686         Prep to make WebIconDatabase an API object:
1687         * Shared/APIObject.h:
1688
1689         Add an "icon DB is enabled" flag to WebProcessCreationParameters:
1690         * Shared/WebProcessCreationParameters.cpp:
1691         (WebKit::WebProcessCreationParameters::encode):
1692         (WebKit::WebProcessCreationParameters::decode):
1693         * Shared/WebProcessCreationParameters.h:
1694
1695         Add SPI for client apps to set the icon database path:
1696         * UIProcess/API/C/WKContext.cpp:
1697         (WKContextSetIconDatabasePath):
1698         * UIProcess/API/C/WKContextPrivate.h:
1699         * UIProcess/WebContext.h:
1700         (WebKit::WebContext::setIconDatabasePath):
1701
1702         Hook up initialization, clearing, and messaging for the icon database:
1703         * UIProcess/WebContext.cpp:
1704         (WebKit::WebContext::WebContext):
1705         (WebKit::WebContext::~WebContext):
1706         (WebKit::WebContext::ensureWebProcess):
1707         (WebKit::WebContext::didReceiveMessage):
1708         (WebKit::WebContext::didReceiveSyncMessage):
1709         (WebKit::WebContext::iconDatabasePath):
1710         * UIProcess/gtk/WebContextGtk.cpp:
1711         (WebKit::WebContext::platformDefaultIconDatabasePath):
1712         * UIProcess/mac/WebContextMac.mm:
1713         (WebKit::WebContext::platformDefaultIconDatabasePath):
1714         * UIProcess/qt/WebContextQt.cpp:
1715         (WebKit::WebContext::platformDefaultIconDatabasePath):
1716         * UIProcess/win/WebContextWin.cpp:
1717         (WebKit::WebContext::platformDefaultIconDatabasePath):
1718
1719         Add the UIProcess-side IconDatabase. It will be the "actual database" as well as the API object:
1720         * UIProcess/WebIconDatabase.cpp: Added.
1721         (WebKit::WebIconDatabase::create):
1722         (WebKit::WebIconDatabase::~WebIconDatabase):
1723         (WebKit::WebIconDatabase::WebIconDatabase):
1724         (WebKit::WebIconDatabase::invalidate):
1725         (WebKit::WebIconDatabase::retainIconForPageURL):
1726         (WebKit::WebIconDatabase::releaseIconForPageURL):
1727         (WebKit::WebIconDatabase::setIconURLForPageURL):
1728         (WebKit::WebIconDatabase::setIconDataForIconURL):
1729         (WebKit::WebIconDatabase::iconDataForPageURL):
1730         (WebKit::WebIconDatabase::iconURLForPageURL):
1731         (WebKit::WebIconDatabase::iconDataKnownForIconURL):
1732         (WebKit::WebIconDatabase::loadDecisionForIconURL):
1733         (WebKit::WebIconDatabase::didReceiveMessage):
1734         (WebKit::WebIconDatabase::didReceiveSyncMessage):
1735         * UIProcess/WebIconDatabase.h: Added.
1736         (WebKit::WebIconDatabase::clearContext):
1737         (WebKit::WebIconDatabase::type):
1738
1739         Add the WebProcess-side IconDatabaseProxy. It acts as the WebCore IconDatabase and operates via messaging:
1740         * WebProcess/IconDatabase: Added.
1741         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp: Added.
1742         (WebKit::WebIconDatabaseProxy::~WebIconDatabaseProxy):
1743         (WebKit::WebIconDatabaseProxy::WebIconDatabaseProxy):
1744         (WebKit::WebIconDatabaseProxy::isEnabled):
1745         (WebKit::WebIconDatabaseProxy::setEnabled):
1746         (WebKit::WebIconDatabaseProxy::iconForPageURL):
1747         (WebKit::WebIconDatabaseProxy::retainIconForPageURL):
1748         (WebKit::WebIconDatabaseProxy::releaseIconForPageURL):
1749         (WebKit::WebIconDatabaseProxy::iconURLForPageURL):
1750         (WebKit::WebIconDatabaseProxy::iconDataKnownForIconURL):
1751         (WebKit::WebIconDatabaseProxy::loadDecisionForIconURL):
1752         (WebKit::WebIconDatabaseProxy::setIconURLForPageURL):
1753         (WebKit::WebIconDatabaseProxy::setIconDataForIconURL):
1754         (WebKit::WebIconDatabaseProxy::urlImportFinished):
1755         (WebKit::WebIconDatabaseProxy::didReceiveMessage):
1756         * WebProcess/IconDatabase/WebIconDatabaseProxy.h: Added.
1757
1758         Hook up initialization and messaging for the icon database proxy:
1759         * WebProcess/WebProcess.cpp:
1760         (WebKit::WebProcess::WebProcess):
1761         (WebKit::WebProcess::initializeWebProcess):
1762         (WebKit::WebProcess::didReceiveMessage):
1763         * WebProcess/WebProcess.h:
1764
1765 2011-03-15  Sam Weinig  <sam@webkit.org>
1766
1767         Reviewed by Anders Carlsson.
1768
1769         WebKit2: False SPOD cursor when context menu is open
1770         <rdar://problem/9029154>
1771         https://bugs.webkit.org/show_bug.cgi?id=56433
1772
1773         * UIProcess/WebPageProxy.cpp:
1774         (WebKit::WebPageProxy::showContextMenu):
1775         Update to match showPopupMenu idiomatically, and stop the responsivenessTimer
1776         since the act of showing the context menu could spin a nested runloop.
1777
1778         * UIProcess/mac/WebContextMenuProxyMac.mm:
1779         (WebKit::WebContextMenuProxyMac::showContextMenu):
1780         * UIProcess/qt/WebContextMenuProxyQt.cpp:
1781         (WebKit::WebContextMenuProxyQt::showContextMenu):
1782         * UIProcess/win/WebContextMenuProxyWin.cpp:
1783         (WebKit::WebContextMenuProxyWin::showContextMenu):
1784         Move isEmpty() check to implementations, since we don't want to show
1785         this in any case, not just the one where we check it.
1786
1787 2011-03-15  Siddharth Mathur  <siddharth.mathur@nokia.com>
1788
1789         Reviewed by Laszlo Gombos.
1790
1791         [Qt][Symbian][WK2] Fix exporting and importing the WebProcessMainQt symbol
1792         https://bugs.webkit.org/show_bug.cgi?id=56417
1793
1794         Use the Q_DECL_EXPORT and Q_DECL_IMPORT macros directly to make sure
1795         the symbol is always exported/imported.
1796
1797         * WebProcess/qt/WebProcessMainQt.cpp:
1798         (WebKit::WebProcessMainQt):
1799         * qt/MainQt.cpp:
1800
1801 2011-03-15  Alexey Proskuryakov  <ap@apple.com>
1802
1803         Reviewed by Darin Adler.
1804
1805         REGRESSION (WebKit2): keygen element doesn't work
1806         https://bugs.webkit.org/show_bug.cgi?id=56402
1807         <rdar://problem/9006545>
1808
1809         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1810         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1811         Added strings used by keygen.
1812
1813         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: Initialize a WebCore pointer to
1814         a function used by keygen.
1815
1816 2011-03-15  Beth Dakin  <bdakin@apple.com>
1817
1818         Reviewed by Simon Fraser.
1819
1820         WebKit2 part of <rdar://problem/9075624> Overlay scrollbars slow down PLT by 6%
1821
1822         New WebKitystemInterface function to force the scrollbars to flash
1823         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1824         (InitWebCoreSystemInterface):
1825
1826 2011-03-15  Anders Carlsson  <andersca@apple.com>
1827
1828         Reviewed by Sam Weinig.
1829
1830         Make sure that NP_Shutdown is always the last NPP function called
1831         https://bugs.webkit.org/show_bug.cgi?id=56391
1832         <rdar://problem/8989902>
1833
1834         Make sure to always increment the load count whenever a web process connection
1835         is opened to a plug-in process, and decrement it when the last web process connection
1836         goes away.
1837
1838         * PluginProcess/PluginProcess.cpp:
1839         (WebKit::PluginProcess::createWebProcessConnection):
1840         (WebKit::PluginProcess::startShutdownTimerIfNecessary):
1841         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
1842         * Shared/Plugins/Netscape/NetscapePluginModule.h:
1843         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1844         (WebKit::NetscapePlugin::NetscapePlugin):
1845         (WebKit::NetscapePlugin::~NetscapePlugin):
1846
1847 2011-03-15  Martin Robinson  <mrobinson@igalia.com>
1848
1849         Reviewed by Adam Barth.
1850
1851         [GTK] [WebKit2] The UIProcess never changes the mouse cursor
1852         https://bugs.webkit.org/show_bug.cgi?id=56333
1853
1854         Add an implementation for WebView::addCursor for WebKit2 GTK+. This allows
1855         the cursor to change as the user mouses around the page. There is currently
1856         no test infrastructure to track cursor changes.
1857
1858         * UIProcess/gtk/WebView.cpp:
1859         (WebKit::WebView::setCursor): Ported implementation from WebKit1.
1860
1861 2011-03-15  Kevin Ollivier  <kevino@theolliviers.com>
1862
1863         Reviewed by Darin Adler.
1864
1865         Introduce WTF_USE_EXPORT_MACROS, which will allow us to put shared library import/export
1866         info into the headers rather than in export symbol definition files, but disable it on 
1867         all platforms initially so we can deal with port build issues one port at a time.
1868         
1869         https://bugs.webkit.org/show_bug.cgi?id=27551
1870
1871         * config.h:
1872
1873 2011-03-14  Alexey Proskuryakov  <ap@apple.com>
1874
1875         Reviewed by Darin Adler.
1876
1877         REGRESSION: Print preview is blank when selecting multiple pages per sheet
1878         https://bugs.webkit.org/show_bug.cgi?id=56341
1879         <rdar://problem/8991382>
1880
1881         * UIProcess/API/mac/WKPrintingView.mm: (pageDidDrawToPDF): Don't reset latest expected
1882         callback number after receiving a different one. We only update preview after receiving
1883         the latest expected page data (and the assumption is that AppKit will ask for pages in
1884         natural order for N-up).
1885
1886 2011-03-14  Adam Roben  <aroben@apple.com>
1887
1888         Make WKBundlePageCanHandleRequest return true for empty document URLs
1889
1890         Reviewed by Sam Weinig.
1891
1892         * WebProcess/WebPage/WebPage.cpp:
1893         (WebKit::WebPage::canHandleRequest): Return true for any URL schemes that are handled as
1894         empty documents, and defer to the platform for everything else.
1895
1896         * WebProcess/WebPage/WebPage.h: Added platformCanHandleRequest.
1897
1898         * WebProcess/WebPage/mac/WebPageMac.mm:
1899         (WebKit::WebPage::platformCanHandleRequest):
1900         * WebProcess/WebPage/qt/WebPageQt.cpp:
1901         (WebKit::WebPage::platformCanHandleRequest):
1902         * WebProcess/WebPage/win/WebPageWin.cpp:
1903         (WebKit::WebPage::platformCanHandleRequest):
1904         Renamed from canHandleRequest.
1905
1906 2011-03-14  Chris Fleizach  <cfleizach@apple.com>
1907
1908         Reviewed by Beth Dakin.
1909
1910         CrashTracer: 60 crashes in WebProcess at com.apple.WebKit2: -[AccessibilityWebPageObject accessibilityHitTest:] + 248
1911         https://bugs.webkit.org/show_bug.cgi?id=56336
1912
1913         Crash trace indicates a nil pointer access in one of these m_page->mainFrame()->coreFrame()->view()
1914         pointers.
1915
1916         * WebProcess/WebPage/mac/AccessibilityWebPageObject.mm:
1917         (-[AccessibilityWebPageObject accessibilityHitTest:]):
1918
1919 2011-03-14  Alice Liu  <alice.liu@apple.com>
1920
1921         Reviewed by Sam Weinig.
1922
1923         Provide API for creating WKImage from CGImageRef
1924         https://bugs.webkit.org/show_bug.cgi?id=56159
1925
1926         Add function for creating a WKImage from CGImage data.
1927         * Shared/API/c/cg/WKImageCG.cpp:
1928         (WKImageCreateFromCGImage): Added. Creates a graphics context for the bitmap-backed image and draws into it. 
1929         * Shared/API/c/cg/WKImageCG.h:
1930
1931 2011-03-14  Balazs Kelemen  <kbalazs@webkit.org>
1932
1933         Reviewed by Adam Roben.
1934
1935         [Qt][WK2]Unbreak InjectedBundle on Qt
1936         https://bugs.webkit.org/show_bug.cgi?id=54109
1937
1938         Add API's to WKURL and WKString to satisfy
1939         WebKitTestRunner's needs.
1940
1941         * Shared/API/c/WKString.cpp:
1942         (WKStringIsEqualToUTF8CStringIgnoringCase):
1943         * Shared/API/c/WKString.h:
1944         * Shared/API/c/WKURL.cpp:
1945         (WKURLCopyHostName):
1946         (WKURLCopyScheme):
1947         * Shared/API/c/WKURL.h:
1948         * Shared/WebString.h:
1949         (WebKit::WebString::equalToUTF8StringIgnoringCase):
1950         * Shared/WebURL.h: Added OwnPtr<KURL> member to be able
1951         to lazily parse the URL and store the result.
1952         (WebKit::WebURL::host):
1953         (WebKit::WebURL::protocol):
1954         (WebKit::WebURL::parseURLIfNecessary):
1955         * win/WebKit2.def: Revert the symbol exports that were
1956         needed to use KURL in WebKitTestRunner.
1957
1958 2011-03-14  Jeff Miller  <jeffm@apple.com>
1959
1960         Reviewed by Adam Roben.
1961
1962         Add WKViewSetScrollOffsetOnNextResize() to C API on Windows
1963         https://bugs.webkit.org/show_bug.cgi?id=56340
1964
1965         * UIProcess/API/C/win/WKView.cpp:
1966         (WKViewSetScrollOffsetOnNextResize): Added.
1967         * UIProcess/API/C/win/WKView.h: Added WKViewSetScrollOffsetOnNextResize().
1968         * UIProcess/win/WebView.cpp:
1969         (WebKit::WebView::onSizeEvent): Apply any scroll offset when setting the drawing area size.
1970         (WebKit::WebView::setScrollOffsetOnNextResize): Added.
1971         * UIProcess/win/WebView.h: Added setScrollOffsetOnNextResize().
1972
1973 2011-03-14  Brian Weinstein  <bweinstein@apple.com>
1974
1975         Reviewed by Adam Roben and Gavin Barraclough.
1976
1977         FileSystemWin.cpp needs listDirectory() implementation
1978         https://bugs.webkit.org/show_bug.cgi?id=56331
1979         <rdar://problem/9126635>
1980         
1981         Move PathWalker down into WebCore, and call the PathWalker in WebCore
1982         (that now has a second argument, the pattern to take).
1983
1984         * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
1985         (WebKit::PluginInfoStore::pluginPathsInDirectory):
1986
1987 2011-03-14  Sam Weinig  <sam@webkit.org>
1988
1989         Reviewed by Darin Adler.
1990
1991         WebKit2: No icon shown for <input type=file>
1992         <rdar://problem/8988982>
1993         https://bugs.webkit.org/show_bug.cgi?id=54288
1994
1995         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1996         (WebKit::WebChromeClient::chooseIconForFiles):
1997         Add implementation for chooseIconForFiles which calls down to Icon::createIconForFiles.
1998
1999 2011-03-14  Brady Eidson  <beidson@apple.com>
2000
2001         Reviewed by Dan Bernstein.
2002
2003         <rdar://problem/8762095> and https://bugs.webkit.org/show_bug.cgi?id=55172
2004         Need WK2 API to view/manage origins with LocalStorage
2005
2006         Hookup the existing API stubs to the WebCore implementations:
2007         * WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp:
2008         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
2009         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
2010         (WebKit::WebKeyValueStorageManager::deleteAllEntries):
2011
2012 2011-03-13  Brady Eidson  <beidson@apple.com>
2013
2014         Reviewed by Sam Weinig.
2015
2016         <rdar://problem/9127270> and https://bugs.webkit.org/show_bug.cgi?id=56282
2017
2018         Pass the path along with creation parameters:
2019         * Shared/WebProcessCreationParameters.cpp:
2020         (WebKit::WebProcessCreationParameters::encode):
2021         (WebKit::WebProcessCreationParameters::decode):
2022         * Shared/WebProcessCreationParameters.h:
2023
2024         Add SPI to set the path:
2025         * UIProcess/API/C/WKContext.cpp:
2026         (WKContextSetLocalStorageDirectory):
2027         * UIProcess/API/C/WKContextPrivate.h:
2028
2029         Pass the path along in the process creation parameters:
2030         * UIProcess/WebContext.cpp:
2031         (WebKit::WebContext::ensureWebProcess):
2032         (WebKit::WebContext::localStorageDirectory):
2033         * UIProcess/WebContext.h:
2034         (WebKit::WebContext::setLocalStorageDirectory):
2035
2036         * UIProcess/gtk/WebContextGtk.cpp:
2037         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
2038         * UIProcess/mac/WebContextMac.mm:
2039         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
2040         * UIProcess/qt/WebContextQt.cpp:
2041         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
2042         * UIProcess/win/WebContextWin.cpp:
2043         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
2044
2045         Include the path with settings updates, because WebCore needs it set on the Settings object:
2046         * WebProcess/WebPage/WebPage.cpp:
2047         (WebKit::WebPage::updatePreferences):
2048
2049         * WebProcess/WebProcess.cpp:
2050         (WebKit::WebProcess::initializeWebProcess):
2051         * WebProcess/WebProcess.h:
2052         (WebKit::WebProcess::localStorageDirectory):
2053
2054         Sandboxing stuff:
2055         * WebProcess/com.apple.WebProcess.sb:
2056         * WebProcess/mac/WebProcessMac.mm:
2057         (WebKit::initializeSandbox):
2058
2059 2011-03-12  Jer Noble  <jer.noble@apple.com>
2060
2061         Reviewed by Mark Rowe.
2062
2063         WebKit2: Build WKFullScreenWindowController cleanly in 32-bit.
2064         https://bugs.webkit.org/show_bug.cgi?id=56260
2065
2066         Include <Carbon/Carbon.h> instead of <HIToolbox/MacApplication.h>.
2067
2068         * UIProcess/mac/WKFullScreenWindowController.mm:
2069
2070 2011-03-13  Sam Weinig  <sam@webkit.org>
2071
2072         Reviewed by Anders Carlsson.
2073
2074         Add ability to create a WKErrorRef
2075         <rdar://problem/9115768>
2076         https://bugs.webkit.org/show_bug.cgi?id=56279
2077
2078         * Shared/API/c/cf/WKErrorCF.cpp: Added.
2079         (WKErrorCreateWithCFError):
2080         (WKErrorCopyCFError):
2081         * Shared/API/c/cf/WKErrorCF.h: Added.
2082         Add new API to create a WKErrorRef from a CFErrorRef
2083         and vice-versa.
2084
2085         * WebKit2.xcodeproj/project.pbxproj:
2086         * win/WebKit2.vcproj:
2087         * win/WebKit2Generated.make:
2088         Add new files.
2089
2090 2011-03-13  Pratik Solanki  <psolanki@apple.com>
2091
2092         Reviewed by Brady Eidson.
2093
2094         Make adjustMIMETypeIfNecessary use CFNetwork directly
2095         https://bugs.webkit.org/show_bug.cgi?id=55912
2096
2097         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2098         (InitWebCoreSystemInterface): Support for new WKSI functions.
2099
2100 2011-03-13  Dan Bernstein  <mitz@apple.com>
2101
2102         Reviewed by Darin Adler.
2103
2104         WebPageProxy cleanup
2105         https://bugs.webkit.org/show_bug.cgi?id=56267
2106
2107         * UIProcess/WebPageProxy.cpp: Moved all Mac-only function implementations from
2108         here to WebPageProxyMac.mm.
2109         * UIProcess/WebPageProxy.h: Cleaned up #includes.
2110         * UIProcess/mac/WebPageProxyMac.mm: Moved all Mac-only function implementations
2111         here.
2112         (WebKit::WebPageProxy::updateWindowIsVisible):
2113         (WebKit::WebPageProxy::windowAndViewFramesChanged):
2114         (WebKit::WebPageProxy::getMarkedRange):
2115         (WebKit::WebPageProxy::characterIndexForPoint):
2116         (WebKit::WebPageProxy::firstRectForCharacterRange):
2117         (WebKit::WebPageProxy::writeSelectionToPasteboard):
2118         (WebKit::WebPageProxy::setDragImage):
2119         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
2120         (WebKit::WebPageProxy::interpretKeyEvent):
2121         (WebKit::WebPageProxy::sendComplexTextInputToPlugin):
2122         (WebKit::WebPageProxy::uppercaseWord):
2123         (WebKit::WebPageProxy::lowercaseWord):
2124         (WebKit::WebPageProxy::capitalizeWord):
2125         (WebKit::WebPageProxy::setSmartInsertDeleteEnabled):
2126         (WebKit::WebPageProxy::didPerformDictionaryLookup):
2127         (WebKit::WebPageProxy::registerWebProcessAccessibilityToken):
2128         (WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
2129         (WebKit::WebPageProxy::setComplexTextInputEnabled):
2130
2131 2011-03-13  Dan Bernstein  <mitz@apple.com>
2132
2133         Reviewed by Darin Adler.
2134
2135         <rdar://problem/8949683> WebKit2: Drag image is offset when the page is scrolled down
2136         https://bugs.webkit.org/show_bug.cgi?id=56265
2137
2138         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2139         (WebKit::WebDragClient::startDrag): Send the location in view coordinates rather than
2140         document coordinates.
2141
2142 2011-03-13  Dan Bernstein  <mitz@apple.com>
2143
2144         Reviewed by Mark Rowe.
2145
2146         Fix a crash when dragging.
2147
2148         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2149         (WebKit::convertImageToBitmap): Retain the saved context.
2150
2151 2011-03-12  Darin Adler  <darin@apple.com>
2152
2153         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2154         (WebKit::WebDragClient::startDrag): Fixed typo in a comment.
2155
2156 2011-03-11  Darin Adler  <darin@apple.com>
2157
2158         Reviewed by Sam Weinig.
2159
2160         Dragging image to desktop gives webloc instead of image file in WebKit2
2161         https://bugs.webkit.org/show_bug.cgi?id=56193
2162
2163         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2164         (WebKit::convertImageToBitmap): Added. Factored out from startDrag to
2165         make the startDrag code clearer.
2166         (WebKit::WebDragClient::startDrag): Streamlined code a bit.
2167         (WebKit::cachedImage): Added. Helper for function below.
2168         (WebKit::arrayForURLsWithTitles): Added. Helper for function below.
2169         (WebKit::WebDragClient::declareAndWriteDragImage): Added code to handle file
2170         promises and removed a log of uneeded code.
2171         (-[WKPasteboardFilePromiseOwner copyDropDirectory]): Added.
2172         (promisedDataClient): Added.
2173         (-[WKPasteboardOwner clearImage]): Added.
2174         (-[WKPasteboardOwner initWithImage:]): Added.
2175         (-[WKPasteboardOwner dealloc]): Added.
2176         (-[WKPasteboardOwner finalize]): Added.
2177         (-[WKPasteboardOwner pasteboard:provideDataForType:]): Added.
2178         (-[WKPasteboardOwner pasteboardChangedOwner:]): Added.
2179         (matchesExtensionOrEquivalent): Added.
2180         (-[WKPasteboardOwner namesOfPromisedFilesDroppedAtDestination:]): Added.
2181         Much of the new code above came from the WebKit1 drag code.
2182
2183         * WebProcess/WebPage/WebPage.cpp:
2184         (WebKit::WebPage::dragEnded): Added call to Mac-only platformDragEnded.
2185         * WebProcess/WebPage/WebPage.h: Added Mac-only platformDragEnded and m_dragSource.
2186         * WebProcess/WebPage/mac/WebPageMac.mm:
2187         (WebKit::WebPage::setDragSource): Added.
2188         (WebKit::WebPage::platformDragEnded): Added.
2189
2190 2011-03-12  Mark Rowe  <mrowe@apple.com>
2191
2192         Fix the 32-bit build.
2193
2194         This involves hacking around some HIToolbox headers that do things of dubious correctness,
2195         and fixing the usual CGRect vs NSRect issues.
2196         
2197         * UIProcess/mac/WKFullScreenWindowController.mm:
2198         (-[WKFullScreenWindowController enterFullScreen:]): NSRect is not CGRect.
2199         * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm:
2200         (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation): Ditto.
2201
2202 2011-03-12  Anders Carlsson  <andersca@apple.com>
2203
2204         Reviewed by Sam Weinig.
2205
2206         * WebProcess/WebPage/WebFrame.cpp:
2207         (WebKit::WebFrame::url):
2208         Get the URL from the loader, not from the document.
2209
2210         (WebKit::WebFrame::suggestedFilenameForResourceWithURL):
2211         Return the correct suggested filename for the main resource.
2212
2213         (WebKit::WebFrame::mimeTypeForResourceWithURL):
2214         Return the correct mime type for the main resource.
2215
2216 2011-03-12  Anders Carlsson  <andersca@apple.com>
2217
2218         Reviewed by Sam Weinig.
2219
2220         Should be able to download a PDF to the Downloads folder
2221         https://bugs.webkit.org/show_bug.cgi?id=56256
2222
2223         * UIProcess/API/C/WKPage.h:
2224         Add WKPageSaveDataToFileInDownloadsFolderCallback to the UI client.
2225
2226         * UIProcess/API/mac/PDFViewController.h:
2227         * UIProcess/API/mac/PDFViewController.mm:
2228         (-[WKPDFView _applyPDFPreferences]):
2229         (-[WKPDFView _updatePreferences:]):
2230         Use new PDFViewController::page getter.
2231
2232         (-[WKPDFView PDFViewSavePDFToDownloadFolder:]):
2233         Call PDFViewController::savePDFToDownloadsFolder.
2234
2235         (WebKit::releaseCFData):
2236         (WebKit::PDFViewController::savePDFToDownloadsFolder):
2237         Create a WebData that wraps the CFData, then pass it along to
2238         WebPageProxy::saveDataToFileInDownloadsFolder.
2239
2240         * UIProcess/WebPageProxy.cpp:
2241         (WebKit::WebPageProxy::saveDataToFileInDownloadsFolder):
2242         Call WebUIClient::saveDataToFileInDownloadsFolder.
2243
2244         (WebKit::WebUIClient::saveDataToFileInDownloadsFolder):
2245         * UIProcess/WebUIClient.h:
2246         Call the UI client callback function.
2247
2248 2011-03-12  Anders Carlsson  <andersca@apple.com>
2249
2250         Reviewed by Sam Weinig.
2251
2252         WebData should be able to wrap already existing data
2253         https://bugs.webkit.org/show_bug.cgi?id=56254
2254
2255         * Shared/WebData.h:
2256         (WebKit::WebData::createWithoutCopying):
2257         (WebKit::WebData::create):
2258         (WebKit::WebData::~WebData):
2259         (WebKit::WebData::bytes):
2260         (WebKit::WebData::size):
2261         (WebKit::WebData::WebData):
2262         (WebKit::WebData::fastFreeBytes):
2263
2264 2011-03-12  Jer Noble  <jer.noble@apple.com>
2265
2266         Reviewed by Eric Carlson.
2267
2268         WebKit2: Initialize the WebFullScreenManagerProxy with a WKView
2269         https://bugs.webkit.org/show_bug.cgi?id=56250
2270
2271         * UIProcess/API/mac/WKView.mm:
2272         (-[WKView initWithFrame:contextRef:pageGroupRef:]): Call fullScreenManager()->setView(self).
2273
2274 2011-03-11  Jer Noble  <jer.noble@apple.com>
2275
2276         Reviewed by Anders Carlsson.
2277
2278         Add full screen animation code to WebFullScreenManager.
2279         https://bugs.webkit.org/show_bug.cgi?id=56220
2280
2281         * WebProcess/FullScreen/WebFullScreenManager.cpp: .
2282         (WebKit::WebFullScreenManager::~WebFullScreenManager): Added.
2283         (WebKit::WebFullScreenManager::exitFullScreenForElement): Remove ASSERTs.
2284         (WebKit::WebFullScreenManager::willEnterFullScreen): Set the full screen renderer's background color.
2285         (WebKit::WebFullScreenManager::didEnterFullScreen): Ditto.
2286         (WebKit::WebFullScreenManager::willExitFullScreen): Ditto.
2287         (WebKit::WebFullScreenManager::didExitFullScreen): Ditto.
2288         * WebProcess/FullScreen/WebFullScreenManager.h: Make a few functions pure virtual to be implemented in a 
2289             concrete subclass.
2290         * WebProcess/FullScreen/mac/WebFullScreenManagerMac.h: Added.
2291         * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: Added.
2292         (-[WebFullScreenManagerAnimationListener initWithManager:WebKit::began:finished:]): Listener for CAAnimations.
2293         (-[WebFullScreenManagerAnimationListener animationDidStart:]): Added.
2294         (-[WebFullScreenManagerAnimationListener animationDidStop:finished:]): Added.
2295         (-[WebFullScreenManagerAnimationListener invalidate]): Added.
2296         (WebKit::WebFullScreenManager::create): Now creates a WebFullScreenManagerMac.
2297         (WebKit::WebFullScreenManagerMac::create): Added.
2298         (WebKit::WebFullScreenManagerMac::WebFullScreenManagerMac): Added.
2299         (WebKit::WebFullScreenManagerMac::~WebFullScreenManagerMac): Added.
2300         (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): Set up the remote layer host.
2301         (WebKit::WebFullScreenManagerMac::beginEnterFullScreenAnimation): Create a CATransform3D
2302             which will animate the full screen renderer from its initial position to its final one.
2303         (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation): Ditto.
2304
2305 2011-03-11  Jer Noble  <jer.noble@apple.com>
2306
2307         Reviewed by Anders Carlsson.
2308
2309         Hook up new WKFullScreenWindowController functions to WebFullScreenManagerProxy
2310         https://bugs.webkit.org/show_bug.cgi?id=56218
2311
2312         * UIProcess/WebFullScreenManagerProxy.cpp:
2313         * UIProcess/mac/WebFullScreenManagerProxyMac.mm: Added.
2314         (WebKit::WebFullScreenManagerProxy::enterFullScreen): Call into WKFullScreenWindowController.
2315         (WebKit::WebFullScreenManagerProxy::exitFullScreen): Ditto.
2316         (WebKit::WebFullScreenManagerProxy::beganEnterFullScreenAnimation): Ditto.
2317         (WebKit::WebFullScreenManagerProxy::finishedEnterFullScreenAnimation): Ditto.
2318         (WebKit::WebFullScreenManagerProxy::beganExitFullScreenAnimation): Ditto.
2319         (WebKit::WebFullScreenManagerProxy::finishedExitFullScreenAnimation): Ditto.
2320         (WebKit::WebFullScreenManagerProxy::enterAcceleratedCompositingMode): Ditto.
2321         (WebKit::WebFullScreenManagerProxy::exitAcceleratedCompositingMode): Ditto.
2322         (WebKit::WebFullScreenManagerProxy::getFullScreenRect): Ditto.
2323         * UIProcess/API/mac/WKView.mm:
2324         (-[WKView fullScreenWindowController]): Lazily instantiate a WKFullScreenWindowController.
2325         * UIProcess/API/mac/WKViewInternal.h:
2326
2327 2011-03-11  Jer Noble  <jer.noble@apple.com>
2328
2329         Reviewed by Anders Carlsson.
2330
2331         Add the WKFullScreenWindowController, mostly cribbed from WebKit's WebFullScreenController.
2332
2333         [WebKit2] Implement a full screen window controller
2334         https://bugs.webkit.org/show_bug.cgi?id=56210
2335
2336         * UIProcess/mac/WKFullScreenWindowController.h: Added.
2337         * UIProcess/mac/WKFullScreenWindowController.mm: Added.
2338         (-[WKFullScreenWindowController init]): Remove the _mediaEventListener.
2339         (-[WKFullScreenWindowController dealloc]): Make sure to cancel previous async requests.
2340         (-[WKFullScreenWindowController windowDidLoad]): Remove the Tiger protection.
2341         (-[WKFullScreenWindowController webView]): Type change.
2342         (-[WKFullScreenWindowController setWebView:]): Type change.
2343         (-[WKFullScreenWindowController applicationDidResignActive:]): Case changes.
2344         (-[WKFullScreenWindowController applicationDidChangeScreenParameters:]): Case changes.
2345         (-[WKFullScreenWindowController enterFullScreen:]): Removed most of the animation code
2346             which will reappear in WebFullScreenManager.
2347         (-[WKFullScreenWindowController beganEnterFullScreenAnimation]): Added.
2348         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Added.
2349         (-[WKFullScreenWindowController exitFullScreen]): Ditto to enterFullScreen.
2350         (-[WKFullScreenWindowController beganExitFullScreenAnimation]): Added.
2351         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Added.
2352         (-[WKFullScreenWindowController enterAcceleratedCompositingMode:WebKit::]): Set up the
2353             layer tree host.
2354         (-[WKFullScreenWindowController exitAcceleratedCompositingMode]): Tear down same.
2355         (-[WKFullScreenWindowController getFullScreenRect:WebCore::]): Added.
2356         (-[WKFullScreenWindowController _updateMenuAndDockForFullScreen]): Case changes.
2357         (-[WKFullScreenWindowController _disableIdleDisplaySleep]): Ditto.
2358         (-[WKFullScreenWindowController _enableIdleDisplaySleep]): Ditto.
2359         (-[WKFullScreenWindowController _disableIdleSystemSleep]): Ditto.
2360         (-[WKFullScreenWindowController _enableIdleSystemSleep]): Ditto.
2361         (-[WKFullScreenWindowController _enableTickleTimer]): Ditto.
2362         (-[WKFullScreenWindowController _disableTickleTimer]): Ditto.
2363         (-[WKFullScreenWindowController _tickleTimerFired]): Ditto.
2364         (-[WKFullScreenWindowController _updatePowerAssertions]): Use _isPlaying ivar.
2365         (-[WKFullScreenWindowController _manager]): Added.
2366         (-[WKFullScreenWindowController _requestExit]): Case changes.
2367         (-[WKFullScreenWindowController _requestExitFullScreenWithAnimation:]): Ditto.
2368         (-[WKFullScreenWindowController _swapView:with:]): Added.
2369         (-[WKFullScreenWindowController _fullScreenWindow]): Case changes.
2370         (-[WKFullScreenWindow initWithContentRect:styleMask:backing:defer:]): Geometry no
2371             longer needs to be flipped.
2372         (-[WKFullScreenWindow cancelOperation:]): Case changes.
2373
2374 2011-03-11  Jer Noble  <jer.noble@apple.com>
2375
2376         Reviewed by Anders Carlsson.
2377
2378         Create new interface stubs to support full screen mode in WebKit2.
2379
2380         WebKit2: Plumb new full screen animation APIs through WebKit2.
2381         https://bugs.webkit.org/show_bug.cgi?id=55993
2382
2383         * UIProcess/WebFullScreenManagerProxy.cpp:
2384         (WebKit::WebFullScreenManagerProxy::WebFullScreenManagerProxy): Added.
2385         (WebKit::WebFullScreenManagerProxy::invalidate): Clear m_webView.
2386         (WebKit::WebFullScreenManagerProxy::setWebView): Set m_webView.
2387         (WebKit::WebFullScreenManagerProxy::beginEnterFullScreenAnimation): Added.
2388         (WebKit::WebFullScreenManagerProxy::beginExitFullScreenAnimation): Added.
2389         (WebKit::WebFullScreenManagerProxy::beganEnterFullScreenAnimation): Added stub.
2390         (WebKit::WebFullScreenManagerProxy::finishedEnterFullScreenAnimation): Added stub.
2391         (WebKit::WebFullScreenManagerProxy::beganExitFullScreenAnimation): Added stub.
2392         (WebKit::WebFullScreenManagerProxy::finishedExitFullScreenAnimation): Added stub.
2393         (WebKit::WebFullScreenManagerProxy::enterAcceleratedCompositingMode): Added stub.
2394         (WebKit::WebFullScreenManagerProxy::exitAcceleratedCompositingMode): Added stub.
2395         (WebKit::WebFullScreenManagerProxy::getFullScreenRect): Added stub.
2396         * UIProcess/WebFullScreenManagerProxy.h:
2397         * UIProcess/WebFullScreenManagerProxy.messages.in: Added new message definitions.
2398         * UIProcess/WebPageProxy.cpp: Moved include of WebFullScreenManagerProxy.h into source file.
2399         * UIProcess/WebPageProxy.h: Ditto.
2400         * WebProcess/FullScreen/WebFullScreenManager.cpp:
2401         (WebKit::WebFullScreenManager::element): Added.
2402         (WebKit::WebFullScreenManager::supportsFullScreen): Send message through WebPage.
2403         (WebKit::WebFullScreenManager::enterFullScreenForElement): Ditto.
2404         (WebKit::WebFullScreenManager::exitFullScreenForElement): Ditto.
2405         (WebKit::WebFullScreenManager::beganEnterFullScreenAnimation): Added..
2406         (WebKit::WebFullScreenManager::finishedEnterFullScreenAnimation): Added.
2407         (WebKit::WebFullScreenManager::beganExitFullScreenAnimation): Added.
2408         (WebKit::WebFullScreenManager::finishedExitFullScreenAnimation): Added.
2409         (WebKit::WebFullScreenManager::setRootFullScreenLayer): Added stub.
2410         (WebKit::WebFullScreenManager::getFullScreenRect): Added.
2411         (WebKit::WebFullScreenManager::beginEnterFullScreenAnimation): Added stub.
2412         (WebKit::WebFullScreenManager::beginExitFullScreenAnimation): Added stub.
2413         * WebProcess/FullScreen/WebFullScreenManager.h:
2414         * WebProcess/FullScreen/WebFullScreenManager.messages.in: Added new message definitions.
2415         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2416         (WebKit::WebChromeClient::setRootFullScreenLayer): Added.
2417         * WebProcess/WebCoreSupport/WebChromeClient.h:
2418
2419 2011-03-11  Alice Liu  <alice.liu@apple.com>
2420
2421         Reviewed by Sam Weinig.
2422
2423         Support encoding /decoding WebData in usermessages
2424         https://bugs.webkit.org/show_bug.cgi?id=56158
2425
2426         Added encoding/decoding for APIObject::TypeData
2427         * Shared/UserMessageCoders.h:
2428         (WebKit::UserMessageEncoder::baseEncode):
2429         (WebKit::UserMessageDecoder::baseDecode):
2430
2431 2011-03-11  Alice Liu  <alice.liu@apple.com>
2432
2433         Reviewed by Sam Weinig.
2434
2435         Add api for "remove" to WKMutableDictionary
2436         https://bugs.webkit.org/show_bug.cgi?id=56157
2437
2438         * Shared/API/c/WKMutableDictionary.cpp:
2439         (WKDictionaryRemoveItem): Added; call remove on MutableDictionary impl.
2440         * Shared/API/c/WKMutableDictionary.h:
2441         * Shared/MutableDictionary.cpp:
2442         (WebKit::MutableDictionary::remove): Added; call remove on the underlying hashmap.
2443         * Shared/MutableDictionary.h:
2444
2445 2011-03-11  Sheriff Bot  <webkit.review.bot@gmail.com>
2446
2447         Unreviewed, rolling out r80899 and r80912.
2448         http://trac.webkit.org/changeset/80899
2449         http://trac.webkit.org/changeset/80912
2450         https://bugs.webkit.org/show_bug.cgi?id=56236
2451
2452         Caused animation tests to crash on Snow Leopard WebKit2
2453         (Requested by rniwa on #webkit).
2454
2455         * Shared/ShareableBitmap.cpp:
2456         (WebKit::ShareableBitmap::create):
2457         (WebKit::ShareableBitmap::createShareable):
2458         (WebKit::ShareableBitmap::resize):
2459         * Shared/ShareableBitmap.h:
2460         (WebKit::ShareableBitmap::numBytesForSize):
2461         (WebKit::ShareableBitmap::sizeInBytes):
2462         * UIProcess/DrawingAreaProxyImpl.cpp:
2463         (WebKit::DrawingAreaProxyImpl::update):
2464         * WebKit2.xcodeproj/project.pbxproj:
2465         * WebProcess/WebPage/DrawingArea.h:
2466         (WebKit::DrawingArea::didUpdate):
2467         * WebProcess/WebPage/DrawingArea.messages.in:
2468         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2469         (WebKit::DrawingAreaImpl::~DrawingAreaImpl):
2470         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
2471         (WebKit::DrawingAreaImpl::didUpdate):
2472         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
2473         (WebKit::DrawingAreaImpl::display):
2474         * WebProcess/WebPage/DrawingAreaImpl.h:
2475         * WebProcess/WebPage/SharedMemoryCache.cpp: Removed.
2476         * WebProcess/WebPage/SharedMemoryCache.h: Removed.
2477         * win/WebKit2.vcproj:
2478
2479 2011-03-11  Brian Weinstein  <bweinstein@apple.com>
2480
2481         Windows build fix. Add SharedMemoryCache to the vcproj.
2482
2483         * win/WebKit2.vcproj:
2484
2485 2011-03-11  Alexey Proskuryakov  <ap@apple.com>
2486
2487         Reviewed by Sam Weinig.
2488
2489         https://bugs.webkit.org/show_bug.cgi?id=56222
2490         A window remains frozen if web process crashes during printing
2491
2492         * UIProcess/API/mac/PageClientImpl.h:
2493         * UIProcess/API/mac/PageClientImpl.mm:
2494         * UIProcess/PageClient.h:
2495         * UIProcess/WebPageProxy.cpp:
2496         (WebKit::WebPageProxy::setComplexTextInputEnabled):
2497         * UIProcess/WebPageProxy.h:
2498         Moved setAutodisplay code into WKPrintingView.
2499
2500         * UIProcess/API/mac/WKPrintingView.h:
2501         * UIProcess/API/mac/WKView.mm:
2502         (-[WKView printOperationWithPrintInfo:forFrame:]):
2503         Keep a reference to the actual WKView, so that we can manipulate how it displays, even if
2504         page goes away.
2505
2506         * UIProcess/API/mac/WKPrintingView.mm:
2507         (-[WKPrintingView initWithFrameProxy:WebKit::view:]):
2508         (-[WKPrintingView _setAutodisplay:]):
2509         (-[WKPrintingView _suspendAutodisplay]):
2510         (-[WKPrintingView _delayedResumeAutodisplayTimerFired]):
2511         Move setAutodisplay here.
2512
2513 2011-03-11  Anders Carlsson  <andersca@apple.com>
2514
2515         Reviewed by Sam Weinig.
2516
2517         Add a shared memory cache to the web process
2518         https://bugs.webkit.org/show_bug.cgi?id=56232
2519
2520         Add a very simple shared memory cache to the web process, so that we don't have to allocate and
2521         free memory over and over when painting.
2522
2523         * Shared/ShareableBitmap.cpp:
2524         (WebKit::ShareableBitmap::create):
2525         (WebKit::ShareableBitmap::createShareable):
2526         (WebKit::ShareableBitmap::resize):
2527         * Shared/ShareableBitmap.h:
2528         (WebKit::ShareableBitmap::numBytesNeededForBitmapSize):
2529         (WebKit::ShareableBitmap::sizeInBytes):
2530         Rename numBytesForSize to numBytesNeededForBitmapSize.
2531
2532         * UIProcess/DrawingAreaProxyImpl.cpp:
2533         (WebKit::DrawingAreaProxyImpl::update):
2534         Always send back a DidUpdate message, even if we didn't use the update info.
2535         This is needed so that the web process knows when the UI process is done with the shared memory inside
2536         the update info struct.
2537
2538         * WebKit2.xcodeproj/project.pbxproj:
2539         Add new files.
2540
2541         * WebProcess/WebPage/DrawingArea.h:
2542         (WebKit::DrawingArea::didUpdate):
2543         * WebProcess/WebPage/DrawingArea.messages.in:
2544         DidUpdate now takes a boolean.
2545
2546         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2547         (WebKit::sharedMemoryCache):
2548         Add shared memory cache.
2549
2550         (WebKit::DrawingAreaImpl::~DrawingAreaImpl):
2551         Return the shared memory to the cache.
2552
2553         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
2554         display now takes an extra boolean.
2555
2556         (WebKit::DrawingAreaImpl::didUpdate):
2557         Return the shared memory to the cache.
2558
2559         (WebKit::DrawingAreaImpl::display):
2560         If useSharedMemoryCache is true, get shared memory from the cache.
2561
2562         * WebProcess/WebPage/SharedMemoryCache.cpp: Added.
2563         (WebKit::SharedMemoryCache::acquireSharedMemory):
2564         If the memory we currently hold on to is big enough, return it.
2565
2566         (WebKit::SharedMemoryCache::releaseSharedMemory):
2567         If we're already holding on to shared memory, evict it if the returned
2568         shared memory object is bigger than the one we currently hold.
2569
2570         (WebKit::SharedMemoryCache::clearCacheTimerFired):
2571         Null out the shared memory object.
2572
2573 2011-03-11  Jessie Berlin  <jberlin@apple.com>
2574
2575         Reviewed by Adam Roben.
2576
2577         Crash calling WebContext::clearResourceCaches(InMemoryResourceCachesOnly) before the Web
2578         Process has finished launching.
2579         https://bugs.webkit.org/show_bug.cgi?id=56208
2580
2581         Only send the message if the Web Process is valid.
2582
2583         * UIProcess/WebContext.cpp:
2584         (WebKit::WebContext::clearResourceCaches):
2585
2586 2011-03-11  Anders Carlsson  <andersca@apple.com>
2587
2588         Reviewed by Dan Bernstein.
2589
2590         Don't paint more than 60 times per second
2591         https://bugs.webkit.org/show_bug.cgi?id=56206
2592         <rdar://problem/9085989>
2593
2594         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2595         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
2596         Initialize m_lastDisplayTime to 0. Change the display timer to call displayTimerFired.
2597
2598         (WebKit::DrawingAreaImpl::didUpdate):
2599         Call displayTimerFired instead of display.
2600
2601         (WebKit::DrawingAreaImpl::displayTimerFired):
2602         If we're asked to paint again less than 1/60th of a second after we've already painted,
2603         defer painting.
2604
2605         (WebKit::DrawingAreaImpl::display):
2606         Update m_lastDisplayTime.
2607
2608 2011-03-11  Mark Rowe  <mrowe@apple.com>
2609
2610         Reviewed by Alice Liu.
2611
2612         <rdar://problem/9120161> WKPageRestoreFromSessionState does not set the pending API request URL.
2613
2614         * UIProcess/cf/WebPageProxyCF.cpp:
2615         (WebKit::WebPageProxy::restoreFromSessionStateData): If we're navigating to a back/forward item
2616         as part of the restoration, call setPendingAPIRequestURL. When there's a provisional URL this will
2617         be done by our call to loadURL elsewhere in the function.
2618
2619 2011-03-10  Alexey Proskuryakov  <ap@apple.com>
2620
2621         Reviewed by Jon Honeycutt.
2622
2623         WebKit2 UI process crashes if web process crashes while computing page rects for printing
2624         https://bugs.webkit.org/show_bug.cgi?id=56160
2625         <rdar://problem/9027410>
2626
2627         * UIProcess/API/mac/WKPrintingView.mm:
2628         (-[WKPrintingView _suspendAutodisplay]): Added a null check for page, matching one that
2629         we have when resuming autodisplay.
2630         (-[WKPrintingView _delayedResumeAutodisplayTimerFired]): Added a FIXME.
2631         (pageDidComputePageRects): Sanitize results coming from the web process (and avoid crashing
2632         when there is a communication error, so results are all null).
2633         (-[WKPrintingView knowsPageRange:]): If there is no page any more, we can't tell how many
2634         pages it had.
2635         (-[WKPrintingView rectForPage:]): Handle the case where we are neither calculating pages
2636         nor knowing them, as it happens when the web process crashes.        
2637
2638 2011-03-10  Mark Rowe  <mrowe@apple.com>
2639
2640         Rubber-stamped by Sam Weinig.
2641
2642         Part of <rdar://problem/8728860> WebKit2 needs to be made localizable
2643
2644         The presence of CFBundleDevelopmentRegion in the application's Info.plist prevents
2645         the default localization that we set during launch from being respected.
2646
2647         * PluginProcess/Info.plist: Remove CFBundleDevelopmentRegion.
2648         * WebProcess/Info.plist: Ditto.
2649
2650 2011-03-10  Martin Robinson  <mrobinson@igalia.com>
2651
2652         Build for WebKit2 GTK+ after r80714.
2653
2654         * GNUmakefile.am: Update source list.
2655         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: 
2656         (WebKit::x11Display): Add missing semicolon.
2657
2658 2011-03-10  Chris Fleizach  <cfleizach@apple.com>
2659
2660         Reviewed by Darin Adler.
2661
2662         REGRESSION (WebKit2): VoiceOver focus no longer follows keyboard focus
2663         https://bugs.webkit.org/show_bug.cgi?id=55959
2664
2665         NSApplication has to return the focused element within the app in order
2666         for NSAccessibilityHandleFocusChanged() to work. The default implementation
2667         relies on keyWindow. Consequently, in WK2, the WebProcess must override that method
2668         to return the appropriate focused element within the WebProcess, since
2669         there is no keyWindow.
2670
2671         * WebKit2.xcodeproj/project.pbxproj:
2672         * WebProcess/WebPage/mac/AccessibilityWebPageObject.mm:
2673         (-[AccessibilityWebPageObject accessibilityFocusedUIElement]):
2674         * WebProcess/WebProcess.cpp:
2675         (WebKit::WebProcess::focusedWebPage):
2676         * WebProcess/WebProcess.h:
2677         * WebProcess/mac/NSApplicationOverride.mm: Added.
2678         (-[NSApplication accessibilityFocusedUIElement]):
2679
2680 2011-03-10  Oleg Romashin  <romaxa@gmail.com>
2681
2682         Reviewed by Andreas Kling.
2683
2684         Make Qt port compiling with ENABLE_PLUGIN_PROCESS=1, part3
2685         Solving conflict of Qt and Xlib includes
2686
2687         * Shared/Plugins/NPIdentifierData.cpp:
2688         * Shared/Plugins/NPIdentifierData.h:
2689         * Shared/Plugins/NPObjectProxy.cpp:
2690         * Shared/Plugins/NPVariantData.h:
2691
2692 2011-03-10  Sam Weinig  <sam@webkit.org>
2693
2694         Reviewed by Mark Rowe.
2695
2696         - Fix plugins in release and production builds.
2697
2698         * WebKit2.xcodeproj/project.pbxproj:
2699         Make sure to base the PluginProcess target on the correct xcconfig file
2700         in all configurations.
2701
2702 2011-03-09  Matthew Delaney  <mdelaney@apple.com>
2703
2704         Reviewed by Simon Fraser.
2705
2706         Plumb through settings for accelerated drawing for canvas
2707         https://bugs.webkit.org/show_bug.cgi?id=56039
2708
2709         * Shared/WebPreferencesStore.h:
2710         * UIProcess/API/C/WKPreferences.cpp:
2711         * UIProcess/API/C/WKPreferencesPrivate.h:
2712         * WebProcess/WebPage/WebPage.cpp:
2713
2714 2011-03-10  Jessie Berlin  <jberlin@apple.com>
2715
2716         Reviewed by Oliver Hunt and Brian Weinstein.
2717
2718         WebKit2: Need a way to clear only the in-memory resource caches
2719         https://bugs.webkit.org/show_bug.cgi?id=56022
2720
2721         Add a parameter to WKContextClearResourceCaches to specify whether to clear all the caches
2722         or just the memory caches.
2723
2724         * Shared/ResourceCachesToClear.h: Added.
2725         * UIProcess/API/C/WKAPICast.h:
2726         (WebKit::toResourceCachesToClear):
2727
2728         * UIProcess/API/C/WKContext.cpp:
2729         (WKContextClearResourceCaches):
2730         Add the new parameter.
2731         * UIProcess/API/C/WKContext.h:
2732         * UIProcess/WebContext.cpp:
2733         (WebKit::WebContext::clearResourceCaches):
2734         Ditto.
2735         * UIProcess/WebContext.h:
2736
2737         * WebProcess/WebProcess.cpp:
2738         (WebKit::WebProcess::clearResourceCaches):
2739         Pass the new parameter through to the platform-specific functions.
2740         * WebProcess/WebProcess.h:
2741         Add the new parameter and give it a default of AllResourceCaches.
2742         * WebProcess/WebProcess.messages.in:
2743         Ditto.
2744         * WebProcess/gtk/WebProcessGtk.cpp:
2745         (WebKit::WebProcess::platformClearResourceCaches):
2746         Ditto.
2747         * WebProcess/qt/WebProcessQt.cpp:
2748         (WebKit::WebProcess::platformClearResourceCaches):
2749         Ditto.
2750         * WebProcess/win/WebProcessWin.cpp:
2751         (WebKit::WebProcess::platformClearResourceCaches):
2752         When told to clear only the in-memory caches, return early so as not to clear the CFNetwork
2753         disk cache.
2754         * WebProcess/mac/WebProcessMac.mm:
2755         (WebKit::WebProcess::platformClearResourceCaches):
2756         Ditto.
2757
2758         * WebKit2.xcodeproj/project.pbxproj:
2759         Add ResourceCachesToClear.h
2760         * win/WebKit2.vcproj:
2761         Ditto.
2762
2763 2011-03-10  Jeff Miller  <jeffm@apple.com>
2764
2765         Reviewed by Adam Roben.
2766
2767         WKViewRegisterEditCommandCallback should use WKViewUndoType
2768         https://bugs.webkit.org/show_bug.cgi?id=56120
2769
2770         * UIProcess/API/C/win/WKView.h: Change undoOrRedo parameter in WKViewRegisterEditCommandCallback to be WKViewUndoType.
2771
2772 2011-03-10  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
2773
2774         Reviewed by Kenneth Rohde Christiansen.
2775
2776         Tiled backing store's delegated scroll request uses incorrect convention
2777         https://bugs.webkit.org/show_bug.cgi?id=56011
2778
2779         Adapt all of the internal API to match the delta to point
2780         conversion at the WebCore side.
2781
2782         * UIProcess/API/qt/qwkpage.cpp:
2783         (QWKPagePrivate::pageDidRequestScroll):
2784         * UIProcess/API/qt/qwkpage_p.h:
2785         * UIProcess/PageClient.h:
2786         * UIProcess/WebPageProxy.cpp:
2787         (WebKit::WebPageProxy::pageDidRequestScroll):
2788         * UIProcess/WebPageProxy.h:
2789         * UIProcess/WebPageProxy.messages.in:
2790         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2791         (WebKit::WebChromeClient::delegatedScrollRequested):
2792         * WebProcess/WebCoreSupport/WebChromeClient.h:
2793         * WebProcess/WebPage/WebPage.cpp:
2794         (WebKit::WebPage::pageDidRequestScroll):
2795         * WebProcess/WebPage/WebPage.h:
2796
2797 2011-03-10  Balazs Kelemen  <kbalazs@webkit.org>
2798
2799         Reviewed by Andreas Kling.
2800
2801         [WK2] Make non-transparent windowless plugins paint on X11
2802         https://bugs.webkit.org/show_bug.cgi?id=55660
2803
2804         Implement painting for non-transparent windowless X11 plugins.
2805         The essence of the logic has been adapted from WebCore.
2806         The implementation is stubbed for GTK and working only on Qt
2807         but it should be really easy to finish it for GTK.
2808
2809         * WebKit2.pro:
2810         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2811         (WebKit::NPN_GetValue): Handle X11 specific values that are necessary.
2812         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2813         (WebKit::NetscapePlugin::NetscapePlugin): Initialize the X11 specific
2814         members that has been added.
2815         (WebKit::NetscapePlugin::callSetWindow): Always set the x and y coordinates
2816         of the NP_Window to 0 on X11 since we are using a backings store as the
2817         painting area for the plugin.
2818         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2819         * WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp: Removed in favour
2820         of a common implementation for X11.
2821         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp: Ditto.
2822         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: Added.
2823         (WebKit::getPluginDisplay):
2824
2825         Platform specific static getters.
2826         (WebKit::x11Display):
2827         (WebKit::displayDepth):
2828         (WebKit::rootWindowID):
2829         (WebKit::x11Screen):
2830
2831         (WebKit::NetscapePlugin::platformPostInitialize): Set up the visual
2832         settings and the colormap for the plugin.
2833         (WebKit::NetscapePlugin::platformDestroy):
2834         (WebKit::NetscapePlugin::platformInvalidate): Remained stub.
2835         (WebKit::NetscapePlugin::platformGeometryDidChange): Create a new
2836         pixmap that fits the geometry.
2837         (WebKit::NetscapePlugin::platformPaint): Propagate a paint event
2838         to the plugin, sync with it if necessary and draw the pixmap to
2839         the screen.
2840         (WebKit::toNP): Remained stub.
2841         (WebKit::NetscapePlugin::platformHandleMouseEvent): Remained stub.
2842         (WebKit::NetscapePlugin::platformHandleWheelEvent): Remained stub.
2843         (WebKit::NetscapePlugin::platformSetFocus): Remained stub.
2844         (WebKit::NetscapePlugin::platformHandleMouseEnterEvent): Remained stub.
2845         (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent): Remained stub.
2846         (WebKit::NetscapePlugin::platformHandleKeyboardEvent): Remained stub.
2847         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2848         (WebKit::WebFrameLoaderClient::createPlugin): Hack. Inject wmode=opaque
2849         key-value pair to the plugin parameters to force Flash to act in
2850         non-transparent windowless mode. Qt also doing this in WebCore.
2851
2852 2011-03-09  Peter Kasting  <pkasting@google.com>
2853
2854         Reviewed by Mihai Parparita.
2855
2856         Unify Windows version checks.
2857         https://bugs.webkit.org/show_bug.cgi?id=55979
2858
2859         * UIProcess/win/WebPageProxyWin.cpp:
2860         (WebKit::WebPageProxy::standardUserAgent):
2861
2862 2011-03-09  Adele Peterson  <adele@apple.com>
2863
2864         Reviewed by Anders Carlsson.
2865
2866         Fix for https://bugs.webkit.org/show_bug.cgi?id=56068
2867         <rdar://problem/9058245> WebKit2: Can't uncheck 'Spelling and Grammar' contextual items
2868
2869         * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::contextMenuItemSelected):
2870         Add cases for ContextMenuItemTagCorrectSpellingAutomatically, ContextMenuItemTagCheckSpellingWhileTyping, 
2871         and ContextMenuItemTagCheckGrammarWithSpelling
2872
2873 2011-03-09  Alexey Proskuryakov  <ap@apple.com>
2874
2875         Reviewed by Dan Bernstein.
2876
2877         Frequent crashes when printing in WebPageProxy::setAutodisplay
2878         https://bugs.webkit.org/show_bug.cgi?id=56057
2879         <rdar://problem/9053290>
2880
2881         * UIProcess/API/mac/WKPrintingView.mm: (-[WKPrintingView _delayedResumeAutodisplayTimerFired]):
2882         Null check the page, there is no reason for it to still exist.
2883
2884 2011-03-09  Brent Fulgham  <bfulgham@webkit.org>
2885
2886         Unreviewed build correction.
2887
2888         * UIProcess/DrawingAreaProxy.messages.in: Exclude the other
2889           method using LayerTreeContext for non-accelerated composition case.
2890
2891 2011-03-09  Sam Weinig  <sam@webkit.org>
2892
2893         Reviewed by Anders Carlsson.
2894
2895         Change plugins to use their own executable on Mac OS X
2896         https://bugs.webkit.org/show_bug.cgi?id=55991
2897
2898         * Configurations/PluginProcess.xcconfig: Copied from Source/WebKit2/Configurations/WebProcess.xcconfig.
2899         * PluginProcess/Info.plist: Copied from Source/WebKit2/WebProcess/Info.plist.
2900         Add files necessary for adding PluginProcess.app.
2901
2902         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2903         (WebKit::ProcessLauncher::launchProcess):
2904         Launch the PluginProcess.app when launching a plugin process.
2905
2906         * WebKit2.xcodeproj/project.pbxproj:
2907         Add new executable and new files, removes some unneeded copying
2908         and duplicate compiling of files.
2909
2910         * WebProcess/Info.plist:
2911         Sorted.
2912
2913 2011-03-09  Jessie Berlin  <jberlin@apple.com>
2914
2915         Reviewed by Adam Roben.
2916
2917         Use the Cookie Storage from the Private Browsing Storage Session directly
2918         https://bugs.webkit.org/show_bug.cgi?id=55986
2919
2920         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2921         (InitWebCoreSystemInterface):
2922
2923 2011-03-09  Alejandro G. Castro  <alex@igalia.com>
2924
2925         Fix compilation after r80596, add soup Download stubs.
2926
2927         * GNUmakefile.am:
2928         * WebProcess/Downloads/soup/DownloadSoup.cpp: Added.
2929         (WebKit::Download::start):
2930         (WebKit::Download::startWithHandle):
2931         (WebKit::Download::cancel):
2932         (WebKit::Download::platformInvalidate):
2933         (WebKit::Download::didDecideDestination):
2934         (WebKit::Download::platformDidFinish):
2935
2936 2011-03-09  Alejandro G. Castro  <alex@igalia.com>
2937
2938         Fix GTK+ compilation after r80619. Add WebFullScreenManager.
2939
2940         * GNUmakefile.am:
2941
2942 2011-03-08  Jer Noble  <jer.noble@apple.com>
2943
2944         Reviewed by Sam Weinig.
2945
2946         WebKit2: Plumb through the FULLSCREEN_API Chrome client calls
2947         https://bugs.webkit.org/show_bug.cgi?id=55273
2948
2949         The FULLSCREEN_API Chrome client calls need to be plumbed through from the 
2950         WebProcess to the UIProcess.  To do this, WebFullScreenManager (and Proxy)
2951         classes have been added to WebPage.
2952
2953         * DerivedSources.make: Added rules necessary to build DerivedSources for new .in files.
2954         * DerivedSources.pro: Ditto.
2955         * Platform/CoreIPC/MessageID.h: Added message types for WebFullScreenManager.
2956         * Shared/API/c/WKBase.h: Added WKFullScreenManagerRef.
2957         * Shared/APIObject.h: Added APIType for WebFullScreenManager.
2958         * UIProcess/WebFullScreenManagerProxy.cpp: Added.
2959         * UIProcess/WebFullScreenManagerProxy.h: Added.
2960         * UIProcess/WebFullScreenManagerProxy.messages.in: Added.
2961         * UIProcess/WebPageProxy.cpp:
2962         (WebKit::WebPageProxy::close): Invalidate and clear m_fullScreenManager.
2963         (WebKit::WebPageProxy::processDidCrash): Ditto.
2964         (WebKit::WebPageProxy::didReceiveMessage): Pass messages on to WebFullScreenManagerProxy.
2965         (WebKit::WebPageProxy::didReceiveSyncMessage): Ditto.
2966         (WebKit::WebPageProxy::fullScreenManager): Added. Lazy instantiation of m_fullScreenManager.
2967         * UIProcess/WebPageProxy.h:
2968         * UIProcess/WebPageProxy.messages.in:
2969         * UIProcess/WebUIClient.cpp:
2970         * UIProcess/WebUIClient.h:
2971         * WebKit2.xcodeproj/project.pbxproj: Added references to new classes in project file.
2972         * WebKit2.pro: Ditto.
2973         * win/WebKit2.vcproj: Ditto.
2974         * WebKit2.pri: Added new directories to include file path.
2975         * win/WebKit2Common.vsprops: Ditto.
2976         * WebProcess/FullScreen/WebFullScreenManager.cpp: Added.
2977         * WebProcess/FullScreen/WebFullScreenManager.h: Added.
2978         * WebProcess/FullScreen/WebFullScreenManager.messages.in: Added.
2979         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2980         (WebKit::WebChromeClient::supportsFullScreenForElement): Pass through to WebFullScreenManager.
2981         (WebKit::WebChromeClient::enterFullScreenForElement): Ditto.
2982         (WebKit::WebChromeClient::exitFullScreenForElement): Ditto.
2983         * WebProcess/WebPage/WebPage.cpp:
2984         (WebKit::WebPage::close): Invalidate and clear m_fullScreenManager.
2985         (WebKit::WebPage::fullScreenManager): Lazy instantiation of m_fullScreenManager.
2986         (WebKit::WebPage::didReceiveMessage): Pass messages through to WebFullScreenManager.
2987         * WebProcess/WebPage/WebPage.h:
2988
2989 2011-03-08  Jer Noble  <jer.noble@apple.com>
2990
2991         Reviewed by Sam Weinig.
2992
2993         WebKit2: Plumb through the "supportsFullScreen" preference.
2994         https://bugs.webkit.org/show_bug.cgi?id=55261
2995
2996         The "supportsFullScreen" preference needs to be plumbed through from
2997         the UIProcess to the WebProcess.
2998
2999         * Shared/WebPreferencesStore.h: Add a new macro entry.
3000         * UIProcess/API/C/WKPreferences.cpp: Implement preferences getter and setter.
3001         (WKPreferencesSetFullScreenEnabled):
3002         (WKPreferencesGetFullScreenEnabled):
3003         * UIProcess/API/C/WKPreferences.h:
3004         * WebProcess/WebPage/WebPage.cpp:
3005         (WebKit::WebPage::updatePreferences): Sync the fullScreenEnabled setting through to
3006             the settings object.
3007
3008 2011-03-08  Jeff Miller  <jeffm@apple.com>
3009
3010         Reviewed by Adele Peterson.
3011
3012         WebKit2: Implement Windows glue for Undo/Redo
3013         https://bugs.webkit.org/show_bug.cgi?id=55961
3014         
3015         Expose Undo/Redo infrastructure through WKView on Windows by
3016         adding an undo client as well as APIs to reapply and unapply
3017         an edit command.
3018
3019         * UIProcess/API/C/win/WKView.cpp:
3020         (WKViewSetViewUndoClient): Added.
3021         (WKViewReapplyEditCommand): Added.
3022         (WKViewUnapplyEditCommand): Added.
3023         * UIProcess/API/C/win/WKView.h: Added WKViewUndoClient, WKViewSetViewUndoClient(), and WKViewUnapplyEditCommand().
3024         * UIProcess/WebPageProxy.cpp:
3025         (WebKit::WebPageProxy::isValidEditCommand): Added, used to validated an edit command from a WKView API.
3026         * UIProcess/WebPageProxy.h: Added isValidEditCommand().
3027         * UIProcess/win/WebUndoClient.cpp: Added, APIClient for WKViewUndoClient. 
3028         (WebKit::WebUndoClient::registerEditCommand): Added.
3029         (WebKit::WebUndoClient::clearAllEditCommands): Added.
3030         * UIProcess/win/WebUndoClient.h: Added, APIClient for WKViewUndoClient.
3031         * UIProcess/win/WebView.cpp:
3032         (WebKit::WebView::initializeUndoClient): Added.
3033         (WebKit::WebView::close): Clear out undo client.
3034         (WebKit::WebView::registerEditCommand): Implemented to call through to WKViewUndoClient.
3035         (WebKit::WebView::clearAllEditCommands): Implmented to call through to WKViewUndoClient.
3036         (WebKit::WebView::reapplyEditCommand): Added.
3037         (WebKit::WebView::unapplyEditCommand): Added.
3038         * UIProcess/win/WebView.h: Added undo client support.
3039         * win/WebKit2.vcproj: Added WebUndoClient.cpp and WebUndoClient.h.
3040
3041 2011-03-08  Jeff Miller  <jeffm@apple.com>
3042
3043         Reviewed by Sam Weinig.
3044
3045         WebKit2: Expose WebEditCommandProxy in the C API on Windows
3046         https://bugs.webkit.org/show_bug.cgi?id=55962
3047         
3048         Make WebEditCommandProxy a subclass of APIObject, and define
3049         WKEditCommandRef as the type that will be exposed through the C API.
3050
3051         * Shared/API/c/win/WKBaseWin.h: Add WKEditCommandRef.
3052         * Shared/APIObject.h: Add platform-specific TypeEditCommandProxy.
3053         * UIProcess/API/C/win/WKAPICastWin.h: Add API mapping for WKEditCommandRef.
3054         * UIProcess/WebEditCommandProxy.h: Subclass WebEditCommandProxy from APIObject.
3055         (WebKit::WebEditCommandProxy::type): Added.
3056
3057 2011-03-08  Jeff Miller  <jeffm@apple.com>
3058
3059         Reviewed by Oliver Hunt.
3060
3061         WebKit2: Redo is broken
3062         https://bugs.webkit.org/show_bug.cgi?id=55978
3063         
3064         WebEditCommandProxy::unapply() and WebEditCommandProxy::reapply() were registering the wrong edit command when an undo or redo happens.
3065         For example, when we unapply(), we should register a Redo command, not an Undo command.
3066
3067         * UIProcess/WebEditCommandProxy.cpp:
3068         (WebKit::WebEditCommandProxy::unapply): Register a Redo command, not an Undo command.
3069         (WebKit::WebEditCommandProxy::reapply): Register an Undo command, not a Redo command.
3070
3071 2011-03-08  Brent Fulgham  <bfulgham@webkit.org>
3072
3073         Reviewed by Adam Roben.
3074
3075         https://bugs.webkit.org/show_bug.cgi?id=55977
3076         Refine CF/CFNet distinctions for better code sharing.
3077         1. Rename Downloads/cf/win/DownloadCFNetWin.cpp to DownloadCFWin.cpp
3078            since it does not use any CFNETWORK features.
3079         2. Create new cfnet directory.
3080         3. Move Downloads/cf/DownloadCFNet.cpp to Downloads/cfnet
3081         4. Update project file.
3082
3083         * WebProcess/Downloads/cf/DownloadCFNet.cpp: Removed.
3084         * WebProcess/Downloads/cf/win/DownloadCFNetWin.cpp: Removed.
3085         * WebProcess/Downloads/cf/win/DownloadCFWin.cpp: Copied from WebProcess/Downloads/cf/win/DownloadCFNetWin.cpp.
3086         * WebProcess/Downloads/cfnet: Added.
3087         * WebProcess/Downloads/cfnet/DownloadCFNet.cpp: Copied from WebProcess/Downloads/cf/DownloadCFNet.cpp.
3088         * win/WebKit2.vcproj:
3089
3090 2011-03-08  Mark Rowe  <mrowe@apple.com>
3091
3092         Reviewed by Brady Eidson.
3093
3094         <http://webkit.org/b/55976> Provisional URL should be loaded when restoring session state even if there are back / forward list entries.
3095
3096         * UIProcess/cf/WebPageProxyCF.cpp:
3097         (WebKit::WebPageProxy::restoreFromSessionStateData): If there's a provisional URL that we will load then restore the session state
3098         without navigating to the current item.
3099         * WebProcess/WebPage/WebPage.messages.in: Expose the ability to restore the session state without navigating to the current item.
3100
3101 2011-03-08  Brent Fulgham  <bfulgham@webkit.org>
3102
3103         Reviewed by Anders Carlsson.
3104
3105         https://bugs.webkit.org/show_bug.cgi?id=55956
3106         WebKit2 Changes to correct WinCairo port build
3107
3108         * Shared/LayerTreeContext.h: Don't exclude CoreIPC declarations for non-accelerated
3109           compositing case.
3110         * UIProcess/DrawingAreaProxy.h: Add "stdint.h" include needed for Cairo build.
3111         * UIProcess/DrawingAreaProxyImpl.cpp: Exclude accelerated compositing code for
3112           WinCairo build.
3113         (WebKit::DrawingAreaProxyImpl::~DrawingAreaProxyImpl):
3114         (WebKit::DrawingAreaProxyImpl::didUpdateBackingStoreState):
3115         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
3116         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
3117         (WebKit::DrawingAreaProxyImpl::sendUpdateBackingStoreState):
3118         (WebKit::DrawingAreaProxyImpl::waitForAndDispatchDidUpdateBackingStoreState):
3119         * UIProcess/DrawingAreaProxyImpl.h: Exclude declarations for code only used when
3120           accelerated compositing is enabled.
3121         (WebKit::DrawingAreaProxyImpl::isInAcceleratedCompositingMode):
3122         * UIProcess/win/WebView.cpp: Protect CG-specific drawing code.
3123         (WebKit::WebView::setFindIndicator):
3124         * WebProcess/Downloads/Download.h: Allow CFLite implentation to share overwrite flag,
3125           as well as destination and bundle paths.
3126         * WebProcess/Downloads/curl/DownloadCurl.cpp: Remove stub (to share CFNet implementation
3127           of file handling.  This will be moved to a common area in a future patch.)
3128         * WebProcess/WebPage/DrawingAreaImpl.cpp: Exclude accelerated-compositing paths.
3129         (WebKit::DrawingAreaImpl::layerHostDidFlushLayers):
3130         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
3131         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
3132         * WebProcess/WebPage/WebPage.cpp: Protect CG-specific drawing code.
3133         (WebKit::WebPage::drawRectToPDF):
3134         (WebKit::WebPage::drawPagesToPDF):
3135         * win/WebKit2.vcproj: Exclude unused LayerTreeContext from WinCairo
3136
3137 2011-03-08  Ivan Krstić  <ike@apple.com>
3138
3139         Reviewed by Sam Weinig.
3140
3141         Re-fix: can't paste from 3rd party text editor into WebKit2 window
3142         <rdar://problem/8978624>
3143
3144         * WebProcess/com.apple.WebProcess.sb:
3145
3146 2011-03-08  Martin Robinson  <mrobinson@igalia.com>
3147
3148         Fix the WebKit2 compilation after r80578.
3149
3150         * UIProcess/gtk/WebView.cpp:
3151         (WebKit::WebView::setFocus): Added.
3152         * UIProcess/gtk/WebView.h:
3153
3154 2011-03-08  Jessie Berlin  <jberlin@apple.com>
3155
3156         Reviewed by Anders Carlsson.
3157
3158         Crash in CFNetwork visiting google.com
3159         https://bugs.webkit.org/show_bug.cgi?id=55958
3160
3161         * Shared/API/c/cf/WKURLResponseCF.cpp:
3162         (WKURLResponseCopyCFURLResponse):
3163         If the response to copy is null, return 0;
3164
3165 2011-03-08  John Sullivan  <sullivan@apple.com>
3166
3167         Reverted the patch for https://bugs.webkit.org/show_bug.cgi?id=55940
3168         
3169         The patch was insufficient, and it wasn't useful for the intended client use either.
3170
3171         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
3172         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3173         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3174
3175 2011-03-08  Alejandro G. Castro  <alex@igalia.com>
3176
3177         Unreviewed, fixed GTK+ compilation after r80569.
3178
3179         * UIProcess/gtk/WebView.cpp:
3180         (WebKit::WebView::windowToScreen):
3181         * UIProcess/gtk/WebView.h:
3182
3183 2011-03-08  Chris Fleizach  <cfleizach@apple.com>
3184
3185         Reviewed by Sam Weinig.
3186
3187         WK2: Cannot set focus on an element when focus is outside of WKView
3188         https://bugs.webkit.org/show_bug.cgi?id=55281
3189
3190         * UIProcess/API/mac/PageClientImpl.h:
3191         * UIProcess/API/mac/PageClientImpl.mm:
3192         (WebKit::PageClientImpl::setFocus):
3193         * UIProcess/API/qt/qwkpage_p.h:
3194         (QWKPagePrivate::setFocus):
3195         * UIProcess/PageClient.h:
3196         * UIProcess/WebPageProxy.cpp:
3197         (WebKit::WebPageProxy::setFocus):
3198         * UIProcess/WebPageProxy.h:
3199         * UIProcess/WebPageProxy.messages.in:
3200         * UIProcess/win/WebView.h:
3201         (WebKit::WebView::setFocus):
3202         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3203         (WebKit::WebChromeClient::focus):
3204         (WebKit::WebChromeClient::unfocus):
3205
3206 2011-03-08  Jeff Miller  <jeffm@apple.com>
3207
3208         Unreviewed, fix last change so WKBaseWin.h is in alphabetical order in the project XML.
3209
3210         * win/WebKit2.vcproj: Move WKBaseWin.h to be in alphabetical order.
3211
3212 2011-03-08  Jeff Miller  <jeffm@apple.com>
3213
3214         Reviewed by Darin Adler.
3215
3216         Remove Source/WebKit2/UIProcess/API/C/win/WKBaseWin.h
3217         https://bugs.webkit.org/show_bug.cgi?id=55952
3218
3219         * UIProcess/API/C/win/WKBaseWin.h: Removed.
3220         * win/WebKit2.vcproj: Refer to the Shared version of WKBaseWin.h instead of the one in UIProcess.
3221
3222 2011-03-08  Alejandro G. Castro  <alex@igalia.com>
3223
3224         Reviewed by Martin Robinson.
3225
3226         [GTK] Add new files to compilation after r77974
3227         https://bugs.webkit.org/show_bug.cgi?id=54076
3228
3229         The commit added new code to allow passing context to policy
3230         delegate methods, we also added dummy ResourceRequest and
3231         ResourceResponse decoders until we implement them.
3232
3233         * GNUmakefile.am:
3234         * Shared/gtk/WebCoreArgumentCodersGtk.cpp:
3235         (CoreIPC::decodeResourceRequest):
3236         (CoreIPC::decodeResourceResponse):
3237
3238 2011-03-08  Chris Fleizach  <cfleizach@apple.com>
3239
3240         Reviewed by Darin Adler.
3241
3242         AX: Webkit2 not sending UAZoomFocusChanged notifications
3243         https://bugs.webkit.org/show_bug.cgi?id=55916
3244
3245         Needed to implement the windowToScreen() method so that the right frame
3246         could be calculated to send for zoom focus changes.
3247
3248         * UIProcess/API/mac/PageClientImpl.h:
3249         * UIProcess/API/mac/PageClientImpl.mm:
3250         (WebKit::PageClientImpl::windowToScreen):
3251         * UIProcess/API/qt/qwkpage.cpp:
3252         (QWKPagePrivate::windowToScreen):
3253         * UIProcess/API/qt/qwkpage_p.h:
3254         * UIProcess/PageClient.h:
3255         * UIProcess/WebPageProxy.cpp:
3256         (WebKit::WebPageProxy::windowToScreen):
3257         * UIProcess/WebPageProxy.h:
3258         * UIProcess/WebPageProxy.messages.in:
3259         * UIProcess/win/WebView.cpp:
3260         (WebKit::WebView::windowToScreen):
3261         * UIProcess/win/WebView.h:
3262         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3263         (WebKit::WebChromeClient::windowToScreen):
3264         * WebProcess/WebPage/WebPage.cpp:
3265         (WebKit::WebPage::windowToScreen):
3266         * WebProcess/WebPage/WebPage.h:
3267
3268 2011-03-08  John Sullivan  <sullivan@apple.com>
3269
3270         Reviewed by Darin Adler.
3271
3272         https://bugs.webkit.org/show_bug.cgi?id=55940
3273         WebKit2 should support Ignore policy from injected bundle client
3274
3275         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
3276         Added WKBundlePagePolicyActionIgnore.
3277         
3278         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3279         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3280         If the injected bundle client returns WKBundlePagePolicyActionIgnore, convert it
3281         to the loader's PolicyIgnore.
3282
3283 2011-03-08  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
3284
3285         Reviewed by Kenneth Rohde Christiansen.
3286
3287         [Qt] [Symbian] [WK2] Fix building WebKit 2 API tests
3288         https://bugs.webkit.org/show_bug.cgi?id=55876
3289
3290         Make sure TESTS_SOURCE_DIR is set for Symbian the same way
3291         as it is for WK1.
3292
3293         * UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp:
3294         (tst_QGraphicsWKView::loadEmptyPage):
3295         * UIProcess/API/qt/tests/tests.pri:
3296
3297 2011-03-07  Damian Kaleta  <dkaleta@apple.com>
3298
3299         Reviewed by Anders Carlsson.
3300
3301         QuickTime plugin should opt in to a 32-bit non-executable heap
3302         https://bugs.webkit.org/show_bug.cgi?id=55704
3303         <rdar://problem/8105706>
3304
3305         * UIProcess/Plugins/PluginProcessProxy.cpp:
3306         (WebKit::pluginNeedsExecutableHeap): Decides per plugin if it should opt-in to a 32-bit non-executable heap.
3307         By default it should opt-out.
3308         (WebKit::PluginProcessProxy::PluginProcessProxy):
3309
3310 2011-03-07  Sam Weinig  <sam@webkit.org>
3311
3312         Reviewed by Anders Carlsson.
3313
3314         Add unableToImplementPolicy callback for WebKit2 policy client
3315         <rdar://problem/9071902>
3316         https://bugs.webkit.org/show_bug.cgi?id=55884
3317
3318         * UIProcess/API/C/WKPage.h:
3319         * UIProcess/WebPageProxy.cpp:
3320         (WebKit::WebPageProxy::unableToImplementPolicy):
3321         * UIProcess/WebPageProxy.h:
3322         * UIProcess/WebPageProxy.messages.in:
3323         * UIProcess/WebPolicyClient.cpp:
3324         (WebKit::WebPolicyClient::unableToImplementPolicy):
3325         * UIProcess/WebPolicyClient.h:
3326         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
3327         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp:
3328         (WebKit::InjectedBundlePagePolicyClient::unableToImplementPolicy):
3329         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h:
3330         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3331         (WebKit::WebFrameLoaderClient::dispatchUnableToImplementPolicy):
3332         Pipe unableToImplementPolicy through both the bundle and the main WebKit2 API.
3333
3334 2011-03-07  Sam Weinig  <sam@webkit.org>
3335
3336         Reviewed by Anders Carlsson.
3337
3338         Replace WebKit2's decidePolicyForMIMEType with decidePolicyForResponse
3339         https://bugs.webkit.org/show_bug.cgi?id=55827
3340
3341         - Renamed FrameLoaderClient::dispatchDecidePolicyForMIMEType to dispatchDecidePolicyForResponse
3342           and pass the entire response, instead of just the MIMEType.
3343         - Updated both UIProcess API and bundle API to also be based on the whole response, not just the
3344           MIMEType.
3345
3346         * UIProcess/API/C/WKPage.h:
3347         * UIProcess/WebPageProxy.cpp:
3348         (WebKit::WebPageProxy::decidePolicyForResponse):
3349         * UIProcess/WebPageProxy.h:
3350         * UIProcess/WebPageProxy.messages.in:
3351         * UIProcess/WebPolicyClient.cpp:
3352         (WebKit::WebPolicyClient::decidePolicyForResponse):
3353         * UIProcess/WebPolicyClient.h:
3354         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
3355         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp:
3356         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForResponse):
3357         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h:
3358         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3359         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
3360         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3361
3362 2011-03-06  Jessie Berlin  <jberlin@apple.com>
3363
3364         Reviewed by Sam Weinig.
3365
3366         WebKit2: Use CFNetwork Sessions API.
3367         https://bugs.webkit.org/show_bug.cgi?id=55435.
3368
3369         When Private Browsing is enabled, use cookies from a in-memory cookie storage based on the
3370         Private Browsing Storage Session.
3371
3372         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3373         (InitWebCoreSystemInterface):
3374         Add support for using the new WKSI functions in WebCore.
3375
3376 2011-03-06  Oleg Romashin  <romaxa@gmail.com>
3377
3378         Reviewed by Kenneth Rohde Christiansen.
3379
3380         [Qt][WK2] Make Qt port compiling with ENABLE_PLUGIN_PROCESS=1, part1
3381         Adding dummy Qt files for Plugin Process implementation,
3382         Adding missing sources into Qt pro files
3383         https://bugs.webkit.org/show_bug.cgi?id=55719
3384
3385         * DerivedSources.pro:
3386         * PluginProcess/qt: Added.
3387         * PluginProcess/qt/PluginControllerProxyQt.cpp: Added.
3388         (WebKit::PluginControllerProxy::platformInitialize):
3389         (WebKit::PluginControllerProxy::platformDestroy):
3390         (WebKit::PluginControllerProxy::platformGeometryDidChange):
3391         * PluginProcess/qt/PluginProcessMainQt.cpp: Added.
3392         (WebKit::PluginProcessMain):
3393         * PluginProcess/qt/PluginProcessQt.cpp: Added.
3394         (WebKit::PluginProcess::platformInitialize):
3395         * UIProcess/Plugins/qt/PluginProcessProxyQt.cpp: Added.
3396         (WebKit::PluginProcessProxy::platformInitializePluginProcess):
3397         * WebKit2.pri:
3398         * WebKit2.pro:
3399         * WebKit2API.pri:
3400         * WebProcess/Plugins/Netscape/qt/PluginProxyQt.cpp: Added.
3401         (WebKit::PluginProxy::needsBackingStore):
3402
3403 2011-03-05  Sam Weinig  <sam@webkit.org>
3404
3405         Reviewed by Dan Bernstein.
3406
3407         Remove unneeded onPageClose function from DrawingArea
3408         https://bugs.webkit.org/show_bug.cgi?id=55836
3409
3410         * WebProcess/WebPage/DrawingArea.h:
3411         Remove empty function.
3412
3413         * WebProcess/WebPage/WebPage.cpp:
3414         (WebKit::WebPage::close):
3415         Remove only called
3416
3417 2011-03-04  Jon Honeycutt  <jhoneycutt@apple.com>
3418
3419         WK2 Mac build fix.
3420
3421         * UIProcess/API/C/WKPage.cpp:
3422         (WKPageComputePagesForPrinting):
3423         (WKPageBeginPrinting):
3424
3425         * UIProcess/API/C/WKPagePrivate.h:
3426
3427 2011-03-04  Jon Honeycutt  <jhoneycutt@apple.com>
3428
3429         WK2 Mac build fix.
3430
3431         * UIProcess/API/C/WKPagePrivate.h:
3432
3433 2011-03-04  Jon Honeycutt  <jhoneycutt@apple.com>
3434
3435         WK2 needs printing support on Windows
3436         https://bugs.webkit.org/show_bug.cgi?id=55800
3437         <rdar://problem/8903808>
3438
3439         Reviewed by Darin Adler.
3440
3441         * UIProcess/API/C/WKPage.cpp:
3442         (ComputedPagesContext::ComputedPagesContext):
3443         (computedPagesCallback):
3444         From the Vector of WebCore::IntRects, build up a Vector of WKRects.
3445         Call the callback, passing these rects and the scale factor.
3446         (printInfoFromWKPrintInfo):
3447         Return a PrintInfo structure from the WKPrintInfo.
3448         (WKPageComputePagesForPrinting):
3449         Call WebPageProxy::computePagesForPrinting(). Pass
3450         computedPagesCallback as the callback function, so that we can
3451         translate the WebCore rect type to WKRect before calling the caller's
3452         callback function.
3453         (WKPageBeginPrinting):
3454         Call WebPageProxy::beginPrinting().
3455         (WKPageDrawPagesToPDF):
3456         Call WebPageProxy::drawPagesToPDF().
3457
3458         * UIProcess/API/C/WKPagePrivate.h:
3459         Declare the WKPrintInfo type and new functions.
3460
3461         * UIProcess/WebPageProxy.cpp:
3462         Compile this code on Windows.
3463
3464         * UIProcess/WebPageProxy.h:
3465         Ditto.
3466
3467         * UIProcess/win/WebView.cpp:
3468         (WebKit::WebView::paint):
3469         We're painting the window; leave printing mode.
3470
3471         * WebProcess/WebPage/WebPage.cpp:
3472         Compile this code on Windows.
3473
3474         * WebProcess/WebPage/WebPage.h:
3475         Ditto.
3476
3477         * WebProcess/WebPage/WebPage.messages.in:
3478         Ditto.
3479
3480 2011-03-04  Steve Falkenburg  <sfalken@apple.com>
3481
3482         Reviewed by Darin Adler.
3483
3484         Adopt VersionStamper tool for Windows WebKit DLLs
3485         https://bugs.webkit.org/show_bug.cgi?id=55784
3486         <rdar://problem/9021320>
3487
3488         We now use a tool to stamp the version number onto the Apple WebKit DLLs
3489         during the post-build step.
3490
3491         Fetch the WebKit version from a string resource instead of the version resource.
3492
3493         * UIProcess/win/WebPageProxyWin.cpp:
3494         (WebKit::userVisibleWebKitVersionString): Fetch version from a string resource.
3495         * win/WebKit2.rc: Removed version, added stringtable.
3496         * win/WebKit2WebProcess.rc: Removed.
3497         * win/WebKit2WebProcess.vcproj:
3498         * win/WebKit2WebProcessPostBuild.cmd: Don't run autoversion script. It isn't used in this project.
3499         * win/WebKit2WebProcessPreBuild.cmd: Stamp version.
3500         * win/WebKitPostBuild.cmd: Stamp version.
3501
3502 2011-03-04  Jeff Miller  <jeffm@apple.com>
3503
3504         Reviewed by Darin Adler.
3505
3506         Add WKPageValidateCommand()
3507         https://bugs.webkit.org/show_bug.cgi?id=55793
3508         
3509         On the Mac, validation of edit menu commands is handled within WebKit2 in WKView.mm.
3510         However, on Windows we need to do this in the client, so expose this functionality
3511         in the API via WKPageValidateCommand().
3512         
3513         Change the Mac implementation to call WebPageProxy::validateCommand() with a callback
3514         to match this new API, so it no longer has to go through PageClient to get notified
3515         when a command is validated.  This makes PageClient::setEditCommandState() obsolete,
3516         so I removed the stub implementations in qt and gtk as well.
3517
3518         * UIProcess/API/C/WKPage.cpp:
3519         (WKPageValidateCommand): Added.
3520         * UIProcess/API/C/WKPage.h: Added WKPageValidateCommand().
3521         * UIProcess/API/mac/PageClientImpl.h: Removed setEditCommandState().
3522         * UIProcess/API/mac/PageClientImpl.mm: Removed setEditCommandState().
3523         * UIProcess/API/mac/WKView.mm:
3524         (validateCommandCallback): Added.
3525         (-[WKView validateUserInterfaceItem:]): Pass callback to validateCommand().
3526         * UIProcess/API/qt/qwkpage.cpp: Removed setEditCommandState().
3527         * UIProcess/API/qt/qwkpage_p.h: Removed setEditCommandState().
3528         * UIProcess/PageClient.h: Removed setEditCommandState().
3529         * UIProcess/WebPageProxy.cpp: Removed didValidateCommand().
3530         (WebKit::WebPageProxy::validateCommand): This now takes a callback.
3531         (WebKit::WebPageProxy::validateCommandCallback): Added.
3532         (WebKit::WebPageProxy::processDidCrash): Invalidate m_validateCommandCallbacks.
3533         * UIProcess/WebPageProxy.h: Removed didValidateCommand(), validateCommand() now takes a callback.
3534         (WebKit::ValidateCommandCallback::create): Added.
3535         (WebKit::ValidateCommandCallback::~ValidateCommandCallback): Added.
3536         (WebKit::ValidateCommandCallback::performCallbackWithReturnValue): Added.
3537         (WebKit::ValidateCommandCallback::invalidate): Added.
3538         (WebKit::ValidateCommandCallback::ValidateCommandCallback): Added.
3539         * UIProcess/WebPageProxy.messages.in: Removed DidValidateCommand, added ValidateCommandCallback.
3540         * UIProcess/gtk/WebView.cpp: Removed setEditCommandState().
3541         * UIProcess/gtk/WebView.h: Removed setEditCommandState().
3542         * UIProcess/win/WebView.cpp: Removed setEditCommandState().
3543         * UIProcess/win/WebView.h: Removed setEditCommandState().
3544         * WebProcess/WebPage/WebPage.cpp:
3545         (WebKit::WebPage::validateCommand): This now takes a callbackID.
3546         * WebProcess/WebPage/WebPage.h: validateCommand now takes a callbackID.
3547         * WebProcess/WebPage/WebPage.messages.in: ValidateCommand now takes a callbackID.
3548
3549 2011-03-04  Brian Weinstein  <bweinstein@apple.com>
3550
3551         Reviewed by Darin Adler.
3552
3553         Reference-counting for WKBundlePageResourceLoadClient::willSendRequestForFrame seems unclear/wrong
3554         https://bugs.webkit.org/show_bug.cgi?id=53919
3555         <rdar://problem/8966020>
3556         
3557         Adopt the result of m_client.willSendRequestForFrame (which will be leaked by the client).
3558
3559         * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp:
3560         (WebKit::InjectedBundlePageResourceLoadClient::willSendRequestForFrame):
3561
3562 2011-03-04  Darin Adler  <darin@apple.com>
3563
3564         Reviewed by Mark Rowe.
3565
3566         WebKit2 session state should include even loads too new to be in the back/forward list
3567         https://bugs.webkit.org/show_bug.cgi?id=55781
3568         part of <rdar://problem/8968847>
3569
3570         * UIProcess/cf/WebPageProxyCF.cpp:
3571         (WebKit::WebPageProxy::sessionStateData): Save URLs that are early enough in the loading
3572         process to not be included in the back/forward list yet: The pending API request URL and
3573         the provisional URL.
3574         (WebKit::WebPageProxy::restoreFromSessionStateData): Call loadURL if the back/forward
3575         list is not restored and a URL is present. Later we can improve the way we handle the
3576         case where we have both a back/forward list and a URL.
3577
3578 2011-03-04  Jessie Berlin  <jberlin@apple.com>
3579
3580         Reviewed by Darin Adler.
3581
3582         WebKit2: Use CFNetwork Sessions API.
3583         https://bugs.webkit.org/show_bug.cgi?id=55435.
3584
3585         Add in the CFURLSTORAGESESSIONS guards that I incorrectly left out because the code was
3586         contained within guards that made USE(CFURLSTORAGESESSIONS) always be true.
3587
3588         * UIProcess/mac/WebContextMac.mm:
3589         (WebKit::WebContext::platformInitializeWebProcess):
3590         * UIProcess/win/WebContextWin.cpp:
3591         (WebKit::WebContext::platformInitializeWebProcess):
3592
3593 2011-03-04  Jessie Berlin  <jberlin@apple.com>
3594
3595         Reviewed by Maciej Stachowiak.
3596
3597         WebKit2: Use CFNetwork Sessions API.
3598         https://bugs.webkit.org/show_bug.cgi?id=55435.
3599
3600         When Private Browsing is enabled, get the cached url response from the cache associated with
3601         the Private Browsing Storage Session.
3602
3603         * WebProcess/WebPage/mac/WebPageMac.mm:
3604         (WebKit::WebPage::platformHasLocalDataForURL):
3605         If Private Browsing is enabled, call into WKSI to get the response.
3606         (WebKit::WebPage::cachedResponseMIMETypeForURL):
3607         Ditto.
3608         * WebProcess/WebPage/win/WebPageWin.cpp:
3609         (WebKit::WebPage::platformHasLocalDataForURL):
3610         If Private Browsing is enabled, call into WKSI to get the CFURLCacheRef.
3611         (WebKit::WebPage::cachedResponseMIMETypeForURL):
3612         Ditto.
3613
3614 2011-03-04  Jeff Miller  <jeffm@apple.com>
3615
3616         Reviewed by Darin Adler.
3617
3618         Move WKViewExecuteCommand() to WKPageExecuteCommand()
3619         https://bugs.webkit.org/show_bug.cgi?id=55744
3620         
3621         Executing a command operates on a page, so it makes more sense for it to be in WKPage.
3622         This also makes it available on all platforms, not just Windows.
3623
3624         * UIProcess/API/C/WKPage.cpp:
3625         (WKPageExecuteCommand): Added.
3626         * UIProcess/API/C/WKPage.h: Add WKPageExecuteCommand().
3627         * UIProcess/API/C/win/WKView.cpp: Remove WKViewExecuteCommand().
3628         * UIProcess/API/C/win/WKView.h: Remove WKViewExecuteCommand().
3629
3630 2011-03-04  Dan Bernstein  <mitz@apple.com>
3631
3632         LLVM Compiler build fix.
3633
3634         * WebProcess/WebPage/WebPage.cpp:
3635         (WebKit::WebPage::runJavaScriptInMainFrame):
3636
3637 2011-03-03  Timothy Hatcher  <timothy@apple.com>
3638
3639         Make the WKPageRunJavaScriptFunction callback take a WKSerializedScriptValueRef.
3640
3641         https://webkit.org/b/55623
3642
3643         Reviewed by Darin Adler.
3644
3645         * UIProcess/API/C/WKPage.cpp:
3646         (WKPageRunJavaScriptInMainFrame): Use ScriptValueCallback.
3647         (callRunJavaScriptBlockAndRelease): Use WKSerializedScriptValueRef.
3648         * UIProcess/API/C/WKPage.h: Use WKSerializedScriptValueRef.
3649         * UIProcess/WebPageProxy.cpp:
3650         (WebKit::WebPageProxy::close): Call invalidateCallbackMap for m_scriptValueCallbacks.
3651         (WebKit::WebPageProxy::runJavaScriptInMainFrame): Take a ScriptValueCallback.
3652         (WebKit::WebPageProxy::scriptValueCallback): Added. Create a WebSerializedScriptValue
3653         from the DataReference before calling the callback.
3654         (WebKit::WebPageProxy::processDidCrash): Call invalidateCallbackMap for m_scriptValueCallbacks.
3655         * UIProcess/WebPageProxy.h: Added ScriptValueCallback and m_scriptValueCallbacks.
3656         * UIProcess/WebPageProxy.messages.in: Added ScriptValueCallback.
3657         * WebProcess/WebPage/WebPage.cpp:
3658         (WebKit::WebPage::runJavaScriptInMainFrame): Create a DataReference from a WebCore::SerializedScriptValue.
3659         And use ScriptValueCallback to send the message back.
3660
3661 2011-03-03  Brian Weinstein  <bweinstein@apple.com>
3662
3663         Reviewed by Adam Roben.
3664
3665         Cleanup from https://bugs.webkit.org/show_bug.cgi?id=55427.
3666         
3667         Call WebCore::startObservingCookieChanges and WebCore::stopObservingCookieChanges
3668         on all platforms, and stub the functions on platforms that don't implement them.
3669
3670         * WebProcess/Cookies/WebCookieManager.cpp:
3671         (WebKit::WebCookieManager::startObservingCookieChanges):
3672         (WebKit::WebCookieManager::stopObservingCookieChanges):
3673
3674 2011-03-03  Jeff Miller  <jeffm@apple.com>
3675
3676         Reviewed by Darin Adler.
3677
3678         Refactor classes in GenericCallback.h
3679         https://bugs.webkit.org/show_bug.cgi?id=55732
3680         
3681         Since we're going to need to add additional callback classes, make a CallbackBase class that manages
3682         the context and the callback ID.  The existing callback classes (VoidCallback, GenericCallback, and
3683         ComputedPagesCallback) now all derive from CallbackBase.
3684         
3685         Fix bug in VoidCallback where we meant to implement the destructor, but we were implementing the default
3686         constructor instead (we forgot the leading ~).
3687  
3688         * UIProcess/GenericCallback.h:
3689         (WebKit::CallbackBase::~CallbackBase):
3690         (WebKit::CallbackBase::callbackID):
3691         (WebKit::CallbackBase::CallbackBase):
3692         (WebKit::CallbackBase::context):
3693         (WebKit::CallbackBase::generateCallbackID):
3694         (WebKit::VoidCallback::~VoidCallback):
3695         (WebKit::VoidCallback::performCallback):
3696         (WebKit::VoidCallback::invalidate):
3697         (WebKit::VoidCallback::VoidCallback):
3698         (WebKit::GenericCallback::create):
3699         (WebKit::GenericCallback::~GenericCallback):
3700         (WebKit::GenericCallback::performCallbackWithReturnValue):
3701         (WebKit::GenericCallback::invalidate):
3702         (WebKit::GenericCallback::GenericCallback):
3703         (WebKit::ComputedPagesCallback::create):
3704         (WebKit::ComputedPagesCallback::~ComputedPagesCallback):
3705         (WebKit::ComputedPagesCallback::performCallbackWithReturnValue):
3706         (WebKit::ComputedPagesCallback::invalidate):
3707         (WebKit::ComputedPagesCallback::ComputedPagesCallback):
3708
3709 2011-03-03  Adam Roben  <aroben@apple.com>
3710
3711         Don't assume the web process has had a chance to paint before the view has to paint
3712
3713         Fixes <http://webkit.org/b/55739> REGRESSION (r80307): Lots of tests crashing in
3714         BackingStore::paint
3715
3716         Reviewed by Anders Carlsson.
3717
3718         * UIProcess/DrawingAreaProxyImpl.cpp:
3719         (WebKit::DrawingAreaProxyImpl::paint): Bail if the web process hasn't had a chance to paint
3720         yet.
3721
3722 2011-03-03  Adam Roben  <aroben@apple.com>
3723
3724         Throw away DrawingAreaProxyImpl's backing store after not painting for 5 seconds
3725
3726         The intent is to save memory for views that aren't painting.
3727
3728         Fixes <http://webkit.org/b/51262> <rdar://problem/8782537> WebPageProxy should delete its
3729         backing store after not painting for a while
3730
3731         Reviewed by Anders Carlsson.
3732
3733         * UIProcess/DrawingAreaProxyImpl.cpp:
3734         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl): Initialize our timer.
3735         (WebKit::DrawingAreaProxyImpl::paint): Don't bail if we don't have a backing store (but do
3736         bail if we're in accelerated compositing mode); we might have thrown it away to save memory
3737         but now are being asked to paint by the view. The existing code in this function will handle
3738         getting a new backing store if possible by blocking for a little while to try to receive a
3739         DidUpdateBackingStoreState message. Added an assertion that we do have a backing store if we
3740         don't have any outstanding UpdateBackingStoreState requests. After painting, call
3741         discardBackingStoreSoon to update our timer.
3742         (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon): Set the timer for 5 seconds in the
3743         future.
3744         (WebKit::DrawingAreaProxyImpl::discardBackingStore): Throw away the backing store, and tell
3745         the web process we'll need a full backing store update on the next paint.
3746
3747         * UIProcess/DrawingAreaProxyImpl.h: Added m_discardBackingStoreTimer.
3748
3749 2011-03-03  Adam Roben  <aroben@apple.com>
3750
3751         Add a way to tell the web process to perform a full backing store update on its next paint
3752
3753         Messages::DrawingArea::UpdateBackingStoreState now takes a boolean specifying whether the
3754         full backing store update should happen immediately or should be deferred until the next
3755         paint or compositing mode change occurs. The deferred update isn't used yet, but will be
3756         used when we start throwing away backing stores to save memory.
3757
3758         Fixes <http://webkit.org/b/55730> UI process needs a way to tell the web process its backing
3759         store needs a full update on the next paint
3760
3761         Reviewed by Anders Carlsson.
3762
3763         * UIProcess/DrawingAreaProxyImpl.cpp:
3764         (WebKit::DrawingAreaProxyImpl::paint): If we have an outstanding backing store state change
3765         request, tell the web process to perform the backing store update right away, in case we
3766         previously told it it could defer the update.
3767         (WebKit::DrawingAreaProxyImpl::sizeDidChange): Specify that we need an immediate backing
3768         store update.
3769         (WebKit::DrawingAreaProxyImpl::didUpdateBackingStoreState): We can no longer assert that we
3770         were waiting for a DidUpdateBackingStoreState message when we receive one, as it's possible
3771         for the web process to decide to send us this message on its own (if we asked it to do a
3772         deferred backing store update and then it needed to paint some part of the page). Specify
3773         that we need an immediate backing store update if the web process hasn't updated to our
3774         latest state, as we're about to draw potentially out-of-date bits to the screen and want to
3775         get the right bits as soon as possible. Also added a FIXME about a potential optimization.
3776         (WebKit::DrawingAreaProxyImpl::backingStoreStateDidChange): Added a RespondImmediatelyOrNot
3777         parameter, which is just passed through to sendUpdateBackingStoreState.
3778         (WebKit::DrawingAreaProxyImpl::sendUpdateBackingStoreState): Added a RespondImmediatelyOrNot
3779         parameter that is used to specify to the web process whether to perform the full backing
3780         store update immediately. We now only wait for a DidUpdateBackingStoreState message (and
3781         thus suppress any more UpdateBackingStoreState messages until one is received) when we ask
3782         the web process for an immediate response; otherwise we could end up accidentally calling
3783         waitForAndDispatchDidUpdateBackingStoreState when the web process hasn't been told to send
3784         us such a message.
3785
3786         * UIProcess/DrawingAreaProxyImpl.h: Added RespondImmediatelyOrNot.
3787
3788         * WebProcess/WebPage/DrawingArea.h:
3789         (WebKit::DrawingArea::updateBackingStoreState): Added respondImmediately argument.
3790
3791         * WebProcess/WebPage/DrawingArea.messages.in: Added respondImmediately argument to
3792         UpdateBackingStoreState message.
3793
3794         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3795         (WebKit::DrawingAreaImpl::DrawingAreaImpl): Initialize new member that's used to track
3796         whether we should send a DidUpdateBackingStoreState message instead of an Update or
3797         compositing mode change message. This will be set to true when a deferred backing store
3798         update is pending.
3799         (WebKit::DrawingAreaImpl::layerHostDidFlushLayers): If a deferred update is pending, send a
3800         DidUpdateBackingStoreState message instead of a compositing mode change message.
3801         (WebKit::DrawingAreaImpl::updateBackingStoreState): Added respondImmediately argument. If
3802         we've already been told about this state ID (as can happen when the UI process decides it
3803         needs an immediate update to a state that it previously requested a deferred update to),
3804         don't bother updating the page's size, etc. In addition, if we've already sent a
3805         DidUpdateBackingStoreState message for this state, we don't have to do anything at all.
3806         Moved code to send the DidUpdateBackingStoreState message from here...
3807         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState): ...to here.
3808         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): Always update our dirty region,
3809         even if painting is suspended or we're in the process of updating the backing store state.
3810         It causes no harm and simplifies the code. If a deferred update is pending, send a
3811         DidUpdateBackingStoreState message instead of a compositing mode change message. Also
3812         removed a redundant if.
3813         (WebKit::DrawingAreaImpl::display): Added an assertion that this isn't called while updating
3814         backing store state, as otherwise we might end up sending two DidUpdateBackingStoreState
3815         messages. If a deferred update is pending, send a DidUpdateBackingStoreState message instead
3816         of an Update message.
3817
3818         * WebProcess/WebPage/DrawingAreaImpl.h: Updated updateBackingStoreState to match the base
3819         class. Added sendDidUpdateBackingStoreState and m_shouldSendDidUpdateBackingStoreState.
3820
3821 2011-03-03  Andy Estes  <aestes@apple.com>
3822
3823         Reviewed by Darin Adler.
3824
3825         When displaying the missing plug-in sheet, pass the 'pluginspage'
3826         attribute to the UI process.
3827         https://bugs.webkit.org/show_bug.cgi?id=55553
3828
3829         * UIProcess/API/C/WKPage.h: Add pluginsPageURL as the third argument to
3830         missingPluginButtonClicked.
3831         * UIProcess/WebPageProxy.cpp:
3832         (WebKit::WebPageProxy::missingPluginButtonClicked): Ditto.
3833         * UIProcess/WebPageProxy.h: Ditto.
3834         * UIProcess/WebPageProxy.messages.in: Ditto.
3835         * UIProcess/WebUIClient.cpp:
3836         (WebKit::WebUIClient::missingPluginButtonClicked): Ditto.
3837         * UIProcess/WebUIClient.h: Ditto.
3838         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3839         (WebKit::WebChromeClient::missingPluginButtonClicked): Get the value of
3840         pluginspageAttr.
3841
3842 2011-03-03  Alexey Proskuryakov  <ap@apple.com>
3843
3844         Suggested by Dan Bernstein.
3845
3846         Move "const" around "NSString *", so that it suddenly begins to make sense.
3847
3848         * WebProcess/mac/FullKeyboardAccessWatcher.mm:
3849
3850 2011-03-03  Jeff Miller  <jeffm@apple.com>
3851
3852         Reviewed by Anders Carlsson.
3853
3854         WebKit2: Add WKViewRef API for executing edit commands
3855         https://bugs.webkit.org/show_bug.cgi?id=49829
3856
3857         Added WKViewExecuteCommand() and documented some of the WebCore EditorCommand strings.
3858
3859         * UIProcess/API/C/win/WKView.cpp:
3860         (WKViewExecuteCommand): Added.
3861         * UIProcess/API/C/win/WKView.h: Added WKViewExecuteCommand() and comment block with WebCore EditorCommand strings.
3862
3863 2011-03-03  Jessie Berlin  <jberlin@apple.com>
3864
3865         Reviewed by Adam Roben.
3866
3867         WebKit2: Use CFNetwork Sessions API.
3868         https://bugs.webkit.org/show_bug.cgi?id=55435
3869
3870         Set the Private Browsing Storage Session on requests when Private Browsing is enabled.
3871
3872         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3873         (InitWebCoreSystemInterface):
3874         Support using WKCopyRequestWithStorageSession in WebCore.
3875
3876 2011-03-03  Adam Roben  <aroben@apple.com>
3877
3878         Don't try to paint outside the page's bounds
3879
3880         When the page is resized smaller, we would allocate a ShareableBitmap at the old, larger
3881         size, even though we only needed to paint at the new, smaller size.
3882
3883         The assertion added in this patch will fire during the WebKit2/ResizeViewWhileHidden API
3884         test if this fix gets broken in the future.
3885
3886         Fixes <http://webkit.org/b/55715> DrawingAreaImpl allocates more memory than necessary when
3887         the page is resized smaller
3888
3889         Reviewed by Anders Carlsson.
3890
3891         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3892         (WebKit::DrawingAreaImpl::updateBackingStoreState): Update our dirty region even if painting
3893         is suspended (but still refrain from updating it when in accelerated compositing mode).
3894         Rather than unite our existing dirty region with the page's new bounds, overwrite our dirty
3895         region with the page's new bounds. This prevents us from accumulating a dirty region that is
3896         larger than the page in the case where the page is being resized smaller.
3897         (WebKit::DrawingAreaImpl::display): Added an assertion that we're not trying to paint
3898         outside of the page's bounds.
3899
3900 2011-03-03  Maciej Stachowiak  <mjs@apple.com>
3901
3902         Reviewed by Brady Eidson.
3903
3904         WebProcess is calling CFURLCacheRemoveAllCachedResponses when loading, results in origin-load for all resources
3905         https://bugs.webkit.org/show_bug.cgi?id=55701
3906         <rdar://problem/9074017>
3907
3908         * Shared/WebProcessCreationParameters.cpp:
3909         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): Initialize cache-clearing
3910         flag parameters to false.
3911         (WebKit::WebProcessCreationParameters::encode): Serialize them properly.
3912         (WebKit::WebProcessCreationParameters::decode): And deserialize.
3913
3914 2011-03-03  Alexey Proskuryakov  <ap@apple.com>
3915
3916         Reviewed by Darin Adler.
3917
3918         REGRESSION (WebKit2): Tab keys no longer observe Full Keyboard Access
3919         https://bugs.webkit.org/show_bug.cgi?id=55633
3920         <rdar://problem/8963023>
3921
3922         * WebKit2.xcodeproj/project.pbxproj:
3923         * WebProcess/mac/FullKeyboardAccessWatcher.h: Added.
3924         * WebProcess/mac/FullKeyboardAccessWatcher.mm: Added.
3925         (-[FullKeyboardAccessWatcher retrieveKeyboardUIModeFromPreferences:]):
3926         (-[FullKeyboardAccessWatcher init]):
3927         (+[FullKeyboardAccessWatcher fullKeyboardAccessEnabled]):
3928         Get the current state of full keyboard access, listening for change notifications.
3929
3930         * WebProcess/WebProcess.h:  Added fullKeyboardAccessEnabled().
3931
3932         * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fullKeyboardAccessEnabled):
3933         WebKit1 also doesn't implement this on platforms other than Mac.
3934
3935         * WebProcess/mac/WebProcessMac.mm: (WebKit::WebProcess::fullKeyboardAccessEnabled):
3936         Just ask FullKeyboardAccessWatcher.
3937
3938         * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::keyboardUIMode):
3939         * WebProcess/WebCoreSupport/WebChromeClient.h:
3940         Added keyboardUIMode(), removed tabsToLinks().
3941
3942         * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::keyboardUIMode):
3943         * WebProcess/WebPage/WebPage.h:
3944         Generate keyboard UI mode from tabToLinks preference and current state of FKA.
3945
3946 2011-03-03  Sam Weinig  <sam@webkit.org>
3947
3948         Reviewed by Anders Carlsson.
3949
3950         Give the Bundle's policy client the option of deciding the policy
3951         https://bugs.webkit.org/show_bug.cgi?id=55699
3952
3953         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
3954         Add WKBundlePagePolicyAction enum and make it the return value of
3955         the WKBundlePagePolicyClient functions.
3956
3957         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp:
3958         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNavigationAction):
3959         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNewWindowAction):
3960         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForMIMEType):
3961         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h:
3962         Pass the return value back to the caller. For unimplemented functions, return WKBundlePagePolicyActionPassThrough.
3963
3964         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3965         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForMIMEType):
3966         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
3967         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3968         Call the policy function early if the bundle handles it.
3969
3970 2011-03-02  Brian Weinstein  <bweinstein@apple.com>
3971
3972         Reviewed by Adam Roben.
3973
3974         Rest of WebKit2: Need a way to send notifications to client when cookies change
3975         https://bugs.webkit.org/show_bug.cgi?id=55427
3976         <rdar://problem/9056027>
3977         
3978         This patch adds the communication from the WebProcess <-> UIProcess about starting/stopping
3979         listening for cookies changing, and adds a mechanism for the WebProcess to notify the UIProcess
3980         when the cookies have changed. The WebProcess sends a message to the UIProcess when the cookies
3981         change, and the UIProcess passes this along to the WebCookieManagerProxyClient.
3982
3983         * UIProcess/API/C/WKCookieManager.cpp:
3984         (WKCookieManagerSetClient): Call through to WebCookieManagerProxy.
3985         (WKCookieManagerStartObservingCookieChanges): Ditto.
3986         (WKCookieManagerStopObservingCookieChanges): Ditto.
3987
3988         * UIProcess/API/C/WKCookieManager.h: Add new functions and a WKCookieManagerClient
3989             which is responsible for cookiesDidChange.
3990
3991         * UIProcess/WebCookieManagerProxy.cpp:
3992         (WebKit::WebCookieManagerProxy::initializeClient):
3993         (WebKit::WebCookieManagerProxy::startObservingCookieChanges): Send the message down to the web process.
3994         (WebKit::WebCookieManagerProxy::stopObservingCookieChanges): Ditto.
3995         (WebKit::WebCookieManagerProxy::cookiesDidChange): Tell the WKCookieManagerClient the cookies were
3996             modified.
3997         * UIProcess/WebCookieManagerProxy.h:
3998         * UIProcess/WebCookieManagerProxy.messages.in: Add new messages.
3999
4000         * UIProcess/WebCookieManagerProxyClient.cpp: Added.
4001         (WebKit::WebCookieManagerProxyClient::cookiesDidChange): Calls through to the client saying that
4002             cookies changed.
4003         * UIProcess/WebCookieManagerProxyClient.h: Added.
4004     
4005         * WebProcess/Cookies/WebCookieManager.cpp:
4006         (WebKit::WebCookieManager::startObservingCookieChanges): Call through to WebCore::startObservingCookieChanges
4007             (on platforms that support it).
4008         (WebKit::WebCookieManager::stopObservingCookieChanges): Ditto (for stopObservingCookieChanges).
4009         (WebKit::WebCookieManager::dispatchDidModifyCookies): Send a message to the UI process that cookies changed.
4010         * WebProcess/Cookies/WebCookieManager.h:
4011         * WebProcess/Cookies/WebCookieManager.messages.in:
4012         
4013         Add new files.
4014         * WebKit2.pro:
4015         * WebKit2.xcodeproj/project.pbxproj:
4016         * GNUmakefile.am:
4017         * win/WebKit2.vcproj:
4018
4019 2011-03-03  Anders Carlsson  <andersca@apple.com>
4020
4021         Reviewed by Darin Adler.
4022
4023         Remove CanRunBeforeUnloadConfirmPanel sync message
4024         https://bugs.webkit.org/show_bug.cgi?id=55689
4025
4026         * Shared/WebPageCreationParameters.cpp:
4027         (WebKit::WebPageCreationParameters::encode):
4028         (WebKit::WebPageCreationParameters::decode):
4029         Encode and decode canRunBeforeUnloadConfirmPanel, as well as canRunModal, which wasn't
4030         being encoded/decoded.
4031
4032         * Shared/WebPageCreationParameters.h:
4033         Add canRunBeforeUnloadConfirmPanel.
4034
4035         * UIProcess/WebPageProxy.cpp:
4036         (WebKit::WebPageProxy::initializeUIClient):
4037         Send SetCanRunBeforeUnloadConfirmPanel and SetCanRunModal messages.
4038
4039         (WebKit::WebPageProxy::creationParameters):
4040         Initialize parameters.canRunBeforeUnloadConfirmPanel.
4041
4042         * UIProcess/WebPageProxy.messages.in:
4043         Remove CanRunBeforeUnloadConfirmPanel message.
4044
4045         * UIProcess/WebUIClient.cpp:
4046         (WebKit::WebUIClient::canRunBeforeUnloadConfirmPanel):
4047         * UIProcess/WebUIClient.h:
4048         Make canRunBeforeUnloadConfirmPanel const.
4049
4050         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
4051         (WebKit::WebChromeClient::canRunBeforeUnloadConfirmPanel):
4052         Ask the web page instead of sending a synchronous message.
4053
4054         * WebProcess/WebPage/WebPage.cpp:
4055         (WebKit::WebPage::WebPage):
4056         Initialize m_canRunBeforeUnloadConfirmPanel.
4057
4058         * WebProcess/WebPage/WebPage.h:
4059         (WebKit::WebPage::canRunBeforeUnloadConfirmPanel):
4060         (WebKit::WebPage::setCanRunBeforeUnloadConfirmPanel):
4061         Add getter and setter for m_canRunBeforeUnloadConfirmPanel.
4062
4063         (WebKit::WebPage::setCanRunModal):
4064         Add setter for m_canRunModal.
4065
4066         * WebProcess/WebPage/WebPage.messages.in:
4067         Add SetCanRunBeforeUnloadConfirmPanel and SetCanRunModal messages.
4068
4069 2011-03-03  Adam Roben  <aroben@apple.com>
4070
4071         Create the CFBundleRef for WebKit.dll on Windows if needed
4072
4073         WebKit part of <http://webkit.org/b/55672> <rdar://problem/9080867> All inspector tests time
4074         out or crash on Windows 7 Release (WebKit2 Tests)
4075
4076         Reviewed by Darin Adler.
4077
4078         * Shared/win/WebKitBundle.cpp: Added.
4079         (WebKit::createWebKitBundle): Returns a pre-existing bundle, if possible, otherwise creates
4080         and returns a new bundle.
4081         (WebKit::webKitBundle): Creates and caches a bundle, and returns it.
4082
4083         * Shared/win/WebKitBundle.h: Added.
4084
4085         * UIProcess/win/WebInspectorProxyWin.cpp:
4086         (WebKit::WebInspectorProxy::inspectorPageURL):
4087         * WebProcess/WebPage/win/WebInspectorWin.cpp:
4088         (WebKit::WebInspector::localizedStringsURL):
4089         Changed to use webKitBundle() to ensure that the bundle has been created.
4090
4091         * win/WebKit2.vcproj: Added new files.
4092
4093 2011-03-03  Peter Kasting  <pkasting@google.com>
4094
4095         Reviewed by James Robinson.
4096
4097         Drop redundant "Windows; " from the Windows-specific User Agent string.
4098         https://bugs.webkit.org/show_bug.cgi?id=54567
4099
4100         * UIProcess/win/WebPageProxyWin.cpp:
4101         (WebKit::WebPageProxy::standardUserAgent):
4102
4103 2011-03-02  Sheriff Bot  <webkit.review.bot@gmail.com>
4104
4105         Unreviewed, rolling out r80188.
4106         http://trac.webkit.org/changeset/80188