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