Source/WebCore: WebKit2: Use CFNetwork Sessions API.
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2011-03-03  Jessie Berlin  <jberlin@apple.com>
2
3         Reviewed by Adam Roben.
4
5         WebKit2: Use CFNetwork Sessions API.
6         https://bugs.webkit.org/show_bug.cgi?id=55435
7
8         Set the Private Browsing Storage Session on requests when Private Browsing is enabled.
9
10         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
11         (InitWebCoreSystemInterface):
12         Support using WKCopyRequestWithStorageSession in WebCore.
13
14 2011-03-03  Adam Roben  <aroben@apple.com>
15
16         Don't try to paint outside the page's bounds
17
18         When the page is resized smaller, we would allocate a ShareableBitmap at the old, larger
19         size, even though we only needed to paint at the new, smaller size.
20
21         The assertion added in this patch will fire during the WebKit2/ResizeViewWhileHidden API
22         test if this fix gets broken in the future.
23
24         Fixes <http://webkit.org/b/55715> DrawingAreaImpl allocates more memory than necessary when
25         the page is resized smaller
26
27         Reviewed by Anders Carlsson.
28
29         * WebProcess/WebPage/DrawingAreaImpl.cpp:
30         (WebKit::DrawingAreaImpl::updateBackingStoreState): Update our dirty region even if painting
31         is suspended (but still refrain from updating it when in accelerated compositing mode).
32         Rather than unite our existing dirty region with the page's new bounds, overwrite our dirty
33         region with the page's new bounds. This prevents us from accumulating a dirty region that is
34         larger than the page in the case where the page is being resized smaller.
35         (WebKit::DrawingAreaImpl::display): Added an assertion that we're not trying to paint
36         outside of the page's bounds.
37
38 2011-03-03  Maciej Stachowiak  <mjs@apple.com>
39
40         Reviewed by Brady Eidson.
41
42         WebProcess is calling CFURLCacheRemoveAllCachedResponses when loading, results in origin-load for all resources
43         https://bugs.webkit.org/show_bug.cgi?id=55701
44         <rdar://problem/9074017>
45
46         * Shared/WebProcessCreationParameters.cpp:
47         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): Initialize cache-clearing
48         flag parameters to false.
49         (WebKit::WebProcessCreationParameters::encode): Serialize them properly.
50         (WebKit::WebProcessCreationParameters::decode): And deserialize.
51
52 2011-03-03  Alexey Proskuryakov  <ap@apple.com>
53
54         Reviewed by Darin Adler.
55
56         REGRESSION (WebKit2): Tab keys no longer observe Full Keyboard Access
57         https://bugs.webkit.org/show_bug.cgi?id=55633
58         <rdar://problem/8963023>
59
60         * WebKit2.xcodeproj/project.pbxproj:
61         * WebProcess/mac/FullKeyboardAccessWatcher.h: Added.
62         * WebProcess/mac/FullKeyboardAccessWatcher.mm: Added.
63         (-[FullKeyboardAccessWatcher retrieveKeyboardUIModeFromPreferences:]):
64         (-[FullKeyboardAccessWatcher init]):
65         (+[FullKeyboardAccessWatcher fullKeyboardAccessEnabled]):
66         Get the current state of full keyboard access, listening for change notifications.
67
68         * WebProcess/WebProcess.h:  Added fullKeyboardAccessEnabled().
69
70         * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fullKeyboardAccessEnabled):
71         WebKit1 also doesn't implement this on platforms other than Mac.
72
73         * WebProcess/mac/WebProcessMac.mm: (WebKit::WebProcess::fullKeyboardAccessEnabled):
74         Just ask FullKeyboardAccessWatcher.
75
76         * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::keyboardUIMode):
77         * WebProcess/WebCoreSupport/WebChromeClient.h:
78         Added keyboardUIMode(), removed tabsToLinks().
79
80         * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::keyboardUIMode):
81         * WebProcess/WebPage/WebPage.h:
82         Generate keyboard UI mode from tabToLinks preference and current state of FKA.
83
84 2011-03-03  Sam Weinig  <sam@webkit.org>
85
86         Reviewed by Anders Carlsson.
87
88         Give the Bundle's policy client the option of deciding the policy
89         https://bugs.webkit.org/show_bug.cgi?id=55699
90
91         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
92         Add WKBundlePagePolicyAction enum and make it the return value of
93         the WKBundlePagePolicyClient functions.
94
95         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp:
96         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNavigationAction):
97         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNewWindowAction):
98         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForMIMEType):
99         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h:
100         Pass the return value back to the caller. For unimplemented functions, return WKBundlePagePolicyActionPassThrough.
101
102         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
103         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForMIMEType):
104         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
105         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
106         Call the policy function early if the bundle handles it.
107
108 2011-03-02  Brian Weinstein  <bweinstein@apple.com>
109
110         Reviewed by Adam Roben.
111
112         Rest of WebKit2: Need a way to send notifications to client when cookies change
113         https://bugs.webkit.org/show_bug.cgi?id=55427
114         <rdar://problem/9056027>
115         
116         This patch adds the communication from the WebProcess <-> UIProcess about starting/stopping
117         listening for cookies changing, and adds a mechanism for the WebProcess to notify the UIProcess
118         when the cookies have changed. The WebProcess sends a message to the UIProcess when the cookies
119         change, and the UIProcess passes this along to the WebCookieManagerProxyClient.
120
121         * UIProcess/API/C/WKCookieManager.cpp:
122         (WKCookieManagerSetClient): Call through to WebCookieManagerProxy.
123         (WKCookieManagerStartObservingCookieChanges): Ditto.
124         (WKCookieManagerStopObservingCookieChanges): Ditto.
125
126         * UIProcess/API/C/WKCookieManager.h: Add new functions and a WKCookieManagerClient
127             which is responsible for cookiesDidChange.
128
129         * UIProcess/WebCookieManagerProxy.cpp:
130         (WebKit::WebCookieManagerProxy::initializeClient):
131         (WebKit::WebCookieManagerProxy::startObservingCookieChanges): Send the message down to the web process.
132         (WebKit::WebCookieManagerProxy::stopObservingCookieChanges): Ditto.
133         (WebKit::WebCookieManagerProxy::cookiesDidChange): Tell the WKCookieManagerClient the cookies were
134             modified.
135         * UIProcess/WebCookieManagerProxy.h:
136         * UIProcess/WebCookieManagerProxy.messages.in: Add new messages.
137
138         * UIProcess/WebCookieManagerProxyClient.cpp: Added.
139         (WebKit::WebCookieManagerProxyClient::cookiesDidChange): Calls through to the client saying that
140             cookies changed.
141         * UIProcess/WebCookieManagerProxyClient.h: Added.
142     
143         * WebProcess/Cookies/WebCookieManager.cpp:
144         (WebKit::WebCookieManager::startObservingCookieChanges): Call through to WebCore::startObservingCookieChanges
145             (on platforms that support it).
146         (WebKit::WebCookieManager::stopObservingCookieChanges): Ditto (for stopObservingCookieChanges).
147         (WebKit::WebCookieManager::dispatchDidModifyCookies): Send a message to the UI process that cookies changed.
148         * WebProcess/Cookies/WebCookieManager.h:
149         * WebProcess/Cookies/WebCookieManager.messages.in:
150         
151         Add new files.
152         * WebKit2.pro:
153         * WebKit2.xcodeproj/project.pbxproj:
154         * GNUmakefile.am:
155         * win/WebKit2.vcproj:
156
157 2011-03-03  Anders Carlsson  <andersca@apple.com>
158
159         Reviewed by Darin Adler.
160
161         Remove CanRunBeforeUnloadConfirmPanel sync message
162         https://bugs.webkit.org/show_bug.cgi?id=55689
163
164         * Shared/WebPageCreationParameters.cpp:
165         (WebKit::WebPageCreationParameters::encode):
166         (WebKit::WebPageCreationParameters::decode):
167         Encode and decode canRunBeforeUnloadConfirmPanel, as well as canRunModal, which wasn't
168         being encoded/decoded.
169
170         * Shared/WebPageCreationParameters.h:
171         Add canRunBeforeUnloadConfirmPanel.
172
173         * UIProcess/WebPageProxy.cpp:
174         (WebKit::WebPageProxy::initializeUIClient):
175         Send SetCanRunBeforeUnloadConfirmPanel and SetCanRunModal messages.
176
177         (WebKit::WebPageProxy::creationParameters):
178         Initialize parameters.canRunBeforeUnloadConfirmPanel.
179
180         * UIProcess/WebPageProxy.messages.in:
181         Remove CanRunBeforeUnloadConfirmPanel message.
182
183         * UIProcess/WebUIClient.cpp:
184         (WebKit::WebUIClient::canRunBeforeUnloadConfirmPanel):
185         * UIProcess/WebUIClient.h:
186         Make canRunBeforeUnloadConfirmPanel const.
187
188         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
189         (WebKit::WebChromeClient::canRunBeforeUnloadConfirmPanel):
190         Ask the web page instead of sending a synchronous message.
191
192         * WebProcess/WebPage/WebPage.cpp:
193         (WebKit::WebPage::WebPage):
194         Initialize m_canRunBeforeUnloadConfirmPanel.
195
196         * WebProcess/WebPage/WebPage.h:
197         (WebKit::WebPage::canRunBeforeUnloadConfirmPanel):
198         (WebKit::WebPage::setCanRunBeforeUnloadConfirmPanel):
199         Add getter and setter for m_canRunBeforeUnloadConfirmPanel.
200
201         (WebKit::WebPage::setCanRunModal):
202         Add setter for m_canRunModal.
203
204         * WebProcess/WebPage/WebPage.messages.in:
205         Add SetCanRunBeforeUnloadConfirmPanel and SetCanRunModal messages.
206
207 2011-03-03  Adam Roben  <aroben@apple.com>
208
209         Create the CFBundleRef for WebKit.dll on Windows if needed
210
211         WebKit part of <http://webkit.org/b/55672> <rdar://problem/9080867> All inspector tests time
212         out or crash on Windows 7 Release (WebKit2 Tests)
213
214         Reviewed by Darin Adler.
215
216         * Shared/win/WebKitBundle.cpp: Added.
217         (WebKit::createWebKitBundle): Returns a pre-existing bundle, if possible, otherwise creates
218         and returns a new bundle.
219         (WebKit::webKitBundle): Creates and caches a bundle, and returns it.
220
221         * Shared/win/WebKitBundle.h: Added.
222
223         * UIProcess/win/WebInspectorProxyWin.cpp:
224         (WebKit::WebInspectorProxy::inspectorPageURL):
225         * WebProcess/WebPage/win/WebInspectorWin.cpp:
226         (WebKit::WebInspector::localizedStringsURL):
227         Changed to use webKitBundle() to ensure that the bundle has been created.
228
229         * win/WebKit2.vcproj: Added new files.
230
231 2011-03-03  Peter Kasting  <pkasting@google.com>
232
233         Reviewed by James Robinson.
234
235         Drop redundant "Windows; " from the Windows-specific User Agent string.
236         https://bugs.webkit.org/show_bug.cgi?id=54567
237
238         * UIProcess/win/WebPageProxyWin.cpp:
239         (WebKit::WebPageProxy::standardUserAgent):
240
241 2011-03-02  Sheriff Bot  <webkit.review.bot@gmail.com>
242
243         Unreviewed, rolling out r80188.
244         http://trac.webkit.org/changeset/80188
245         https://bugs.webkit.org/show_bug.cgi?id=55647
246
247         Broke the WebKit API tests. (Requested by xenon on #webkit).
248
249         * UIProcess/API/C/WKPage.cpp:
250         (WKPageRunJavaScriptInMainFrame):
251         (callRunJavaScriptBlockAndRelease):
252         * UIProcess/API/C/WKPage.h:
253         * UIProcess/WebPageProxy.cpp:
254         (WebKit::WebPageProxy::close):
255         (WebKit::WebPageProxy::runJavaScriptInMainFrame):
256         (WebKit::WebPageProxy::processDidCrash):
257         * UIProcess/WebPageProxy.h:
258         * UIProcess/WebPageProxy.messages.in:
259         * WebProcess/WebPage/WebPage.cpp:
260         (WebKit::WebPage::runJavaScriptInMainFrame):
261
262 2011-03-02  Jeff Miller  <jeffm@apple.com>
263
264         Reviewed by Darin Adler.
265
266         Rename WebKit::WebPage::validateMenuItem() to validateCommand()
267         https://bugs.webkit.org/show_bug.cgi?id=55636
268         
269         Since this method can validate more than menu items, validateCommand() is a better name.  Also rename various messages and WebKit::WebPageProxy::didValidateMenuItem() to didValidateCommand().
270
271         * UIProcess/API/mac/WKView.mm:
272         (-[WKView validateUserInterfaceItem:]): Call validateCommand() instead of validateMenuItem().
273         * UIProcess/WebPageProxy.cpp:
274         (WebKit::WebPageProxy::validateCommand): Renamed from validateMenuItem().
275         (WebKit::WebPageProxy::didValidateCommand): Renamed from didValidateMenuItem().
276         * UIProcess/WebPageProxy.h:
277         * UIProcess/WebPageProxy.messages.in: Renamed DidValidateMenuItem to DidValidateCommand.
278         * WebProcess/WebPage/WebPage.cpp:
279         (WebKit::WebPage::validateCommand): Renamed from validateMenuItem().
280         * WebProcess/WebPage/WebPage.h:
281         * WebProcess/WebPage/WebPage.messages.in: Renamed ValidateMenuItem to ValidateCommand.
282
283 2011-03-02  Anders Carlsson  <andersca@apple.com>
284
285         Reviewed by Sam Weinig.
286
287         WKPageSetMemoryCacheClientCallsEnabled doesn't persist if web process crashes
288         https://bugs.webkit.org/show_bug.cgi?id=55635
289
290         * Shared/WebPageCreationParameters.cpp:
291         (WebKit::WebPageCreationParameters::encode):
292         (WebKit::WebPageCreationParameters::decode):
293         Encode and decode areMemoryCacheClientCallsEnabled.
294
295         * Shared/WebPageCreationParameters.h:
296         Add areMemoryCacheClientCallsEnabled member variable.
297
298         * UIProcess/WebPageProxy.cpp:
299         (WebKit::WebPageProxy::WebPageProxy):
300         Initialize m_areMemoryCacheClientCallsEnabled.
301
302         (WebKit::WebPageProxy::setMemoryCacheClientCallsEnabled):
303         Update m_areMemoryCacheClientCallsEnabled. Send a message if necessary.
304
305         (WebKit::WebPageProxy::creationParameters):
306         Set areMemoryCacheClientCallsEnabled.
307
308         * WebProcess/WebPage/WebPage.cpp:
309         (WebKit::WebPage::WebPage):
310         Call WebPage::setMemoryCacheMessagesEnabled.
311
312 2011-03-02  Timothy Hatcher  <timothy@apple.com>
313
314         Make the runJavaScriptInMainFrame callback send a WKSerializedScriptValueRef.
315
316         https://webkit.org/b/55623
317
318         Reviewed by Darin Adler.
319
320         * UIProcess/API/C/WKPage.cpp:
321         (WKPageRunJavaScriptInMainFrame): Use ScriptValueCallback.
322         (callRunJavaScriptBlockAndRelease): Use WKSerializedScriptValueRef.
323         * UIProcess/API/C/WKPage.h: Use WKSerializedScriptValueRef.
324         * UIProcess/WebPageProxy.cpp:
325         (WebKit::WebPageProxy::close): Call invalidateCallbackMap for m_scriptValueCallbacks.
326         (WebKit::WebPageProxy::runJavaScriptInMainFrame): Take a ScriptValueCallback.
327         (WebKit::WebPageProxy::scriptValueCallback): Added. Create a WebSerializedScriptValue
328         from the DataReference before calling the callback.
329         (WebKit::WebPageProxy::processDidCrash): Call invalidateCallbackMap for m_scriptValueCallbacks.
330         * UIProcess/WebPageProxy.h: Added ScriptValueCallback and m_scriptValueCallbacks.
331         * UIProcess/WebPageProxy.messages.in: Added ScriptValueCallback.
332         * WebProcess/WebPage/WebPage.cpp:
333         (WebKit::WebPage::runJavaScriptInMainFrame): Create a DataReference from a WebCore::SerializedScriptValue.
334         And use ScriptValueCallback to send the message back.
335
336 2011-03-02  Jessie Berlin  <jberlin@apple.com>
337
338         Reviewed by Adam Roben.
339
340         WebKit2: Use CFNetwork Sessions API.
341         https://bugs.webkit.org/show_bug.cgi?id=55435
342
343         Add the ability to create a Private Browsing Storage Session.
344
345         * Shared/WebProcessCreationParameters.cpp:
346         (WebKit::WebProcessCreationParameters::encode):
347         Encode the UI Process bundle identifier.
348         (WebKit::WebProcessCreationParameters::decode):
349         Decode the UI Process bundle identifier.
350         * Shared/WebProcessCreationParameters.h:
351
352         * UIProcess/mac/WebContextMac.mm:
353         (WebKit::WebContext::platformInitializeWebProcess):
354         Grab the bundle identifier and use it to set the WebProcessCreationParameter.
355         * UIProcess/win/WebContextWin.cpp:
356         (WebKit::WebContext::platformInitializeWebProcess):
357         Ditto.
358
359         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
360         (InitWebCoreSystemInterface):
361         Support using the wkCreatePrivateStorageSession WKSI in WebCore.
362
363         * WebProcess/WebProcess.cpp:
364         (WebKit::WebProcess::initializeWebProcess):
365         Set the base for the Private Browsing Storage Session identifier to be the bundle identifier
366         from the UI Process so that WebKit1 would create a Private Browsing Storage Session with the
367         same identifier as WebKit2.
368
369 2011-03-01  Brian Weinstein  <bweinstein@apple.com>
370
371         Reviewed by Adam Roben.
372
373         Part of WebKit2: Need a way to send notifications to client when cookies change
374         https://bugs.webkit.org/show_bug.cgi?id=55427
375         <rdar://problem/9056027>
376
377         * WebProcess/Cookies/WebCookieManager.cpp:
378         (WebKit::WebCookieManager::dispatchDidModifyCookies): Add a stub with a FIXME to send a 
379             message to the UI process.
380
381         * WebProcess/Cookies/WebCookieManager.h:
382         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
383         (WebKit::WebPlatformStrategies::createCookiesStrategy):
384         (WebKit::WebPlatformStrategies::notifyCookiesChanged): Call WebCookieManager::dispatchDidModifyCookies.
385         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
386
387 2011-03-02  Andras Becsi  <abecsi@webkit.org>
388
389         Reviewed by Laszlo Gombos.
390
391         [Qt][WK2] generate-forwarding-headers.pl should generate paths with framework names
392         https://bugs.webkit.org/show_bug.cgi?id=55478
393
394         On case insensitive systems the generated forwarding headers cause build problems.
395
396         * Scripts/generate-forwarding-headers.pl: The generated header should
397         also contain the framework name.
398
399 2011-03-01  Jeff Miller  <jeffm@apple.com>
400
401         Reviewed by Darin Adler.
402
403         Expose some selection state fields in WKPage
404         https://bugs.webkit.org/show_bug.cgi?id=55541
405         
406         Added WKPageCanDelete(), WKPageHasSelectedRange(), and WKPageIsContentEditable() so we can enable some
407         Edit menu items properly on Windows when using WebKit2.
408
409         * UIProcess/API/C/WKPage.cpp:
410         (WKPageCanDelete): Added.
411         (WKPageHasSelectedRange): Added.
412         (WKPageIsContentEditable): Added.
413         * UIProcess/API/C/WKPage.h: Added new functions.
414         * UIProcess/WebPageProxy.h:
415         (WebKit::WebPageProxy::canDelete): Added.
416         (WebKit::WebPageProxy::hasSelectedRange): Added.
417         (WebKit::WebPageProxy::isContentEditable): Added.
418
419 2011-03-01  Mark Rowe  <mrowe@apple.com>
420
421         Hide the typeinfo name symbols for std::exception and std::bad_alloc too.
422
423         * Configurations/Base.xcconfig:
424
425 2011-03-01  Mark Rowe  <mrowe@apple.com>
426
427         Reviewed by Sam Weinig.
428
429         Add verification scripts to WebKit2 project and fix the issues they reveal.
430
431         * Configurations/Base.xcconfig: Add linker flags to prevent C++ standard
432         library functions from being exported as weak externals.
433         * Configurations/WebKit2.xcconfig: Inherit linker flags from the project level.
434         * Shared/WebContextMenuItem.cpp:
435         (WebKit::WebContextMenuItem::separatorItem): Use DEFINE_STATIC_LOCAL.
436         * UIProcess/WebPageGroup.cpp:
437         (WebKit::webPageGroupMap): Ditto.
438         * WebKit2.xcodeproj/project.pbxproj: Don't copy .in files in to the framework.
439         Run verification scripts at the appropriate times.
440         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
441         (WebKit::WebEditorClient::didBeginEditing): Use DEFINE_STATIC_LOCAL.
442         (WebKit::WebEditorClient::respondToChangedContents): Ditto.
443         (WebKit::WebEditorClient::respondToChangedSelection): Ditto.
444         (WebKit::WebEditorClient::didEndEditing): Ditto.
445         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
446         (WebKit::idToHistoryItemMap): Ditto.
447         (WebKit::historyItemToIDMap): Ditto.
448
449 2011-03-01  Joseph Pecoraro  <joepeck@webkit.org>
450
451         Unreviewed. Roll out r80068 and r80073 due to breaking WebKit2 Qt port.
452
453         * UIProcess/API/qt/qwkpage.cpp:
454         (QWKPage::viewportAttributesForSize):
455
456 2011-03-01  Joseph Pecoraro  <joepeck@webkit.org>
457
458         Unreviewed, missed updating a call to WebCore::computeViewportAttributes
459         who's prototype changed.
460
461         Viewport Warning/Error Messages Are Now Inaccurate
462         https://bugs.webkit.org/show_bug.cgi?id=53707
463
464         * UIProcess/API/qt/qwkpage.cpp:
465         (QWKPage::viewportAttributesForSize): pass in a value for the document argument.
466
467 2011-03-01  Anders Carlsson  <andersca@apple.com>
468
469         Reviewed by Sam Weinig.
470
471         WKPluginSiteDataManagerClearAllSiteData is not working
472         https://bugs.webkit.org/show_bug.cgi?id=55528
473         <rdar://problem/9071823>
474
475         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
476         (WebKit::NetscapePluginModule::tryGetSitesWithData):
477         Remove version checks, checking that the function pointer is not null is enough.
478
479         (WebKit::NetscapePluginModule::tryClearSiteData):
480         Remove version checks, checking that the function pointer is not null is enough.
481         Also, correctly convert a null String to a null CString.
482
483 2011-03-01  Adam Roben  <aroben@apple.com>
484
485         Incorporate a review comment I missed in r80051
486
487         * Shared/Plugins/Netscape/NetscapePluginModule.cpp: Clarified error message.
488
489 2011-03-01  Adam Roben  <aroben@apple.com>
490
491         Make the PLUGIN_ARCHITECTURE() macro work with MSVC
492
493         Fixes <http://webkit.org/b/55513> <rdar://problem/9069189> REGRESSION (r79925): Lots of
494         plugins tests crashing in NetscapePlugin::initialize on Windows
495
496         Reviewed by Anders Carlsson.
497
498         * Shared/Plugins/Netscape/NetscapePluginModule.cpp: Added a compile-time check to make sure
499         PLUGIN_ARCHITECTURE() is defined for some platform.
500
501         * config.h: Removed the parentheses from the use of "defined" in the PLUGIN_ARCHITECTURE()
502         macro. This matches PLATFORM(), OS(), etc., and makes the macro work on Windows. Also
503         replaced the nonsense OS(WIN) with OS(WINDOWS).
504
505         * win/WebKit2.vcproj: Added config.h for editing convenience. Let VS do its thang.
506
507 2011-03-01  Sam Weinig  <sam@webkit.org>
508
509         Reviewed by Timothy Hatcher.
510
511         WebKit2 needs to be made localizable
512         https://bugs.webkit.org/show_bug.cgi?id=55483
513
514         * PluginProcess/mac/PluginProcessMainMac.mm:
515         * WebProcess/mac/WebProcessMainMac.mm:
516         Set the default localization from the passed in parameter.
517
518         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
519         Add the preferred localization as a parameter when launching processes
520         so that they can set their localization to match the launching app.
521
522         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
523         Use WebCore's localizedString function on the mac, to actually localize
524         these strings.
525
526         (WebKit::WebPlatformStrategies::imageTitle):
527         Switch to using replace, instead of concatenation, to give localizers a chance
528         to rearrange the wording.
529
530 2011-03-01  Balazs Kelemen  <kbalazs@webkit.org>
531
532         Reviewed by Anders Carlsson.
533
534         [Qt][WK2] Plugin initialization
535         https://bugs.webkit.org/show_bug.cgi?id=48127
536
537         Apply the quirks that are necessary for the flash plugin
538         to not crash on X11.
539
540         * Platform/qt/ModuleQt.cpp:
541         (WebKit::Module::load): Use the ResolveAllSymbols hint as we do in WebCore.
542         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
543         (WebKit::NetscapePluginModule::tryLoad): Call applyX11QuirksBeforeLoad
544         if PLUGIN_ARCHITECTURE is X11.
545         * Shared/Plugins/Netscape/NetscapePluginModule.h:
546         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
547         (WebKit::initializeGTK):  The same hack that we do in WebCore.
548         Call gtk_init because flash don't do it for itself.
549         (WebKit::NetscapePluginModule::applyX11QuirksBeforeLoad): Added for X11.
550         Do the hacks that we need to do before calling NP_Initialize on the
551         flash plugin to save it form crashing.
552         * Shared/Plugins/PluginQuirks.h: Use PLUGIN_ARCHITECTURE macros.
553         Added RequiresGTKToolKit quirk for X11.
554         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
555         (WebKit::NPN_GetValue): Handle the RequiresGTKToolKit quirk on X11.
556         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
557         (WebKit::NetscapePlugin::quirks): Added getter for the PluginModule's
558         quirks to be available in NPN_GetValue.
559
560 2011-03-01  Adam Roben  <aroben@apple.com>
561
562         Convert seconds to milliseconds before calling ::SetTimer
563
564         Fixes <http://webkit.org/b/55417> <rdar://problem/9065287> RunLoop::Timer fires 1000x too
565         early on Windows
566
567         Reviewed by Anders Carlsson.
568
569         * Platform/win/RunLoopWin.cpp:
570         (RunLoop::TimerBase::start): Convert the timeout interval to milliseconds, since that's what
571         ::SetTimer expects.
572
573 2011-03-01  Andras Becsi  <abecsi@webkit.org>
574
575         Reviewed by Csaba Osztrogonác.
576
577         [Qt] Clean up the project files and move common options to WebKit.pri.
578
579         * WebKit2.pro: Deduplicate options.
580
581 2011-03-01  Juha Savolainen  <juha.savolainen@weego.fi>
582
583         Reviewed by Andreas Kling.
584
585         [Qt] WebKit2 needs to support font size changing and getting default font size
586         https://bugs.webkit.org/show_bug.cgi?id=53671
587
588         Added new enum for font size type and added methods to set and get default font sizes.
589
590         * UIProcess/API/qt/qwkpreferences.cpp:
591         (QWKPreferences::setFontSize): Added.
592         (QWKPreferences::fontSize): Added.
593         * UIProcess/API/qt/qwkpreferences.h:
594
595 2011-02-28  Alice Liu  <alice.liu@apple.com>
596
597         Reviewed by Adam Roben and Gavin Barraclough.
598
599         https://bugs.webkit.org/show_bug.cgi?id=54898
600         InjectedBundleNodeHandle dies too early in WKBundleHitTestResultGetNodeHandle
601
602         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
603         (WKBundleHitTestResultCopyNodeHandle): 
604         Instead of .get(), call .release.leakRef() like other functions that return WKBundleNodeHandleRef.
605         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h:
606         Renamed from "get" to "copy", because it leaksRef.
607
608 2011-02-28  Alice Liu  <alice.liu@apple.com>
609
610         Reviewed by Gavin Barraclough.
611
612         https://bugs.webkit.org/show_bug.cgi?id=55442
613         Webarchives don't contain subframe content
614
615         * WebProcess/WebPage/WebPage.cpp:
616         (WebKit::WebPage::getWebArchiveOfFrame):
617         Pass the frame's document instead of just the frame, to use a different LegacyWebArchive::create function.
618
619 2011-02-28  Benjamin Poulain  <benjamin.poulain@nokia.com>
620
621         Reviewed by Kenneth Rohde Christiansen.
622
623         [Qt][WK2] Add a way to test the WebKit 2 APIs
624         https://bugs.webkit.org/show_bug.cgi?id=55408
625
626         Add an initial test for the WebKit 2 APIs of Qt.
627
628         * UIProcess/API/qt/tests/html/basic_page.html: Added.
629         * UIProcess/API/qt/tests/qgraphicswkview/qgraphicswkview.pro: Added.
630         * UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp: Added.
631         (View::View):
632         (View::resizeEvent):
633         (tst_QGraphicsWKView::init):
634         (tst_QGraphicsWKView::cleanup):
635         (tst_QGraphicsWKView::loadEmptyPage):
636         * UIProcess/API/qt/tests/tests.pri: Added.
637         * UIProcess/API/qt/tests/tests.pro: Added.
638         * UIProcess/API/qt/tests/util.h: Added.
639         (waitForSignal):
640
641 2011-02-28  Anders Carlsson  <andersca@apple.com>
642
643         Fix clang build.
644
645         * UIProcess/API/mac/FindIndicatorWindow.mm:
646         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
647         (WebKit::ChunkedUpdateDrawingAreaProxy::deprecatedUpdate):
648         (WebKit::ChunkedUpdateDrawingAreaProxy::didReceiveMessage):
649         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
650         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
651         (WebKit::ChunkedUpdateDrawingArea::deprecatedResumePainting):
652         (WebKit::ChunkedUpdateDrawingArea::didReceiveMessage):
653         * WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
654
655 2011-02-28  Dan Bernstein  <mitz@apple.com>
656
657         Rubber-stamped by Anders Carlsson.
658
659         Do not copy config.h into WebKit2.
660
661         * WebKit2.xcodeproj/project.pbxproj:
662
663 2011-02-28  Dan Bernstein  <mitz@apple.com>
664
665         LLVM Compiler build fix.
666
667         * Scripts/webkit2/messages.py:
668         * UIProcess/WebPageProxy.h:
669
670 2011-02-28  Anders Carlsson  <andersca@apple.com>
671
672         Reviewed by Dan Bernstein, Sam Weinig, Alexey Proskuryakov and Darin Adler.
673
674         Open PDF in Preview doesn't work
675         https://bugs.webkit.org/show_bug.cgi?id=55400
676         <rdar://problem/8750353>
677
678         * UIProcess/API/mac/PDFViewController.mm:
679         (-[WKPDFView initWithFrame:PDFViewController:]):
680         Set the WKPDFView as the delegate of itself.
681
682         (-[WKPDFView PDFViewOpenPDFInNativeApplication:]):
683         Call PDFViewController::openPDFInFinder.
684
685         (WebKit::PDFViewController::PDFViewController):
686         Initialize m_hasWrittenPDFToDisk to false.
687
688         (WebKit::PDFViewController::openPDFInFinder):
689         Write the PDF to disk if needed and then open it using -[NSWorkspace openFile:].
690         
691         (WebKit::temporaryPDFDirectoryPath):
692         Create a directory to put PDFs in.
693
694         (WebKit::PDFViewController::pathToPDFOnDisk):
695         Return a path to a (non-existent) file in the temporary PDF directory.
696
697 2011-02-28  Alexey Proskuryakov  <ap@apple.com>
698
699         Reviewed by Dan Bernstein.
700
701         Frequent crashes in CFURLCache code on Snow Leopard
702         https://bugs.webkit.org/show_bug.cgi?id=55412
703         <rdar://problem/9063922>
704
705         CString is evil, it has two lengths which can be different - specifically, fileSystemRepresentation()
706         creates a string with maximum possible buffer size. A path with garbage at the end confused
707         CFURLCache into corrupting its data structures.
708
709         * Shared/WebProcessCreationParameters.h: Added a FIXME about merging Mac and Windows code.
710         This problem wouldn't have occured if we didn't use CString in the first place.
711
712         * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformInitializeWebProcess):
713         Added an assertion matching Windows behavior (seems likely that NSURLCache also wouldn't
714         have liked trailing slash).
715
716         * UIProcess/win/WebContextWin.cpp: (WebKit::WebContext::platformInitializeWebProcess):
717         Made slash removal conditional for robustness.
718
719         * WebProcess/mac/WebProcessMac.mm: (WebKit::WebProcess::platformInitializeWebProcess):
720         Use actual string length, not CString::length().
721
722 2011-02-28  Balazs Kelemen  <kbalazs@webkit.org>
723
724         Reviewed by Anders Carlsson.
725
726         [Qt][WK2] Plugin initialization
727         https://bugs.webkit.org/show_bug.cgi?id=48127
728
729         Specialize the way of initializing the plugin for X11.
730         Introduce PLUGIN_ARCHITECTURE macros to allow code sharing
731         across platforms.
732
733         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
734         (WebKit::NetscapePluginModule::tryLoad):
735         * config.h:
736
737 2011-02-28  Sam Weinig  <sam@webkit.org>
738
739         Reviewed by Brady Eidson.
740
741         WK2 Context Menus - Implement LookUpInDictionary
742         https://bugs.webkit.org/show_bug.cgi?id=55405
743
744         * Shared/DictionaryPopupInfo.cpp:
745         (WebKit::DictionaryPopupInfo::encode):
746         (WebKit::DictionaryPopupInfo::decode):
747         * Shared/DictionaryPopupInfo.h:
748         Add type to differentiate between HotKey and ContextMenu triggered
749         dictionary popups. This is necessary since HotKey triggered ones want
750         to override the style to always be overlay.
751
752         * UIProcess/API/mac/PageClientImpl.mm:
753         (WebKit::PageClientImpl::didPerformDictionaryLookup):
754         Only force the overlay style for HotKey triggered dictionary lookups.
755
756         * WebProcess/WebPage/WebPage.h:
757         * WebProcess/WebPage/mac/WebPageMac.mm:
758         (WebKit::WebPage::performDictionaryLookupAtLocation):
759         (WebKit::WebPage::performDictionaryLookupForRange):
760         Factor out shared functionality into performDictionaryLookupForRange.
761
762         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
763         (WebKit::WebContextMenuClient::lookUpInDictionary):
764         Get selected range and call newly factored out performDictionaryLookupForRange.
765
766 2011-02-28  Anders Carlsson  <andersca@apple.com>
767
768         Reviewed by Dan Bernstein.
769
770         PDFViewController should hold a reference to the PDF data
771         https://bugs.webkit.org/show_bug.cgi?id=55394
772
773         * UIProcess/API/mac/PDFViewController.h:
774         * UIProcess/API/mac/PDFViewController.mm:
775         (WebKit::PDFViewController::setPDFDocumentData):
776
777 2011-02-28  Sam Weinig  <sam@webkit.org>
778
779         Reviewed by Darin Adler.
780
781         Size of text in popup menu doesn't match size of text in <select> itself in WebKit2
782         https://bugs.webkit.org/show_bug.cgi?id=48234
783
784         * Shared/TextInfo.cpp: Removed.
785         * Shared/TextInfo.h: Removed.
786         Replace this with the more appropriately DictionaryPopupInfo.
787
788         * Shared/DictionaryPopupInfo.cpp: Copied from Source/WebKit2/Shared/TextInfo.cpp.
789         (WebKit::DictionaryPopupInfo::encode):
790         (WebKit::DictionaryPopupInfo::decode):
791         * Shared/DictionaryPopupInfo.h: Copied from Source/WebKit2/Shared/TextInfo.h.
792         (WebKit::DictionaryPopupInfo::DictionaryPopupInfo):
793         Replace individual font related fields with FontInfo.
794
795         * Shared/FontInfo.cpp: Added.
796         (WebKit::FontInfo::FontInfo):
797         (WebKit::FontInfo::encode):
798         (WebKit::FontInfo::decode):
799         * Shared/FontInfo.h: Added.
800         Add class to encapsulate passing a font description over the wire.
801
802         * Shared/PlatformPopupMenuData.cpp:
803         (WebKit::PlatformPopupMenuData::encode):
804         (WebKit::PlatformPopupMenuData::decode):
805         * Shared/PlatformPopupMenuData.h:
806         Add FontInfo as extra data for the Mac.
807
808         * UIProcess/API/mac/PageClientImpl.h:
809         * UIProcess/API/mac/PageClientImpl.mm:
810         (WebKit::PageClientImpl::didPerformDictionaryLookup):
811         * UIProcess/PageClient.h:
812         Add scaleFactor and use it to construct a font at the right size.
813
814         * UIProcess/WebPageProxy.cpp:
815         (WebKit::WebPageProxy::showPopupMenu):
816         (WebKit::WebPageProxy::didPerformDictionaryLookup):
817         * UIProcess/WebPageProxy.h:
818         * UIProcess/WebPageProxy.messages.in:
819         * UIProcess/WebPopupMenuProxy.h:
820         * UIProcess/mac/WebPopupMenuProxyMac.h:
821         (WebKit::WebPopupMenuProxyMac::create):
822         * UIProcess/mac/WebPopupMenuProxyMac.mm:
823         (WebKit::WebPopupMenuProxyMac::WebPopupMenuProxyMac):
824         (WebKit::WebPopupMenuProxyMac::populate):
825         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
826         * UIProcess/qt/WebPopupMenuProxyQt.cpp:
827         (WebKit::WebPopupMenuProxyQt::showPopupMenu):
828         * UIProcess/qt/WebPopupMenuProxyQt.h:
829         * UIProcess/win/WebPopupMenuProxyWin.cpp:
830         (WebKit::WebPopupMenuProxyWin::showPopupMenu):
831         * UIProcess/win/WebPopupMenuProxyWin.h:
832         * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
833         (WebKit::WebPopupMenu::setUpPlatformData):
834         * WebProcess/WebPage/mac/WebPageMac.mm:
835         (WebKit::WebPage::performDictionaryLookupAtLocation):
836         Pass scale factor through and rename TextInfo -> DictionaryPopupInfo.
837
838         * WebKit2.pro:
839         * WebKit2.xcodeproj/project.pbxproj:
840         * win/WebKit2.vcproj:
841         Add new files.
842
843 2011-02-28  Adam Roben  <aroben@apple.com>
844
845         One more rename as a followup to r79868
846
847         Rubber-stamped by Anders Carlsson.
848
849         * UIProcess/DrawingAreaProxyImpl.cpp:
850         * UIProcess/DrawingAreaProxyImpl.h:
851         Rename stateDidChange to backingStoreStateDidChange.
852
853 2011-02-28  Adam Roben  <aroben@apple.com>
854
855         Rename DrawingArea[Proxy]Impl's "state ID" concept to "backing store state ID"
856
857         Rubber-stamped (and suggested) by Anders Carlsson.
858
859         * UIProcess/DrawingAreaProxy.h:
860         * UIProcess/DrawingAreaProxy.messages.in:
861         * UIProcess/DrawingAreaProxyImpl.cpp:
862         * UIProcess/DrawingAreaProxyImpl.h:
863         * WebProcess/WebPage/DrawingArea.h:
864         * WebProcess/WebPage/DrawingArea.messages.in:
865         * WebProcess/WebPage/DrawingAreaImpl.cpp:
866         * WebProcess/WebPage/DrawingAreaImpl.h:
867         Perform the rename.
868
869 2011-02-28  Adam Roben  <aroben@apple.com>
870
871         Decouple state changes from sending of UpdateState messages in DrawingAreaProxyImpl
872
873         The new DrawingAreaProxyImpl::stateDidChange function should be called whenever
874         DrawingAreaProxyImpl's state changes in a way that will require allocating a new backing
875         store. (Currently, this is just when the size changes.) This function will sometimes (but
876         not always, as when we're waiting for a DidUpdateState message) send an UpdateState message
877         to the web process. This means it's now possible for the state IDs sent in consecutive
878         UpdateState messages to increase by more than one, but that's OK.
879
880         This should cause no change in behavior.
881
882         Fixes <http://webkit.org/b/55382> DrawingAreaProxyImpl's state ID should be updated whenever
883         its state changes, not just when we send an UpdateState message
884
885         Reviewed by Anders Carlsson.
886
887         * UIProcess/DrawingAreaProxyImpl.cpp:
888         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl): Updated for rename.
889         (WebKit::DrawingAreaProxyImpl::sizeDidChange): Changed to call stateDidChange.
890         (WebKit::DrawingAreaProxyImpl::didUpdateState): Updated for rename, and changed to call
891         sendUpdateState whenever our state has changed for any reason since the last UpdateState
892         message was sent.
893         (WebKit::DrawingAreaProxyImpl::stateDidChange): Added. Increments m_nextStateID and calls
894         through to sendUpdateState.
895         (WebKit::DrawingAreaProxyImpl::sendUpdateState): Updated for rename, moved incrementing of
896         the state ID we send to the web process from here to stateDidChange, and added an assertion.
897
898         * UIProcess/DrawingAreaProxyImpl.h: Renamed m_requestedStateID to m_nextStateID, and updated
899         the comment explaining its meaning.
900
901 2011-02-28  Adam Roben  <aroben@apple.com>
902
903         Pass the right dirty rect to Plugin::paint
904
905         A typo in r79040 broke this. Much of this patch is just support for testing the fix.
906
907         Fixes <http://webkit.org/b/55365> <rdar://problem/9031089> REGRESSION (r79040): WebKit2:
908         Large portions of pages with plugins paint black
909
910         Reviewed by Anders Carlsson.
911
912         * WebProcess/Plugins/PluginView.cpp:
913         (WebKit::PluginView::paint): Pass the dirty rect we calculated earlier to Plugin::paint,
914         rather than just passing along the dirty rect that was passed into this function. This is
915         the bug fix.
916
917         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
918         (WKBundlePageForceRepaint):
919         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
920         Added new SPI. Just calls through to WebPage::forceRepaintWithoutCallback.
921
922         * WebProcess/WebPage/WebPage.cpp:
923         (WebKit::WebPage::forceRepaintWithoutCallback): Moved code to force a repaint here...
924         (WebKit::WebPage::forceRepaint): ...from here.
925
926         * WebProcess/WebPage/WebPage.h: Added forceRepaintWithoutCallback.
927
928 2011-02-27  Sam Weinig  <sam@webkit.org>
929
930         Reviewed by Dan Bernstein.
931
932         Force dictionary popup to use overlay type
933         <rdar://problem/9052483>
934         https://bugs.webkit.org/show_bug.cgi?id=55337
935
936         * UIProcess/API/mac/PageClientImpl.mm:
937         (WebKit::PageClientImpl::didPerformDictionaryLookup): As this is only
938         used for the hot key version of the dictionary popup, force the overlay
939         style.
940
941 2011-02-27  Benjamin Poulain  <benjamin.poulain@nokia.com>
942
943         Reviewed by Kenneth Rohde Christiansen.
944
945         [Qt] [WK2] QGraphicsWKView::showContextMenu() should be public
946         https://bugs.webkit.org/show_bug.cgi?id=55330
947
948         Move QGraphicsWKView::showContextMenu() to the public API. Add documentation
949         on its use.
950
951         * UIProcess/API/qt/qgraphicswkview.cpp:
952         * UIProcess/API/qt/qgraphicswkview.h:
953
954 2011-02-27  Alejandro G. Castro  <alex@igalia.com>
955
956         Unreviewed, fixed GTK compilation after r79806.
957
958         * UIProcess/gtk/WebView.cpp:
959         (WebKit::WebView::didFinishLoadingDataForCustomRepresentation):
960         * UIProcess/gtk/WebView.h:
961
962 2011-02-26  Anders Carlsson  <andersca@apple.com>
963
964         Reviewed by Dan Bernstein.
965
966         Asynchronous response to FramePolicyListener is not finishing the load
967         https://bugs.webkit.org/show_bug.cgi?id=55305
968         <rdar://problem/9044356>
969
970         Always initialize the receivedPolicyAction reply parameter.
971
972         * UIProcess/WebPageProxy.cpp:
973         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
974         (WebKit::WebPageProxy::decidePolicyForMIMEType):
975
976 2011-02-26  Anders Carlsson  <andersca@apple.com>
977
978         Reviewed by Sam Weinig.
979
980         DidFinishLoadingDataForCustomRepresentation should pass along the suggested filename
981         https://bugs.webkit.org/show_bug.cgi?id=55304
982
983         * UIProcess/API/mac/PDFViewController.h:
984         * UIProcess/API/mac/PDFViewController.mm:
985         (WebKit::PDFViewController::setPDFDocumentData):
986         * UIProcess/API/mac/PageClientImpl.h:
987         * UIProcess/API/mac/PageClientImpl.mm:
988         (WebKit::PageClientImpl::didFinishLoadingDataForCustomRepresentation):
989         * UIProcess/API/mac/WKView.mm:
990         (-[WKView _didFinishLoadingDataForCustomRepresentationWithSuggestedFilename:dataReference:CoreIPC::]):
991         * UIProcess/API/mac/WKViewInternal.h:
992         * UIProcess/API/qt/qwkpage.cpp:
993         (QWKPagePrivate::didFinishLoadingDataForCustomRepresentation):
994         * UIProcess/API/qt/qwkpage_p.h:
995         * UIProcess/PageClient.h:
996         * UIProcess/WebPageProxy.cpp:
997         (WebKit::WebPageProxy::didFinishLoadingDataForCustomRepresentation):
998         * UIProcess/WebPageProxy.h:
999         * UIProcess/WebPageProxy.messages.in:
1000         * UIProcess/win/WebView.cpp:
1001         (WebKit::WebView::didFinishLoadingDataForCustomRepresentation):
1002         * UIProcess/win/WebView.h:
1003         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1004         (WebKit::WebFrameLoaderClient::finishedLoading):
1005
1006 2011-02-26  Anders Carlsson  <andersca@apple.com>
1007
1008         Reviewed by Oliver Hunt.
1009
1010         DrawingArea should not be reference counted
1011         https://bugs.webkit.org/show_bug.cgi?id=55284
1012
1013         * Shared/DrawingAreaInfo.h:
1014         * Shared/WebPageCreationParameters.cpp:
1015         (WebKit::WebPageCreationParameters::encode):
1016         (WebKit::WebPageCreationParameters::decode):
1017         * Shared/WebPageCreationParameters.h:
1018         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
1019         (WebKit::ChunkedUpdateDrawingAreaProxy::ChunkedUpdateDrawingAreaProxy):
1020         (WebKit::ChunkedUpdateDrawingAreaProxy::setPageIsVisible):
1021         (WebKit::ChunkedUpdateDrawingAreaProxy::update):
1022         (WebKit::ChunkedUpdateDrawingAreaProxy::sendSetSize):
1023         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
1024         * UIProcess/DrawingAreaProxy.cpp:
1025         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
1026         * UIProcess/DrawingAreaProxy.h:
1027         (WebKit::DrawingAreaProxy::type):
1028         * UIProcess/DrawingAreaProxyImpl.cpp:
1029         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
1030         * UIProcess/DrawingAreaProxyImpl.h:
1031         * UIProcess/TiledDrawingAreaProxy.cpp:
1032         (WebKit::TiledDrawingAreaProxy::TiledDrawingAreaProxy):
1033         * UIProcess/TiledDrawingAreaProxy.h:
1034         * UIProcess/WebPageProxy.cpp:
1035         (WebKit::WebPageProxy::didReceiveSyncMessage):
1036         (WebKit::WebPageProxy::creationParameters):
1037         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
1038         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
1039         (WebKit::ChunkedUpdateDrawingArea::ChunkedUpdateDrawingArea):
1040         (WebKit::ChunkedUpdateDrawingArea::display):
1041         (WebKit::ChunkedUpdateDrawingArea::setSize):
1042         (WebKit::ChunkedUpdateDrawingArea::didReceiveMessage):
1043         * WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
1044         * WebProcess/WebPage/DrawingArea.cpp:
1045         (WebKit::DrawingArea::create):
1046         (WebKit::DrawingArea::DrawingArea):
1047         * WebProcess/WebPage/DrawingArea.h:
1048         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1049         (WebKit::DrawingAreaImpl::create):
1050         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
1051         * WebProcess/WebPage/DrawingAreaImpl.h:
1052         * WebProcess/WebPage/TiledDrawingArea.cpp:
1053         (WebKit::TiledDrawingArea::TiledDrawingArea):
1054         * WebProcess/WebPage/TiledDrawingArea.h:
1055         * WebProcess/WebPage/WebPage.cpp:
1056         (WebKit::WebPage::drawRect):
1057         * WebProcess/WebPage/WebPage.h:
1058
1059 2011-02-26  Vsevolod Vlasov  <vsevik@chromium.org>
1060
1061         Reviewed by Pavel Feldman.
1062
1063         DumpRenderTree should reset frame opener between tests.
1064         https://bugs.webkit.org/show_bug.cgi?id=54874
1065
1066         Added clearOpener method to WKBundleWebFramePrivate.
1067
1068         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1069         (WKBundleFrameClearOpener):
1070         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
1071
1072 2011-02-26  Yael Aharon  <yael.aharon@nokia.com>
1073
1074         Reviewed by Andreas Kling.
1075
1076         [Qt] Fix the focus in MiniBrowser.
1077         https://bugs.webkit.org/show_bug.cgi?id=55288
1078
1079         Implement basic functionality for focus in QWKPagePrivate.
1080
1081         * UIProcess/API/qt/qwkpage.cpp:
1082         (QWKPagePrivate::isViewWindowActive):
1083         (QWKPagePrivate::isViewFocused):
1084         (QWKPagePrivate::isViewVisible):
1085
1086 2011-02-26  Sheriff Bot  <webkit.review.bot@gmail.com>
1087
1088         Unreviewed, rolling out r79764.
1089         http://trac.webkit.org/changeset/79764
1090         https://bugs.webkit.org/show_bug.cgi?id=55295
1091
1092         "broke Chromium builds" (Requested by rniwa on #webkit).
1093
1094         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1095         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
1096
1097 2011-02-26  Vsevolod Vlasov  <vsevik@chromium.org>
1098
1099         Reviewed by Pavel Feldman.
1100
1101         DumpRenderTree should reset frame opener between tests.
1102         https://bugs.webkit.org/show_bug.cgi?id=54874
1103
1104         Added clearOpener method to WKBundleWebFramePrivate.
1105
1106         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1107         (WKBundleFrameClearOpener):
1108         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
1109
1110 2011-02-25  Anders Carlsson  <andersca@apple.com>
1111
1112         Reviewed by Darin Adler.
1113
1114         Plug-in process crashes when using GuardMalloc
1115         https://bugs.webkit.org/show_bug.cgi?id=55279
1116         <rdar://problem/9044618>
1117
1118         Update m_environmentPointer after copying the environment variables.
1119         
1120         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1121         (WebKit::EnvironmentVariables::copyEnvironmentVariables):
1122
1123 2011-02-25  Darin Adler  <darin@apple.com>
1124
1125         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1126         (WebKit::ProcessLauncher::launchProcess): Fixed backwards logic from last change.
1127
1128 2011-02-25  Darin Adler  <darin@apple.com>
1129
1130         Reviewed by Mark Rowe.
1131
1132         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1133         (WebKit::ProcessLauncher::launchProcess): Fixed performance problem in production
1134         builds by only setting DYLD_FRAMEWORK_PATH in engineering configurations.
1135
1136 2011-02-25  Darin Adler  <darin@apple.com>
1137
1138         Reviewed by Anders Carlsson.
1139
1140         <rdar://problem/8036034> WebKit2 should work even if DYLD_FRAMEWORK_PATH is not set
1141
1142         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1143         (WebKit::EnvironmentVariables::~EnvironmentVariables): Use fastFree, not delete, on
1144         the strings here because they are allocated with fastMalloc, not new.
1145         (WebKit::EnvironmentVariables::set): Use const more.
1146         (WebKit::EnvironmentVariables::get): Ditto.
1147         (WebKit::EnvironmentVariables::appendValue): Ditto.
1148         (WebKit::EnvironmentVariables::valueIfVariableHasName): Ditto. Also fix mistake
1149         where this would match if the name matched only a prefix of the environment variable's
1150         name. We want to match the whole name, so we need to use memcmp, not strncmp.
1151         (WebKit::EnvironmentVariables::createStringForVariable): Use const more.
1152         (WebKit::ProcessLauncher::launchProcess): Use clearer name, frameworkExecutablePath,
1153         for what was called bundlePath before. Append the frameworks path to DYLD_FRAMEWORK_PATH,
1154         ensuring we can pick up other frameworks from the same directory in the web process.
1155         Use a const_cast instead of a C-style cast.
1156
1157 2011-02-25  Chris Fleizach  <cfleizach@apple.com>
1158
1159         Reviewed by Anders Carlsson.
1160
1161         AX: WK2: AXApplication not returning the AXFocusedUIElement within the web area
1162         https://bugs.webkit.org/show_bug.cgi?id=55277
1163
1164         * UIProcess/API/mac/WKView.mm:
1165         (-[WKView accessibilityFocusedUIElement]):
1166
1167 2011-02-25  Alexey Proskuryakov  <ap@apple.com>
1168
1169         Reviewed by Anders Carlsson.
1170
1171         https://bugs.webkit.org/show_bug.cgi?id=55276
1172         WebPage::close() accesses "this" after it is destroyed.
1173
1174         This was making many tests crash with GuardMalloc.
1175
1176         * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::close): Access "this" before it can be
1177         destroyed, not after.
1178
1179 2011-02-25  Balazs Kelemen  <kbalazs@webkit.org>
1180
1181         Unreviewed.
1182         Add missing sources to WebKit2API.pri.
1183
1184         * WebKit2API.pri:
1185
1186 2011-02-25  Anders Carlsson  <andersca@apple.com>
1187
1188         Reviewed by Darin Adler.
1189
1190         A WKView without a window will cause CG errors in the console
1191         https://bugs.webkit.org/show_bug.cgi?id=55264
1192         <rdar://problem/9044281>
1193
1194         Check that the window has a valid window number before trying to get its graphics context.
1195
1196         * UIProcess/API/mac/PageClientImpl.mm:
1197         (WebKit::PageClientImpl::containingWindowGraphicsContext):
1198
1199 2011-02-25  Brian Weinstein  <bweinstein@apple.com>
1200
1201         Reviewed by Brady Eidson and looked over by Jessie Berlin.
1202
1203         WebKit2: Need a way to manage cookies from the web process
1204         https://bugs.webkit.org/show_bug.cgi?id=55086
1205         
1206         Call through to WebCore::CookieJar in our WebCookieManager functions.
1207
1208         * WebProcess/Cookies/WebCookieManager.cpp:
1209         (WebKit::WebCookieManager::getHostnamesWithCookies):
1210         (WebKit::WebCookieManager::deleteCookiesForHostname):
1211         (WebKit::WebCookieManager::deleteAllCookies):
1212
1213 2011-02-25  Anders Carlsson  <andersca@apple.com>
1214
1215         Reviewed by Sam Weinig.
1216
1217         Option-clicking on links doesn't download them due to sandbox violation
1218         https://bugs.webkit.org/show_bug.cgi?id=55250
1219         <rdar://problem/9018359>
1220
1221         The change to make DecidePolicyForNavigationAction sync didn't handle the case when the
1222         decided policy was "Download". Fix this by passing along the download ID back to the web process.
1223
1224         * Platform/CoreIPC/HandleMessage.h:
1225         (CoreIPC::callMemberFunction):
1226         Add new overload.
1227
1228         * UIProcess/WebPageProxy.cpp:
1229         (WebKit::WebPageProxy::WebPageProxy):
1230         Initialize m_syncNavigationActionPolicyDownloadID.
1231
1232         (WebKit::WebPageProxy::receivedPolicyDecision):
1233         Set m_syncNavigationActionPolicyDownloadID to the download ID.
1234
1235         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1236         Return the m_syncNavigationActionPolicyDownloadID.
1237
1238         * UIProcess/WebPageProxy.h:
1239         * UIProcess/WebPageProxy.messages.in:
1240         Add a DownloadID reply parameter.
1241
1242         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1243         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1244         Don't pass a zero download ID to didReceivePolicyDecision.
1245
1246 2011-02-25  Amruth Raj  <amruthraj@motorola.com> and Ravi Phaneendra Kasibhatla  <ravi.kasibhatla@motorola.com> and Alejandro G. Castro  <alex@igalia.com>
1247
1248         Reviewed by Martin Robinson.
1249
1250         [GTK] Implement WebContext and NativeKeyboardEvent classes for WebKit2
1251         https://bugs.webkit.org/show_bug.cgi?id=48510
1252
1253         * GNUmakefile.am:
1254         * Shared/NativeWebKeyboardEvent.h: Added the GTK event attribute
1255         and constructors, in our case we need it because we use a pointer
1256         and copy the event.
1257         (WebKit::NativeWebKeyboardEvent::nativeEvent):
1258         * Shared/gtk/NativeWebKeyboardEventGtk.cpp: Added.
1259         (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): We need
1260         to copy the event in the constructor to avoid two references to
1261         the same event.
1262         * Shared/gtk/WebEventFactory.cpp: Changed the prototype of the
1263         functions to add const, we need it for the NativeWebKeyboardEvent
1264         constructor.
1265         (WebKit::modifiersForEvent):
1266         (WebKit::WebEventFactory::createWebKeyboardEvent):
1267         * UIProcess/gtk/WebContextGtk.cpp: Added. Stubbed implementation
1268         for GTK port. Yet to implement.
1269         (WebKit::WebContext::applicationCacheDirectory):
1270         (WebKit::WebContext::platformInitializeWebProcess):
1271         (WebKit::WebContext::platformDefaultDatabaseDirectory):
1272         * UIProcess/gtk/WebView.cpp:
1273         (WebKit::WebView::handleKeyboardEvent):
1274
1275 2011-02-25  Anders Carlsson  <andersca@apple.com>
1276
1277         Reviewed by Sam Weinig.
1278
1279         Get rid of more old accelerated compositing code
1280         https://bugs.webkit.org/show_bug.cgi?id=55235
1281
1282         * Shared/CoreIPCSupport/DrawingAreaProxyMessageKinds.h:
1283         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
1284         * UIProcess/DrawingAreaProxy.h:
1285         * UIProcess/DrawingAreaProxyImpl.cpp:
1286         * UIProcess/DrawingAreaProxyImpl.h:
1287         * WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
1288         * WebProcess/WebPage/DrawingArea.h:
1289         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1290         * WebProcess/WebPage/DrawingAreaImpl.h:
1291
1292 2011-02-25  Andras Becsi  <abecsi@webkit.org>
1293
1294         Reviewed by Csaba Osztrogonác.
1295
1296         [Qt] Make the WebKit2 build system less confusing for non-Qt developers
1297         https://bugs.webkit.org/show_bug.cgi?id=55213
1298
1299         * WebKit2API.pri: Added.
1300
1301 2011-02-25  Amruth Raj  <amruthraj@motorola.com> and Ravi Phaneendra Kasibhatla  <ravi.kasibhatla@motorola.com> and Alejandro G. Castro  <alex@igalia.com>
1302
1303         Reviewed by Martin Robinson.
1304
1305         [GTK] Implement WebView and WebKitWebView classes for WebKit2
1306         https://bugs.webkit.org/show_bug.cgi?id=48509
1307
1308         * GNUmakefile.am:
1309         * UIProcess/API/C/gtk/WKView.cpp:
1310         * UIProcess/API/C/gtk/WKView.h: Removed gdkrectangle from
1311         constructor.
1312         * UIProcess/gtk/WebViewWidget.cpp: Added. The GObject interface
1313         for WebView. The GObject is the GtkWidget handle which is used by
1314         WebView class for GTK port.
1315         * UIProcess/gtk/WebViewWidget.h: Added. The GObject interface
1316         declarations for GtkWidget handle for GTK port.
1317         * UIProcess/gtk/WebView.cpp: Added. The native GtkWidget handle
1318         for GTK port which is associated with each WKViewRef.
1319         * UIProcess/gtk/WebView.h: Added. Class which implements the
1320         PageClient interface. It is a wrapper over the native GtkWidget
1321         handle associated with each WKViewRef for GTK port.
1322
1323 2011-02-25  Alejandro G. Castro  <alex@igalia.com>
1324
1325         Fix GTK compilation after r79654.
1326
1327         * GNUmakefile.am:
1328
1329 2011-02-24  Brian Weinstein  <bweinstein@apple.com>
1330
1331         Qt build fix.
1332
1333         * WebKit2.pri:
1334
1335 2011-02-24  Brady Eidson  <beidson@apple.com>
1336
1337         Reviewed by Sam Weinig and looked over by Brian Weinstein.
1338
1339         Part of <rdar://problem/8762095> and https://bugs.webkit.org/show_bug.cgi?id=55172
1340         Need WebKit2 API to view/manage origins with LocalStorage.
1341
1342         Project file stuff:
1343         * GNUmakefile.am:
1344         * WebKit2.pri:
1345         * WebKit2.pro:
1346         * WebKit2.xcodeproj/project.pbxproj:
1347         * win/WebKit2.vcproj:
1348         * win/WebKit2Common.vsprops:
1349         * win/WebKit2Generated.make:
1350
1351         WK2 derived sources and API stuff:
1352         * DerivedSources.make:
1353         * DerivedSources.pro:
1354         * Platform/CoreIPC/MessageID.h:
1355         * Shared/API/c/WKBase.h:
1356         * Shared/APIObject.h:
1357         * UIProcess/API/C/WKAPICast.h:
1358
1359         Add an KeyValueStorageManager to the context and invalidate it at the appropriate times:
1360         * UIProcess/WebContext.cpp:
1361         (WebKit::WebContext::WebContext):
1362         (WebKit::WebContext::~WebContext):
1363         (WebKit::WebContext::disconnectProcess):
1364         (WebKit::WebContext::didReceiveMessage):
1365         * UIProcess/WebContext.h:
1366         (WebKit::WebContext::keyValueStorageManagerProxy):
1367
1368         Add API to get the KeyValueStorageManager for a context:
1369         * UIProcess/API/C/WKContext.cpp:
1370         (WKContextGetKeyValueStorageManager):
1371         * UIProcess/API/C/WKContext.h:
1372
1373         Route messages to the right place:
1374         * UIProcess/WebProcessProxy.cpp:
1375         (WebKit::WebProcessProxy::didReceiveMessage):
1376         * WebProcess/WebProcess.cpp:
1377         (WebKit::WebProcess::didReceiveMessage):
1378
1379         Add the API object, which wraps to WebKeyValueStorageManagerProxy:
1380         * UIProcess/API/C/WKKeyValueStorageManager.cpp: Added.
1381         (WKKeyValueStorageManagerGetTypeID):
1382         (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
1383         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
1384         (WKKeyValueStorageManagerDeleteAllEntries):
1385         * UIProcess/API/C/WKKeyValueStorageManager.h: Added.
1386
1387         The UIProcess implementation of the manager to send messages to the WebProcess and pipe a callback back up to the client:
1388         * UIProcess/WebKeyValueStorageManagerProxy.cpp: Added.
1389         (WebKit::WebKeyValueStorageManagerProxy::create):
1390         (WebKit::WebKeyValueStorageManagerProxy::WebKeyValueStorageManagerProxy):
1391         (WebKit::WebKeyValueStorageManagerProxy::~WebKeyValueStorageManagerProxy):
1392         (WebKit::WebKeyValueStorageManagerProxy::invalidate):
1393         (WebKit::WebKeyValueStorageManagerProxy::didReceiveMessage):
1394         (WebKit::WebKeyValueStorageManagerProxy::getKeyValueStorageOrigins):
1395         (WebKit::WebKeyValueStorageManagerProxy::didGetKeyValueStorageOrigins):
1396         (WebKit::WebKeyValueStorageManagerProxy::deleteEntriesForOrigin):
1397         (WebKit::WebKeyValueStorageManagerProxy::deleteAllEntries):
1398         * UIProcess/WebKeyValueStorageManagerProxy.h: Added.
1399         (WebKit::WebKeyValueStorageManagerProxy::clearContext):
1400         (WebKit::WebKeyValueStorageManagerProxy::type):
1401         * UIProcess/WebKeyValueStorageManagerProxy.messages.in: Added.
1402
1403         The WebProcess implementation to response to UIProcess messages and actually do the dirty-work in WebCore:
1404         * WebProcess/KeyValueStorage: Added.
1405         * WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp: Added.
1406         (WebKit::WebKeyValueStorageManager::shared):
1407         (WebKit::WebKeyValueStorageManager::WebKeyValueStorageManager):
1408         (WebKit::WebKeyValueStorageManager::didReceiveMessage):
1409         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
1410         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
1411         (WebKit::WebKeyValueStorageManager::deleteAllEntries):
1412         * WebProcess/KeyValueStorage/WebKeyValueStorageManager.h: Added.
1413         * WebProcess/KeyValueStorage/WebKeyValueStorageManager.messages.in: Added.
1414
1415 2011-02-24  Darin Adler  <darin@apple.com>
1416
1417         Reviewed by Anders Carlsson.
1418
1419         WebKit2: Image-based cursors do not work
1420         https://bugs.webkit.org/show_bug.cgi?id=55184
1421
1422         * Shared/ShareableBitmap.h: Added releaseData function
1423         declaration. This is only defined for CG, but we can declare
1424         it without defining it on non-CG platforms without causing problems.
1425
1426         * Shared/WebCoreArgumentCoders.cpp: Added.
1427         (CoreIPC::encodeImage): Added. For use in the Cursor argument coder.
1428         (CoreIPC::decodeImage): Ditto.
1429
1430         * Shared/WebCoreArgumentCoders.h: Added code to the Cursor encoder
1431         and decoder to handle image-based cursors, using the new encodeImage
1432         and decodeImage functions.
1433
1434         * Shared/cg/ShareableBitmapCG.cpp:
1435         (WebKit::ShareableBitmap::releaseData): Added.
1436         (WebKit::ShareableBitmap::createGraphicsContext): Use
1437         CGBitmapContextCreateWithData instead of CGBitmapContextCreate,
1438         to guarantee we outlast the CGBitmapContext we create.
1439         (WebKit::ShareableBitmap::paint): Got rid of unnneeded local variable.
1440
1441         * Shared/cg/WebCoreArgumentCodersCG.cpp: Added.
1442         (CoreIPC::createImage): Added. For use by CoreIPC::decodeImage.
1443
1444         * WebKit2.xcodeproj/project.pbxproj: Added WebCoreArgumentCoders.cpp
1445         and WebCoreArgumentCodersCG.cpp.
1446         * win/WebKit2.vcproj: Ditto.
1447
1448 2011-02-24  Anders Carlsson  <andersca@apple.com>
1449
1450         Reviewed by Dan Bernstein.
1451
1452         Crash when trying to send a sync message on an invalid connection
1453         https://bugs.webkit.org/show_bug.cgi?id=55190
1454         <rdar://problem/9035806>
1455
1456         * Platform/CoreIPC/Connection.cpp:
1457         (CoreIPC::Connection::sendSyncMessage):
1458         Don't try to call a client function if isValid() returns false since the client
1459         will be null in that case.
1460
1461 2011-02-24  Anders Carlsson  <andersca@apple.com>
1462
1463         Reviewed by Dan Bernstein.
1464
1465         Remove the layer backed drawing area
1466         https://bugs.webkit.org/show_bug.cgi?id=55174
1467
1468         * GNUmakefile.am:
1469         * Shared/DrawingAreaInfo.h:
1470         * UIProcess/API/mac/WKView.mm:
1471         * UIProcess/LayerBackedDrawingAreaProxy.cpp: Removed.
1472         * UIProcess/LayerBackedDrawingAreaProxy.h: Removed.
1473         * UIProcess/mac/LayerBackedDrawingAreaProxyMac.mm: Removed.
1474         * UIProcess/win/LayerBackedDrawingAreaProxyWin.cpp: Removed.
1475         * UIProcess/win/WebView.cpp:
1476         * WebKit2.xcodeproj/project.pbxproj:
1477         * WebProcess/WebPage/DrawingArea.cpp:
1478         (WebKit::DrawingArea::create):
1479         * WebProcess/WebPage/LayerBackedDrawingArea.cpp: Removed.
1480         * WebProcess/WebPage/LayerBackedDrawingArea.h: Removed.
1481         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm: Removed.
1482         * WebProcess/WebPage/win/LayerBackedDrawingAreaWin.cpp: Removed.
1483         * win/WebKit2.vcproj:
1484
1485 2011-02-24  Mike Thole  <mthole@apple.com>
1486
1487         Reviewed by Sam Weinig.
1488
1489         WK2: Add ability to get document node for a WKBundleNodeHandle
1490         https://bugs.webkit.org/post_bug.cgi
1491
1492         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
1493         (WKBundleNodeHandleCopyDocument):
1494         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
1495         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1496         (WebKit::InjectedBundleNodeHandle::document):
1497         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
1498
1499 2011-02-24  Brady Eidson  <beidson@apple.com>
1500
1501         Reviewed by Adam Roben and looked at by Brian Weinstein.
1502
1503         https://bugs.webkit.org/show_bug.cgi?id=55165
1504         Can call CF API with a null CFArray in WebResourceCacheManager
1505
1506         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
1507         (WebKit::WebResourceCacheManager::getCacheOrigins): cfURLCacheHostNames() can return a null CFArrayRef, 
1508           so the call to CFArrayGetCount must be null checked.
1509
1510 2011-02-24  Anders Carlsson  <andersca@apple.com>
1511
1512         Reviewed by Simon Fraser.
1513
1514         ASSERTION FAILED: !isInAcceleratedCompositingMode() when entering accelerated compositing early
1515         https://bugs.webkit.org/show_bug.cgi?id=55162
1516         <rdar://problem/9048523>
1517
1518         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1519         (WebKit::DrawingAreaImpl::updateState):
1520         Call setShouldNotifyAfterNextScheduledLayerFlush(false) so the web process process won't send an
1521         EnterAcceleratedCompositingMode message.
1522
1523         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
1524         setShouldNotifyAfterNextScheduledLayerFlush now takes a boolean.
1525
1526         * WebProcess/WebPage/LayerTreeHost.h:
1527         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
1528         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
1529         (WebKit::LayerTreeHostMac::setShouldNotifyAfterNextScheduledLayerFlush):
1530         Make this take a boolean.
1531
1532 2011-02-24  Peter Kasting  <pkasting@google.com>
1533
1534         Reviewed by Eric Seidel.
1535
1536         Drop the "U; " encryption level from the User Agent string.
1537         https://bugs.webkit.org/show_bug.cgi?id=54566
1538
1539         * UIProcess/gtk/WebPageProxyGtk.cpp:
1540         (WebKit::WebPageProxy::standardUserAgent):
1541         * UIProcess/mac/WebPageProxyMac.mm:
1542         (WebKit::WebPageProxy::standardUserAgent):
1543         * UIProcess/qt/WebPageProxyQt.cpp:
1544         (WebKit::WebPageProxy::standardUserAgent):
1545         * UIProcess/win/WebPageProxyWin.cpp:
1546         (WebKit::WebPageProxy::standardUserAgent):
1547
1548 2011-02-24  Andrew Wilson  <atwilson@chromium.org>
1549
1550         Unreviewed, rolling out r79570.
1551         http://trac.webkit.org/changeset/79570
1552         https://bugs.webkit.org/show_bug.cgi?id=54874
1553
1554         Breaks chromium build because glue/mocks/mock_web_frame.h/cc
1555         was not updated
1556
1557         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1558         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
1559
1560 2011-02-23  Brian Weinstein  <bweinstein@apple.com>
1561
1562         Reviewed by Adam Roben and looked over by Jessie Berlin.
1563
1564         Part of WebKit2: Need a way to manage cookies from the web process
1565         https://bugs.webkit.org/show_bug.cgi?id=55086
1566         
1567         This patch adds the plumbing and classes that are needed to manage cookies from the web process.
1568         The functions that the API calls are currently stubs, but will be implemented in a follow-up patch.
1569
1570         Project file changes.
1571         * DerivedSources.make:
1572         * DerivedSources.pro:
1573         * GNUmakefile.am:
1574         * WebKit2.pri:
1575         * WebKit2.pro:
1576         * WebKit2.xcodeproj/project.pbxproj:
1577         * win/WebKit2.vcproj:
1578         * win/WebKit2Common.vsprops:
1579         * win/WebKit2Generated.make:
1580
1581         Add some needed plumbing for WebCookieManager{Proxy}.
1582         * Platform/CoreIPC/MessageID.h:
1583         * Shared/API/c/WKBase.h:
1584         * Shared/APIObject.h:
1585         * UIProcess/API/C/WKAPICast.h:
1586
1587         * UIProcess/API/C/WKContext.cpp:
1588         (WKContextGetCookieManager): Gets the cookie manager proxy.
1589         * UIProcess/API/C/WKContext.h:
1590         * UIProcess/API/C/WKCookieManager.cpp: Added.
1591         (WKCookieManagerGetTypeID):
1592         (WKCookieManagerGetHostnamesWithCookies): Calls through to WebCookieManagerProxy.
1593         (WKCookieManagerDeleteCookiesForHostname): Ditto.
1594         (WKCookieManagerDeleteAllCookies): Ditto.
1595         * UIProcess/API/C/WKCookieManager.h: Added.
1596
1597         * UIProcess/WebProcessProxy.cpp:
1598         (WebKit::WebProcessProxy::didReceiveMessage): Add a case for the cookie manager.
1599         * UIProcess/WebContext.cpp:
1600         (WebKit::WebContext::WebContext): Initialize the cookie manager.
1601         (WebKit::WebContext::~WebContext): Invalidate the cookie manager.
1602         (WebKit::WebContext::disconnectProcess): Ditto.
1603         (WebKit::WebContext::didReceiveMessage): Add a case for the cookie manager.
1604         * UIProcess/WebContext.h:
1605         (WebKit::WebContext::cookieManagerProxy): Returns the cookie manager.
1606         * WebProcess/WebProcess.cpp:
1607         (WebKit::WebProcess::didReceiveMessage): Add a case for the cookie manager.
1608
1609         * UIProcess/WebCookieManagerProxy.cpp: Added.
1610         (WebKit::WebCookieManagerProxy::create):
1611         (WebKit::WebCookieManagerProxy::WebCookieManagerProxy):
1612         (WebKit::WebCookieManagerProxy::~WebCookieManagerProxy):
1613         (WebKit::WebCookieManagerProxy::invalidate):
1614         (WebKit::WebCookieManagerProxy::didReceiveMessage): 
1615         (WebKit::WebCookieManagerProxy::getHostnamesWithCookies): Call through to the web process to get hostnames with cookies.
1616         (WebKit::WebCookieManagerProxy::didGetHostnamesWithCookies): Call the callback we were passed in getHostnamesWithCookies.
1617         (WebKit::WebCookieManagerProxy::deleteCookiesForHostname): Call through to the web process to delete cookies
1618             for the origin.
1619         (WebKit::WebCookieManagerProxy::deleteAllCookies): Call through to the web process to delete all cookies.
1620         * UIProcess/WebCookieManagerProxy.h: Added.
1621         (WebKit::WebCookieManagerProxy::clearContext):
1622         (WebKit::WebCookieManagerProxy::type):
1623         * UIProcess/WebCookieManagerProxy.messages.in: Added.
1624
1625         * WebProcess/Cookies: Added.
1626         * WebProcess/Cookies/WebCookieManager.cpp: Added.
1627         (WebKit::WebCookieManager::shared):
1628         (WebKit::WebCookieManager::WebCookieManager):
1629         (WebKit::WebCookieManager::didReceiveMessage): Call through to didReceiveWebCookieManagerMessage.
1630         (WebKit::WebCookieManager::getHostnamesWithCookies): Build an array from a HashSet (that isn't filled yet), and 
1631             convert that HashSet to a Vector to send to the UI process.
1632         (WebKit::WebCookieManager::deleteCookiesForHostname): Added a stub.
1633         (WebKit::WebCookieManager::deleteAllCookies): Ditto.
1634         * WebProcess/Cookies/WebCookieManager.h: Added.
1635         * WebProcess/Cookies/WebCookieManager.messages.in: Added.
1636
1637 2011-02-24   Amruth Raj  <amruthraj@motorola.com> and Ravi Phaneendra Kasibhatla  <ravi.kasibhatla@motorola.com> and Alejandro G. Castro  <alex@igalia.com>
1638
1639         Reviewed by Martin Robinson.
1640
1641         [GTK] Implement WebEventFactory, WebErrors classes for WebKit2
1642         https://bugs.webkit.org/show_bug.cgi?id=48510
1643
1644         * GNUmakefile.am:
1645         * Shared/gtk/WebEventFactory.cpp: Added. implementation for
1646         WebMouseEvent, WebWheelEvent, WebKeyboardEvent.
1647         * Shared/gtk/WebEventFactory.h: Added.
1648         * WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp: Added. Stubbed
1649         implementation for GTK port.
1650
1651 2011-02-24  Vsevolod Vlasov  <vsevik@chromium.org>
1652
1653         Reviewed by Alexey Proskuryakov.
1654
1655         DumpRenderTree should reset frame opener between tests.
1656         https://bugs.webkit.org/show_bug.cgi?id=54874
1657
1658         Added clearOpener method to WKBundleWebFramePrivate.
1659
1660         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1661         (WKBundleFrameClearOpener):
1662         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
1663
1664 2011-02-24  Benjamin Poulain  <benjamin.poulain@nokia.com>
1665
1666         Reviewed by Eric Seidel.
1667
1668         Support building WebKit with Python 3
1669         https://bugs.webkit.org/show_bug.cgi?id=55038
1670
1671         Update the generator scripts to support Python 3.
1672
1673         * Scripts/generate-message-receiver.py: print is a function in Python 3, write the output to
1674         sys.stdout to be compatible with Python 2 and 3.
1675         * Scripts/generate-messages-header.py:
1676         * Scripts/webkit2/messages.py: dist.iteritems does not exist in Python 3, fallback
1677           to dict.items which is common to Python 2 and 3.
1678
1679 2011-02-24  Andras Becsi  <abecsi@webkit.org>
1680
1681         Reviewed by Laszlo Gombos.
1682
1683         [Qt] MinGW build fails to link
1684         https://bugs.webkit.org/show_bug.cgi?id=55050
1685
1686         Prepend the libraries of subcomponents instead of appending them
1687         to fix the library order according to the dependency of the libraries
1688
1689         * WebKit2.pri:
1690
1691 2011-02-24  Andras Becsi  <abecsi@webkit.org>
1692
1693         Reviewed by Csaba Osztrogonác.
1694
1695         [Qt] REGRESSION(69304): WKNativeEvent.h forwarding header is always regenerated
1696         https://bugs.webkit.org/show_bug.cgi?id=47589
1697
1698         In case of file name clashes only generate forwarding header for the current platform.
1699
1700         * Scripts/generate-forwarding-headers.pl:
1701
1702 2011-02-23  Anders Carlsson  <andersca@apple.com>
1703
1704         Reviewed by Sam Weinig.
1705
1706         Remove some of the old accelerated compositing code
1707         https://bugs.webkit.org/show_bug.cgi?id=55084
1708
1709         * UIProcess/API/mac/PageClientImpl.h:
1710         * UIProcess/API/mac/PageClientImpl.mm:
1711         (WebKit::PageClientImpl::exitAcceleratedCompositingMode):
1712         * UIProcess/API/mac/WKView.mm:
1713         * UIProcess/API/mac/WKViewInternal.h:
1714         * UIProcess/API/qt/qwkpage_p.h:
1715         * UIProcess/PageClient.h:
1716         * UIProcess/WebPageProxy.cpp:
1717         (WebKit::WebPageProxy::exitAcceleratedCompositingMode):
1718         * UIProcess/WebPageProxy.h:
1719         * UIProcess/WebPageProxy.messages.in:
1720         * UIProcess/mac/LayerBackedDrawingAreaProxyMac.mm:
1721         (WebKit::LayerBackedDrawingAreaProxy::attachCompositingContext):
1722         (WebKit::LayerBackedDrawingAreaProxy::detachCompositingContext):
1723         * UIProcess/win/WebView.cpp:
1724         * UIProcess/win/WebView.h:
1725         * WebProcess/WebPage/WebPage.cpp:
1726         (WebKit::WebPage::enterAcceleratedCompositingMode):
1727         (WebKit::WebPage::exitAcceleratedCompositingMode):
1728         * WebProcess/WebPage/WebPage.h:
1729
1730 2011-02-23  Enrica Casucci  <enrica@apple.com>
1731
1732         Reverting an unintentional change that was part of http://trac.webkit.org/changeset/79494.
1733         Unreviewed.
1734
1735         * WebProcess/WebPage/mac/WebPageMac.mm:
1736         (WebKit::WebPage::interceptEditingKeyboardEvent):
1737
1738 2011-02-18  Enrica Casucci  <enrica@apple.com>
1739
1740         Reviewed by Adam Roben.
1741
1742         Mac OS X Services are not available for selected text in WebKit2 windows.
1743         https://bugs.webkit.org/show_bug.cgi?id=54777
1744         <rdar://problem/8666428>
1745         
1746         This patch adds support for Mac OS X Services in WebKit2 windows.
1747         In WKView we now call registerServicesMenuSendTypes providing the
1748         pasteboard types supported by WebKit and we also implement the two
1749         protocol methods required to validate the send type and write the
1750         content to the pasteboard. Unfortunately, AppKit expects the content
1751         to be available in the pasteboard upon return from writeSelectionToPasteboard and
1752         this is the reason why the call to the WebProcess is synchronous.
1753
1754         * Shared/SelectionState.h:
1755         (WebKit::SelectionState::SelectionState): Extended to include
1756         isContentRichlyEditable
1757         * Shared/mac/PasteboardTypes.h:
1758         * Shared/mac/PasteboardTypes.mm:
1759         (WebKit::PasteboardTypes::forSelection): Added.
1760         * UIProcess/API/mac/WKView.mm:
1761         (-[WKView initWithFrame:contextRef:pageGroupRef:]): Added call
1762         to registerServicesMenuSendTypes.
1763         (-[WKView writeSelectionToPasteboard:types:]): Added.
1764         (-[WKView validRequestorForSendType:returnType:]): Added.
1765         * UIProcess/WebPageProxy.cpp:
1766         (WebKit::WebPageProxy::writeSelectionToPasteboard):
1767         * UIProcess/WebPageProxy.h:
1768         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1769         (WebKit::WebEditorClient::respondToChangedSelection): Modified to
1770         support the new SelectionState value.
1771         * WebProcess/WebPage/WebPage.h:
1772         * WebProcess/WebPage/WebPage.messages.in:
1773         * WebProcess/WebPage/mac/WebPageMac.mm:
1774         (WebKit::WebPage::writeSelectionToPasteboard): Added synchronous
1775         message to write the selected content to the pasteboard.
1776
1777 2011-02-23  Anders Carlsson  <andersca@apple.com>
1778
1779         Reviewed by Sam Weinig.
1780
1781         Add a ShareableBitmap::create overload that takes an existing SharedMemory object
1782         https://bugs.webkit.org/show_bug.cgi?id=55081
1783
1784         * Shared/ShareableBitmap.cpp:
1785         (WebKit::ShareableBitmap::createShareable):
1786         (WebKit::ShareableBitmap::create):
1787         * Shared/ShareableBitmap.h:
1788
1789 2011-02-23  Anders Carlsson  <andersca@apple.com>
1790
1791         Reviewed by Dan Bernstein.
1792
1793         Web Inspector toolbar looks bad in WebKit2
1794         https://bugs.webkit.org/show_bug.cgi?id=55076
1795         <rdar://problem/8866258>
1796
1797         * UIProcess/API/mac/WKView.mm:
1798         (-[WKView mouseDownCanMoveWindow]):
1799         Return NO from mouseDownCanMoveWindow to prevent drags in the (now transparent) inspector WKView
1800         from dragging the window around.
1801
1802         * UIProcess/mac/WebInspectorProxyMac.mm:
1803         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1804         Call [WKView setDrawsBackground:NO].
1805
1806 2011-02-23  Sam Weinig  <sam@webkit.org>
1807
1808         Reviewed by Anders Carlsson.
1809
1810         Remove WKPageForceRepaintWithInvalidation and instead make WKPageForceRepaint
1811         always dirty the entire page.
1812
1813         * Shared/ForceRepaintFlags.h: Removed.
1814         * UIProcess/API/C/WKPage.cpp:
1815         (WKPageForceRepaint):
1816         * UIProcess/API/C/WKPage.h:
1817         * UIProcess/WebPageProxy.cpp:
1818         (WebKit::WebPageProxy::forceRepaint):
1819         * UIProcess/WebPageProxy.h:
1820         * WebKit2.pro:
1821         * WebKit2.xcodeproj/project.pbxproj:
1822         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1823         (WebKit::DrawingAreaImpl::forceRepaint):
1824         * WebProcess/WebPage/WebPage.cpp:
1825         (WebKit::WebPage::forceRepaint):
1826         * WebProcess/WebPage/WebPage.h:
1827         * WebProcess/WebPage/WebPage.messages.in:
1828         * win/WebKit2.vcproj:
1829
1830 2011-02-23  Anders Carlsson  <andersca@apple.com>
1831
1832         Reviewed by Sam Weinig.
1833
1834         Race condition when creating and destroying pages quickly
1835         https://bugs.webkit.org/show_bug.cgi?id=55061
1836         <rdar://problem/8708435>
1837
1838         When the last page in a web process is closed, the web process would
1839         previously terminate, even if the UI process had created a new page
1840         (the CreateNewPage message just wouldn't have reached the web process yet).
1841
1842         Fix this by adding a ShouldTerminate message that the web process sends when it's
1843         about to terminate. If the UI process has any pending pages, downloads etc. it will
1844         prevent the web process from terminating. Otherwise, it will immmediately disconnect
1845         the WebPageProxy so that creating a page after that will launch a new web process.
1846
1847         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
1848         (WebKit::WebPluginSiteDataManager::shouldTerminate):
1849         * UIProcess/Plugins/WebPluginSiteDataManager.h:
1850         * UIProcess/WebContext.cpp:
1851         (WebKit::WebContext::shouldTerminate):
1852         (WebKit::WebContext::disconnectProcess):
1853         * UIProcess/WebContext.h:
1854         * UIProcess/WebProcessProxy.cpp:
1855         (WebKit::WebProcessProxy::disconnect):
1856         (WebKit::WebProcessProxy::didReceiveSyncMessage):
1857         (WebKit::WebProcessProxy::didClose):
1858         (WebKit::WebProcessProxy::shouldTerminate):
1859         * UIProcess/WebProcessProxy.h:
1860         * UIProcess/WebProcessProxy.messages.in:
1861         * WebProcess/WebProcess.cpp:
1862         (WebKit::WebProcess::terminateIfPossible):
1863
1864 2011-02-23  Mike Thole  <mthole@apple.com>
1865
1866         Reviewed by Darin Adler.
1867
1868         WKBundleNavigationAction.h should be exposed as a public header
1869         https://bugs.webkit.org/show_bug.cgi?id=55059
1870
1871         * WebKit2.xcodeproj/project.pbxproj:
1872         Changed WKBundleNavigationAction.h from 'project' to 'public'.
1873
1874 2011-02-23  Siddharth Mathur  <siddharth.mathur@nokia.com>
1875
1876         Reviewed by Laszlo Gombos.
1877
1878         [Qt] Make sure Symbian binary UIDs are unique
1879
1880         * WebProcess.pro: Resolve the UID collision with QtTestBrowser.pro
1881         by changing the UID.
1882
1883 2011-02-23  Siddharth Mathur  <siddharth.mathur@nokia.com>
1884
1885         Reviewed by Laszlo Gombos.
1886
1887         [Qt] Fix the Symbian build after r79334
1888         https://bugs.webkit.org/show_bug.cgi?id=55044
1889
1890         * WebKit2.pri: Copy the rules from JavaScriptCore.pri for
1891         defineTest().
1892
1893         Remove addWebKit2LibWholeArchive as it is no longer needed.
1894
1895 2011-02-23  Alejandro G. Castro  <alex@igalia.com>
1896
1897         Unreviewed, fixed GTK WebKit2 compilation after r79366.
1898
1899         * GNUmakefile.am:
1900
1901 2011-02-23  Patrick Gansterer  <paroga@webkit.org>
1902
1903         Reviewed by Darin Adler.
1904
1905         Rename PLATFORM(CF) to USE(CF)
1906         https://bugs.webkit.org/show_bug.cgi?id=53540
1907
1908         * UIProcess/WebBackForwardList.h:
1909         * UIProcess/WebPageProxy.cpp:
1910         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1911         (WebKit::formatLocalizedString):
1912
1913 2011-02-23  Benjamin Poulain  <benjamin.poulain@nokia.com>
1914
1915         Reviewed by Andreas Kling.
1916
1917         [Qt] [WK2] When the context menu is empty, we should still send the signal QWKPage::showContextMenu()
1918         https://bugs.webkit.org/show_bug.cgi?id=54996
1919
1920         Send the signal QWKPage::showContextMenu() with an empty menu even if the content menu generated
1921         is empty/contain only disabled elements.
1922
1923         * UIProcess/API/qt/qgraphicswkview.cpp:
1924         (QGraphicsWKView::showContextMenu):
1925         * UIProcess/qt/WebContextMenuProxyQt.cpp:
1926         (WebKit::WebContextMenuProxyQt::showContextMenu):
1927
1928 2011-02-22  Dan Bernstein  <mitz@apple.com>
1929
1930         LLVM Compiler build fix.
1931
1932         * Scripts/webkit2/messages.py:
1933         * WebProcess/ApplicationCache/WebApplicationCacheManager.h:
1934
1935 2011-02-22  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1936
1937         Reviewed by Alexey Proskuryakov.
1938
1939         Drop the language tag part from the User Agent string
1940         https://bugs.webkit.org/show_bug.cgi?id=54560
1941
1942         * UIProcess/gtk/WebPageProxyGtk.cpp:
1943         (WebKit::WebPageProxy::standardUserAgent):
1944
1945         * UIProcess/mac/WebPageProxyMac.mm:
1946         (WebKit::WebPageProxy::standardUserAgent):
1947
1948         * UIProcess/qt/WebPageProxyQt.cpp:
1949         (WebKit::WebPageProxy::standardUserAgent):
1950
1951         * UIProcess/win/WebPageProxyWin.cpp:
1952         (WebKit::WebPageProxy::standardUserAgent): Drop the language tag
1953         part and fix style.
1954
1955 2011-02-22  Sam Weinig  <sam@webkit.org>
1956
1957         Reviewed by Anders Carlsson.
1958
1959         Add WebKit2 API to force a repaint with an invalidation
1960         https://bugs.webkit.org/show_bug.cgi?id=55015
1961
1962         * Shared/ForceRepaintFlags.h: Added.
1963         * UIProcess/API/C/WKPage.cpp:
1964         (WKPageForceRepaint):
1965         (WKPageForceRepaintWithInvalidation):
1966         * UIProcess/API/C/WKPage.h:
1967         Add WKPageForceRepaintWithInvalidation which does the same thing WKPageForceRepaint
1968         but also calls setNeedsDisplay on the entire bounds of the page.
1969
1970         * UIProcess/WebPageProxy.cpp:
1971         (WebKit::WebPageProxy::forceRepaint):
1972         * UIProcess/WebPageProxy.h:
1973         * WebProcess/WebPage/WebPage.cpp:
1974         (WebKit::WebPage::forceRepaint):
1975         * WebProcess/WebPage/WebPage.h:
1976         * WebProcess/WebPage/WebPage.messages.in:
1977         Pipe the flag down to the WebProcess.
1978
1979         * WebKit2.pro:
1980         * WebKit2.xcodeproj/project.pbxproj:
1981         * win/WebKit2.vcproj:
1982         Add ForceRepaintFlags.h.
1983
1984 2011-02-22  Simon Fraser  <simon.fraser@apple.com>
1985
1986         Reviewed by Dan Bernstein.
1987
1988         <rdar://problem/9039670>
1989         
1990         Make sure that we set the accelerateDrawing property on the LayerTreeHosts's
1991         non-composited content layer if the preference is set.
1992
1993         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
1994         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
1995
1996 2011-02-22  Brady Eidson  <beidson@apple.com>
1997
1998         Fix it Windows-style.
1999
2000         * WebProcess/WebProcess.cpp:
2001         (WebKit::WebProcess::getSitesWithPluginData):
2002         (WebKit::WebProcess::clearPluginSiteData):
2003
2004 2011-02-22  Anders Carlsson  <andersca@apple.com>
2005
2006         Reviewed by Dan Bernstein.
2007
2008         Rename WebProcess::shutdownIfPossible to WebProcess::terminateIfPossible
2009         https://bugs.webkit.org/show_bug.cgi?id=55008
2010
2011         * WebProcess/Downloads/DownloadManager.cpp:
2012         (WebKit::DownloadManager::downloadFinished):
2013         * WebProcess/WebProcess.cpp:
2014         (WebKit::WebProcess::removeWebPage):
2015         (WebKit::WebProcess::terminateIfPossible):
2016         (WebKit::WebProcess::getSitesWithPluginData):
2017         * WebProcess/WebProcess.h:
2018         * WebProcess/gtk/WebProcessGtk.cpp:
2019         (WebKit::WebProcess::platformTerminate):
2020         * WebProcess/mac/WebProcessMac.mm:
2021         (WebKit::WebProcess::platformTerminate):
2022         * WebProcess/qt/WebProcessQt.cpp:
2023         (WebKit::WebProcess::platformTerminate):
2024         * WebProcess/win/WebProcessWin.cpp:
2025         (WebKit::WebProcess::platformTerminate):
2026
2027 2011-02-22  Brady Eidson  <beidson@apple.com>
2028
2029         Windows build-fix attempt.
2030
2031         * win/WebKit2Generated.make:
2032
2033 2011-02-22  Csaba Osztrogonác  <ossy@webkit.org>
2034
2035         Unreviewed.
2036
2037         <rdar://problem/8762042> and  https://bugs.webkit.org/show_bug.cgi?id=54514
2038         API to view and delete Application Cache data by origin.
2039
2040         [Qt][WK2] Buildfix after r79364.
2041
2042         * DerivedSources.pro:
2043         * WebKit2.pri:
2044
2045 2011-02-22  Brady Eidson  <beidson@apple.com>
2046
2047         Reviewed by Anders Carlsson and looked over by Brian Weinstein.
2048
2049         <rdar://problem/8762042> and https://bugs.webkit.org/show_bug.cgi?id=54514
2050         API to view and delete Application Cache data by origin.
2051
2052         I couldn't help myself - I also re-alphabetized WebResourceCacheManager in many places where
2053         it's sorting was wrong due to a last minute name change.
2054
2055         Project file changes:
2056         * GNUmakefile.am:
2057         * win/WebKit2.vcproj:
2058         * win/WebKit2Common.vsprops:
2059         * win/WebKit2Generated.make:
2060         * WebKit2.pro:
2061         * WebKit2.xcodeproj/project.pbxproj:
2062
2063         WK2 build-system and API paperwork:
2064         * DerivedSources.make:
2065         * Platform/CoreIPC/MessageID.h:
2066         * Shared/API/c/WKBase.h:
2067         * Shared/APIObject.h:
2068         * UIProcess/API/C/WKAPICast.h:
2069
2070         Add a helper to perform an ArrayCallback with a Vector of SecurityOriginDatas:
2071         * Shared/SecurityOriginData.cpp:
2072         (WebKit::performAPICallbackWithSecurityOriginDataVector):
2073         * Shared/SecurityOriginData.h:
2074         * UIProcess/WebResourceCacheManagerProxy.cpp:
2075         (WebKit::WebResourceCacheManagerProxy::didGetCacheOrigins): Use performAPICallbackWithSecurityOriginDataVector here.
2076
2077         Add an ApplicationCacheManagerProxy to the context and invalidate it at the appropriate times:
2078         * UIProcess/WebContext.cpp:
2079         (WebKit::WebContext::WebContext):
2080         (WebKit::WebContext::~WebContext):
2081         (WebKit::WebContext::processDidClose):
2082         (WebKit::WebContext::didReceiveMessage): Route messages to the right proxy.
2083         * UIProcess/WebContext.h:
2084         (WebKit::WebContext::applicationCacheManagerProxy):
2085         (WebKit::WebContext::resourceCacheManagerProxy):
2086
2087         Add API to get the ApplicationCacheManager for a context:
2088         * UIProcess/API/C/WKContext.cpp:
2089         (WKContextGetApplicationCacheManager):
2090         (WKContextGetResourceCacheManager):
2091         * UIProcess/API/C/WKContext.h:
2092
2093         Route messages to the right place:
2094         * UIProcess/WebProcessProxy.cpp:
2095         (WebKit::WebProcessProxy::didReceiveMessage):
2096         * WebProcess/WebProcess.cpp:
2097         (WebKit::WebProcess::didReceiveMessage):
2098
2099         Add the API object, which wraps to WebApplicationCacheManagerProxy:
2100         * UIProcess/API/C/WKApplicationCacheManager.cpp: Added.
2101         (WKApplicationCacheManagerGetTypeID):
2102         (WKApplicationCacheManagerGetApplicationCacheOrigins):
2103         (WKApplicationCacheManagerDeleteEntriesForOrigin):
2104         (WKApplicationCacheManagerDeleteAllEntries):
2105         * UIProcess/API/C/WKApplicationCacheManager.h: Added.
2106
2107         The UIProcess implementation of the manager to send messages to the WebProcess and pipe a callback back up to the client:
2108         * UIProcess/WebApplicationCacheManagerProxy.cpp: Added.
2109         (WebKit::WebApplicationCacheManagerProxy::create):
2110         (WebKit::WebApplicationCacheManagerProxy::WebApplicationCacheManagerProxy):
2111         (WebKit::WebApplicationCacheManagerProxy::~WebApplicationCacheManagerProxy):
2112         (WebKit::WebApplicationCacheManagerProxy::invalidate):
2113         (WebKit::WebApplicationCacheManagerProxy::didReceiveMessage):
2114         (WebKit::WebApplicationCacheManagerProxy::getApplicationCacheOrigins):
2115         (WebKit::WebApplicationCacheManagerProxy::didGetApplicationCacheOrigins): Use performAPICallbackWithSecurityOriginDataVector here.
2116         (WebKit::WebApplicationCacheManagerProxy::deleteEntriesForOrigin):
2117         (WebKit::WebApplicationCacheManagerProxy::deleteAllEntries):
2118         * UIProcess/WebApplicationCacheManagerProxy.h: Added.
2119         (WebKit::WebApplicationCacheManagerProxy::clearContext):
2120         (WebKit::WebApplicationCacheManagerProxy::type):
2121         * UIProcess/WebApplicationCacheManagerProxy.messages.in: Added.
2122
2123         The WebProcess implementation to response to UIProcess messages and actually do the dirty-work in WebCore:
2124         * WebProcess/ApplicationCache: Added.
2125         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp: Added.
2126         (WebKit::WebApplicationCacheManager::shared):
2127         (WebKit::WebApplicationCacheManager::WebApplicationCacheManager):
2128         (WebKit::WebApplicationCacheManager::didReceiveMessage):
2129         (WebKit::WebApplicationCacheManager::getApplicationCacheOrigins):
2130         (WebKit::WebApplicationCacheManager::deleteEntriesForOrigin):
2131         (WebKit::WebApplicationCacheManager::deleteAllEntries):
2132         * WebProcess/ApplicationCache/WebApplicationCacheManager.h: Added.
2133         * WebProcess/ApplicationCache/WebApplicationCacheManager.messages.in: Added.
2134
2135 2011-02-22  Anders Carlsson  <andersca@apple.com>
2136
2137         Reviewed by Sam Weinig.
2138
2139         Get rid of WebProcessManager
2140         https://bugs.webkit.org/show_bug.cgi?id=55001
2141
2142         WebProcessManager had become a stupid map of WebContext > WebProcess relations,
2143         which isn't really useful since the WebContext already knows about its process.
2144
2145         * Shared/WebURLRequest.cpp:
2146         * UIProcess/API/mac/WKView.mm:
2147         * UIProcess/WebContext.cpp:
2148         (WebKit::WebContext::~WebContext):
2149         (WebKit::WebContext::ensureWebProcess):
2150         (WebKit::WebContext::processDidFinishLaunching):
2151         * UIProcess/WebProcessManager.cpp: Removed.
2152         * UIProcess/WebProcessManager.h: Removed.
2153         * UIProcess/WebProcessProxy.cpp:
2154         (WebKit::WebProcessProxy::didClose):
2155         * WebKit2.pro:
2156         * WebKit2.xcodeproj/project.pbxproj:
2157         * win/WebKit2.vcproj:
2158
2159 2011-02-22  Anders Carlsson  <andersca@apple.com>
2160
2161         Reviewed by Darin Adler.
2162
2163         Get rid of WebProcessManager::getAllWebProcessContexts
2164         https://bugs.webkit.org/show_bug.cgi?id=55000
2165
2166         * Shared/WebURLRequest.cpp:
2167         (WebKit::WebURLRequest::setDefaultTimeoutInterval):
2168         Call WebContext::allContexts instead.
2169
2170         * UIProcess/WebContext.cpp:
2171         * UIProcess/WebContext.h:
2172         Add a vector of WebContext objects. Update it when creating and destroying contexts.
2173
2174         * UIProcess/WebProcessManager.cpp:
2175         * UIProcess/WebProcessManager.h:
2176         Remove WebProcessManager::getAllWebProcessContexts.
2177
2178 2011-02-22  Sam Weinig  <sam@webkit.org>
2179
2180         Reviewed by Anders Carlsson.
2181
2182         Re-add early bail out in dispatchDecidePolicyForNavigationAction with prevents
2183         a crash running fast/loader/empty-embed-src-attribute.html. This matches a 
2184         bail out in the default policy delegate in WebKit1.
2185
2186         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2187         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2188
2189 2011-02-22  Anders Carlsson  <andersca@apple.com>
2190
2191         Reviewed by Dan Bernstein.
2192
2193         Grammar correction from Spelling & Grammar window doesn't work
2194         https://bugs.webkit.org/show_bug.cgi?id=54982
2195         <rdar://problem/8940918>
2196
2197         * UIProcess/API/mac/WKView.mm:
2198         (-[WKView isGrammarCheckingEnabled]):
2199         (-[WKView setGrammarCheckingEnabled:]):
2200         Call down to the text checker.
2201
2202         * UIProcess/TextChecker.h:
2203         Add updateSpellingUIWithGrammarString.
2204
2205         * UIProcess/WebPageProxy.cpp:
2206         (WebKit::WebPageProxy::updateSpellingUIWithGrammarString):
2207         Call TextChecker::updateSpellingUIWithGrammarString.
2208
2209         * UIProcess/WebPageProxy.messages.in:
2210         Add UpdateSpellingUIWithGrammarString message.
2211
2212         * UIProcess/gtk/TextCheckerGtk.cpp:
2213         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
2214         * UIProcess/qt/TextCheckerQt.cpp:
2215         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
2216         * UIProcess/win/TextCheckerWin.cpp:
2217         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
2218         Add stubs.
2219
2220         * UIProcess/mac/TextCheckerMac.mm:
2221         (WebKit::TextChecker::updateSpellingUIWithGrammarString):
2222         Update the spelling panel.
2223
2224         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2225         (WebKit::WebEditorClient::updateSpellingUIWithGrammarString):
2226         Send an UpdateSpellingUIWithGrammarString message to the UI process.
2227
2228 2011-02-22  Balazs Kelemen  <kbalazs@webkit.org>
2229
2230         Reviewed by Anders Carlsson.
2231
2232         notImplemented() should behave identical in WebCore and WebKit2
2233         https://bugs.webkit.org/show_bug.cgi?id=54449
2234
2235         Use NotImplemented.h from WebCore. Initialize logging channels.
2236         Remove the WebKit2 concept of notImplemented().
2237
2238         * Platform/gtk/SharedMemoryGtk.cpp:
2239         * Platform/gtk/WorkQueueGtk.cpp:
2240         * Platform/qt/WorkQueueQt.cpp:
2241         * Platform/win/WorkQueueWin.cpp:
2242         * Shared/NotImplemented.h: Removed.
2243         * Shared/Plugins/NPIdentifierData.cpp:
2244         * Shared/Plugins/NPRemoteObjectMap.cpp:
2245         * Shared/Plugins/NPVariantData.cpp:
2246         * Shared/cairo/ShareableBitmapCairo.cpp:
2247         * Shared/gtk/ShareableBitmapGtk.cpp:
2248         * Shared/gtk/WebCoreArgumentCodersGtk.cpp:
2249         * Shared/qt/WebCoreArgumentCodersQt.cpp:
2250         * Shared/win/LayerTreeContextWin.cpp:
2251         * UIProcess/API/mac/PageClientImpl.mm:
2252         * UIProcess/API/qt/qwkpage.cpp:
2253         * UIProcess/Launcher/gtk/ThreadLauncherGtk.cpp:
2254         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
2255         * UIProcess/Plugins/gtk/PluginInfoStoreGtk.cpp:
2256         * UIProcess/WebContext.cpp:
2257         (WebKit::WebContext::WebContext):
2258         * UIProcess/WebInspectorProxy.cpp:
2259         * UIProcess/gtk/TextCheckerGtk.cpp:
2260         * UIProcess/gtk/WebInspectorGtk.cpp:
2261         * UIProcess/gtk/WebPreferencesGtk.cpp:
2262         * UIProcess/qt/TextCheckerQt.cpp:
2263         * UIProcess/qt/WebInspectorProxyQt.cpp:
2264         * UIProcess/win/TextCheckerWin.cpp:
2265         * UIProcess/win/WebContextMenuProxyWin.cpp:
2266         * WebKit2.pro:
2267         * WebKit2.xcodeproj/project.pbxproj:
2268         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
2269         * WebProcess/Downloads/curl/DownloadCurl.cpp:
2270         * WebProcess/Downloads/mac/DownloadMac.mm:
2271         * WebProcess/Downloads/qt/DownloadQt.cpp:
2272         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
2273         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
2274         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2275         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
2276         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2277         * WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp:
2278         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp:
2279         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
2280         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2281         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
2282         * WebProcess/WebCoreSupport/WebDragClient.cpp:
2283         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2284         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2285         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2286         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
2287         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2288         * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
2289         * WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp:
2290         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
2291         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
2292         * WebProcess/WebCoreSupport/qt/WebContextMenuClientQt.cpp:
2293         * WebProcess/WebPage/gtk/WebInspectorGtk.cpp:
2294         * WebProcess/WebPage/qt/WebInspectorQt.cpp:
2295         * WebProcess/WebProcess.cpp:
2296         (WebKit::WebProcess::WebProcess):
2297         * WebProcess/gtk/WebProcessGtk.cpp:
2298         * config.h:
2299         * win/WebKit2.vcproj:
2300
2301 2011-02-22  Brian Weinstein  <bweinstein@apple.com>
2302
2303         Rubber-stamped by Brady Eidson.
2304
2305         Invalidate the WebResourceCacheManagerProxy in WebContext::processDidClose.
2306
2307         * UIProcess/WebContext.cpp:
2308         (WebKit::WebContext::processDidClose):
2309
2310 2011-02-21  Adam Roben  <aroben@apple.com>
2311
2312         Make DrawingAreaProxyImpl keep track of the most recent state ID it sent to the web process
2313
2314         This will be useful for sending repeated messages for the same state ID to the web process.
2315         We don't do this currently, but will need to if we're asked to paint after we've thrown away
2316         our backing store to save memory.
2317
2318         Fixes <http://webkit.org/b/54916> DrawingAreaProxyImpl should keep track of the state ID it
2319         last sent to the web process
2320
2321         Reviewed by Anders Carlsson.
2322
2323         * UIProcess/DrawingAreaProxyImpl.cpp:
2324         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl): Initialize m_requestedStateID, and
2325         reordered member initialization to match the new declaration order.
2326         (WebKit::DrawingAreaProxyImpl::didUpdateState): Added an assertion that the stateID we got
2327         from the web process is no newer than the most recent one we requested.
2328         (WebKit::DrawingAreaProxyImpl::sendUpdateState): Changed to increment and send
2329         m_requestedStateID instead of a new global stateID.
2330
2331         * UIProcess/DrawingAreaProxyImpl.h: Added m_requestedStateID, and moved the state IDs before
2332         other data members. Also beefed the comment explaining m_currentStateID.
2333
2334 2011-02-22  Andras Becsi  <abecsi@webkit.org>
2335
2336         Reviewed by Laszlo Gombos.
2337
2338         [Qt] Redesign the build system
2339         https://bugs.webkit.org/show_bug.cgi?id=51339
2340
2341         Part 2.
2342
2343         Build WebCore as a static library, compile the WebKit API and WebKit2 API
2344         in a final step and link to WebKit2, WebCore and JSC libraries to fix
2345         linking issues resulting from stripped away symbols.
2346
2347         * WebKit2.pri: Add include paths.
2348         * WebKit2.pro: Move include paths to WebKit2.pri and move
2349         the API source to WebKit/qt/QtWebKit.pro
2350
2351 2011-02-22  Benjamin Poulain  <benjamin.poulain@nokia.com>
2352
2353         Reviewed by Kenneth Rohde Christiansen.
2354
2355         [Qt] [WK2] Improve the memory handling of the context menu for WebKit 2
2356         https://bugs.webkit.org/show_bug.cgi?id=54902
2357
2358         Refactor the context menu handling of Qt to make it simpler to manage memory.
2359
2360         WebContextMenuProxyQt uses smart pointer for all the references to menu so
2361         there is no need to delete it explicitely.
2362
2363         Passing the QMenu from QWKPage to the client of the signal now uses a QSharedPointer so
2364         the client can choose to handle the memory, but there is no leak if it does not.
2365
2366         * UIProcess/API/qt/qgraphicswkview.cpp:
2367         (QGraphicsWKView::QGraphicsWKView):
2368         (QGraphicsWKView::showContextMenu):
2369         * UIProcess/API/qt/qgraphicswkview.h:
2370         * UIProcess/API/qt/qwkpage.h:
2371         * UIProcess/qt/WebContextMenuProxyQt.cpp:
2372         (WebKit::WebContextMenuProxyQt::showContextMenu):
2373         (WebKit::WebContextMenuProxyQt::createContextMenu):
2374         * UIProcess/qt/WebContextMenuProxyQt.h:
2375
2376 2011-02-22  Philippe Normand  <pnormand@igalia.com>
2377
2378         Reviewed by Xan Lopez.
2379
2380         [GTK] make distcheck fails
2381         https://bugs.webkit.org/show_bug.cgi?id=54943
2382
2383         Removed reference to NotImplemented.h which was removed.
2384
2385         * GNUmakefile.am:
2386
2387 2011-02-22  Kimmo Kinnunen  <kimmo.t.kinnunen@nokia.com>
2388
2389         Reviewed by Kenneth Rohde Christiansen.
2390
2391         [Qt] QtWebProcess should be installed with 'make install'
2392         https://bugs.webkit.org/show_bug.cgi?id=44100
2393
2394         Follow the standard in other project files and allow install
2395         location to be changed with INSTALL_BINS variable.
2396
2397         * WebProcess.pro: Install QtWebProcess.
2398
2399 2011-02-22  Sheriff Bot  <webkit.review.bot@gmail.com>
2400
2401         Unreviewed, rolling out r79296.
2402         http://trac.webkit.org/changeset/79296
2403         https://bugs.webkit.org/show_bug.cgi?id=54941
2404
2405         Breaks compilation on SnowLeapard Intel Release (Requested by
2406         kbalazs_ on #webkit).
2407
2408         * Platform/gtk/SharedMemoryGtk.cpp:
2409         * Platform/gtk/WorkQueueGtk.cpp:
2410         * Platform/qt/WorkQueueQt.cpp:
2411         * Platform/win/WorkQueueWin.cpp:
2412         * Shared/NotImplemented.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp.
2413         * Shared/Plugins/NPIdentifierData.cpp:
2414         * Shared/Plugins/NPRemoteObjectMap.cpp:
2415         * Shared/Plugins/NPVariantData.cpp:
2416         * Shared/cairo/ShareableBitmapCairo.cpp:
2417         * Shared/gtk/ShareableBitmapGtk.cpp:
2418         * Shared/gtk/WebCoreArgumentCodersGtk.cpp:
2419         * Shared/qt/WebCoreArgumentCodersQt.cpp:
2420         * Shared/win/LayerTreeContextWin.cpp:
2421         * UIProcess/API/mac/PageClientImpl.mm:
2422         * UIProcess/API/qt/qwkpage.cpp:
2423         * UIProcess/Launcher/gtk/ThreadLauncherGtk.cpp:
2424         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
2425         * UIProcess/Plugins/gtk/PluginInfoStoreGtk.cpp:
2426         * UIProcess/WebContext.cpp:
2427         (WebKit::WebContext::WebContext):
2428         * UIProcess/WebInspectorProxy.cpp:
2429         * UIProcess/gtk/TextCheckerGtk.cpp:
2430         * UIProcess/gtk/WebInspectorGtk.cpp:
2431         * UIProcess/gtk/WebPreferencesGtk.cpp:
2432         * UIProcess/qt/TextCheckerQt.cpp:
2433         * UIProcess/qt/WebInspectorProxyQt.cpp:
2434         * UIProcess/win/TextCheckerWin.cpp:
2435         * UIProcess/win/WebContextMenuProxyWin.cpp:
2436         * WebKit2.pro:
2437         * WebKit2.xcodeproj/project.pbxproj:
2438         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
2439         * WebProcess/Downloads/curl/DownloadCurl.cpp:
2440         * WebProcess/Downloads/mac/DownloadMac.mm:
2441         * WebProcess/Downloads/qt/DownloadQt.cpp:
2442         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
2443         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
2444         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2445         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
2446         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2447         * WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp:
2448         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp:
2449         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
2450         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2451         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
2452         * WebProcess/WebCoreSupport/WebDragClient.cpp:
2453         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2454         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2455         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2456         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
2457         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2458         * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
2459         * WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp:
2460         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
2461         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
2462         * WebProcess/WebCoreSupport/qt/WebContextMenuClientQt.cpp:
2463         * WebProcess/WebPage/gtk/WebInspectorGtk.cpp:
2464         * WebProcess/WebPage/qt/WebInspectorQt.cpp:
2465         * WebProcess/WebProcess.cpp:
2466         (WebKit::WebProcess::WebProcess):
2467         * WebProcess/gtk/WebProcessGtk.cpp:
2468         * config.h:
2469         * win/WebKit2.vcproj:
2470
2471 2011-02-16  Balazs Kelemen  <kbalazs@webkit.org>
2472
2473         Reviewed by Anders Carlsson.
2474
2475         notImplemented() should behave identical in WebCore and WebKit2
2476         https://bugs.webkit.org/show_bug.cgi?id=54449
2477
2478         Use NotImplemented.h from WebCore. Initialize logging channels.
2479         Remove the WebKit2 concept of notImplemented().
2480
2481         * Platform/gtk/SharedMemoryGtk.cpp:
2482         * Platform/gtk/WorkQueueGtk.cpp:
2483         * Platform/qt/WorkQueueQt.cpp:
2484         * Platform/win/WorkQueueWin.cpp:
2485         * Shared/NotImplemented.h: Removed.
2486         * Shared/Plugins/NPIdentifierData.cpp:
2487         * Shared/Plugins/NPRemoteObjectMap.cpp:
2488         * Shared/Plugins/NPVariantData.cpp:
2489         * Shared/cairo/ShareableBitmapCairo.cpp:
2490         * Shared/gtk/ShareableBitmapGtk.cpp:
2491         * Shared/gtk/WebCoreArgumentCodersGtk.cpp:
2492         * Shared/qt/WebCoreArgumentCodersQt.cpp:
2493         * Shared/win/LayerTreeContextWin.cpp:
2494         * UIProcess/API/qt/qwkpage.cpp:
2495         * UIProcess/Launcher/gtk/ThreadLauncherGtk.cpp:
2496         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
2497         * UIProcess/Plugins/gtk/PluginInfoStoreGtk.cpp:
2498         * UIProcess/WebContext.cpp:
2499         (WebKit::WebContext::WebContext):
2500         * UIProcess/WebInspectorProxy.cpp:
2501         * UIProcess/gtk/TextCheckerGtk.cpp:
2502         * UIProcess/gtk/WebInspectorGtk.cpp:
2503         * UIProcess/gtk/WebPreferencesGtk.cpp:
2504         * UIProcess/qt/TextCheckerQt.cpp:
2505         * UIProcess/qt/WebInspectorProxyQt.cpp:
2506         * UIProcess/win/TextCheckerWin.cpp:
2507         * UIProcess/win/WebContextMenuProxyWin.cpp:
2508         * WebKit2.pro:
2509         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
2510         * WebProcess/Downloads/curl/DownloadCurl.cpp:
2511         * WebProcess/Downloads/mac/DownloadMac.mm:
2512         * WebProcess/Downloads/qt/DownloadQt.cpp:
2513         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
2514         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
2515         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2516         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
2517         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2518         * WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp:
2519         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp:
2520         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
2521         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2522         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
2523         * WebProcess/WebCoreSupport/WebDragClient.cpp:
2524         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2525         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2526         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2527         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
2528         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2529         * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
2530         * WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp:
2531         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
2532         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
2533         * WebProcess/WebCoreSupport/qt/WebContextMenuClientQt.cpp:
2534         * WebProcess/WebPage/gtk/WebInspectorGtk.cpp:
2535         * WebProcess/WebPage/qt/WebInspectorQt.cpp:
2536         * WebProcess/WebProcess.cpp:
2537         (WebKit::WebProcess::WebProcess):
2538         * WebProcess/gtk/WebProcessGtk.cpp:
2539
2540 2011-02-21  Timothy Hatcher  <timothy@apple.com>
2541
2542         Set and update the window title for the Web Inspector in WebKit2.
2543
2544         https://webkit.org/b/50945
2545         rdar://problem/8762410
2546
2547         Reviewed by Adam Roben.
2548
2549         * UIProcess/WebInspectorProxy.cpp:
2550         (WebKit::WebInspectorProxy::inspectedURLChanged): Added. Call platformInspectedURLChanged.
2551         * UIProcess/WebInspectorProxy.h:
2552         * UIProcess/WebInspectorProxy.messages.in: Added InspectedURLChanged.
2553         * UIProcess/mac/WebInspectorProxyMac.mm:
2554         (WebKit::WebInspectorProxy::platformInspectedURLChanged): Added. Set the window title.
2555         * UIProcess/win/WebInspectorProxyWin.cpp:
2556         (WebKit::WebInspectorProxy::platformInspectedURLChanged): Added. Set the window title.
2557         * UIProcess/gtk/WebInspectorGtk.cpp:
2558         (WebKit::WebInspectorProxy::platformInspectedURLChanged): Added. Not implemented.
2559         * UIProcess/qt/WebInspectorProxyQt.cpp:
2560         (WebKit::WebInspectorProxy::platformInspectedURLChanged): Added. Not implemented.
2561         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
2562         (WebKit::WebInspectorFrontendClient::inspectedURLChanged): Call WebInspector::inspectedURLChanged.
2563         * WebProcess/WebPage/WebInspector.cpp:
2564         (WebKit::WebInspector::inspectedURLChanged): Added. Send the InspectedURLChanged message.
2565         * WebProcess/WebPage/WebInspector.h:
2566
2567 2011-02-21  Sam Weinig  <sam@webkit.org>
2568
2569         Reviewed by Anders Carlsson.
2570
2571         Can't paste from 3rd party text editor into WebKit2 window.
2572         <rdar://problem/8978624>
2573
2574         * WebProcess/com.apple.WebProcess.sb:
2575
2576 2011-02-21  Anders Carlsson  <andersca@apple.com>
2577
2578         Reviewed by Dan Bernstein.
2579
2580         Initialize DrawingAreaProxy::m_size
2581         https://bugs.webkit.org/show_bug.cgi?id=54913
2582
2583         This was removed in r76962 since it caused flashes when switching drawing areas due to
2584         entering and exiting composited mode, but since we no longer switch drawing areas we can
2585         put it back.
2586
2587         * UIProcess/DrawingAreaProxy.cpp:
2588         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
2589
2590 2011-02-21  Adam Roben  <aroben@apple.com>
2591
2592         Add some assertions about the state IDs we receive from the web process
2593
2594         Rubber-stamped by Anders Carlsson.
2595
2596         * UIProcess/DrawingAreaProxyImpl.cpp:
2597         (WebKit::DrawingAreaProxyImpl::update):
2598         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
2599         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
2600         Assert that the state ID the web process sent us is no newer than our own state ID.
2601
2602 2011-02-21  Adam Roben  <aroben@apple.com>
2603
2604         Rename DrawingArea[Proxy]Impl's "sequence number" concept to "state ID".
2605
2606         As explained in r79251, DrawingAreaProxyImpl has some state that, when it changes, causes
2607         all operations performed before that state change to become invalid. Currently, this state
2608         consists of a single piece of data: the view's size. Eventually it will encompass more data
2609         (e.g., the backing store we're drawing into; when we start throwing away the backing store
2610         to save memory, our state will have changed, and any operations that were intended for the
2611         old backing store will have become invalid). r79251 effectively transformed
2612         DrawingArea[Proxy]Impl's "sequence number," which incremented every time DrawingAreaImpl
2613         sent DrawingAreaProxyImpl a message, to a "state ID," which only increments when the view's
2614         size changes.
2615
2616         This patch is just a set of simple renames to reflect the transformation that r79251
2617         effected. It should not introduce any changes in behavior. The renames are:
2618           - Messages::DrawingArea::SetSize -> UpdateState
2619           - Messages::DrawingAreaProxy::DidSetSize -> DidUpdateState
2620           - DrawingAreaProxyImpl::m_lastDidSetSizeSequenceNumber -> m_currentStateID
2621           - DrawingAreaProxyImpl::m_isWaitingForDidSetSize -> m_isWaitingForDidUpdateState
2622           - DrawingAreaProxyImpl::waitForAndDispatchDidSetSize -> waitForAndDispatchDidUpdateState
2623           - DrawingAreaImpl::m_inSetSize -> m_inUpdateState
2624           - generateSequenceNumber -> generateStateID
2625           - sequenceNumber -> stateID
2626
2627         Fixes <http://webkit.org/b/54911> DrawingArea[Proxy]Impl's "sequence number" concept should
2628         be renamed to "state ID"
2629
2630         Reviewed by Anders Carlsson.
2631
2632         * UIProcess/DrawingAreaProxy.h:
2633         * UIProcess/DrawingAreaProxy.messages.in:
2634         * UIProcess/DrawingAreaProxyImpl.cpp:
2635         * UIProcess/DrawingAreaProxyImpl.h:
2636         * WebProcess/WebPage/DrawingArea.h:
2637         * WebProcess/WebPage/DrawingArea.messages.in:
2638         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2639         * WebProcess/WebPage/DrawingAreaImpl.h:
2640         Performed the renames described above.
2641
2642 2011-02-21  Alexey Proskuryakov  <ap@apple.com>
2643
2644         Reviewed by Adam Roben.
2645
2646         REGRESSION (WebKit2): HTTP requests time out after 60 seconds
2647         https://bugs.webkit.org/show_bug.cgi?id=54755
2648         <rdar://problem/9006592>
2649
2650         * Shared/API/c/WKURLRequest.cpp:
2651         (WKURLRequestSetDefaultTimeoutInterval):
2652         * Shared/API/c/WKURLRequest.h:
2653         Added an API to set a default timeout interval for requests created from URLs. The API
2654         affects both the UI process and requests created internally by the Web process. Requests
2655         created from NSURLRequest or CFURLRequest take timeout from those.
2656
2657         * Shared/WebURLRequest.cpp: (WebKit::WebURLRequest::setDefaultTimeoutInterval):
2658         * Shared/WebURLRequest.h:
2659         Pipe the default timeout interval from WKURLRequest down to actual implementation. Since
2660         WebURLRequest is currently implemented with WebCore::ResourceRequest, it automatically respects
2661         NSURLRequest default timeout interval.
2662
2663         * UIProcess/WebProcessManager.cpp: (WebKit::WebProcessManager::getAllWebProcessContexts):
2664         * UIProcess/WebProcessManager.h:
2665         Added a way to enumerate all contexts running in separate processes.
2666
2667         * Shared/WebProcessCreationParameters.cpp:
2668         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
2669         (WebKit::WebProcessCreationParameters::encode):
2670         (WebKit::WebProcessCreationParameters::decode):
2671         * Shared/WebProcessCreationParameters.h:
2672         (WebKit::WebContext::ensureWebProcess):
2673         (WebKit::WebContext::setDefaultRequestTimeoutInterval):
2674         * UIProcess/WebContext.h:
2675         * WebProcess/WebProcess.cpp:
2676         (WebKit::WebProcess::initializeWebProcess):
2677         (WebKit::WebProcess::setDefaultRequestTimeoutInterval):
2678         * WebProcess/WebProcess.h:
2679         * WebProcess/WebProcess.messages.in:
2680         Use UI process default timeout interval in separate process contexts, too.
2681
2682 2011-02-18  Brian Weinstein  <bweinstein@apple.com>
2683
2684         Reviewed by Adam Roben.
2685
2686         WebResourceCacheManager should be responsible for managing the CFURLCache as well
2687         as the WebCore memory cache.
2688         https://bugs.webkit.org/show_bug.cgi?id=54886
2689         Part of <rdar://problem/8971738>
2690
2691         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
2692         (WebKit::WebResourceCacheManager::getCacheOrigins): Call through to cFURLCacheHostNames, and add
2693             create SecurityOrigin's for them and add them to the set of SecurityOrigins with cache.
2694         (WebKit::WebResourceCacheManager::clearCacheForOrigin): Call through to clear the CFURLCache for
2695             the origin's hostname.
2696         * WebProcess/ResourceCache/WebResourceCacheManager.h:
2697
2698         * WebProcess/ResourceCache/cf: Added.
2699         * WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.cpp: Added.
2700         (WebKit::WebResourceCacheManager::cfURLCacheHostNames): Call through to WebKitSystemInterface.
2701         (WebKit::WebResourceCacheManager::clearCFURLCacheForHostNames): Ditto.
2702
2703         * win/WebKit2.vcproj: Added new file.
2704         * WebKit2.xcodeproj/project.pbxproj: Ditto.
2705
2706 2011-02-21  Adam Roben  <aroben@apple.com>
2707
2708         Move control of the sequence number from DrawingAreaImpl to DrawingAreaProxyImpl
2709
2710         DrawingAreaProxyImpl has some state that, when it changes, causes all operations performed
2711         before that state change to become invalid. When painting, we need to have performed at
2712         least one Update for the most recent state; otherwise, we'll be painting old/incorrect bits
2713         into the view.
2714
2715         Currently, this state consists of a single piece of data: the view's size. Whenever the
2716         state (i.e., size) changes, we tell the web process via the SetSize message, and the web
2717         process lets us know that it has updated to match the new state (i.e., size) via the
2718         DidSetSize message.
2719
2720         When it's time to paint, if we're waiting for the web process to update to match our current
2721         state (i.e., size), we block for a little while hoping to receive a DidSetSize message so
2722         that we can paint up-to-date bits into the window. This can cause us to receive messages
2723         out-of-order; the DidSetSize message will be processed immediately, and any messages that
2724         were sent before the DidSetSize message will be processed later. Since the messages from
2725         before the DidSetSize message correspond to an old state (i.e., size), they are no longer
2726         useful (e.g., they contain bits of the page that are drawn at the wrong size/location), so
2727         we discard them.
2728
2729         The way we identify and discard these messages is by keeping track of a sequence number.
2730         Currently, DrawingAreaImpl sends a monotonically-increasing sequence number to
2731         DrawingAreaProxyImpl with every message. Whenever DrawingAreaProxyImpl receives a DidSetSize
2732         message, it records the sequence number that came along with it. If we then later receive
2733         any messages that have a lower sequence number, we know they correspond to an old state
2734         (i.e., size) and can discard them.
2735
2736         This patch moves control of the sequence number to DrawingAreaProxyImpl.
2737         DrawingAreaProxyImpl now sends a monotonically-increasing sequence number in the SetSize
2738         message. DrawingAreaImpl records this sequence number when it receives the SetSize message,
2739         and sends it back to DrawingAreaProxyImpl in every message. Otherwise the logic is the same
2740         as before.
2741
2742         This should cause no changes in behavior, but will allow DrawingAreaProxyImpl to request a
2743         full backing store update (by incrementing the sequence number) at times other than when the
2744         view's size changes (e.g., after it has thrown away its backing store in order to save
2745         memory).
2746
2747         Fixes <http://webkit.org/b/54907> DrawingAreaProxyImpl should tell DrawingAreaImpl what
2748         sequence number to use
2749
2750         Reviewed by Anders Carlsson.
2751
2752         * UIProcess/DrawingAreaProxyImpl.cpp:
2753         (WebKit::generateSequenceNumber): Moved here from DrawingAreaImpl.cpp.
2754         (WebKit::DrawingAreaProxyImpl::sendSetSize): Changed to pass a new sequence number in the
2755         SetSize message.
2756         (WebKit::DrawingAreaProxyImpl::waitForAndDispatchDidSetSize): Added a FIXME about a
2757         potential improvement.
2758
2759         * WebProcess/WebPage/DrawingArea.h:
2760         (WebKit::DrawingArea::setSize): Updated to match the message's new parameters.
2761
2762         * WebProcess/WebPage/DrawingArea.messages.in: Added a sequenceNumber parameter to SetSize.
2763
2764         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2765         (WebKit::DrawingAreaImpl::DrawingAreaImpl): Initialize m_sequenceNumber.
2766         (WebKit::DrawingAreaImpl::setSize): Record the new sequence number from the UI process.
2767
2768         (WebKit::DrawingAreaImpl::layerHostDidFlushLayers):
2769         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
2770         (WebKit::DrawingAreaImpl::display):
2771         Send m_sequenceNumber, instead of a new sequence number, back to the UI process.
2772
2773         * WebProcess/WebPage/DrawingAreaImpl.h: Added m_sequenceNumber, updated setSize function to
2774         match the base class.
2775
2776 2011-02-21  Gavin Barraclough  <barraclough@apple.com>
2777
2778         Reviewed by Sam Weinig.
2779
2780         Bug 54894 - Make inheritance structure described by ClassInfo match C++ class hierarchy.
2781
2782         The ClassInfo objects describe an inheritance hierarchy, with each ClassInfo instance
2783         containing a pointer to its parent class. These links should reflect the inheritance
2784         hierarchy of C++ classes below JSObject. For the large part it does, but in some cases
2785         entries in the C++ hierarchy are skipped over. This presently likely doesn't matter,
2786         since intervening C++ classes may not have ClassInfo - but would be a potential bug
2787         were ClassInfo were to be added.
2788
2789         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
2790
2791 2011-02-21  Balazs Kelemen  <kbalazs@webkit.org>
2792
2793         Reviewed by Kenneth Rohde Christiansen.
2794
2795         [Qt] Implement WorkQueue::sheduleWorkAfterDelay
2796         https://bugs.webkit.org/show_bug.cgi?id=54878
2797
2798         * Platform/qt/WorkQueueQt.cpp:
2799         (WorkQueue::scheduleWorkAfterDelay):
2800
2801 2011-02-20  Alejandro G. Castro  <alex@igalia.com>
2802
2803         Reviewed by Martin Robinson.
2804
2805         [GTK] Add WebResourceCacheDataManager to the compilation after r78848
2806         https://bugs.webkit.org/show_bug.cgi?id=54732
2807
2808         Added resource cache manager API to GTK+ compilation after r78848.
2809
2810         * GNUmakefile.am:
2811
2812 2011-02-20  Sam Weinig  <sam@webkit.org>
2813
2814         Reviewed by Dan Bernstein.
2815
2816         Crash in WebProcess at com.apple.WebCore: WebCore::Page::goToItem + 46
2817         <rdar://problem/8942726>
2818
2819         * WebProcess/WebPage/WebPage.cpp:
2820         (WebKit::WebPage::goForward):
2821         (WebKit::WebPage::goBack):
2822         (WebKit::WebPage::goToBackForwardItem):
2823         Defend agains null HistoryItems.
2824
2825 2011-02-20  Anders Carlsson  <andersca@apple.com>
2826
2827         Reviewed by Maciej Stachowiak.
2828
2829         Crash when a plug-in requests a javascript: url that destroys the plug-in
2830         https://bugs.webkit.org/show_bug.cgi?id=54837
2831         <rdar://problem/9005475>
2832
2833         * WebProcess/Plugins/PluginProxy.cpp:
2834         (WebKit::PluginProxy::destroy):
2835         Null out m_pluginController.
2836
2837         * WebProcess/Plugins/PluginView.cpp:
2838         (WebKit::PluginView::performJavaScriptURLRequest):
2839         Don't access the frame through m_pluginElement since it will be nulled out
2840         when the plug-in is destroyed.
2841
2842 2011-02-20  Anders Carlsson  <andersca@apple.com>
2843
2844         Reviewed by Sam Weinig.
2845
2846         Fix another crash when a plug-in is destroyed when evaluating JavaScript
2847         https://bugs.webkit.org/show_bug.cgi?id=54834
2848         <rdar://problem/9005475>
2849
2850         This contains three separate fixes:
2851
2852         - In unprotectPluginFromDestruction we can't just destroy the plug-in once
2853           the count reaches zero, because the plug-in might still have code executing
2854           on the stack. To fix this we use a zero-delay timer to defer destruction
2855           of the plug-in.
2856
2857         - Trying to get the NPObject for the window using NPN_GetValue would return
2858           NPERR_NO_ERROR, even if the returned NPObject was null. Fix this to return
2859           NPERR_GENERIC_ERROR instead.
2860
2861         - Protect the plug-in from destruction anytime an NPAPI call that sends a 
2862           synchronous IPC message is made.
2863
2864         * PluginProcess/PluginControllerProxy.cpp:
2865         (WebKit::PluginControllerProxy::PluginControllerProxy):
2866         (WebKit::PluginControllerProxy::destroy):
2867         (WebKit::PluginControllerProxy::unprotectPluginFromDestruction):
2868         * PluginProcess/PluginControllerProxy.h:
2869         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2870         (WebKit::PluginDestructionProtector::PluginDestructionProtector):
2871         (WebKit::NPN_GetValue):
2872         (WebKit::NPN_Evaluate):
2873         (WebKit::NPN_GetProperty):
2874         (WebKit::NPN_SetProperty):
2875         (WebKit::NPN_RemoveProperty):
2876         (WebKit::NPN_HasProperty):
2877         (WebKit::NPN_HasMethod):
2878         (WebKit::NPN_Enumerate):
2879         (WebKit::NPN_Construct):
2880         (WebKit::NPN_GetValueForURL):
2881         (WebKit::NPN_SetValueForURL):
2882
2883 2011-02-19  Sam Weinig  <sam@webkit.org>
2884
2885         Reviewed by Anders Carlsson.
2886
2887         Add phase in addition to momentumPhase to platform wheel events
2888         Part of <rdar://problem/8945362>
2889
2890         Rename existing phase to momentumPhase.
2891
2892         * Shared/WebEvent.h:
2893         (WebKit::WebWheelEvent::momentumPhase):
2894         * Shared/WebEventConversion.cpp:
2895         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
2896         * Shared/WebWheelEvent.cpp:
2897         (WebKit::WebWheelEvent::WebWheelEvent):
2898         (WebKit::WebWheelEvent::encode):
2899         (WebKit::WebWheelEvent::decode):
2900         * Shared/mac/WebEventFactory.mm:
2901         (WebKit::phaseForEvent):
2902         (WebKit::momentumPhaseForEvent):
2903         (WebKit::WebEventFactory::createWebWheelEvent):
2904
2905 2011-02-19  Anders Carlsson  <andersca@apple.com>
2906
2907         Reviewed by Dan Bernstein.
2908
2909         Crash when trying to take a snapshot of an uninitialized plug-in
2910         https://bugs.webkit.org/show_bug.cgi?id=54812
2911
2912         * WebProcess/Plugins/PluginView.cpp:
2913         (WebKit::PluginView::notifyWidget):
2914         Don't try to create a snapshot of the plug-in if it hasn't been initialized.
2915
2916 2011-02-18  Gavin Barraclough  <barraclough@apple.com>
2917
2918         Reviewed by Sam Weinig.
2919
2920         Bug 54786 - Devirtualize JSCell::classInfo()
2921
2922         Instead of making a virtual function call, add a pointer to the ClassInfo
2923         onto Structure.
2924
2925         This removes a virtual function call, and paves the way towards removing all
2926         the createStructure methods, and StructureFlags/AnonymousSlotCount properties
2927         (these should be able to move onto ClassInfo).
2928
2929         Calls to Structure::create must now pass a pointer to the ClassInfo for the
2930         structure. All objects now have a ClassInfo pointer, non-object cell types
2931         still do not.
2932
2933         Changes are most mechanical, involving three steps:
2934             * Remove virtual classInfo() methods.
2935             * Add &s_info parameter to calls to Structure::create.
2936             * Rename ClassInfo static members on classes from 'info' to 's_info',
2937               for consistency.
2938
2939         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
2940         (WebKit::JSNPMethod::JSNPMethod):
2941         * WebProcess/Plugins/Netscape/JSNPMethod.h:
2942         (WebKit::JSNPMethod::createStructure):
2943         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
2944         (WebKit::JSNPObject::JSNPObject):
2945         * WebProcess/Plugins/Netscape/JSNPObject.h:
2946         (WebKit::JSNPObject::createStructure):
2947
2948 2011-02-19  Sam Weinig  <sam@webkit.org>
2949
2950         Reviewed by Anders Carlsson.
2951
2952         Rename performLookupAtCurrentMouseLocation to performDictionaryLookupAtCurrentMouseLocation
2953
2954         * UIProcess/API/mac/WKView.mm:
2955         (-[WKView performDictionaryLookupAtCurrentMouseLocation]):
2956         * UIProcess/API/mac/WKViewPrivate.h:
2957
2958 2011-02-19  Charlie Reis  <creis@chromium.org>
2959
2960         Reviewed by Mihai Parparita.
2961
2962         Ensure loading has stopped in HistoryController::goToItem
2963         https://bugs.webkit.org/show_bug.cgi?id=54517
2964
2965         Add a FrameLoaderClient callback for whether to stop loading before goToItem.
2966
2967         Test: http/tests/navigation/forward-to-fragment-fires-onload.html
2968
2969         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2970         (WebFrameLoaderClient::shouldStopLoadingForHistoryItem): Added.
2971         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2972
2973 2011-02-18  Sam Weinig  <sam@webkit.org>
2974
2975         Reviewed by Adele Peterson.
2976
2977         Real fix for <rdar://problem/9025723> CrashTracer: [USER] 
2978         1 crash in WebProcess at com.apple.WebKit2: 
2979         WebKit::WebPage::didChangeScrollOffsetForMainFrame + 31
2980
2981         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2982         (WebKit::WebFrameLoaderClient::didChangeScrollOffset):
2983         Add null check for the FrameView. This function can be called when the
2984         FrameView is being torn down during a transition to a new FrameView.
2985
2986         * WebProcess/WebPage/WebPage.cpp:
2987         (WebKit::WebPage::didChangeScrollOffsetForMainFrame):
2988         Revert last attempt.
2989
2990 2011-02-18  Anders Carlsson  <andersca@apple.com>
2991
2992         Reviewed by Sam Weinig.
2993
2994         Hang trying to load nytimes.com with Flash installed
2995         <rdar://problem/9018113> 
2996
2997         * Platform/CoreIPC/Connection.cpp:
2998         (CoreIPC::Connection::sendSyncMessage):
2999         Call beginWaitForSyncReply() before sending the message. Otherwise, in some cases we could
3000         have gotten back a synchronous request before calling beginWaitForSyncReply(), and then we wouldn't
3001         process it correctly. (Which would lead to the hang).
3002
3003 2011-02-18  Simon Fraser  <simon.fraser@apple.com>
3004
3005         Reviewed by Kevin Decker.
3006
3007         <rdar://problem/9021296> Some plug-ins are the wrong size after zooming
3008         
3009         Use the same frame/bounds adjustment that we use for NSView-based
3010         plugins in WebKit2, which allows plug-ins and their snapshots to
3011         render with the correct size after scaling.
3012
3013         * WebProcess/Plugins/PluginView.cpp:
3014         (WebKit::PluginView::setBoundsSize):
3015         (WebKit::PluginView::viewGeometryDidChange):
3016         (WebKit::PluginView::clipRectInWindowCoordinates):
3017         * WebProcess/Plugins/PluginView.h:
3018
3019 2011-02-18  Beth Dakin  <bdakin@apple.com>
3020
3021         Rubber-stamped by Adele Peterson.
3022
3023         Fix for <rdar://problem/9025723> CrashTracer: [USER] 
3024         1 crash in WebProcess at com.apple.WebKit2: 
3025         WebKit::WebPage::didChangeScrollOffsetForMainFrame + 31
3026
3027         Simple null-check.
3028         * WebProcess/WebPage/WebPage.cpp:
3029         (WebKit::WebPage::didChangeScrollOffsetForMainFrame):
3030
3031 2011-02-18  Viatcheslav Ostapenko  <ostapenko.viatcheslav@nokia.com>
3032
3033         Reviewed by Kenneth Rohde Christiansen.
3034
3035         Tiled backing store area is too big.
3036         Error in area calculcation causes size of backing store
3037         up to 8 times bigger than viewport with default multipliers.
3038         https://bugs.webkit.org/show_bug.cgi?id=54587
3039
3040         * UIProcess/TiledDrawingAreaProxy.cpp:
3041         (WebKit::TiledDrawingAreaProxy::calculateKeepRect):
3042         (WebKit::TiledDrawingAreaProxy::calculateCoverRect):
3043
3044 2011-02-18  John Sullivan  <sullivan@apple.com>
3045
3046         Reviewed by Maciej Stachowiak.
3047
3048         <rdar://problem/9026169>
3049         https://bugs.webkit.org/show_bug.cgi?id=54780
3050         pendingAPIRequestURL isn't updated for WKPageGoToBackForwardListItem
3051
3052         * UIProcess/WebPageProxy.cpp:
3053         (WebKit::WebPageProxy::goToBackForwardItem):
3054         Update the pending API URL.
3055
3056 2011-02-18  Anders Carlsson  <andersca@apple.com>
3057
3058         Reviewed by Sam Weinig.
3059
3060         Accelerated content fades in when using a layer backed WKView
3061         <rdar://problem/9021586>
3062
3063         * UIProcess/API/mac/WKView.mm:
3064         (-[WKView _enterAcceleratedCompositingMode:]):
3065         Make a new nested CATransaction and disable animations when adding the layer 
3066         hosting subview. This avoids an implicit fade animation that would otherwise occur.
3067
3068 2011-02-18  Simon Fraser  <simon.fraser@apple.com>
3069
3070         Reviewed by Dan Bernstein.
3071
3072         Plugin snapshot location is wrong for subframes
3073         https://bugs.webkit.org/show_bug.cgi?id=54776
3074         
3075         Only change the CTM to the way that the plugin expects it
3076         when painting the plugin, not when drawing the snapshot.
3077         This fixes the snapshot location when painting flattened
3078         frames.
3079
3080         * WebProcess/Plugins/PluginView.cpp:
3081         (WebKit::PluginView::paint):
3082
3083 2011-02-18  Anders Carlsson  <andersca@apple.com>
3084
3085         Reviewed by Simon Fraser.
3086
3087         Implement NetscapePlugin::pluginComplexTextInputIdentifier
3088         https://bugs.webkit.org/show_bug.cgi?id=54770
3089
3090         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
3091         (WebKit::NetscapePlugin::pluginComplexTextInputIdentifier):
3092
3093 2011-02-18  Sam Weinig  <sam@webkit.org>
3094
3095         Reviewed by Maciej Stachowiak.
3096
3097         Add the ability to ask the WKPage if the main frame is pinned
3098         to the right or left hand side.
3099         Part of <rdar://problem/9017043>.
3100
3101         * UIProcess/API/C/WKPage.cpp:
3102         (WKPageIsPinnedToLeftSide):
3103         (WKPageIsPinnedToRightSide):
3104         * UIProcess/API/C/WKPage.h:
3105         Add new API calls.
3106
3107         * UIProcess/WebPageProxy.cpp:
3108         (WebKit::WebPageProxy::WebPageProxy):
3109         (WebKit::WebPageProxy::close):
3110         (WebKit::WebPageProxy::processDidCrash):
3111         (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
3112         * UIProcess/WebPageProxy.h:
3113         (WebKit::WebPageProxy::isPinnedToLeftSide):
3114         (WebKit::WebPageProxy::isPinnedToRightSide):
3115         Initialize, reset and update the pinned state.
3116
3117         * UIProcess/WebPageProxy.messages.in:
3118         Add message to update the pinned state.
3119
3120         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3121         (WebKit::WebFrameLoaderClient::didChangeScrollOffset):
3122         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3123         * WebProcess/WebPage/WebPage.cpp:
3124         (WebKit::WebPage::WebPage):
3125         (WebKit::WebPage::didChangeScrollOffsetForMainFrame):
3126         * WebProcess/WebPage/WebPage.h:
3127         Cache the pinned state, and only update the UIProcess when it
3128         changes.
3129
3130 2011-02-18  Anders Carlsson  <andersca@apple.com>
3131
3132         Reviewed by Simon Fraser.
3133
3134         Fix assertion in SharedMemory::create when trying to snapshot 0x0 plug-in
3135         https://bugs.webkit.org/show_bug.cgi?id=54768
3136
3137         * PluginProcess/PluginControllerProxy.cpp:
3138         (WebKit::PluginControllerProxy::snapshot):
3139         Don't try to create a handle from a null ShareableBitmap.
3140
3141         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3142         (WebKit::NetscapePlugin::snapshot):
3143         Check for a zero sized plug-in before trying to create a snapshot.
3144
3145 2011-02-18  Anders Carlsson  <andersca@apple.com>
3146
3147         Reviewed by Simon Fraser.
3148
3149         WKView flashes when entering/exiting compositing mode
3150         https://bugs.webkit.org/show_bug.cgi?id=54695
3151         <rdar://problem/9011554>
3152
3153         * UIProcess/API/mac/WKView.mm:
3154         (-[WKView _exitAcceleratedCompositingMode]):
3155         Remove the layer hosting view before clearing out its layer, otherwise we can get
3156         white flashes when exiting accelerated compositing mode.
3157
3158         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3159         When entering accelerated compositing mode, we want to defer sending the message
3160         until we've actually committed the layer tree and pushed all changes over to the
3161         UI process.
3162
3163         (WebKit::DrawingAreaImpl::layerHostDidFlushLayers):
3164         Tell the layer tree host to force a repaint. This will ensure that all layer tree
3165         changes are pushed over to the UI process. When that is done, send the new layer tree
3166         context over to the UI process.
3167
3168         (WebKit::DrawingAreaImpl::setRootCompositingLayer):
3169         When exiting compositing mode in response to a didSetSize, we want to exit accelerated 
3170         compositing mode right away to avoid flashes. This is safe since we've laid out the page
3171         already so we won't end up reentering setRootCompositingLayer.
3172
3173         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
3174         Tell the layer tree host to notify us when the next layer tree flush happened, so we can
3175         let the UI process know. If we're entering accelerated compositing mode in response to a
3176         SetSize message, the new layer tree context will be passed in the DidSetSize message.
3177
3178         * WebProcess/WebPage/DrawingAreaImpl.h:
3179         Add layerHostDidFlushLayers.
3180
3181         * WebProcess/WebPage/LayerTreeHost.h:
3182         Add setShouldNotifyAfterNextScheduledLayerFlush.
3183
3184         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
3185         Add a m_notifyAfterScheduledLayerFlush flag.
3186
3187         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
3188         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
3189         Initialize m_notifyAfterScheduledLayerFlush to false.
3190
3191         (WebKit::LayerTreeHostMac::setShouldNotifyAfterNextScheduledLayerFlush):
3192         Set m_notifyAfterScheduledLayerFlush to true.
3193
3194         (WebKit::LayerTreeHostMac::flushPendingLayerChangesRunLoopObserverCallback):
3195         If m_notifyAfterScheduledLayerFlush is true, call DrawingAreaImpl::layerHostDidFlushLayers.
3196
3197 2011-02-18  Alexey Proskuryakov  <ap@apple.com>
3198
3199         Reviewed by Adele Peterson.
3200
3201         REGRESSION (WebKit2): Wrong frame printed on tivofaq.com
3202         https://bugs.webkit.org/show_bug.cgi?id=54677
3203         <rdar://problem/8994133>
3204
3205         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3206         (WebKit::area): Use visible frame bounds.
3207         (WebKit::findLargestFrameInFrameSet): Added a comment explaining what we're up to here.
3208         WebKit2 shouldn't be making policy decisions for the client, but it gets dangerously close
3209         to that. We used to expose the same as WK1 API though.
3210
3211 2011-02-18  Balazs Kelemen  <kbalazs@webkit.org>
3212
3213         Unreviwed.
3214
3215         Remove CleanupHandler since we do not use it anymore.
3216
3217         * Shared/qt/CleanupHandler.cpp: Removed.
3218         * Shared/qt/CleanupHandler.h: Removed.
3219
3220 2011-02-18  Alejandro G. Castro  <alex@igalia.com>
3221
3222         Fix GTK build by fixing signature of platformPaint(), required after r78956.
3223
3224         * WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp:
3225         (WebKit::NetscapePlugin::platformPaint):
3226
3227 2011-02-17  Dan Bernstein  <mitz@apple.com>
3228
3229         LLVM Compiler build fix.
3230
3231         * UIProcess/WebResourceCacheManagerProxy.h:
3232         * WebProcess/ResourceCache/WebResourceCacheManager.h:
3233
3234 2011-02-17  Simon Fraser  <simon.fraser@apple.com>
3235
3236         Fix Windows and Qt builds by fixing signature of platformPaint().
3237
3238         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp:
3239         (WebKit::NetscapePlugin::platformPaint):
3240         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
3241         (WebKit::NetscapePlugin::platformPaint):
3242
3243 2011-02-17  Simon Fraser  <simon.fraser@apple.com>
3244
3245         Reviewed by Sam Weinig.
3246
3247         WebKit2 snapshots don't show plug-ins
3248         https://bugs.webkit.org/show_bug.cgi?id=54716
3249         
3250         Fix WebKit2 plug-ins to do a software paint for
3251         snapshotting.
3252
3253         * PluginProcess/PluginControllerProxy.h:
3254         * PluginProcess/PluginControllerProxy.cpp:
3255         (WebKit::PluginControllerProxy::snapshot): Respond to the snapshot
3256         message by getting a sharable bitmap from the plugin, and returning
3257         a handle to it in the reply.
3258
3259         * PluginProcess/PluginControllerProxy.messages.in: Add the snapshot
3260         message.
3261         
3262         * Shared/Plugins/PluginQuirks.h:
3263         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
3264         (WebKit::NetscapePluginModule::determineQuirks): Add a quirk for the
3265         ability to be snapshotted, which we only set for Flash at the moment.
3266         
3267         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
3268         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3269         (WebKit::NetscapePlugin::snapshot): Create a shareable bitmap, and
3270         paint into it.
3271         (WebKit::NetscapePlugin::supportsSnapshotting): Test the quirk.
3272
3273         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
3274         (WebKit::NetscapePlugin::platformPaint): Allow the paint to happen
3275         if we're snapshotting, even when using the CoreAnimation drawing
3276         model.
3277         
3278         * WebProcess/Plugins/Plugin.h: New snapshot method.
3279         
3280         * WebProcess/Plugins/PluginProxy.h:
3281         * WebProcess/Plugins/PluginProxy.cpp:
3282         (WebKit::PluginProxy::snapshot): Send a sync message to the plugin process,
3283         asking for a snapshot in a shareble bitmap.
3284         
3285         * WebProcess/Plugins/PluginView.h:
3286         * WebProcess/Plugins/PluginView.cpp:
3287         (WebKit::PluginView::paint): Use the snapshot if we have one, to avoid
3288         calling into the plugin to draw, which may run script.
3289         
3290         (WebKit::PluginView::notifyWidget): Generate the snapshot before
3291         a flattening paint, and throw it away after.
3292
3293 2011-02-17  Jessie Berlin  <jberlin@apple.com>
3294
3295         Reviewed by Adam Roben.
3296
3297         WebKit2: The CFNetwork Cache should be shared between the UI Process and the Web Process on
3298         Windows.
3299         https://bugs.webkit.org/show_bug.cgi?id=54683
3300
3301         * Shared/WebProcessCreationParameters.cpp:
3302         (WebKit::WebProcessCreationParameters::encode):
3303         (WebKit::WebProcessCreationParameters::decode):
3304         * Shared/WebProcessCreationParameters.h:
3305  
3306         * UIProcess/win/WebContextWin.cpp:
3307         (WebKit::WebContext::platformInitializeWebProcess):
3308         Make sure to remove the ending slash, as CFNetwork does not recognize the directory with
3309         that slash.
3310
3311         * WebProcess/win/WebProcessWin.cpp:
3312         (WebKit::WebProcess::platformInitializeWebProcess):
3313         Create a cache using the path, disk capacity, and memory capacity and set it as default.
3314
3315 2011-02-17  Anders Carlsson  <andersca@apple.com>
3316
3317         Reviewed by Sam Weinig.
3318
3319         Web and/or plug-in process crashes when NPN_Evaluate destroys the plug-in
3320         https://bugs.webkit.org/show_bug.cgi?id=54686
3321         <rdar://problem/9013384>
3322
3323         This patch fixes two bugs with a plug-in calling NPN_Evaluate to destroy itself:
3324
3325         - The PluginProxy object would be destroyed in the middle of PluginProxy::evaluate.
3326           This would cause the web process to crash.
3327
3328         - The PluginControllerProxy would call NPP_Destroy while the plug-in was busy running
3329           code. This would cause the plug-in process to crash.
3330
3331         To fix this, we add protectPluginFromDestruction/unprotectPluginFromDestruction to
3332         PluginControllerProxy and use it to defer calling destroy() in the plug-in process,
3333         and defer actually destroying the plug-in in the web process.
3334
3335         https://bugs.webkit.org/show_bug.cgi?id=54171 tracks adding a test for this.
3336
3337         * PluginProcess/PluginControllerProxy.cpp:
3338         (WebKit::PluginControllerProxy::PluginControllerProxy):
3339         (WebKit::PluginControllerProxy::destroy):
3340         (WebKit::PluginControllerProxy::evaluate):
3341         (WebKit::PluginControllerProxy::protectPluginFromDestruction):
3342         (WebKit::PluginControllerProxy::unprotectPluginFromDestruction):
3343         * PluginProcess/PluginControllerProxy.h:
3344         (WebKit::PluginControllerProxy::asPluginController):
3345         * PluginProcess/WebProcessConnection.cpp:
3346         (WebKit::WebProcessConnection::destroyPluginControllerProxy):
3347         (WebKit::WebProcessConnection::didReceiveMessage):
3348         (WebKit::WebProcessConnection::didReceiveSyncMessage):
3349         * PluginProcess/WebProcessConnection.h:
3350         (WebKit::WebProcessConnection::connection):
3351         * WebProcess/Plugins/PluginController.h:
3352         (WebKit::PluginController::PluginDestructionProtector::PluginDestructionProtector):
3353         (WebKit::PluginController::PluginDestructionProtector::~PluginDestructionProtector):
3354         * WebProcess/Plugins/PluginProxy.cpp:
3355         (WebKit::PluginProxy::evaluate):
3356         * WebProcess/Plugins/PluginView.cpp:
3357         (WebKit::PluginView::protectPluginFromDestruction):
3358         (WebKit::PluginView::unprotectPluginFromDestruction):
3359         * WebProcess/Plugins/PluginView.h:
3360
3361 2011-02-17  Sam Weinig  <sam@webkit.org>
3362
3363         Build fix.
3364
3365         * WebProcess/WebPage/mac/WebPageMac.mm:
3366         (WebKit::WebPage::performDictionaryLookupAtLocation):
3367
3368 2011-02-17  Sam Weinig  <sam@webkit.org>
3369
3370         Reviewed by Maciej Stachowiak.
3371
3372         WebKit2: Support Dictionary popup
3373         <rdar://problem/7660670>
3374
3375         * Shared/TextInfo.cpp: Added.
3376         (WebKit::TextInfo::encode):
3377         (WebKit::TextInfo::decode):
3378         * Shared/TextInfo.h: Added.
3379         (WebKit::TextInfo::TextInfo):
3380         Add class to represent the location and style of a run of text.
3381
3382         * UIProcess/PageClient.h:
3383         * UIProcess/API/mac/PageClientImpl.h:
3384         * UIProcess/API/mac/PageClientImpl.mm:
3385         (WebKit::PageClientImpl::didPerformDictionaryLookup):
3386         Invoke the dictionary popup.
3387
3388         * UIProcess/API/mac/WKView.mm:
3389         (-[WKView performLookupAtCurrentMouseLocation]):
3390         Tell the WebProcess to get get the text under the mouse and cause
3391         the dictionary popup to appear.
3392
3393         * UIProcess/API/mac/WKViewPrivate.h:
3394         Add performLookupAtCurrentMouseLocation.
3395
3396         * UIProcess/WebPageProxy.cpp:
3397         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
3398         (WebKit::WebPageProxy::didPerformDictionaryLookup):
3399         * UIProcess/WebPageProxy.h:
3400         * UIProcess/WebPageProxy.messages.in:
3401         * WebProcess/WebPage/WebPage.cpp:
3402         * WebProcess/WebPage/WebPage.h:
3403         * WebProcess/WebPage/WebPage.messages.in:
3404         Pipe messages through.
3405
3406         * WebProcess/WebPage/mac/WebPageMac.mm:
3407         (WebKit::characterRangeAtPoint): Fix to return PassRefPtr
3408         and not potentially stale pointers.
3409
3410         (WebKit::WebPage::characterIndexForPoint):
3411         Change to use a RefPtr.
3412
3413         (WebKit::WebPage::performDictionaryLookupAtLocation):
3414         Add simple heuristic to get the word at the current point (or the current selection
3415         if it is at that point) and grab the style of the word to send the UIProcess.
3416
3417         * WebKit2.pro:
3418         * WebKit2.xcodeproj/project.pbxproj:
3419         * win/WebKit2.vcproj:
3420         Add new files.
3421
3422 2011-02-17  Brian Weinstein  <bweinstein@apple.com>
3423
3424         Qt build fix.
3425
3426         * WebKit2.pro: Update after renaming of MemoryCache to ResourceCache.
3427
3428 2011-02-17  Brian Weinstein  <bweinstein@apple.com>
3429
3430         Mac build fix.
3431
3432         * WebKit2.xcodeproj/project.pbxproj: Use relative to group instead of absolute paths. Not everyone's home
3433             directory is /Users/brian_weinstein.
3434
3435 2011-02-16  Brian Weinstein  <bweinstein@apple.com>
3436
3437         Reviewed by Brady Eidson.
3438
3439         WebKit2: Need a way to manage the WebCore Cache
3440         https://bugs.webkit.org/show_bug.cgi?id=54501
3441         
3442         Implement a WebKit2 API to manage the WebCore memory cache. This API exposes three functions:
3443         
3444         1) A method to get a list of all security origins that have entries in the WebCore memory cache.
3445         2) A method to remove all entries in the WebCore memory cache from a SecurityOrigin.
3446         3) A method to remove all entries from the WebCore memory cache.
3447
3448         * Platform/CoreIPC/MessageID.h: Add two new MessageClasses.
3449         * Shared/API/c/WKBase.h:
3450         * Shared/APIObject.h: Add a CacheManager type.
3451         * Shared/WebSecurityOrigin.h: Typedef WKCacheManagerRef.
3452         (WebKit::WebSecurityOrigin::createFromString): Creates a WebCore::SecurityOrigin using 
3453             SecurityOrigin::createFromString.
3454         (WebKit::WebSecurityOrigin::toString): Calls through to SecurityOrigin::toString.
3455         * UIProcess/API/C/WKAPICast.h:
3456
3457         * UIProcess/API/C/WKCacheManager.cpp: Added.
3458         (WKCacheManagerGetTypeID): Returns the WebResourceCacheManagerProxy type.
3459         (WKCacheManagerGetCacheOrigins): Calls through to WebResourceCacheManagerProxy::getCacheOrigins.
3460         (callGetCacheOriginsBlockBlockAndDispose):
3461         (WKCacheManagerGetCacheOrigins_b):
3462         (WKCacheManagerDeleteCacheForOrigin): Calls through to WebResourceCacheManagerProxy::deleteCacheForOrigin.
3463         (WKCacheManagerDeleteAllCache): Calls through to WebResourceCacheManagerProxy::deleteAllCache.
3464         * UIProcess/API/C/WKCacheManager.h: Added.
3465
3466         * UIProcess/API/C/WKContext.cpp:
3467         (WKContextGetCacheManager): Calls to get the WebResourceCacheManagerProxy.
3468         * UIProcess/API/C/WKContext.h:
3469
3470         * UIProcess/WebResourceCacheManagerProxy.cpp: Added.
3471         (WebKit::WebResourceCacheManagerProxy::create): Calls through to the constructor.
3472         (WebKit::WebResourceCacheManagerProxy::WebResourceCacheManagerProxy): Initialize the m_webContext variable.
3473         (WebKit::WebResourceCacheManagerProxy::~WebResourceCacheManagerProxy):
3474         (WebKit::WebResourceCacheManagerProxy::invalidate): Invalidate the callback map.
3475         (WebKit::WebResourceCacheManagerProxy::getCacheOrigins): Call through to the web process to get the cache
3476             origins.
3477         (WebKit::WebResourceCacheManagerProxy::didGetCacheOrigins): Call the callback.
3478         (WebKit::WebResourceCacheManagerProxy::deleteCacheForOrigin): Call through to the web process to delete cache
3479             for the given origin. 
3480         (WebKit::WebResourceCacheManagerProxy::deleteAllCache): Call through to the web process to delete all of the cache.
3481         * UIProcess/WebResourceCacheManagerProxy.h: Added.
3482         (WebKit::WebResourceCacheManagerProxy::clearContext):
3483         (WebKit::WebResourceCacheManagerProxy::type):
3484         * UIProcess/WebResourceCacheManagerProxy.messages.in: Added.
3485
3486         * UIProcess/WebContext.cpp:
3487         (WebKit::WebContext::WebContext): Initialize new member variable.
3488         (WebKit::WebContext::~WebContext):  Invalidates new member variable.
3489         (WebKit::WebContext::didReceiveMessage): Passes cache messages to the cache manager.
3490         * UIProcess/WebContext.h:
3491         (WebKit::WebContext::cacheManagerProxy):
3492         * UIProcess/WebProcessProxy.cpp:
349