diff options
author | Ben Murdoch <benm@google.com> | 2011-06-02 12:07:03 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-06-10 10:47:21 +0100 |
commit | 2daae5fd11344eaa88a0d92b0f6d65f8d2255c00 (patch) | |
tree | e4964fbd1cb70599f7718ff03e50ea1dab33890b /Source/WebKit/chromium | |
parent | 87bdf0060a247bfbe668342b87e0874182e0ffa9 (diff) | |
download | external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.zip external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.gz external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.bz2 |
Merge WebKit at r84325: Initial merge by git.
Change-Id: Ic1a909300ecc0a13ddc6b4e784371d2ac6e3d59b
Diffstat (limited to 'Source/WebKit/chromium')
126 files changed, 3442 insertions, 664 deletions
diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog index 8becdba..dce7bf9 100644 --- a/Source/WebKit/chromium/ChangeLog +++ b/Source/WebKit/chromium/ChangeLog @@ -1,3 +1,1452 @@ +2011-04-19 Evan Martin <evan@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] didReceiveTitle API signature should not change + https://bugs.webkit.org/show_bug.cgi?id=58909 + + My previous attempt at a temporary shim was wrong. + This second try should correctly work with older clients. + + * public/WebFrameClient.h: + (WebKit::WebFrameClient::didReceiveTitle): + +2011-04-19 Jungshik Shin <jshin@chromium.org> + + Reviewed by Adam Barth + + Fix the compile failure in UniscribeHelperTest.cpp due to + a change in UniscribeHelper made by the CL for bug 48860 + (r84264) + + http://bugs.webkit.org/show_bug.cgi?id=48860 + + * tests/UniscribeHelperTest.cpp: + (TEST_F): + +2011-04-19 Stuart Morgan <stuartmorgan@chromium.org> + + Reviewed by Tony Chang. + + [chromium] Clicking on plugin for first time blocks focus shift + https://bugs.webkit.org/show_bug.cgi?id=58419 + + Switched to using FocusController when moving focus to a plugin + so that cross-frame focus changes are handled correctly. + + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::handleMouseEvent): + +2011-04-19 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: Rename lengthReceived to encodedDataLength/dataLength + https://bugs.webkit.org/show_bug.cgi?id=58883 + + Renamed lengthReceived to encodedDataLength/dataLength. + + * public/WebURLLoaderClient.h: + (WebKit::WebURLLoaderClient::didReceiveData): + * src/AssociatedURLLoader.cpp: + (WebKit::AssociatedURLLoader::ClientAdapter::didReceiveCachedMetadata): + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::dispatchDidReceiveContentLength): + * src/FrameLoaderClientImpl.h: + * src/ResourceHandle.cpp: + (WebCore::ResourceHandleInternal::didReceiveData): + +2011-04-19 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + Chromium DevTools: Network panel timing test is flaky + https://bugs.webkit.org/show_bug.cgi?id=58699 + + Fixed network timing test flakiness. + + * src/js/Tests.js: + (.TestSuite.prototype.testNetworkTiming.finishResource): + +2011-04-19 Andrey Kosyakov <caseq@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: add chrome.devTools alias to webInspector namespace for chromium port + https://bugs.webkit.org/show_bug.cgi?id=58894 + + * src/js/DevTools.js: + (WebInspector.platformExtensionAPI): + +2011-04-19 Kinuko Yasuda <kinuko@chromium.org> + + Not reviewed; another build fix attempt. + + * src/StorageInfoChromium.cpp: + (WebCore::StorageInfo::queryUsageAndQuota): + (WebCore::StorageInfo::requestQuota): + * src/WebStorageQuotaCallbacksImpl.cpp: + (WebKit::WebStorageQuotaCallbacksImpl::WebStorageQuotaCallbacksImpl): + * src/WebStorageQuotaCallbacksImpl.h: + +2011-04-19 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by David Levin. + + [Chromium] Enable QUOTA API at runtime if enable-quota flag is given + https://bugs.webkit.org/show_bug.cgi?id=58784 + + * features.gypi: Added ENABLE_QUOTA=1. + * public/WebRuntimeFeatures.h: + * src/WebRuntimeFeatures.cpp: + (WebKit::WebRuntimeFeatures::enableQuota): Added. + (WebKit::WebRuntimeFeatures::isQuotaEnabled): Added. + +2011-04-19 John Gregg <johnnyg@google.com> + + Reviewed by Darin Fisher. + + Enable folder drag-n-drop when using a "webkitdirectory" file input + https://bugs.webkit.org/show_bug.cgi?id=58401 + + This uses a new ChromeClient API to enumerate the directory and + return all the files, as if the user had selected that directory + by clicking the control in the normal way. + + * public/WebViewClient.h: + (WebKit::WebViewClient::enumerateChosenDirectory): + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::enumerateChosenDirectory): + * src/ChromeClientImpl.h: + +2011-04-18 Evan Martin <evan@chromium.org> + + Reviewed by Eric Seidel. + + [chromium] expose title direction to webkit client + https://bugs.webkit.org/show_bug.cgi?id=58823 + + * public/WebFrameClient.h: + (WebKit::WebFrameClient::didReceiveTitle): + Add new param to API. + + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::dispatchDidReceiveTitle): + Pass new param in API. + +2011-04-17 Patrick Gansterer <paroga@webkit.org> + + Reviewed by Adam Barth. + + Rename PLATFORM(CG) to USE(CG) + https://bugs.webkit.org/show_bug.cgi?id=58729 + + * src/GraphicsContext3DChromium.cpp: + (WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal): + (WebCore::GraphicsContext3DInternal::~GraphicsContext3DInternal): + (WebCore::GraphicsContext3DInternal::paintRenderingResultsToCanvas): + (WebCore::GraphicsContext3DInternal::reshape): + * src/GraphicsContext3DInternal.h: + * src/PlatformBridge.cpp: + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::doPixelReadbackToCanvas): + +2011-04-15 John Bates <jbates@google.com> + + Reviewed by Kenneth Russell. + + Change WebGraphicsContext3D virtuals to pure virtuals as intended + https://bugs.webkit.org/show_bug.cgi?id=58479 + + * public/WebGraphicsContext3D.h: + +2011-04-15 Shishir Agrawal <shishir@chromium.org> + + Reviewed by James Robinson. + + Add a flag to guard Page Visibility API changes. + https://bugs.webkit.org/show_bug.cgi?id=58464 + + * features.gypi: + +2011-04-15 Charlie Reis <creis@chromium.org> + + Reviewed by Darin Fisher. + + [Chromium] fast/events/popup-allowed-from-gesture-initiated-form-submit.html causing debug ASSERT + https://bugs.webkit.org/show_bug.cgi?id=44079 + + Remove an assert whose invariant doesn't hold. + + * src/FrameLoaderClientImpl.cpp: + +2011-04-15 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by David Levin. + + Expose unified Quota API if QUOTA build flag is enabled + https://bugs.webkit.org/show_bug.cgi?id=58648 + + * src/AssertMatchingEnums.cpp: Added enum assertions. + * src/StorageInfoChromium.cpp: Made a build fix. + +2011-04-15 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: Rename rawRequestHeadersText and RawResponseHeadersText to requestHeadersText and responseHeadersText + https://bugs.webkit.org/show_bug.cgi?id=58650 + + * public/WebHTTPLoadInfo.h: + * src/WebHTTPLoadInfo.cpp: + (WebKit::WebHTTPLoadInfo::requestHeadersText): + (WebKit::WebHTTPLoadInfo::setRequestHeadersText): + (WebKit::WebHTTPLoadInfo::responseHeadersText): + (WebKit::WebHTTPLoadInfo::setResponseHeadersText): + +2011-04-15 Zelidrag Hornung <zelidrag@chromium.org> + + Reviewed by Darin Fisher. + + Added enums for external file system type and exposed factory function + for creating File- and DirectoryEntry objects from Chromium side. + https://bugs.webkit.org/show_bug.cgi?id=58456 + + * public/WebFileSystem.h: + * public/WebFrame.h: + * src/AssertMatchingEnums.cpp: + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::createFileSystem): + (WebKit::WebFrameImpl::createFileEntry): + * src/WebFrameImpl.h: + +2011-04-15 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: [Chromium] Create tests for network panel timing, size and raw headers text + https://bugs.webkit.org/show_bug.cgi?id=58566 + + Added network timing, size and raw headers tests for Inspector + Since chromium used different version of network stack for layout + tests, these are interactive ui tests (DevToolsSanityTest.TestNetwork*) + + * src/js/Tests.js: + (.TestSuite.prototype.testNetworkSize.finishResource): + (.TestSuite.prototype.testNetworkSyncSize.finishResource): + (.TestSuite.prototype.testNetworkRawHeadersText.finishResource): + (.TestSuite.prototype.testNetworkTiming.finishResource): + +2011-04-14 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: Enable raw HTTP headers support + https://bugs.webkit.org/show_bug.cgi?id=58259 + + Added raw headers text support to inspector. + + * public/WebHTTPLoadInfo.h: + * src/WebHTTPLoadInfo.cpp: + (WebKit::WebHTTPLoadInfo::rawRequestHeadersText): + (WebKit::WebHTTPLoadInfo::setRawRequestHeadersText): + (WebKit::WebHTTPLoadInfo::rawResponseHeadersText): + (WebKit::WebHTTPLoadInfo::setRawResponseHeadersText): + +2011-04-14 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: ResourceResponse should have encodedDataLength field for synchronous requests transfer size + https://bugs.webkit.org/show_bug.cgi?id=58447 + + FrameLoader now takes encoded data length for synchronous requests from the field with the same name. + + * public/WebHTTPLoadInfo.h: + * src/WebHTTPLoadInfo.cpp: + (WebKit::WebHTTPLoadInfo::encodedDataLength): + (WebKit::WebHTTPLoadInfo::setEncodedDataLength): + +2011-04-14 Alok Priyadarshi <alokp@chromium.org> + + Reviewed by James Robinson. + + Remove dependency on chromium skia::PlatformCanvas + https://bugs.webkit.org/show_bug.cgi?id=57563 + + * public/WebCanvas.h: + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::printPage): + * tests/TransparencyWinTest.cpp: + (WebCore::drawNativeRect): + (WebCore::getPixelAt): + (WebCore::clearTopLayerAlphaChannel): + (WebCore::clearTopLayerAlphaPixel): + (WebCore::TEST): + +2011-04-14 Brian Salomon <bsalomon@google.com> + + Reviewed by Kenneth Russell. + + In skia platform call SkBitmap::notifyPixelsChanged on WebGL readback + https://bugs.webkit.org/show_bug.cgi?id=58543 + + No new tests. Tested by fast/canvas/webgl/canvas-test.html + + * src/GraphicsContext3DChromium.cpp: + (WebCore::GraphicsContext3DInternal::paintRenderingResultsToCanvas): + +2011-04-14 Adrienne Walker <enne@google.com> + + Reviewed by James Robinson. + + [chromium] TilingData should return 1 tile if tile size is texture size. + https://bugs.webkit.org/show_bug.cgi?id=58364 + + Update test to properly handle this case. + + * tests/TilingDataTest.cpp: + (WebCore::TEST): + +2011-04-14 Bill Budge <bbudge@chromium.org> + + Reviewed by Darin Fisher. + + Make WebURLLoaderOptions disallow cross origin requests by default. + https://bugs.webkit.org/show_bug.cgi?id=58475 + + No new tests. Exposes no new functionality. + + * public/WebURLLoaderOptions.h: + (WebKit::WebURLLoaderOptions::WebURLLoaderOptions): + +2011-04-13 James Robinson <jamesr@chromium.org> + + Reviewed by Simon Fraser. + + Allow setting composited backing stores for scrollbars and scroll corners + https://bugs.webkit.org/show_bug.cgi?id=57202 + + Remove a lot of scrollbar hacks from the chromium compositor implementation now that + scrollbars go to real layers. + + * src/WebScrollbarImpl.cpp: + (WebKit::WebScrollbarImpl::invalidateScrollCornerRect): + (WebKit::WebScrollbarImpl::scrollCornerPresent): + * src/WebScrollbarImpl.h: + (WebKit::WebScrollbarImpl::scrollCornerRect): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): + (WebKit::WebViewImpl::reallocateRenderer): + +2011-04-13 John Abd-El-Malek <jam@chromium.org> + + Reviewed by Jian Li. + + [chromium] Remove unnecessary #define now that chrome has rolled to the latest WebKit + https://bugs.webkit.org/show_bug.cgi?id=58474 + + * DEPS: + * public/WebSpellCheckClient.h: + +2011-04-13 Zhenyao Mo <zmo@google.com> + + Reviewed by Kenneth Russell. + + Extension3D needs to provide a way to check if an extension is enabled + https://bugs.webkit.org/show_bug.cgi?id=58410 + + Implement isEnabled() in chromium port. + + * src/Extensions3DChromium.cpp: + (WebCore::Extensions3DChromium::isEnabled): + * src/GraphicsContext3DChromium.cpp: + (WebCore::GraphicsContext3DInternal::isExtensionEnabled): + * src/GraphicsContext3DInternal.h: + +2011-04-13 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by David Levin. + + Add mock implementation and plumbing code for unified Quota API + https://bugs.webkit.org/show_bug.cgi?id=57927 + + Added plumbing code for the quota API, that is based on the + discussion on public-webapps: + http://lists.w3.org/Archives/Public/public-webapps/2011JanMar/0346.html + + * WebKit.gyp: Added new file entries. + * src/StorageInfoChromium.cpp: Added. + * src/WebStorageQuotaCallbacksImpl.cpp: Added. An implementation of + WebStorageQuotaCallbacks. + * src/WebStorageQuotaCallbacksImpl.h: Added. + +2011-04-12 Hans Wennborg <hans@chromium.org> + + Reviewed by Jeremy Orlow. + + Chromium: Set ENABLE_LEVELDB=1 and add leveldb and snappy to DEPS + https://bugs.webkit.org/show_bug.cgi?id=58343 + + Set ENABLE_LEVELDB=1 so that code gets compiled by the EWS bots. + Add the necessary dependencies to the DEPS file. + + * DEPS: + * features.gypi: + +2011-04-12 Kent Tamura <tkent@chromium.org> + + Reviewed by Dimitri Glazkov. + + [Chromium] Add WebSettings::setValidationMessageTimerMagnification() + https://bugs.webkit.org/show_bug.cgi?id=57426 + + * public/WebSettings.h: Declare new function. + * src/WebSettingsImpl.cpp: + (WebKit::WebSettingsImpl::setValidationMessageTimerMagnification): + Passing the specified value to WebCore::Settings. + * src/WebSettingsImpl.h: Declare new function. + +2011-04-12 Antoine Labour <piman@chromium.org> + + Reviewed by Kenneth Russell. + + Allow WebView users to recreate dependent contexts after a context lost + event. Similarly to the startup case, a temporary context gets created, + that gets used by the layer renderer once it itself gets recreated. + https://bugs.webkit.org/show_bug.cgi?id=58385 + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::reallocateRenderer): use the temporary context to + recreate the layer renderer if it's valid. + (WebKit::WebViewImpl::graphicsContext3D): create a temporary context if + the layer renderer's context is lost. + +2011-04-12 Adrienne Walker <enne@google.com> + + Reviewed by James Robinson. + + [chromium] TilingData mishandles very small texture sizes + https://bugs.webkit.org/show_bug.cgi?id=58364 + + Update test to properly handle texture sizes of 0-3. + + * tests/TilingDataTest.cpp: + (WebCore::TEST): + +2011-04-12 Jian Li <jianli@chromium.org> + + Unreviewed, rolling out r83649. + http://trac.webkit.org/changeset/83649 + https://bugs.webkit.org/show_bug.cgi?id=57563 + + This patch causes compiling errors for chromium + + * public/WebCanvas.h: + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::printPage): + * tests/TransparencyWinTest.cpp: + (WebCore::drawNativeRect): + (WebCore::getPixelAt): + (WebCore::clearTopLayerAlphaChannel): + (WebCore::clearTopLayerAlphaPixel): + (WebCore::TEST): + +2011-04-12 John Abd-El-Malek <jam@chromium.org> + + Reviewed by Jian Li. + + [chromium] Fix spellcheck regression in context menus + https://bugs.webkit.org/show_bug.cgi?id=58386 + + * src/ContextMenuClientImpl.cpp: + (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems): + +2011-04-12 Noel Gordon <noel.gordon@gmail.com> + + Reviewed by Tony Chang. + + [chromium] Use new dragTargetDragEnter() function signature + https://bugs.webkit.org/show_bug.cgi?id=58303 + + After WebKit/chromium/DEPS rolls to chromium r80907, the drag identity + based version of dragTargetDragEnter() is no longer used; remove it. + + * public/WebView.h: + * src/WebViewImpl.cpp: + * src/WebViewImpl.h: + +2011-04-12 Alok Priyadarshi <alokp@chromium.org> + + Reviewed by James Robinson. + + Remove dependency on chromium skia::PlatformCanvas + https://bugs.webkit.org/show_bug.cgi?id=57563 + + * public/WebCanvas.h: + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::printPage): + * tests/TransparencyWinTest.cpp: + (WebCore::drawNativeRect): + (WebCore::getPixelAt): + (WebCore::clearTopLayerAlphaChannel): + (WebCore::clearTopLayerAlphaPixel): + (WebCore::TEST): + +2011-04-12 Adam Barth <abarth@webkit.org> + + Revert unintentional changes to WebKit. + + * public/WebSettings.h: + * src/WebSettingsImpl.cpp: + * src/WebSettingsImpl.h: + +2011-04-11 John Abd-El-Malek <jam@chromium.org> + + Reviewed by Darin Fisher. + + [chromium]: Get the list of misspelled words in the WebKit code insetad of in chromium's RenderView + https://bugs.webkit.org/show_bug.cgi?id=58260 + + * public/WebContextMenuData.h: + * public/WebSpellCheckClient.h: + (WebKit::WebSpellCheckClient::spellCheck): + * src/ContextMenuClientImpl.cpp: + (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems): + * src/EditorClientImpl.cpp: + (WebKit::EditorClientImpl::checkSpellingOfString): + +2011-04-12 Bill Budge <bbudge@chromium.org> + + Reviewed by Darin Fisher. + + Move the WebURLLoaderOptions struct into its own file and rename the CrossOriginRequestPolicy enum to conform to the WebKit coding standard. + https://bugs.webkit.org/show_bug.cgi?id=58287 + + No new tests. No new functionality exposed. + + * WebKit.gyp: + * public/WebURLLoader.h: + * public/WebURLLoaderOptions.h: Added. + (WebKit::WebURLLoaderOptions::WebURLLoaderOptions): + * src/AssociatedURLLoader.cpp: + (WebKit::AssociatedURLLoader::AssociatedURLLoader): + * src/AssociatedURLLoader.h: + +2011-04-11 Pavel Podivilov <podivilov@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: [chromium] script formatting doesn't work when chromium is built with debug_devtools=1. + https://bugs.webkit.org/show_bug.cgi?id=58232 + + * WebKit.gyp: + +2011-04-11 John Bates <jbates@google.com> + + Reviewed by Kenneth Russell. + + chromium support for glSetLatch and glWaitLatch between 3D contexts + https://bugs.webkit.org/show_bug.cgi?id=58003 + + * public/WebGraphicsContext3D.h: + (WebKit::WebGraphicsContext3D::getParentToChildLatchCHROMIUM): + (WebKit::WebGraphicsContext3D::getChildToParentLatchCHROMIUM): + (WebKit::WebGraphicsContext3D::waitLatchCHROMIUM): + (WebKit::WebGraphicsContext3D::setLatchCHROMIUM): + * src/Extensions3DChromium.cpp: + (WebCore::Extensions3DChromium::waitLatchCHROMIUM): + (WebCore::Extensions3DChromium::setLatchCHROMIUM): + * src/GraphicsContext3DChromium.cpp: + * src/GraphicsContext3DInternal.h: + +2011-04-11 Ryosuke Niwa <rniwa@webkit.org> + + Reviewed by Tony Chang. + + [chromium] Crash in WebViewImpl::caretOrSelectionBounds + https://bugs.webkit.org/show_bug.cgi?id=58269 + + The bug was caused by caretOrSelectionBounds's incorrectly assuming + SelectionController::toNormalizedRange to always return a non-null Range. + + Fixed the bug by adding a null pointer check. Also replaced calls to deprecatedNode + by containerNode() and calls to SelectionController::start() and SelectionController::end() + by calls to SelectionController::base() and SelectionController::extent() because + selection extends from base to extent, not from start to end. + + Test: editing/selection/extend-over-file-input-by-drag-crash.html + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::caretOrSelectionBounds): + +2011-04-11 Dimitri Glazkov <dglazkov@chromium.org> + + Reviewed by Eric Carlson. + + Rename MediaControls to MediaControlRootElement. + https://bugs.webkit.org/show_bug.cgi?id=58250 + + Mechanical move using do-webcore-rename. + +2011-04-11 Daniel Cheng <dcheng@chromium.org> + + Reviewed by Dmitry Titov. + + [chromium] Implement image/png support in DataTransferItems + https://bugs.webkit.org/show_bug.cgi?id=58106 + + Add glue for reading image data from clipboard. + + * DEPS: + * src/PlatformBridge.cpp: + (WebCore::PlatformBridge::clipboardReadImage): + +2011-04-05 Hans Wennborg <hans@chromium.org> + + Reviewed by Steve Block. + + IndexedDB: Introduce skeleton for LevelDB backend + https://bugs.webkit.org/show_bug.cgi?id=57827 + + * features.gypi: + Add ENABLE_LEVELDB=0. + * public/WebIDBFactory.h: + (WebKit::WebIDBFactory::open): + Remove pre-roll open() function. + +2011-04-10 Kent Tamura <tkent@chromium.org> + + [Chromium] Fix build errors on "Win Shared Builder (dbg)" + + * WebKit.gyp: Exclude WebFrameTest.cpp for WEBKIT_DLL. + +2011-04-10 Kent Tamura <tkent@chromium.org> + + Unreviewed, rolling out r83353. + http://trac.webkit.org/changeset/83353 + https://bugs.webkit.org/show_bug.cgi?id=58106 + + The new test doesn't pass on all Chromium platforms. + + * DEPS: + * src/PlatformBridge.cpp: + +2011-04-09 Sreeram Ramachandran <sreeram@google.com> + + Reviewed by Ryosuke Niwa. + + Gather data on modal dialogs shown during unload events + https://bugs.webkit.org/show_bug.cgi?id=58115 + + Implementation of the new API to receive notifications of modal dialogs + dispatched during unload events. Count the notifications through a histogram. + + No tests because it's not clear how to test chromium histograms from webkit. + + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::willRunModalDialogDuringPageDismissal): + * src/ChromeClientImpl.h: + +2011-04-08 Aaron Boodman <aa@chromium.org> + + Reviewed by Dmitry Titov. + + Re-land http://trac.webkit.org/changeset/83007. This works + without changes after https://bugs.webkit.org/show_bug.cgi?id=58110. + + https://bugs.webkit.org/show_bug.cgi?id=58096 + + * WebKit.gyp: + * WebKit.gypi: + * public/WebFrame.h: + * src/WebFrameImpl.cpp: + (WebKit::WebFrame::frameForContext): + * tests/WebFrameTest.cpp: + (WebKit::WebFrameTest::WebFrameTest): + (WebKit::WebFrameTest::registerMockedURLLoad): + (WebKit::WebFrameTest::loadFrame): + (WebKit::TEST_F): + +2011-04-08 Daniel Cheng <dcheng@chromium.org> + + Reviewed by Dmitry Titov. + + [chromium] Implement image/png support in DataTransferItems + https://bugs.webkit.org/show_bug.cgi?id=58106 + + Add glue for reading image data from clipboard. + + * DEPS: + * src/PlatformBridge.cpp: + (WebCore::PlatformBridge::clipboardReadImage): + +2011-04-08 Alpha Lam <hclam@chromium.org> + + Unreviewed, rolling out r83335. + http://trac.webkit.org/changeset/83335 + https://bugs.webkit.org/show_bug.cgi?id=53556 + + GTK and QT bots are broken + + * features.gypi: + +2011-04-07 Anna Cavender <annacc@chromium.org> + + Reviewed by Eric Carlson. + + Setup ENABLE(TRACK) feature define + https://bugs.webkit.org/show_bug.cgi?id=53556 + + * features.gypi: + +2011-04-08 Dmitry Titov <dimich@chromium.org> + + Reviewed by Adam Barth. + + [Chromium] Remove unneeded usage of V8::Lockers in IDB tests. + https://bugs.webkit.org/show_bug.cgi?id=58110 + Since they are simple one-thread tests. + This code parallels the code in Chromium's idb bindings that uses v8 Lockers in utility process, + which is equally not needed since there is only one thread running v8 in that process. + + * tests/IDBBindingUtilitiesTest.cpp: + +2011-04-07 Pavel Podivilov <podivilov@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: add test for script formatter worker. + https://bugs.webkit.org/show_bug.cgi?id=57447 + + * WebKit.gyp: + +2011-04-08 Kent Tamura <tkent@chromium.org> + + [Chromium] The second attempt of fixing for Windows (dbg)(shared) build. + + * WebKit.gyp: webkit should not depend on webkit_support. + +2011-04-08 Kent Tamura <tkent@chromium.org> + + [Chromium] Build fix for Windows (dbg)(shared). + + * WebKit.gyp: Add webkit_support dependency, which is required for webkit_unittest_files. + +2011-04-07 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by Darin Fisher. + + [Chromium] Add WebKit API to query and request unified offline-storage quota + https://bugs.webkit.org/show_bug.cgi?id=57849 + Just adding the API, this does not do anything yet. + + The API is based on the public discussion for unified quota API: + http://lists.w3.org/Archives/Public/public-webapps/2011JanMar/0346.html + (The detail is not yet fully specified and might be subject to change.) + + * public/WebFrameClient.h: + (WebKit::WebFrameClient::queryStorageUsageAndQuota): Added. + (WebKit::WebFrameClient::requestStorageQuota): Added. + * public/WebStorageQuotaCallbacks.h: Added. + (WebKit::WebStorageQuotaCallbacks::~WebStorageQuotaCallbacks): + * public/WebStorageQuotaType.h: Added. + +2011-04-07 Dominic Cooney <dominicc@google.com> + + Reviewed by Dimitri Glazkov. + + Let shadow DOM have a list of nodes at the top level of a shadow. + https://bugs.webkit.org/show_bug.cgi?id=57813 + + * src/WebElement.cpp: + (WebKit::WebElement::shadowRoot): shadow roots are ContainerNodes now + +2011-04-07 Magnus Danielsson <public@fuzzac.com> + + Reviewed by Darin Fisher. + + [chromium] WebPageSerializerImpl doesn't serialize sub-frames correctly + https://bugs.webkit.org/show_bug.cgi?id=53897 + + When serializing a web page using 'save page as', sub-frames and resources gets + saved in a sub-directory. However, frame elements didn't get updated to reference + these saved sub-frames, but were still referencing the original url. So when opening + a saved web page, any sub-frames would get pulled in from the original url rather than + what was saved. + + In addition to this, sub-frames in the sub-directory erroneously had the name of the + sub-directory prepended to the path of resources located in the same sub-directory. + + * src/WebPageSerializerImpl.cpp: + (WebKit::WebPageSerializerImpl::openTagToStrne: Fixed resource paths in sub-frames. + Also made sure sub-frames are referenced correctly from parent frame. + (WebKit::WebPageSerializerImpl::endTagToString): Removed constness from argument. + (WebKit::WebPageSerializerImpl::buildContentForNode): Ditto. + * src/WebPageSerializerImpl.h: + +2011-04-07 Nat Duca <nduca@chromium.org> + + Reviewed by David Levin. + + [chromium] Compositor thread infrastructure + https://bugs.webkit.org/show_bug.cgi?id=56131 + + Tests for chrome compositor thread and related infrastructure. + + * WebKit.gyp: + * WebKit.gypi: + * tests/CCThreadTaskTest.cpp: Added. + (WebCore::TEST): + * tests/CCThreadTest.cpp: Added. + (WebCore::TEST): + (WebCore::PingPongUsingCondition::ping): + (WebCore::PingPongTestUsingTasks::ping): + (WebCore::PingPongTestUsingTasks::pong): + * tests/RunAllTests.cpp: + (main): + +2011-04-07 Andrew Scherkus <scherkus@chromium.org> + + Revert ENABLE_TRACK patch due to compile failures. + + * features.gypi: + +2011-04-07 Pavel Feldman <pfeldman@google.com> + + Not reviewed: rolling chromium DEPS 80421:80767. + + * DEPS: + +2011-04-07 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: [Chromium] Rename didReceiveData2 to didReceiveData as part of enabling transfer size support. + https://bugs.webkit.org/show_bug.cgi?id=58036 + + Renamed didReceiveData2 to didReceiveData. + + * public/WebURLLoaderClient.h: + (WebKit::WebURLLoaderClient::didReceiveData): + * src/AssociatedURLLoader.cpp: + (WebKit::AssociatedURLLoader::ClientAdapter::didReceiveData): + * src/ResourceHandle.cpp: + (WebCore::ResourceHandleInternal::didReceiveData): + +2011-04-07 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: [Chromium] Migrate didReceiveData in upstream for plugins as part of enabling transfer size support. + https://bugs.webkit.org/show_bug.cgi?id=58034 + + Migrated didReceiveData to support new lengthReceived parameter. + + * src/AssociatedURLLoader.cpp: + (WebKit::AssociatedURLLoader::ClientAdapter::didReceiveData): + +2011-04-06 Asanka Herath <asanka@chromium.org> + + Reviewed by Darin Fisher. + + Add new TargetType: TargetIsFavicon + + https://bugs.webkit.org/show_bug.cgi?id=57659 + + * public/WebURLRequest.h: + +2011-04-06 Alok Priyadarshi <alokp@chromium.org> + + Reviewed by Eric Seidel. + + [chromium] Add settings API to enable accelerated drawing + https://bugs.webkit.org/show_bug.cgi?id=57863 + + If accelerated drawing is enabled we try to render content and + root layers using GPU. Please note that this setting is ignored if + accelerated compositing is disabled. + + * public/WebSettings.h: + * src/WebSettingsImpl.cpp: + (WebKit::WebSettingsImpl::setAcceleratedDrawingEnabled): + * src/WebSettingsImpl.h: + +2011-04-05 Zelidrag Hornung <zelidrag@chromium.org> + + Reviewed by David Levin. + + Added MediaTypeFile enum value to WebContextMenuData::MediaType. + https://bugs.webkit.org/show_bug.cgi?id=57566 + + * public/WebContextMenuData.h: + +2011-04-05 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r83007. + http://trac.webkit.org/changeset/83007 + https://bugs.webkit.org/show_bug.cgi?id=57920 + + Broke WebFrameTest.FrameForEnteredContext on Chromium-win and + Chromium-mac (Requested by tkent on #webkit). + + * WebKit.gyp: + * WebKit.gypi: + * public/WebFrame.h: + * src/WebFrameImpl.cpp: + * tests/WebFrameTest.cpp: + (WebKit::WebFrameTest::WebFrameTest): + (WebKit::WebFrameTest::registerMockedURLLoad): + (WebKit::WebFrameTest::serveRequests): + (WebKit::TEST_F): + +2011-04-05 James Kozianski <koz@chromium.org> + + Unreviewed, rolling out r82976. + http://trac.webkit.org/changeset/82976 + https://bugs.webkit.org/show_bug.cgi?id=57566 + + Breaks chromium canary build + + * public/WebContextMenuData.h: + +2011-04-05 Aaron Boodman <aa@chromium.org> + + Reviewed by Adam Barth. + + Add ability to get frame from v8 context to chromium WebKit API + https://bugs.webkit.org/show_bug.cgi?id=57516 + + * public/WebFrame.h: + * src/WebFrameImpl.cpp: + (WebKit::WebFrame::frameForV8Context): + +2011-04-05 Nico Weber <thakis@chromium.org> + + Reviewed by Dimitri Glazkov. + + [chromium] Don't have 'using namespace' declarations in header files + https://bugs.webkit.org/show_bug.cgi?id=57882 + + * src/EventListenerWrapper.cpp: + * src/EventListenerWrapper.h: + * src/VideoFrameChromiumImpl.h: + * src/WebDOMEventListener.cpp: + * src/WebDOMEventListenerPrivate.cpp: + * src/WebDOMEventListenerPrivate.h: + (WebKit::WebDOMEventListenerPrivate::ListenerInfo::ListenerInfo): + +2011-04-05 Zelidrag Hornung <zelidrag@chromium.org> + + Reviewed by David Levin. + + Added MediaTypeFile enum value to WebContextMenuData::MediaType. + https://bugs.webkit.org/show_bug.cgi?id=57566 + + * public/WebContextMenuData.h: + +2011-04-04 MORITA Hajime <morrita@google.com> + + Reviewed by Ryosuke Niwa. + + [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult + https://bugs.webkit.org/show_bug.cgi?id=56085 + + Followed the signature change. + + * src/EditorClientImpl.h: + * src/EditorClientImpl.cpp: + * src/WebTextCheckingCompletionImpl.cpp + +2011-04-05 Hans Wennborg <hans@chromium.org> + + Reviewed by Adam Barth + + Clean up IndexedDB WebKit API + https://bugs.webkit.org/show_bug.cgi?id=57507 + + Rename the backend proxy files that didn't have Backend in their name. + Everything in WebKit should be in the WebKit namespace. + Put everything behind the feature flag so we're consistient. + Put the feature flag #if above includes. + + * WebKit.gyp: + * src/IDBCallbacksProxy.cpp: + (WebKit::IDBCallbacksProxy::create): + (WebKit::IDBCallbacksProxy::IDBCallbacksProxy): + (WebKit::IDBCallbacksProxy::onError): + (WebKit::IDBCallbacksProxy::onSuccess): + * src/IDBCallbacksProxy.h: + * src/IDBCursorBackendProxy.cpp: + (WebKit::IDBCursorBackendProxy::create): + (WebKit::IDBCursorBackendProxy::IDBCursorBackendProxy): + * src/IDBCursorBackendProxy.h: + * src/IDBDatabaseBackendProxy.cpp: + (WebKit::IDBDatabaseBackendProxy::create): + (WebKit::IDBDatabaseBackendProxy::IDBDatabaseBackendProxy): + (WebKit::IDBDatabaseBackendProxy::~IDBDatabaseBackendProxy): + (WebKit::IDBDatabaseBackendProxy::name): + (WebKit::IDBDatabaseBackendProxy::version): + (WebKit::IDBDatabaseBackendProxy::objectStoreNames): + (WebKit::IDBDatabaseBackendProxy::createObjectStore): + (WebKit::IDBDatabaseBackendProxy::deleteObjectStore): + (WebKit::IDBDatabaseBackendProxy::setVersion): + (WebKit::IDBDatabaseBackendProxy::transaction): + (WebKit::IDBDatabaseBackendProxy::close): + (WebKit::IDBDatabaseBackendProxy::open): + * src/IDBDatabaseCallbacksProxy.cpp: + (WebKit::IDBDatabaseCallbacksProxy::create): + (WebKit::IDBDatabaseCallbacksProxy::IDBDatabaseCallbacksProxy): + * src/IDBDatabaseCallbacksProxy.h: + * src/IDBFactoryBackendProxy.cpp: + (WebKit::IDBFactoryBackendProxy::IDBFactoryBackendProxy): + (WebKit::IDBFactoryBackendProxy::open): + * src/IDBFactoryBackendProxy.h: + * src/IDBIndexBackendProxy.cpp: + (WebKit::IDBIndexBackendProxy::create): + (WebKit::IDBIndexBackendProxy::IDBIndexBackendProxy): + * src/IDBIndexBackendProxy.h: + * src/IDBObjectStoreBackendProxy.cpp: + (WebKit::IDBObjectStoreBackendProxy::create): + (WebKit::IDBObjectStoreBackendProxy::IDBObjectStoreBackendProxy): + (WebKit::IDBObjectStoreBackendProxy::~IDBObjectStoreBackendProxy): + (WebKit::IDBObjectStoreBackendProxy::name): + (WebKit::IDBObjectStoreBackendProxy::keyPath): + (WebKit::IDBObjectStoreBackendProxy::indexNames): + (WebKit::IDBObjectStoreBackendProxy::get): + (WebKit::IDBObjectStoreBackendProxy::put): + (WebKit::IDBObjectStoreBackendProxy::deleteFunction): + (WebKit::IDBObjectStoreBackendProxy::clear): + (WebKit::IDBObjectStoreBackendProxy::createIndex): + (WebKit::IDBObjectStoreBackendProxy::index): + (WebKit::IDBObjectStoreBackendProxy::deleteIndex): + (WebKit::IDBObjectStoreBackendProxy::openCursor): + * src/IDBObjectStoreBackendProxy.h: Added. + * src/IDBObjectStoreProxy.h: Removed. + * src/IDBTransactionBackendProxy.cpp: + (WebKit::IDBTransactionBackendProxy::create): + (WebKit::IDBTransactionBackendProxy::IDBTransactionBackendProxy): + (WebKit::IDBTransactionBackendProxy::objectStore): + * src/IDBTransactionBackendProxy.h: + (WebKit::IDBTransactionBackendProxy::getWebIDBTransaction): + * src/IDBTransactionCallbacksProxy.cpp: + (WebKit::IDBTransactionCallbacksProxy::create): + (WebKit::IDBTransactionCallbacksProxy::IDBTransactionCallbacksProxy): + * src/IDBTransactionCallbacksProxy.h: + * src/WebIDBCallbacksImpl.cpp: + (WebKit::WebIDBCallbacksImpl::onError): + (WebKit::WebIDBCallbacksImpl::onSuccess): + * src/WebIDBCallbacksImpl.h: + * src/WebIDBCursorImpl.cpp: + * src/WebIDBCursorImpl.h: + * src/WebIDBDatabaseCallbacksImpl.cpp: + (WebKit::WebIDBDatabaseCallbacksImpl::onVersionChange): + * src/WebIDBDatabaseCallbacksImpl.h: + * src/WebIDBDatabaseError.cpp: + * src/WebIDBDatabaseImpl.cpp: + * src/WebIDBDatabaseImpl.h: + * src/WebIDBFactoryImpl.cpp: + (WebKit::WebIDBFactoryImpl::WebIDBFactoryImpl): + * src/WebIDBFactoryImpl.h: + * src/WebIDBIndexImpl.cpp: + * src/WebIDBIndexImpl.h: + * src/WebIDBKey.cpp: + (WebKit::WebIDBKey::createFromValueAndKeyPath): + (WebKit::WebIDBKey::injectIDBKeyIntoSerializedValue): + * src/WebIDBKeyPath.cpp: + (WebKit::WebIDBKeyPath::operator const WTF::Vector<IDBKeyPathElement, 0>&): + * src/WebIDBKeyRange.cpp: + * src/WebIDBObjectStoreImpl.cpp: + * src/WebIDBObjectStoreImpl.h: + * src/WebIDBTransactionCallbacksImpl.cpp: + * src/WebIDBTransactionCallbacksImpl.h: + * src/WebIDBTransactionImpl.cpp: + * src/WebIDBTransactionImpl.h: + +2011-04-05 Sailesh Agrawal <sail@chromium.org> + + Reviewed by Darin Fisher. + + Don't clear existing files if the user cancels the file chooser dialog. + https://bugs.webkit.org/show_bug.cgi?id=55200 + + * src/WebFileChooserCompletionImpl.cpp: + (WebKit::WebFileChooserCompletionImpl::didChooseFile): + +2011-04-05 John Mellor <johnme@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Minor cleanup: simplify WebFrameImpl by using contentsToWindow instead of convertToContainingWindow. + https://bugs.webkit.org/show_bug.cgi?id=55681 + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::find): + (WebKit::WebFrameImpl::scopeStringMatches): + +2011-04-05 Adam Barth <abarth@webkit.org> + + Roll Chromium DEPS. + + * DEPS: Rolled! + +2011-04-04 Chang Shu <cshu@webkit.org> + + Reviewed by Ryosuke Niwa. + + setContentEditable with true/false/inherit string is not working properly + https://bugs.webkit.org/show_bug.cgi?id=52058 + + Move isContentEditable from HTMLElement to Node. WebKit should only access isContentEditable + as rendererIsEditable is for WebCore internal use. + + * src/WebNode.cpp: + (WebKit::WebNode::isContentEditable): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setFocus): + (WebKit::WebViewImpl::setComposition): + (WebKit::WebViewImpl::confirmComposition): + +2011-04-04 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Dan Bernstein. + + REGRESSION (WebKit2): Caps-Lock indicator sometimes doesn't appear in WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=51230 + <rdar://problem/8780989> + + * src/WebViewImpl.cpp: (WebKit::WebViewImpl::keyEvent): Moved Caps Lock handling from + WebKits to WebCore, because WebKit shouldn't be smart. + +2011-04-01 Adam Barth <abarth@webkit.org> + + Attempt to fix the Chromium build using the great and powerful git. + This patch should be the remaining part of reverting Jeremy's ill-fated + refactoring. + + * src/IDBDatabaseProxy.cpp: + (WebCore::IDBDatabaseProxy::create): + (WebCore::IDBDatabaseProxy::IDBDatabaseProxy): + (WebCore::IDBDatabaseProxy::~IDBDatabaseProxy): + (WebCore::IDBDatabaseProxy::name): + (WebCore::IDBDatabaseProxy::version): + (WebCore::IDBDatabaseProxy::objectStoreNames): + (WebCore::IDBDatabaseProxy::createObjectStore): + (WebCore::IDBDatabaseProxy::deleteObjectStore): + (WebCore::IDBDatabaseProxy::setVersion): + (WebCore::IDBDatabaseProxy::transaction): + (WebCore::IDBDatabaseProxy::close): + (WebCore::IDBDatabaseProxy::open): + * src/IDBDatabaseProxy.h: + * src/IDBObjectStoreProxy.cpp: + (WebCore::IDBObjectStoreProxy::create): + (WebCore::IDBObjectStoreProxy::IDBObjectStoreProxy): + (WebCore::IDBObjectStoreProxy::~IDBObjectStoreProxy): + (WebCore::IDBObjectStoreProxy::name): + (WebCore::IDBObjectStoreProxy::keyPath): + (WebCore::IDBObjectStoreProxy::indexNames): + (WebCore::IDBObjectStoreProxy::get): + (WebCore::IDBObjectStoreProxy::put): + (WebCore::IDBObjectStoreProxy::deleteFunction): + (WebCore::IDBObjectStoreProxy::clear): + (WebCore::IDBObjectStoreProxy::createIndex): + (WebCore::IDBObjectStoreProxy::index): + (WebCore::IDBObjectStoreProxy::deleteIndex): + (WebCore::IDBObjectStoreProxy::openCursor): + +2011-04-01 Adam Barth <abarth@webkit.org> + + Move these files back to their old locations. I'm not sure why the + rollout didn't move them properly. + + * src/IDBDatabaseBackendProxy.cpp: Removed. + * src/IDBDatabaseBackendProxy.h: Removed. + * src/IDBDatabaseProxy.cpp: Copied from Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp. + * src/IDBDatabaseProxy.h: Copied from Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h. + * src/IDBObjectStoreBackendProxy.cpp: Removed. + * src/IDBObjectStoreProxy.cpp: Copied from Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp. + +2011-04-01 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r82738. + http://trac.webkit.org/changeset/82738 + https://bugs.webkit.org/show_bug.cgi?id=57684 + + Broke storage/indexeddb/objectstore-autoincrement.html and + InjectIDBKey (Requested by abarth|gardening on #webkit). + + * WebKit.gyp: + * src/IDBCallbacksProxy.cpp: + (WebCore::IDBCallbacksProxy::create): + (WebCore::IDBCallbacksProxy::IDBCallbacksProxy): + (WebCore::IDBCallbacksProxy::onError): + (WebCore::IDBCallbacksProxy::onSuccess): + * src/IDBCallbacksProxy.h: + * src/IDBCursorBackendProxy.cpp: + (WebCore::IDBCursorBackendProxy::create): + (WebCore::IDBCursorBackendProxy::IDBCursorBackendProxy): + * src/IDBCursorBackendProxy.h: + * src/IDBDatabaseCallbacksProxy.cpp: + (WebCore::IDBDatabaseCallbacksProxy::create): + (WebCore::IDBDatabaseCallbacksProxy::IDBDatabaseCallbacksProxy): + * src/IDBDatabaseCallbacksProxy.h: + * src/IDBDatabaseProxy.cpp: Renamed from Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp. + (WebCore::IDBDatabaseProxy::create): + (WebCore::IDBDatabaseProxy::IDBDatabaseProxy): + (WebCore::IDBDatabaseProxy::~IDBDatabaseProxy): + (WebCore::IDBDatabaseProxy::name): + (WebCore::IDBDatabaseProxy::version): + (WebCore::IDBDatabaseProxy::objectStoreNames): + (WebCore::IDBDatabaseProxy::createObjectStore): + (WebCore::IDBDatabaseProxy::deleteObjectStore): + (WebCore::IDBDatabaseProxy::setVersion): + (WebCore::IDBDatabaseProxy::transaction): + (WebCore::IDBDatabaseProxy::close): + (WebCore::IDBDatabaseProxy::open): + * src/IDBDatabaseProxy.h: Renamed from Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h. + * src/IDBFactoryBackendProxy.cpp: + (WebCore::IDBFactoryBackendProxy::IDBFactoryBackendProxy): + (WebCore::IDBFactoryBackendProxy::open): + * src/IDBFactoryBackendProxy.h: + * src/IDBIndexBackendProxy.cpp: + (WebCore::IDBIndexBackendProxy::create): + (WebCore::IDBIndexBackendProxy::IDBIndexBackendProxy): + * src/IDBIndexBackendProxy.h: + * src/IDBObjectStoreBackendProxy.h: Removed. + * src/IDBObjectStoreProxy.cpp: Renamed from Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp. + (WebCore::IDBObjectStoreProxy::create): + (WebCore::IDBObjectStoreProxy::IDBObjectStoreProxy): + (WebCore::IDBObjectStoreProxy::~IDBObjectStoreProxy): + (WebCore::IDBObjectStoreProxy::name): + (WebCore::IDBObjectStoreProxy::keyPath): + (WebCore::IDBObjectStoreProxy::indexNames): + (WebCore::IDBObjectStoreProxy::get): + (WebCore::IDBObjectStoreProxy::put): + (WebCore::IDBObjectStoreProxy::deleteFunction): + (WebCore::IDBObjectStoreProxy::clear): + (WebCore::IDBObjectStoreProxy::createIndex): + (WebCore::IDBObjectStoreProxy::index): + (WebCore::IDBObjectStoreProxy::deleteIndex): + (WebCore::IDBObjectStoreProxy::openCursor): + * src/IDBObjectStoreProxy.h: Added. + * src/IDBTransactionBackendProxy.cpp: + (WebCore::IDBTransactionBackendProxy::create): + (WebCore::IDBTransactionBackendProxy::IDBTransactionBackendProxy): + (WebCore::IDBTransactionBackendProxy::objectStore): + * src/IDBTransactionBackendProxy.h: + (WebCore::IDBTransactionBackendProxy::getWebIDBTransaction): + * src/IDBTransactionCallbacksProxy.cpp: + (WebCore::IDBTransactionCallbacksProxy::create): + (WebCore::IDBTransactionCallbacksProxy::IDBTransactionCallbacksProxy): + * src/IDBTransactionCallbacksProxy.h: + * src/WebIDBCallbacksImpl.cpp: + (WebCore::WebIDBCallbacksImpl::onError): + (WebCore::WebIDBCallbacksImpl::onSuccess): + * src/WebIDBCallbacksImpl.h: + * src/WebIDBCursorImpl.cpp: + * src/WebIDBCursorImpl.h: + * src/WebIDBDatabaseCallbacksImpl.cpp: + (WebCore::WebIDBDatabaseCallbacksImpl::onVersionChange): + * src/WebIDBDatabaseCallbacksImpl.h: + * src/WebIDBDatabaseError.cpp: + * src/WebIDBDatabaseImpl.cpp: + * src/WebIDBDatabaseImpl.h: + * src/WebIDBFactoryImpl.cpp: + (WebKit::WebIDBFactoryImpl::WebIDBFactoryImpl): + * src/WebIDBFactoryImpl.h: + * src/WebIDBIndexImpl.cpp: + * src/WebIDBIndexImpl.h: + * src/WebIDBKey.cpp: + (WebKit::WebIDBKey::createFromValueAndKeyPath): + (WebKit::WebIDBKey::injectIDBKeyIntoSerializedValue): + * src/WebIDBKeyPath.cpp: + (WebKit::WebIDBKeyPath::operator const WTF::Vector<WebCore::IDBKeyPathElement, 0>&): + * src/WebIDBKeyRange.cpp: + * src/WebIDBObjectStoreImpl.cpp: + * src/WebIDBObjectStoreImpl.h: + * src/WebIDBTransactionCallbacksImpl.cpp: + * src/WebIDBTransactionCallbacksImpl.h: + * src/WebIDBTransactionImpl.cpp: + * src/WebIDBTransactionImpl.h: + +2011-03-30 Jeremy Orlow <jorlow@chromium.org> + + Reviewed by Nate Chapin. + + Clean up IndexedDB WebKit API + https://bugs.webkit.org/show_bug.cgi?id=57507 + + Rename the backend proxy files that didn't have Backend in their name. + Everything in WebKit should be in the WebKit namespace. + Put everything behind the feature flag so we're consistient. + Put the feature flag #if above includes. + + * WebKit.gyp: + * src/IDBCallbacksProxy.cpp: + (WebKit::IDBCallbacksProxy::create): + (WebKit::IDBCallbacksProxy::IDBCallbacksProxy): + (WebKit::IDBCallbacksProxy::onError): + (WebKit::IDBCallbacksProxy::onSuccess): + * src/IDBCallbacksProxy.h: + * src/IDBCursorBackendProxy.cpp: + (WebKit::IDBCursorBackendProxy::create): + (WebKit::IDBCursorBackendProxy::IDBCursorBackendProxy): + * src/IDBCursorBackendProxy.h: + * src/IDBDatabaseBackendProxy.cpp: + (WebKit::IDBDatabaseBackendProxy::create): + (WebKit::IDBDatabaseBackendProxy::IDBDatabaseBackendProxy): + (WebKit::IDBDatabaseBackendProxy::~IDBDatabaseBackendProxy): + (WebKit::IDBDatabaseBackendProxy::name): + (WebKit::IDBDatabaseBackendProxy::version): + (WebKit::IDBDatabaseBackendProxy::objectStoreNames): + (WebKit::IDBDatabaseBackendProxy::createObjectStore): + (WebKit::IDBDatabaseBackendProxy::deleteObjectStore): + (WebKit::IDBDatabaseBackendProxy::setVersion): + (WebKit::IDBDatabaseBackendProxy::transaction): + (WebKit::IDBDatabaseBackendProxy::close): + (WebKit::IDBDatabaseBackendProxy::open): + * src/IDBDatabaseCallbacksProxy.cpp: + (WebKit::IDBDatabaseCallbacksProxy::create): + (WebKit::IDBDatabaseCallbacksProxy::IDBDatabaseCallbacksProxy): + * src/IDBDatabaseCallbacksProxy.h: + * src/IDBFactoryBackendProxy.cpp: + (WebKit::IDBFactoryBackendProxy::IDBFactoryBackendProxy): + (WebKit::IDBFactoryBackendProxy::open): + * src/IDBFactoryBackendProxy.h: + * src/IDBIndexBackendProxy.cpp: + (WebKit::IDBIndexBackendProxy::create): + (WebKit::IDBIndexBackendProxy::IDBIndexBackendProxy): + * src/IDBIndexBackendProxy.h: + * src/IDBObjectStoreBackendProxy.cpp: + (WebKit::IDBObjectStoreBackendProxy::create): + (WebKit::IDBObjectStoreBackendProxy::IDBObjectStoreBackendProxy): + (WebKit::IDBObjectStoreBackendProxy::~IDBObjectStoreBackendProxy): + (WebKit::IDBObjectStoreBackendProxy::name): + (WebKit::IDBObjectStoreBackendProxy::keyPath): + (WebKit::IDBObjectStoreBackendProxy::indexNames): + (WebKit::IDBObjectStoreBackendProxy::get): + (WebKit::IDBObjectStoreBackendProxy::put): + (WebKit::IDBObjectStoreBackendProxy::deleteFunction): + (WebKit::IDBObjectStoreBackendProxy::clear): + (WebKit::IDBObjectStoreBackendProxy::createIndex): + (WebKit::IDBObjectStoreBackendProxy::index): + (WebKit::IDBObjectStoreBackendProxy::deleteIndex): + (WebKit::IDBObjectStoreBackendProxy::openCursor): + * src/IDBObjectStoreBackendProxy.h: Added. + * src/IDBObjectStoreProxy.h: Removed. + * src/IDBTransactionBackendProxy.cpp: + (WebKit::IDBTransactionBackendProxy::create): + (WebKit::IDBTransactionBackendProxy::IDBTransactionBackendProxy): + (WebKit::IDBTransactionBackendProxy::objectStore): + * src/IDBTransactionBackendProxy.h: + (WebKit::IDBTransactionBackendProxy::getWebIDBTransaction): + * src/IDBTransactionCallbacksProxy.cpp: + (WebKit::IDBTransactionCallbacksProxy::create): + (WebKit::IDBTransactionCallbacksProxy::IDBTransactionCallbacksProxy): + * src/IDBTransactionCallbacksProxy.h: + * src/WebIDBCallbacksImpl.cpp: + (WebKit::WebIDBCallbacksImpl::onError): + (WebKit::WebIDBCallbacksImpl::onSuccess): + * src/WebIDBCallbacksImpl.h: + * src/WebIDBCursorImpl.cpp: + * src/WebIDBCursorImpl.h: + * src/WebIDBDatabaseCallbacksImpl.cpp: + (WebKit::WebIDBDatabaseCallbacksImpl::onVersionChange): + * src/WebIDBDatabaseCallbacksImpl.h: + * src/WebIDBDatabaseError.cpp: + * src/WebIDBDatabaseImpl.cpp: + * src/WebIDBDatabaseImpl.h: + * src/WebIDBFactoryImpl.cpp: + (WebKit::WebIDBFactoryImpl::WebIDBFactoryImpl): + * src/WebIDBFactoryImpl.h: + * src/WebIDBIndexImpl.cpp: + * src/WebIDBIndexImpl.h: + * src/WebIDBKey.cpp: + (WebKit::WebIDBKey::createFromValueAndKeyPath): + (WebKit::WebIDBKey::injectIDBKeyIntoSerializedValue): + * src/WebIDBKeyPath.cpp: + (WebKit::WebIDBKeyPath::operator const WTF::Vector<IDBKeyPathElement, 0>&): + * src/WebIDBKeyRange.cpp: + * src/WebIDBObjectStoreImpl.cpp: + * src/WebIDBObjectStoreImpl.h: + * src/WebIDBTransactionCallbacksImpl.cpp: + * src/WebIDBTransactionCallbacksImpl.h: + * src/WebIDBTransactionImpl.cpp: + * src/WebIDBTransactionImpl.h: + +2011-03-30 Pavel Podivilov <podivilov@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: [chromium] script formatting doesn't work when all scripts are concatenated. + https://bugs.webkit.org/show_bug.cgi?id=57446 + + * WebKit.gyp: + * scripts/inline_js_imports.py: Added. + +2011-03-31 Victoria Kirst <vrk@google.com> + + Reviewed by Eric Carlson. + + [chromium] Implement preload=none, setPreload hooks to media player + https://bugs.webkit.org/show_bug.cgi?id=56983 + + This patch implements preload=none in Chromium. It also replaces + the now-deprecated setAutobuffer method with setPreload. + + * public/WebMediaPlayer.h: + (WebKit::WebMediaPlayer::setPreload): + * public/WebMediaPlayerClient.h: + * src/WebMediaPlayerClientImpl.cpp: + (WebKit::WebMediaPlayerClientImpl::preload): + (WebKit::WebMediaPlayerClientImpl::load): + (WebKit::WebMediaPlayerClientImpl::loadInternal): + (WebKit::WebMediaPlayerClientImpl::prepareToPlay): + (WebKit::WebMediaPlayerClientImpl::setPreload): + (WebKit::WebMediaPlayerClientImpl::startDelayedLoad): + (WebKit::WebMediaPlayerClientImpl::WebMediaPlayerClientImpl): + * src/WebMediaPlayerClientImpl.h: + +2011-03-31 Evan Martin <evan@chromium.org> + + Reviewed by Eric Seidel. + + <title> should support dir attribute + https://bugs.webkit.org/show_bug.cgi?id=50961 + + Update to new FrameLoaderClient interface. + + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::dispatchDidReceiveTitle): + (WebKit::FrameLoaderClientImpl::setTitle): + * src/FrameLoaderClientImpl.h: + * src/WebDataSourceImpl.cpp: + (WebKit::WebDataSourceImpl::pageTitle): + +2011-03-30 David Levin <levin@chromium.org> + + Reviewed by Dmitry Titov. + + UnlockNonLocked condition reached in WorkerFileSystemsCallbackBridge::mayPostTaskToWorker + https://bugs.webkit.org/show_bug.cgi?id=57382 + + There were two issues to address: + 1. The use of a non-thread safe class (RefPtr) in a ThreadSafeRefCounted class. + The problem was that this RefPtr could be changed on either thread. + 2. Keeping WorkerFileSystemCallbacksBridge alive for while it was being used + including while its mutex was in use. + + * src/WorkerFileSystemCallbacksBridge.cpp: + (WebKit::WorkerFileSystemCallbacksBridge::runTaskOnMainThread): + Changed to take a PassRefPtr and leak the ref count as opposed to relying on + dispatchTaskToMainThread to store the pointer in m_selfRef. + (WebKit::WorkerFileSystemCallbacksBridge::dispatchTaskToMainThread): Remove the + m_selfRef and hand off a PassRefPtr instead. + (WebKit::WorkerFileSystemCallbacksBridge::mayPostTaskToWorker): Balance out the leaked ref + and ensure that WorkerFileSystemCallbacksBridge stays alive while the mutex is held. + * src/WorkerFileSystemCallbacksBridge.h: Removed m_selfRef and derefIfWorkerIsStopped which + was simply due to m_selfRef. + 2011-03-29 John Abd-El-Malek <jam@chromium.org> Reviewed by Tony Chang. diff --git a/Source/WebKit/chromium/DEPS b/Source/WebKit/chromium/DEPS index 3ab2e78..c0e5a6c 100644 --- a/Source/WebKit/chromium/DEPS +++ b/Source/WebKit/chromium/DEPS @@ -32,7 +32,7 @@ vars = { 'chromium_svn': 'http://src.chromium.org/svn/trunk/src', - 'chromium_rev': '79759' + 'chromium_rev': '81564' } deps = { @@ -123,6 +123,10 @@ deps = { From('chromium_deps', 'src/third_party/yasm/source/patched-yasm'), 'third_party/libjpeg_turbo': From('chromium_deps', 'src/third_party/libjpeg_turbo'), + 'third_party/leveldb': + From('chromium_deps', 'src/third_party/leveldb'), + 'third_party/snappy/src': + From('chromium_deps', 'src/third_party/snappy/src'), 'third_party': Var('chromium_svn')+'/third_party@'+Var('chromium_rev'), } diff --git a/Source/WebKit/chromium/WebKit.gyp b/Source/WebKit/chromium/WebKit.gyp index d47248e..0ee5dd6 100644 --- a/Source/WebKit/chromium/WebKit.gyp +++ b/Source/WebKit/chromium/WebKit.gyp @@ -266,6 +266,8 @@ 'public/WebSpeechInputResult.h', 'public/WebStorageArea.h', 'public/WebStorageEventDispatcher.h', + 'public/WebStorageQuotaCallbacks.h', + 'public/WebStorageQuotaType.h', 'public/WebStorageNamespace.h', 'public/WebString.h', 'public/WebTextAffinity.h', @@ -279,6 +281,7 @@ 'public/WebURL.h', 'public/WebURLError.h', 'public/WebURLLoader.h', + 'public/WebURLLoaderOptions.h', 'public/WebURLLoadTiming.h', 'public/WebURLLoaderClient.h', 'public/WebURLRequest.h', @@ -359,14 +362,14 @@ 'src/IDBCursorBackendProxy.h', 'src/IDBDatabaseCallbacksProxy.cpp', 'src/IDBDatabaseCallbacksProxy.h', - 'src/IDBDatabaseProxy.cpp', - 'src/IDBDatabaseProxy.h', + 'src/IDBDatabaseBackendProxy.cpp', + 'src/IDBDatabaseBackendProxy.h', 'src/IDBFactoryBackendProxy.cpp', 'src/IDBFactoryBackendProxy.h', 'src/IDBIndexBackendProxy.cpp', 'src/IDBIndexBackendProxy.h', - 'src/IDBObjectStoreProxy.cpp', - 'src/IDBObjectStoreProxy.h', + 'src/IDBObjectStoreBackendProxy.cpp', + 'src/IDBObjectStoreBackendProxy.h', 'src/IDBTransactionBackendProxy.cpp', 'src/IDBTransactionBackendProxy.h', 'src/IDBTransactionCallbacksProxy.cpp', @@ -400,6 +403,7 @@ 'src/StorageEventDispatcherChromium.cpp', 'src/StorageEventDispatcherImpl.cpp', 'src/StorageEventDispatcherImpl.h', + 'src/StorageInfoChromium.cpp', 'src/StorageNamespaceProxy.cpp', 'src/StorageNamespaceProxy.h', 'src/TemporaryGlue.h', @@ -552,6 +556,8 @@ 'src/WebStorageEventDispatcherImpl.h', 'src/WebStorageNamespaceImpl.cpp', 'src/WebStorageNamespaceImpl.h', + 'src/WebStorageQuotaCallbacksImpl.cpp', + 'src/WebStorageQuotaCallbacksImpl.h', 'src/WebString.cpp', 'src/WebTextRun.cpp', 'src/WebThreadSafeData.cpp', @@ -597,6 +603,7 @@ '<(chromium_src_dir)/base/base.gyp:test_support_base', '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl', '<(chromium_src_dir)/testing/gtest.gyp:gtest', + '<(chromium_src_dir)/testing/gmock.gyp:gmock', '<(chromium_src_dir)/third_party/icu/icu.gyp:*', '<(chromium_src_dir)/third_party/libjpeg/libjpeg.gyp:libjpeg', '<(chromium_src_dir)/third_party/libpng/libpng.gyp:libpng', @@ -607,6 +614,7 @@ '<(chromium_src_dir)/third_party/ots/ots.gyp:ots', '<(chromium_src_dir)/third_party/zlib/zlib.gyp:zlib', '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8', + # We must not add webkit_support here because of cyclic dependency. ], 'direct_dependent_settings': { 'defines': [ @@ -623,6 +631,13 @@ 'tests/TransparencyWinTest.cpp', 'tests/UniscribeHelperTest.cpp', 'tests/WebUnitTests.cpp' + ], + 'sources!' : [ + # We should not include files dpending on webkit_support. + 'tests/CCThreadTest.cpp', + # WebFrameTest.cpp depends on webkit_support and + # functions defined only in !WEBKIT_IMPLEMENTATION. + 'tests/WebFrameTest.cpp', ] }], ], @@ -695,6 +710,7 @@ 'conditions': [ ['debug_devtools==0', { 'dependencies': ['concatenated_devtools_js', + 'concatenated_script_formatter_worker_js', 'concatenated_devtools_css'], }], ], @@ -713,6 +729,17 @@ ], }, { + 'destination': '<(PRODUCT_DIR)/resources/inspector/UglifyJS', + 'files': [ + '<@(webinspector_uglifyjs_files)', + ], + 'conditions': [ + ['debug_devtools==0', { + 'files/': [['exclude', '\\.(js|css|html)$']], + }], + ], + }, + { 'destination': '<(PRODUCT_DIR)/resources/inspector/Images', 'files': [ '<@(webinspector_image_files)', @@ -747,6 +774,7 @@ 'conditions': [ ['debug_devtools==0', { 'dependencies': ['concatenated_devtools_js', + 'concatenated_script_formatter_worker_js', 'concatenated_devtools_css'], },{ # If we're not concatenating devtools files, we want to @@ -761,6 +789,7 @@ 'input_pages': [ '<(PRODUCT_DIR)/resources/inspector/devtools.html', '<(PRODUCT_DIR)/resources/inspector/DevTools.js', + '<(PRODUCT_DIR)/resources/inspector/ScriptFormatterWorker.js', '<(PRODUCT_DIR)/resources/inspector/devTools.css', ], 'images': [ @@ -788,6 +817,7 @@ 'webkit', '../../WebCore/WebCore.gyp/WebCore.gyp:webcore', '<(chromium_src_dir)/testing/gtest.gyp:gtest', + '<(chromium_src_dir)/testing/gmock.gyp:gmock', '<(chromium_src_dir)/base/base.gyp:base', '<(chromium_src_dir)/base/base.gyp:base_i18n', '<(chromium_src_dir)/base/base.gyp:test_support_base', @@ -812,11 +842,10 @@ 'conditions': [ ['OS=="win"', { 'sources': [ - # FIXME: Port PopupMenuTest and WebFrameTest to Linux and Mac. + # FIXME: Port PopupMenuTest to Linux and Mac. 'tests/PopupMenuTest.cpp', 'tests/TransparencyWinTest.cpp', 'tests/UniscribeHelperTest.cpp', - 'tests/WebFrameTest.cpp', 'tests/WebPageSerializerTest.cpp', ], }], @@ -1167,6 +1196,22 @@ }], }, { + 'target_name': 'concatenated_script_formatter_worker_js', + 'type': 'none', + 'actions': [{ + 'action_name': 'concatenate_script_formatter_worker_js', + 'script_name': 'scripts/inline_js_imports.py', + 'input_file': '../../WebCore/inspector/front-end/ScriptFormatterWorker.js', + 'inputs': [ + '<@(_script_name)', + '<@(webinspector_uglifyjs_files)' + ], + 'search_path': '../../WebCore/inspector/front-end', + 'outputs': ['<(PRODUCT_DIR)/resources/inspector/ScriptFormatterWorker.js'], + 'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'], + }], + }, + { 'target_name': 'concatenated_devtools_css', 'type': 'none', 'dependencies': [ diff --git a/Source/WebKit/chromium/WebKit.gypi b/Source/WebKit/chromium/WebKit.gypi index 016cf1a..c23c9ed 100644 --- a/Source/WebKit/chromium/WebKit.gypi +++ b/Source/WebKit/chromium/WebKit.gypi @@ -53,6 +53,8 @@ ], 'webkit_unittest_files': [ 'tests/ArenaTestHelpers.h', + 'tests/CCThreadTaskTest.cpp', + 'tests/CCThreadTest.cpp', 'tests/DragImageTest.cpp', 'tests/IDBBindingUtilitiesTest.cpp', 'tests/IDBKeyPathTest.cpp', @@ -64,6 +66,7 @@ 'tests/TilingDataTest.cpp', 'tests/TreeTestHelpers.cpp', 'tests/TreeTestHelpers.h', + 'tests/WebFrameTest.cpp', ], }, } diff --git a/Source/WebKit/chromium/features.gypi b/Source/WebKit/chromium/features.gypi index 7354eb8..01f5c78 100644 --- a/Source/WebKit/chromium/features.gypi +++ b/Source/WebKit/chromium/features.gypi @@ -65,6 +65,7 @@ 'ENABLE_INPUT_SPEECH=1', 'ENABLE_JAVASCRIPT_DEBUGGER=1', 'ENABLE_JSC_MULTIPLE_THREADS=0', + 'ENABLE_LEVELDB=1', 'ENABLE_LINK_PREFETCH=1', 'ENABLE_MATHML=0', 'ENABLE_MEDIA_STATISTICS=1', @@ -74,7 +75,9 @@ 'ENABLE_OFFLINE_WEB_APPLICATIONS=1', 'ENABLE_OPENTYPE_SANITIZER=1', 'ENABLE_ORIENTATION_EVENTS=0', + 'ENABLE_PAGE_VISIBILITY_API=0', 'ENABLE_PROGRESS_TAG=1', + 'ENABLE_QUOTA=1', 'ENABLE_REGISTER_PROTOCOL_HANDLER=0', 'ENABLE_REQUEST_ANIMATION_FRAME=1', 'ENABLE_SHARED_WORKERS=1', diff --git a/Source/WebKit/chromium/public/WebCanvas.h b/Source/WebKit/chromium/public/WebCanvas.h index 4675487..4cf729e 100644 --- a/Source/WebKit/chromium/public/WebCanvas.h +++ b/Source/WebKit/chromium/public/WebCanvas.h @@ -34,7 +34,7 @@ #include "WebCommon.h" #if WEBKIT_USING_SKIA -namespace skia { class PlatformCanvas; } +class SkCanvas; #elif WEBKIT_USING_CG struct CGContext; #endif @@ -42,7 +42,7 @@ struct CGContext; namespace WebKit { #if WEBKIT_USING_SKIA -typedef skia::PlatformCanvas WebCanvas; +typedef SkCanvas WebCanvas; #elif WEBKIT_USING_CG typedef struct CGContext WebCanvas; #else diff --git a/Source/WebKit/chromium/public/WebContextMenuData.h b/Source/WebKit/chromium/public/WebContextMenuData.h index 5fad616..5bdd2fe 100644 --- a/Source/WebKit/chromium/public/WebContextMenuData.h +++ b/Source/WebKit/chromium/public/WebContextMenuData.h @@ -39,6 +39,8 @@ #include "WebURL.h" #include "WebVector.h" +#define WEBCONTEXT_MEDIATYPEFILE_DEFINED + namespace WebKit { // This struct is passed to WebViewClient::ShowContextMenu. @@ -52,6 +54,8 @@ struct WebContextMenuData { MediaTypeVideo, // An audio node is selected. MediaTypeAudio, + // A file node is selected. + MediaTypeFile, // A plugin node is selected. MediaTypePlugin, }; @@ -91,7 +95,7 @@ struct WebContextMenuData { MediaCanSave = 0x10, MediaHasAudio = 0x20, MediaHasVideo = 0x40, - MediaControls = 0x80, + MediaControlRootElement = 0x80, MediaCanPrint = 0x100, }; @@ -107,6 +111,9 @@ struct WebContextMenuData { // The editable (possibily) misspelled word. WebString misspelledWord; + // If misspelledWord is not empty, holds suggestions from the dictionary. + WebVector<WebString> dictionarySuggestions; + // Whether context is editable. bool isEditable; diff --git a/Source/WebKit/chromium/public/WebFileSystem.h b/Source/WebKit/chromium/public/WebFileSystem.h index 7198f31..773a1f5 100644 --- a/Source/WebKit/chromium/public/WebFileSystem.h +++ b/Source/WebKit/chromium/public/WebFileSystem.h @@ -40,11 +40,15 @@ class WebFileSystemCallbacks; class WebFileWriter; class WebFileWriterClient; +// FIXME(zelidrag): Remove this define once Chromium side catches up. +#define WEB_FILE_SYSTEM_TYPE_EXTERNAL + class WebFileSystem { public: enum Type { TypeTemporary, TypePersistent, + TypeExternal, }; // Moves a file or directory at |srcPath| to |destPath|. diff --git a/Source/WebKit/chromium/public/WebFrame.h b/Source/WebKit/chromium/public/WebFrame.h index d5d2ff4..701936f 100644 --- a/Source/WebKit/chromium/public/WebFrame.h +++ b/Source/WebKit/chromium/public/WebFrame.h @@ -32,6 +32,7 @@ #define WebFrame_h #include "WebCanvas.h" +#include "WebFileSystem.h" #include "WebNode.h" #include "WebURL.h" @@ -67,10 +68,12 @@ class WebURLRequest; class WebView; struct WebConsoleMessage; struct WebFindOptions; +struct WebPoint; struct WebRect; struct WebScriptSource; struct WebSize; struct WebURLLoaderOptions; + template <typename T> class WebVector; class WebFrame { @@ -97,6 +100,13 @@ public: WEBKIT_API static WebFrame* frameForEnteredContext(); WEBKIT_API static WebFrame* frameForCurrentContext(); +#if WEBKIT_USING_V8 + // Returns the frame corresponding to the given context. This can return 0 + // if the context is detached from the frame, or if the context doesn't + // correspond to a frame (e.g., workers). + WEBKIT_API static WebFrame* frameForContext(v8::Handle<v8::Context>); +#endif + // Returns the frame inside a given frame or iframe element. Returns 0 if // the given element is not a frame, iframe or if the frame is empty. WEBKIT_API static WebFrame* fromFrameOwnerElement(const WebElement&); @@ -255,9 +265,15 @@ public: virtual v8::Local<v8::Context> mainWorldScriptContext() const = 0; // Creates an instance of file system object. - virtual v8::Handle<v8::Value> createFileSystem(int type, + virtual v8::Handle<v8::Value> createFileSystem(WebFileSystem::Type, const WebString& name, const WebString& path) = 0; + // Creates an instance of file or directory entry object. + virtual v8::Handle<v8::Value> createFileEntry(WebFileSystem::Type, + const WebString& fileSystemName, + const WebString& fileSystemPath, + const WebString& filePath, + bool isDirectory) = 0; #endif @@ -408,6 +424,8 @@ public: // there is ranged selection. virtual bool selectWordAroundCaret() = 0; + virtual void selectRange(const WebPoint& start, const WebPoint& end) = 0; + // Printing ------------------------------------------------------------ diff --git a/Source/WebKit/chromium/public/WebFrameClient.h b/Source/WebKit/chromium/public/WebFrameClient.h index 2c21ee6..a542c1e 100644 --- a/Source/WebKit/chromium/public/WebFrameClient.h +++ b/Source/WebKit/chromium/public/WebFrameClient.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -35,6 +35,8 @@ #include "WebFileSystem.h" #include "WebNavigationPolicy.h" #include "WebNavigationType.h" +#include "WebStorageQuotaType.h" +#include "WebTextDirection.h" #include "WebURLError.h" namespace WebKit { @@ -51,6 +53,7 @@ class WebNode; class WebPlugin; class WebSecurityOrigin; class WebSharedWorker; +class WebStorageQuotaCallbacks; class WebString; class WebURL; class WebURLRequest; @@ -204,7 +207,12 @@ public: virtual void didCreateDocumentElement(WebFrame*) { } // The page title is available. + // FIXME: remove override once Chrome is updated to new API. virtual void didReceiveTitle(WebFrame*, const WebString& title) { } + virtual void didReceiveTitle(WebFrame* frame, const WebString& title, WebTextDirection direction) + { + didReceiveTitle(frame, title); + } // The icons for the page have changed. virtual void didChangeIcons(WebFrame*) { } @@ -362,6 +370,33 @@ public: WebFrame*, WebFileSystem::Type, long long size, bool create, WebFileSystemCallbacks*) { } + // Quota --------------------------------------------------------- + + // Queries the origin's storage usage and quota information. + // WebStorageQuotaCallbacks::didQueryStorageUsageAndQuota will be called + // with the current usage and quota information for the origin. When + // an error occurs WebStorageQuotaCallbacks::didFail is called with an + // error code. + // The callbacks object is deleted when the callback method is called + // and does not need to be (and should not be) deleted manually. + virtual void queryStorageUsageAndQuota( + WebFrame*, WebStorageQuotaType, WebStorageQuotaCallbacks*) { } + + // Requests a new quota size for the origin's storage. + // |newQuotaInBytes| indicates how much storage space (in bytes) the + // caller expects to need. + // WebStorageQuotaCallbacks::didGrantStorageQuota will be called when + // a new quota is granted. WebStorageQuotaCallbacks::didFail + // is called with an error code otherwise. + // Note that the requesting quota size may not always be granted and + // a smaller amount of quota than requested might be returned. + // The callbacks object is deleted when the callback method is called + // and does not need to be (and should not be) deleted manually. + virtual void requestStorageQuota( + WebFrame*, WebStorageQuotaType, + unsigned long long newQuotaInBytes, + WebStorageQuotaCallbacks*) { } + protected: ~WebFrameClient() { } }; diff --git a/Source/WebKit/chromium/public/WebGraphicsContext3D.h b/Source/WebKit/chromium/public/WebGraphicsContext3D.h index 984f79d..2d7b0a5 100644 --- a/Source/WebKit/chromium/public/WebGraphicsContext3D.h +++ b/Source/WebKit/chromium/public/WebGraphicsContext3D.h @@ -168,6 +168,12 @@ public: virtual void blitFramebufferCHROMIUM(WGC3Dint srcX0, WGC3Dint srcY0, WGC3Dint srcX1, WGC3Dint srcY1, WGC3Dint dstX0, WGC3Dint dstY0, WGC3Dint dstX1, WGC3Dint dstY1, WGC3Dbitfield mask, WGC3Denum filter) = 0; virtual void renderbufferStorageMultisampleCHROMIUM(WGC3Denum target, WGC3Dsizei samples, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height) = 0; + // GL_CHROMIUM_latch + virtual void getParentToChildLatchCHROMIUM(WGC3Duint* latchId) = 0; + virtual void getChildToParentLatchCHROMIUM(WGC3Duint* latchId) = 0; + virtual void waitLatchCHROMIUM(WGC3Duint latchId) = 0; + virtual void setLatchCHROMIUM(WGC3Duint latchId) = 0; + // The entry points below map directly to the OpenGL ES 2.0 API. // See: http://www.khronos.org/registry/gles/ // and: http://www.khronos.org/opengles/sdk/docs/man/ diff --git a/Source/WebKit/chromium/public/WebHTTPLoadInfo.h b/Source/WebKit/chromium/public/WebHTTPLoadInfo.h index 9ff9153..0024878 100644 --- a/Source/WebKit/chromium/public/WebHTTPLoadInfo.h +++ b/Source/WebKit/chromium/public/WebHTTPLoadInfo.h @@ -62,9 +62,18 @@ public: WEBKIT_API WebString httpStatusText() const; WEBKIT_API void setHTTPStatusText(const WebString&); + WEBKIT_API long long encodedDataLength() const; + WEBKIT_API void setEncodedDataLength(long long); + WEBKIT_API void addRequestHeader(const WebString& name, const WebString& value); WEBKIT_API void addResponseHeader(const WebString& name, const WebString& value); + WEBKIT_API WebString requestHeadersText() const; + WEBKIT_API void setRequestHeadersText(const WebString&); + + WEBKIT_API WebString responseHeadersText() const; + WEBKIT_API void setResponseHeadersText(const WebString&); + #if WEBKIT_IMPLEMENTATION WebHTTPLoadInfo(WTF::PassRefPtr<WebCore::ResourceLoadInfo>); operator WTF::PassRefPtr<WebCore::ResourceLoadInfo>() const; diff --git a/Source/WebKit/chromium/public/WebIDBFactory.h b/Source/WebKit/chromium/public/WebIDBFactory.h index 29414e8..97588d5 100755 --- a/Source/WebKit/chromium/public/WebIDBFactory.h +++ b/Source/WebKit/chromium/public/WebIDBFactory.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -57,11 +57,7 @@ public: }; // The WebKit implementation of open ignores the WebFrame* parameter. - // FIXME: Assert not reached when Chromium side is updated. - virtual void open(const WebString& name, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* frame, const WebString& dataDir, unsigned long long maximumSize, BackingStoreType) { open(name, callbacks, origin, frame, dataDir, maximumSize); } - - // FIXME: Remove this when Chromium side is updated. - virtual void open(const WebString& name, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* frame, const WebString& dataDir, unsigned long long maximumSize) { open(name, callbacks, origin, frame, dataDir, maximumSize, DefaultBackingStore); } + virtual void open(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir, unsigned long long maximumSize, BackingStoreType) { WEBKIT_ASSERT_NOT_REACHED(); } virtual void deleteDatabase(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir) { WEBKIT_ASSERT_NOT_REACHED(); } }; diff --git a/Source/WebKit/chromium/public/WebMediaPlayer.h b/Source/WebKit/chromium/public/WebMediaPlayer.h index c0084db..3b2aaaa 100644 --- a/Source/WebKit/chromium/public/WebMediaPlayer.h +++ b/Source/WebKit/chromium/public/WebMediaPlayer.h @@ -79,6 +79,12 @@ public: LiveStream, }; + enum Preload { + None, + MetaData, + Auto, + }; + virtual ~WebMediaPlayer() {} virtual void load(const WebURL&) = 0; @@ -94,7 +100,7 @@ public: virtual void setRate(float) = 0; virtual void setVolume(float) = 0; virtual void setVisible(bool) = 0; - virtual bool setAutoBuffer(bool) = 0; + virtual void setPreload(Preload) { }; virtual bool totalBytesKnown() = 0; virtual const WebTimeRanges& buffered() = 0; virtual float maxTimeSeekable() const = 0; diff --git a/Source/WebKit/chromium/public/WebMediaPlayerClient.h b/Source/WebKit/chromium/public/WebMediaPlayerClient.h index 5f60870..6919717 100644 --- a/Source/WebKit/chromium/public/WebMediaPlayerClient.h +++ b/Source/WebKit/chromium/public/WebMediaPlayerClient.h @@ -31,6 +31,8 @@ #ifndef WebMediaPlayerClient_h #define WebMediaPlayerClient_h +#include "WebMediaPlayer.h" + namespace WebKit { class WebRequest; @@ -50,6 +52,7 @@ public: virtual void sawUnsupportedTracks() = 0; virtual float volume() const = 0; virtual void playbackStateChanged() = 0; + virtual WebMediaPlayer::Preload preload() const = 0; protected: ~WebMediaPlayerClient() { } diff --git a/Source/WebKit/chromium/public/WebRuntimeFeatures.h b/Source/WebKit/chromium/public/WebRuntimeFeatures.h index dfaae5e..276a166 100644 --- a/Source/WebKit/chromium/public/WebRuntimeFeatures.h +++ b/Source/WebKit/chromium/public/WebRuntimeFeatures.h @@ -100,6 +100,9 @@ public: WEBKIT_API static void enableJavaScriptI18NAPI(bool); WEBKIT_API static bool isJavaScriptI18NAPIEnabled(); + WEBKIT_API static void enableQuota(bool); + WEBKIT_API static bool isQuotaEnabled(); + private: WebRuntimeFeatures(); }; diff --git a/Source/WebKit/chromium/public/WebSettings.h b/Source/WebKit/chromium/public/WebSettings.h index 113de52..ed4e6ef 100644 --- a/Source/WebKit/chromium/public/WebSettings.h +++ b/Source/WebKit/chromium/public/WebSettings.h @@ -110,11 +110,13 @@ public: virtual void setAcceleratedCompositingForPluginsEnabled(bool) = 0; virtual void setAcceleratedCompositingForAnimationEnabled(bool) = 0; virtual void setAccelerated2dCanvasEnabled(bool) = 0; + virtual void setAcceleratedDrawingEnabled(bool) = 0; virtual void setMemoryInfoEnabled(bool) = 0; virtual void setHyperlinkAuditingEnabled(bool) = 0; virtual void setAsynchronousSpellCheckingEnabled(bool) = 0; virtual void setCaretBrowsingEnabled(bool) = 0; virtual void setInteractiveFormValidationEnabled(bool) = 0; + virtual void setValidationMessageTimerMagnification(int) = 0; virtual void setMinimumTimerInterval(double) = 0; virtual void setFullScreenEnabled(bool) = 0; diff --git a/Source/WebKit/chromium/public/WebSpellCheckClient.h b/Source/WebKit/chromium/public/WebSpellCheckClient.h index 87bdf9e..5190428 100755 --- a/Source/WebKit/chromium/public/WebSpellCheckClient.h +++ b/Source/WebKit/chromium/public/WebSpellCheckClient.h @@ -32,6 +32,7 @@ #define WebSpellCheckClient_h #include "WebString.h" +#include "WebVector.h" namespace WebKit { @@ -44,9 +45,12 @@ public: // text contains a misspelled word, then upon return misspelledOffset // will point to the start of the misspelled word, and misspelledLength // will indicates its length. Otherwise, if there was not a spelling - // error, then upon return misspelledLength is 0. - virtual void spellCheck( - const WebString& text, int& misspelledOffset, int& misspelledLength) { } + // error, then upon return misspelledLength is 0. If optional_suggestions + // is given, then it will be filled with suggested words (not a cheap step). + virtual void spellCheck(const WebString& text, + int& misspelledOffset, + int& misspelledLength, + WebVector<WebString>* optionalSuggestions) { } // Requests asynchronous spelling and grammar checking, whose result should be // returned by passed completion object. virtual void requestCheckingOfText(const WebString&, WebTextCheckingCompletion*) { } diff --git a/Source/WebKit/chromium/public/WebStorageQuotaCallbacks.h b/Source/WebKit/chromium/public/WebStorageQuotaCallbacks.h new file mode 100644 index 0000000..ee7dc5e --- /dev/null +++ b/Source/WebKit/chromium/public/WebStorageQuotaCallbacks.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebStorageQuotaCallbacks_h +#define WebStorageQuotaCallbacks_h + +#include "WebStorageQuotaError.h" + +namespace WebKit { + +class WebStorageQuotaCallbacks { +public: + // Callback for WebFrameClient::queryStorageUsageAndQuota. + virtual void didQueryStorageUsageAndQuota(unsigned long long usageInBytes, unsigned long long quotaInBytes) = 0; + + // Callback for WebFrameClient::requestStorageQuota. + // This may return a smaller amount of quota than the requested. + virtual void didGrantStorageQuota(unsigned long long grantedQuotaInBytes) = 0; + + virtual void didFail(WebStorageQuotaError) = 0; + +protected: + virtual ~WebStorageQuotaCallbacks() { } +}; + +} // namespace WebKit + +#endif // WebStorageQuotaCallbacks_h diff --git a/Source/WebKit/chromium/public/WebStorageQuotaError.h b/Source/WebKit/chromium/public/WebStorageQuotaError.h new file mode 100644 index 0000000..13e5c03 --- /dev/null +++ b/Source/WebKit/chromium/public/WebStorageQuotaError.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2011 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebStorageQuotaError_h +#define WebStorageQuotaError_h + +namespace WebKit { + +// The error code used for WebStorageQuota. +enum WebStorageQuotaError { + WebStorageQuotaErrorNotSupported = 9, + WebStorageQuotaErrorAbort = 20, +}; + +} // namespace WebKit + +#endif // WebStorageQuotaError_h diff --git a/Source/WebKit/chromium/public/WebStorageQuotaType.h b/Source/WebKit/chromium/public/WebStorageQuotaType.h new file mode 100644 index 0000000..b18caf8 --- /dev/null +++ b/Source/WebKit/chromium/public/WebStorageQuotaType.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2011 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebStorageQuotaType_h +#define WebStorageQuotaType_h + +namespace WebKit { + +enum WebStorageQuotaType { + WebStorageQuotaTypeTemporary, + WebStorageQuotaTypePersistent, +}; + +} // namespace WebKit + +#endif // WebStorageQuotaType_h diff --git a/Source/WebKit/chromium/public/WebURLLoader.h b/Source/WebKit/chromium/public/WebURLLoader.h index 38efcb4..a47b986 100644 --- a/Source/WebKit/chromium/public/WebURLLoader.h +++ b/Source/WebKit/chromium/public/WebURLLoader.h @@ -41,21 +41,6 @@ class WebURLRequest; class WebURLResponse; struct WebURLError; -enum WebCrossOriginRequestPolicy { - DenyCrossOriginRequests, - UseAccessControl, - AllowCrossOriginRequests -}; - -struct WebURLLoaderOptions { - WebURLLoaderOptions() : sniffContent(false), allowCredentials(false), forcePreflight(false), crossOriginRequestPolicy(DenyCrossOriginRequests) { } - - bool sniffContent; // Whether to sniff content. - bool allowCredentials; // Whether to send HTTP credentials and cookies with the request. - bool forcePreflight; // If AccessControl is used, whether to force a preflight. - WebCrossOriginRequestPolicy crossOriginRequestPolicy; -}; - class WebURLLoader { public: // The WebURLLoader may be deleted in a call to its client. diff --git a/Source/WebKit/chromium/public/WebURLLoaderClient.h b/Source/WebKit/chromium/public/WebURLLoaderClient.h index e306b19..20a3b44 100644 --- a/Source/WebKit/chromium/public/WebURLLoaderClient.h +++ b/Source/WebKit/chromium/public/WebURLLoaderClient.h @@ -58,11 +58,7 @@ public: virtual void didDownloadData(WebURLLoader*, int dataLength) { } // Called when a chunk of response data is received. - // FIXME(vsevik): rename once original didReceiveData() is removed. - virtual void didReceiveData2(WebURLLoader*, const char* data, int dataLength, int lengthReceived) { } - - // FIXME(vsevik): remove once not used downstream - virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength) { } + virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength, int encodedDataLength) { } // Called when a chunk of renderer-generated metadata is received from the cache. virtual void didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength) { } diff --git a/Source/WebKit/chromium/public/WebURLLoaderOptions.h b/Source/WebKit/chromium/public/WebURLLoaderOptions.h new file mode 100644 index 0000000..bd10763 --- /dev/null +++ b/Source/WebKit/chromium/public/WebURLLoaderOptions.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2009, 2011 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebURLLoaderOptions_h +#define WebURLLoaderOptions_h + +namespace WebKit { + +struct WebURLLoaderOptions { + + enum CrossOriginRequestPolicy { + CrossOriginRequestPolicyDeny, + CrossOriginRequestPolicyUseAccessControl, + CrossOriginRequestPolicyAllow + }; + + WebURLLoaderOptions() : sniffContent(false), allowCredentials(false), forcePreflight(false), crossOriginRequestPolicy(CrossOriginRequestPolicyDeny) { } + + bool sniffContent; // Whether to sniff content. + bool allowCredentials; // Whether to send HTTP credentials and cookies with the request. + bool forcePreflight; // If policy is to use access control, whether to force a preflight for GET, HEAD, and POST requests. + CrossOriginRequestPolicy crossOriginRequestPolicy; +}; + +} // namespace WebKit + +#endif diff --git a/Source/WebKit/chromium/public/WebURLRequest.h b/Source/WebKit/chromium/public/WebURLRequest.h index 7dd97ca..d88c7b9 100644 --- a/Source/WebKit/chromium/public/WebURLRequest.h +++ b/Source/WebKit/chromium/public/WebURLRequest.h @@ -69,6 +69,7 @@ public: TargetIsWorker = 9, TargetIsSharedWorker = 10, TargetIsPrefetch = 11, + TargetIsFavicon = 12, }; ~WebURLRequest() { reset(); } diff --git a/Source/WebKit/chromium/public/WebView.h b/Source/WebKit/chromium/public/WebView.h index d32e09c..6b69e7c 100644 --- a/Source/WebKit/chromium/public/WebView.h +++ b/Source/WebKit/chromium/public/WebView.h @@ -230,10 +230,6 @@ public: // Callback methods when a drag-and-drop operation is trying to drop // something on the WebView. virtual WebDragOperation dragTargetDragEnter( - const WebDragData&, int identity, // FIXME: remove identity from this function signature. - const WebPoint& clientPoint, const WebPoint& screenPoint, - WebDragOperationsMask operationsAllowed) = 0; - virtual WebDragOperation dragTargetDragEnter( const WebDragData&, const WebPoint& clientPoint, const WebPoint& screenPoint, WebDragOperationsMask operationsAllowed) = 0; diff --git a/Source/WebKit/chromium/public/WebViewClient.h b/Source/WebKit/chromium/public/WebViewClient.h index c168ef2..5174351 100644 --- a/Source/WebKit/chromium/public/WebViewClient.h +++ b/Source/WebKit/chromium/public/WebViewClient.h @@ -122,6 +122,12 @@ public: // The icon is shown in a file upload control. virtual bool queryIconForFiles(const WebVector<WebString>& filenames, WebIconLoadingCompletion*) { return false; } + // This method enumerates all the files in the path. It returns immediately + // and asynchronously invokes the WebFileChooserCompletion with all the + // files in the directory. Returns false if the WebFileChooserCompletion + // will never be called. + virtual bool enumerateChosenDirectory(const WebString& path, WebFileChooserCompletion*) { return false; } + // Navigational -------------------------------------------------------- diff --git a/Source/WebKit/chromium/public/WebWidget.h b/Source/WebKit/chromium/public/WebWidget.h index 36fbf31..1290ad8 100644 --- a/Source/WebKit/chromium/public/WebWidget.h +++ b/Source/WebKit/chromium/public/WebWidget.h @@ -41,6 +41,7 @@ namespace WebKit { class WebInputEvent; class WebString; +struct WebPoint; struct WebRect; struct WebSize; template <typename T> class WebVector; @@ -126,6 +127,10 @@ public: // will be returned if a selection range is available. virtual WebRect caretOrSelectionBounds() = 0; + // Returns the start and end point for the current selection, aligned to the + // bottom of the selected line. + virtual bool selectionRange(WebPoint& start, WebPoint& end) const = 0; + // Changes the text direction of the selected input node. virtual void setTextDirection(WebTextDirection) = 0; diff --git a/Source/WebKit/chromium/scripts/inline_js_imports.py b/Source/WebKit/chromium/scripts/inline_js_imports.py new file mode 100644 index 0000000..2655016 --- /dev/null +++ b/Source/WebKit/chromium/scripts/inline_js_imports.py @@ -0,0 +1,82 @@ +#!/usr/bin/env python +# +# Copyright (C) 2011 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# This script replaces calls to importScripts with script sources +# in input script file and dumps result into output script file. + +from cStringIO import StringIO + +import jsmin +import os.path +import re +import sys + + +def main(argv): + + if len(argv) < 3: + print('usage: %s input_file imports_dir output_file' % argv[0]) + return 1 + + input_file_name = argv[1] + imports_dir = argv[2] + output_file_name = argv[3] + + input_file = open(input_file_name, 'r') + input_script = input_file.read() + input_file.close() + + def replace(match): + import_file_name = match.group(1) + full_path = os.path.join(imports_dir, import_file_name) + if not os.access(full_path, os.F_OK): + raise Exception('File %s referenced in %s not found on any source paths, ' + 'check source tree for consistency' % + (import_file_name, input_file_name)) + import_file = open(full_path, 'r') + import_script = import_file.read() + import_file.close() + return import_script + + output_script = re.sub(r'importScripts\([\'"]([^\'"]+)[\'"]\)', replace, input_script) + + output_file = open(output_file_name, 'w') + output_file.write(jsmin.jsmin(output_script)) + output_file.close() + + # Touch output file directory to make sure that Xcode will copy + # modified resource files. + if sys.platform == 'darwin': + output_dir_name = os.path.dirname(output_file_name) + os.utime(output_dir_name, None) + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp index 7baaf8a..533e8ec 100644 --- a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -38,6 +38,7 @@ #include "AsyncFileSystem.h" #include "DocumentMarker.h" #include "EditorInsertAction.h" +#include "ExceptionCode.h" #include "FileError.h" #include "FileMetadata.h" #include "FontDescription.h" @@ -52,6 +53,7 @@ #include "PasteboardPrivate.h" #include "PlatformCursor.h" #include "Settings.h" +#include "StorageInfo.h" #include "TextAffinity.h" #include "UserContentTypes.h" #include "UserScriptTypes.h" @@ -75,6 +77,8 @@ #include "WebNotificationPresenter.h" #include "WebScrollbar.h" #include "WebSettings.h" +#include "WebStorageQuotaError.h" +#include "WebStorageQuotaType.h" #include "WebTextAffinity.h" #include "WebTextCaseSensitivity.h" #include "WebTextCheckingResult.h" @@ -390,6 +394,7 @@ COMPILE_ASSERT_MATCHING_ENUM(WebIDBFactory::LevelDBBackingStore, IDBFactoryBacke #if ENABLE(FILE_SYSTEM) COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypeTemporary, AsyncFileSystem::Temporary); COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypePersistent, AsyncFileSystem::Persistent); +COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypeExternal, AsyncFileSystem::External); COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeUnknown, FileMetadata::TypeUnknown); COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeFile, FileMetadata::TypeFile); COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeDirectory, FileMetadata::TypeDirectory); @@ -414,6 +419,17 @@ COMPILE_ASSERT_MATCHING_ENUM(WebGeolocationError::ErrorPositionUnavailable, Geol COMPILE_ASSERT_MATCHING_ENUM(WebTextCheckingResult::ErrorSpelling, DocumentMarker::Spelling); COMPILE_ASSERT_MATCHING_ENUM(WebTextCheckingResult::ErrorGrammar, DocumentMarker::Grammar); +#if ENABLE(QUOTA) +COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaErrorNotSupported, NOT_SUPPORTED_ERR); +COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaErrorAbort, ABORT_ERR); + +COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaTypeTemporary, StorageInfo::TEMPORARY); +COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaTypePersistent, StorageInfo::PERSISTENT); + +COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaErrorNotSupported, NOT_SUPPORTED_ERR); +COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaErrorAbort, ABORT_ERR); +#endif + #if OS(DARWIN) COMPILE_ASSERT_MATCHING_ENUM(WebThemeEngine::StateDisabled, PlatformBridge::StateDisabled); COMPILE_ASSERT_MATCHING_ENUM(WebThemeEngine::StateInactive, PlatformBridge::StateInactive); diff --git a/Source/WebKit/chromium/src/AssociatedURLLoader.cpp b/Source/WebKit/chromium/src/AssociatedURLLoader.cpp index 1ca9900..acb7687 100644 --- a/Source/WebKit/chromium/src/AssociatedURLLoader.cpp +++ b/Source/WebKit/chromium/src/AssociatedURLLoader.cpp @@ -124,17 +124,16 @@ void AssociatedURLLoader::ClientAdapter::didReceiveData(const char* data, int da if (!m_client) return; - // FIXME(vsevik): add -1 to params once migrated. - m_client->didReceiveData(m_loader, data, dataLength); + m_client->didReceiveData(m_loader, data, dataLength, -1); m_downloadLength += dataLength; } -void AssociatedURLLoader::ClientAdapter::didReceiveCachedMetadata(const char* data, int lengthReceived) +void AssociatedURLLoader::ClientAdapter::didReceiveCachedMetadata(const char* data, int dataLength) { if (!m_client) return; - m_client->didReceiveCachedMetadata(m_loader, data, lengthReceived); + m_client->didReceiveCachedMetadata(m_loader, data, dataLength); } void AssociatedURLLoader::ClientAdapter::didFinishLoading(unsigned long identifier, double finishTime) @@ -169,7 +168,7 @@ AssociatedURLLoader::AssociatedURLLoader(PassRefPtr<WebFrameImpl> frameImpl) m_options.sniffContent = false; m_options.allowCredentials = true; m_options.forcePreflight = false; - m_options.crossOriginRequestPolicy = AllowCrossOriginRequests; // TODO(bbudge) Default should be DenyCrossOriginRequests, but this would break some tests. + m_options.crossOriginRequestPolicy = WebURLLoaderOptions::CrossOriginRequestPolicyAllow; // FIXME We should deny by default, but this would break some tests. } AssociatedURLLoader::AssociatedURLLoader(PassRefPtr<WebFrameImpl> frameImpl, const WebURLLoaderOptions& options) @@ -189,9 +188,9 @@ AssociatedURLLoader::~AssociatedURLLoader() #define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, webcore_name) \ COMPILE_ASSERT(static_cast<int>(WebKit::webkit_name) == static_cast<int>(WebCore::webcore_name), mismatching_enums) -COMPILE_ASSERT_MATCHING_ENUM(DenyCrossOriginRequests, DenyCrossOriginRequests); -COMPILE_ASSERT_MATCHING_ENUM(UseAccessControl, UseAccessControl); -COMPILE_ASSERT_MATCHING_ENUM(AllowCrossOriginRequests, AllowCrossOriginRequests); +COMPILE_ASSERT_MATCHING_ENUM(WebURLLoaderOptions::CrossOriginRequestPolicyDeny, DenyCrossOriginRequests); +COMPILE_ASSERT_MATCHING_ENUM(WebURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl, UseAccessControl); +COMPILE_ASSERT_MATCHING_ENUM(WebURLLoaderOptions::CrossOriginRequestPolicyAllow, AllowCrossOriginRequests); void AssociatedURLLoader::loadSynchronously(const WebURLRequest& request, WebURLResponse& response, WebURLError& error, WebData& data) { diff --git a/Source/WebKit/chromium/src/AssociatedURLLoader.h b/Source/WebKit/chromium/src/AssociatedURLLoader.h index ed183e5..9458986 100644 --- a/Source/WebKit/chromium/src/AssociatedURLLoader.h +++ b/Source/WebKit/chromium/src/AssociatedURLLoader.h @@ -32,6 +32,7 @@ #define AssociatedURLLoader_h #include "WebURLLoader.h" +#include "WebURLLoaderOptions.h" #include <wtf/Noncopyable.h> #include <wtf/OwnPtr.h> #include <wtf/RefPtr.h> diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.cpp b/Source/WebKit/chromium/src/ChromeClientImpl.cpp index 99302cc..f12bf03 100644 --- a/Source/WebKit/chromium/src/ChromeClientImpl.cpp +++ b/Source/WebKit/chromium/src/ChromeClientImpl.cpp @@ -54,6 +54,7 @@ #include "Node.h" #include "NotificationPresenterImpl.h" #include "Page.h" +#include "PlatformBridge.h" #include "PopupMenuChromium.h" #include "RenderWidget.h" #include "ScriptController.h" @@ -682,6 +683,22 @@ void ChromeClientImpl::chooseIconForFiles(const Vector<String>& filenames, FileC iconCompletion->didLoadIcon(WebData()); } +#if ENABLE(DIRECTORY_UPLOAD) +void ChromeClientImpl::enumerateChosenDirectory(const String& path, FileChooser* fileChooser) +{ + WebViewClient* client = m_webView->client(); + if (!client) + return; + + WebFileChooserCompletionImpl* chooserCompletion = + new WebFileChooserCompletionImpl(fileChooser); + + // If the enumeration can't happen, call the callback with an empty list. + if (!client->enumerateChosenDirectory(path, chooserCompletion)) + chooserCompletion->didChooseFile(WebVector<WebString>()); +} +#endif + void ChromeClientImpl::popupOpened(PopupContainer* popupContainer, const IntRect& bounds, bool handleExternally) @@ -905,4 +922,9 @@ PassRefPtr<SearchPopupMenu> ChromeClientImpl::createSearchPopupMenu(PopupMenuCli return adoptRef(new SearchPopupMenuChromium(client)); } +void ChromeClientImpl::willRunModalDialogDuringPageDismissal(const DialogType& dialogType) const +{ + PlatformBridge::histogramEnumeration("Renderer.ModalDialogsDuringPageDismissal", static_cast<int>(dialogType), static_cast<int>(NumDialogTypes)); +} + } // namespace WebKit diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.h b/Source/WebKit/chromium/src/ChromeClientImpl.h index f3a48ee..6a65522 100644 --- a/Source/WebKit/chromium/src/ChromeClientImpl.h +++ b/Source/WebKit/chromium/src/ChromeClientImpl.h @@ -139,6 +139,9 @@ public: virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*, WebCore::Geolocation*); virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>); virtual void chooseIconForFiles(const Vector<WTF::String>&, WebCore::FileChooser*); +#if ENABLE(DIRECTORY_UPLOAD) + virtual void enumerateChosenDirectory(const WTF::String&, WebCore::FileChooser*); +#endif virtual void setCursor(const WebCore::Cursor&); virtual void formStateDidChange(const WebCore::Node*); #if ENABLE(TOUCH_EVENTS) @@ -191,6 +194,8 @@ public: virtual void showContextMenu() { } #endif + virtual void willRunModalDialogDuringPageDismissal(const DialogType&) const; + private: void getPopupMenuInfo(WebCore::PopupContainer*, WebPopupMenuInfo*); void setCursor(const WebCursorInfo&); diff --git a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp index 9c137c9..0f82d38 100644 --- a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp +++ b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp @@ -61,6 +61,7 @@ #include "WebPlugin.h" #include "WebPluginContainerImpl.h" #include "WebPoint.h" +#include "WebSpellCheckClient.h" #include "WebString.h" #include "WebURL.h" #include "WebURLResponse.h" @@ -206,7 +207,7 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems( if (mediaElement->hasVideo()) data.mediaFlags |= WebContextMenuData::MediaHasVideo; if (mediaElement->controls()) - data.mediaFlags |= WebContextMenuData::MediaControls; + data.mediaFlags |= WebContextMenuData::MediaControlRootElement; } else if (r.innerNonSharedNode()->hasTagName(HTMLNames::objectTag) || r.innerNonSharedNode()->hasTagName(HTMLNames::embedTag)) { RenderObject* object = r.innerNonSharedNode()->renderer(); @@ -256,8 +257,17 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems( if (m_webView->focusedWebCoreFrame()->editor()->isContinuousSpellCheckingEnabled()) { data.isSpellCheckingEnabled = true; // Spellchecking might be enabled for the field, but could be disabled on the node. - if (m_webView->focusedWebCoreFrame()->editor()->isSpellCheckingEnabledInFocusedNode()) + if (m_webView->focusedWebCoreFrame()->editor()->isSpellCheckingEnabledInFocusedNode()) { data.misspelledWord = selectMisspelledWord(defaultMenu, selectedFrame); + if (m_webView->spellCheckClient()) { + int misspelledOffset, misspelledLength; + m_webView->spellCheckClient()->spellCheck( + data.misspelledWord, misspelledOffset, misspelledLength, + &data.dictionarySuggestions); + if (!misspelledLength) + data.misspelledWord.reset(); + } + } } } diff --git a/Source/WebKit/chromium/src/EditorClientImpl.cpp b/Source/WebKit/chromium/src/EditorClientImpl.cpp index 6f2231d..1141ea4 100644 --- a/Source/WebKit/chromium/src/EditorClientImpl.cpp +++ b/Source/WebKit/chromium/src/EditorClientImpl.cpp @@ -858,7 +858,7 @@ void EditorClientImpl::checkSpellingOfString(const UChar* text, int length, // Check to see if the provided text is spelled correctly. if (isContinuousSpellCheckingEnabled() && m_webView->spellCheckClient()) - m_webView->spellCheckClient()->spellCheck(WebString(text, length), spellLocation, spellLength); + m_webView->spellCheckClient()->spellCheck(WebString(text, length), spellLocation, spellLength, 0); else { spellLocation = 0; spellLength = 0; @@ -872,7 +872,7 @@ void EditorClientImpl::checkSpellingOfString(const UChar* text, int length, *misspellingLength = spellLength; } -void EditorClientImpl::requestCheckingOfString(SpellChecker* sender, int identifier, const String& text) +void EditorClientImpl::requestCheckingOfString(SpellChecker* sender, int identifier, TextCheckingTypeMask, const String& text) { if (m_webView->spellCheckClient()) m_webView->spellCheckClient()->requestCheckingOfText(text, new WebTextCheckingCompletionImpl(identifier, sender)); diff --git a/Source/WebKit/chromium/src/EditorClientImpl.h b/Source/WebKit/chromium/src/EditorClientImpl.h index b81fb56..2ebc6ea 100644 --- a/Source/WebKit/chromium/src/EditorClientImpl.h +++ b/Source/WebKit/chromium/src/EditorClientImpl.h @@ -114,7 +114,7 @@ public: WTF::Vector<WTF::String>& guesses); virtual void willSetInputMethodState(); virtual void setInputMethodState(bool enabled); - virtual void requestCheckingOfString(WebCore::SpellChecker*, int, const WTF::String&); + virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&); virtual WebCore::TextCheckerClient* textChecker() { return this; } diff --git a/Source/WebKit/chromium/src/EventListenerWrapper.cpp b/Source/WebKit/chromium/src/EventListenerWrapper.cpp index 6360932..b352d81 100644 --- a/Source/WebKit/chromium/src/EventListenerWrapper.cpp +++ b/Source/WebKit/chromium/src/EventListenerWrapper.cpp @@ -37,6 +37,8 @@ #include "WebDOMEvent.h" #include "WebDOMEventListener.h" +using namespace WebCore; + namespace WebKit { EventListenerWrapper::EventListenerWrapper(WebDOMEventListener* webDOMEventListener) diff --git a/Source/WebKit/chromium/src/EventListenerWrapper.h b/Source/WebKit/chromium/src/EventListenerWrapper.h index 75b6a95..83e1cf1 100644 --- a/Source/WebKit/chromium/src/EventListenerWrapper.h +++ b/Source/WebKit/chromium/src/EventListenerWrapper.h @@ -37,21 +37,19 @@ namespace WebCore { class ScriptExecutionContext; } -using namespace WebCore; - namespace WebKit { class WebDOMEventListener; // FIXME: Remove the DeprecatedEventListenerWrapper class below once Chromium // switched to using WebDOMEvent. -class EventListenerWrapper : public EventListener { +class EventListenerWrapper : public WebCore::EventListener { public: EventListenerWrapper(WebDOMEventListener*); ~EventListenerWrapper(); - virtual bool operator==(const EventListener&); - virtual void handleEvent(ScriptExecutionContext*, Event*); + virtual bool operator==(const WebCore::EventListener&); + virtual void handleEvent(WebCore::ScriptExecutionContext*, WebCore::Event*); void webDOMEventListenerDeleted(); diff --git a/Source/WebKit/chromium/src/Extensions3DChromium.cpp b/Source/WebKit/chromium/src/Extensions3DChromium.cpp index 30101c7..81fa520 100644 --- a/Source/WebKit/chromium/src/Extensions3DChromium.cpp +++ b/Source/WebKit/chromium/src/Extensions3DChromium.cpp @@ -57,6 +57,11 @@ void Extensions3DChromium::ensureEnabled(const String& name) ASSERT(result); } +bool Extensions3DChromium::isEnabled(const String& name) +{ + return m_internal->isExtensionEnabled(name); +} + int Extensions3DChromium::getGraphicsResetStatusARB() { return m_internal->isContextLost() ? static_cast<int>(Extensions3D::UNKNOWN_CONTEXT_RESET_ARB) : static_cast<int>(GraphicsContext3D::NO_ERROR); @@ -97,6 +102,26 @@ void Extensions3DChromium::copyTextureToParentTextureCHROMIUM(unsigned texture, m_internal->copyTextureToParentTextureCHROMIUM(texture, parentTexture); } +void Extensions3DChromium::getParentToChildLatchCHROMIUM(GC3Duint* latchId) +{ + m_internal->getParentToChildLatchCHROMIUM(latchId); +} + +void Extensions3DChromium::getChildToParentLatchCHROMIUM(GC3Duint* latchId) +{ + m_internal->getChildToParentLatchCHROMIUM(latchId); +} + +void Extensions3DChromium::waitLatchCHROMIUM(GC3Duint latchId) +{ + m_internal->waitLatchCHROMIUM(latchId); +} + +void Extensions3DChromium::setLatchCHROMIUM(GC3Duint latchId) +{ + m_internal->setLatchCHROMIUM(latchId); +} + Platform3DObject Extensions3DChromium::createVertexArrayOES() { return 0; diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp index 647a70c..d640b65 100644 --- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp +++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp @@ -380,7 +380,7 @@ void FrameLoaderClientImpl::dispatchDidReceiveResponse(DocumentLoader* loader, void FrameLoaderClientImpl::dispatchDidReceiveContentLength( DocumentLoader* loader, unsigned long identifier, - int lengthReceived) + int dataLength) { } @@ -714,10 +714,18 @@ void FrameLoaderClientImpl::dispatchDidStartProvisionalLoad() // m_expectedClientRedirectDest could be something like // "javascript:history.go(-1)" thus we need to exclude url starts with // "javascript:". See bug: 1080873 - ASSERT(m_expectedClientRedirectDest.protocolIs("javascript") - || m_expectedClientRedirectDest == url); - ds->appendRedirect(m_expectedClientRedirectSrc); - completingClientRedirect = true; + if (m_expectedClientRedirectDest.protocolIs("javascript") + || m_expectedClientRedirectDest == url) { + ds->appendRedirect(m_expectedClientRedirectSrc); + completingClientRedirect = true; + } else { + // Any pending redirect is no longer in progress. This can happen + // if the navigation was canceled with PolicyIgnore, or if the + // redirect was scheduled on the wrong frame (e.g., due to a form + // submission targeted to _blank, as in http://webkit.org/b/44079). + m_expectedClientRedirectSrc = KURL(); + m_expectedClientRedirectDest = KURL(); + } } ds->appendRedirect(url); @@ -734,10 +742,10 @@ void FrameLoaderClientImpl::dispatchDidStartProvisionalLoad() } } -void FrameLoaderClientImpl::dispatchDidReceiveTitle(const String& title) +void FrameLoaderClientImpl::dispatchDidReceiveTitle(const StringWithDirection& title) { if (m_webFrame->client()) - m_webFrame->client()->didReceiveTitle(m_webFrame, title); + m_webFrame->client()->didReceiveTitle(m_webFrame, title.string(), title.direction() == LTR ? WebTextDirectionLeftToRight : WebTextDirectionRightToLeft); } void FrameLoaderClientImpl::dispatchDidChangeIcons() @@ -1328,7 +1336,7 @@ PassRefPtr<DocumentLoader> FrameLoaderClientImpl::createDocumentLoader( return ds.release(); } -void FrameLoaderClientImpl::setTitle(const String& title, const KURL& url) +void FrameLoaderClientImpl::setTitle(const StringWithDirection& title, const KURL& url) { // FIXME: inform consumer of changes to the title. } diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h index f19c26c..042b462 100644 --- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h +++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h @@ -88,7 +88,7 @@ public: virtual void dispatchDidReceiveAuthenticationChallenge(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::AuthenticationChallenge&); virtual void dispatchDidCancelAuthenticationChallenge(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::AuthenticationChallenge&); virtual void dispatchDidReceiveResponse(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceResponse&); - virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int lengthReceived); + virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int dataLength); virtual void dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long identifier); virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceError&); virtual bool dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int length); @@ -104,7 +104,7 @@ public: virtual void dispatchWillClose(); virtual void dispatchDidReceiveIcon(); virtual void dispatchDidStartProvisionalLoad(); - virtual void dispatchDidReceiveTitle(const WTF::String& title); + virtual void dispatchDidReceiveTitle(const WebCore::StringWithDirection&); virtual void dispatchDidChangeIcons(); virtual void dispatchDidCommitLoad(); virtual void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&); @@ -166,7 +166,7 @@ public: virtual void prepareForDataSourceReplacement(); virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader( const WebCore::ResourceRequest&, const WebCore::SubstituteData&); - virtual void setTitle(const WTF::String& title, const WebCore::KURL&); + virtual void setTitle(const WebCore::StringWithDirection&, const WebCore::KURL&); virtual WTF::String userAgent(const WebCore::KURL&); virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*); virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*); diff --git a/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp b/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp index 54c18e3..611103c 100644 --- a/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp +++ b/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp @@ -54,7 +54,7 @@ #include <wtf/FastMalloc.h> #include <wtf/text/CString.h> -#if PLATFORM(CG) +#if USE(CG) #include "GraphicsContext.h" #include "WebGLRenderingContext.h" #include <CoreGraphics/CGContext.h> @@ -84,7 +84,7 @@ GraphicsContext3DInternal::GraphicsContext3DInternal() , m_initializedAvailableExtensions(false) , m_layerComposited(false) #if USE(SKIA) -#elif PLATFORM(CG) +#elif USE(CG) , m_renderOutput(0) #else #error Must port to your platform @@ -94,7 +94,7 @@ GraphicsContext3DInternal::GraphicsContext3DInternal() GraphicsContext3DInternal::~GraphicsContext3DInternal() { -#if PLATFORM(CG) +#if USE(CG) if (m_renderOutput) delete[] m_renderOutput; #endif @@ -210,7 +210,7 @@ void GraphicsContext3DInternal::paintRenderingResultsToCanvas(CanvasRenderingCon // Read back the frame buffer. SkAutoLockPixels bitmapLock(*readbackBitmap); pixels = static_cast<unsigned char*>(readbackBitmap->getPixels()); -#elif PLATFORM(CG) +#elif USE(CG) if (m_renderOutput) pixels = m_renderOutput; #else @@ -230,6 +230,7 @@ void GraphicsContext3DInternal::paintRenderingResultsToCanvas(CanvasRenderingCon } #if USE(SKIA) + readbackBitmap->notifyPixelsChanged(); if (m_resizingBitmap.readyToDraw()) { // We need to draw the resizing bitmap into the canvas's backing store. SkCanvas canvas(*canvasBitmap); @@ -237,7 +238,7 @@ void GraphicsContext3DInternal::paintRenderingResultsToCanvas(CanvasRenderingCon dst.set(SkIntToScalar(0), SkIntToScalar(0), SkIntToScalar(canvasBitmap->width()), SkIntToScalar(canvasBitmap->height())); canvas.drawBitmapRect(m_resizingBitmap, 0, dst); } -#elif PLATFORM(CG) +#elif USE(CG) if (m_renderOutput && context->is3d()) { WebGLRenderingContext* webGLContext = static_cast<WebGLRenderingContext*>(context); webGLContext->graphicsContext3D()->paintToCanvas(m_renderOutput, m_impl->width(), m_impl->height(), canvas->width(), canvas->height(), imageBuffer->context()->platformContext()); @@ -277,7 +278,7 @@ void GraphicsContext3DInternal::reshape(int width, int height) m_impl->reshape(width, height); -#if PLATFORM(CG) +#if USE(CG) // Need to reallocate the client-side backing store. // FIXME: make this more efficient. if (m_renderOutput) { @@ -286,7 +287,7 @@ void GraphicsContext3DInternal::reshape(int width, int height) } int rowBytes = width * 4; m_renderOutput = new unsigned char[height * rowBytes]; -#endif // PLATFORM(CG) +#endif // USE(CG) } IntSize GraphicsContext3DInternal::getInternalFramebufferSize() @@ -793,6 +794,13 @@ bool GraphicsContext3DInternal::ensureExtensionEnabled(const String& name) return m_enabledExtensions.contains(mappedName); } +bool GraphicsContext3DInternal::isExtensionEnabled(const String& name) +{ + initializeExtensions(); + String mappedName = mapExtensionName(name); + return m_enabledExtensions.contains(mappedName); +} + DELEGATE_TO_IMPL_4R(mapBufferSubDataCHROMIUM, GC3Denum, GC3Dsizeiptr, GC3Dsizei, GC3Denum, void*) DELEGATE_TO_IMPL_1(unmapBufferSubDataCHROMIUM, const void*) DELEGATE_TO_IMPL_9R(mapTexSubImage2DCHROMIUM, GC3Denum, GC3Dint, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei, GC3Denum, GC3Denum, GC3Denum, void*) @@ -800,6 +808,10 @@ DELEGATE_TO_IMPL_1(unmapTexSubImage2DCHROMIUM, const void*) DELEGATE_TO_IMPL_2(copyTextureToParentTextureCHROMIUM, Platform3DObject, Platform3DObject) DELEGATE_TO_IMPL_10(blitFramebufferCHROMIUM, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dbitfield, GC3Denum) DELEGATE_TO_IMPL_5(renderbufferStorageMultisampleCHROMIUM, GC3Denum, GC3Dsizei, GC3Denum, GC3Dsizei, GC3Dsizei) +DELEGATE_TO_IMPL_1(getParentToChildLatchCHROMIUM, GC3Duint*) +DELEGATE_TO_IMPL_1(getChildToParentLatchCHROMIUM, GC3Duint*) +DELEGATE_TO_IMPL_1(waitLatchCHROMIUM, GC3Duint) +DELEGATE_TO_IMPL_1(setLatchCHROMIUM, GC3Duint) //---------------------------------------------------------------------- // GraphicsContext3D diff --git a/Source/WebKit/chromium/src/GraphicsContext3DInternal.h b/Source/WebKit/chromium/src/GraphicsContext3DInternal.h index 0af291e..c02491c 100644 --- a/Source/WebKit/chromium/src/GraphicsContext3DInternal.h +++ b/Source/WebKit/chromium/src/GraphicsContext3DInternal.h @@ -251,6 +251,7 @@ public: Extensions3D* getExtensions(); bool supportsExtension(const String& name); bool ensureExtensionEnabled(const String& name); + bool isExtensionEnabled(const String& name); // EXT_texture_format_BGRA8888 bool supportsBGRA(); @@ -270,6 +271,12 @@ public: void blitFramebufferCHROMIUM(GC3Dint srcX0, GC3Dint srcY0, GC3Dint srcX1, GC3Dint srcY1, GC3Dint dstX0, GC3Dint dstY0, GC3Dint dstX1, GC3Dint dstY1, GC3Dbitfield mask, GC3Denum filter); void renderbufferStorageMultisampleCHROMIUM(GC3Denum target, GC3Dsizei samples, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height); + // Latch support + void getParentToChildLatchCHROMIUM(GC3Duint* latchId); + void getChildToParentLatchCHROMIUM(GC3Duint* latchId); + void waitLatchCHROMIUM(GC3Duint latchId); + void setLatchCHROMIUM(GC3Duint latchId); + private: OwnPtr<WebKit::WebGraphicsContext3D> m_impl; OwnPtr<Extensions3DChromium> m_extensions; @@ -291,7 +298,7 @@ private: SkBitmap m_resizingBitmap; #endif -#if PLATFORM(CG) +#if USE(CG) unsigned char* m_renderOutput; #endif diff --git a/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp b/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp index 727092a..c536c38 100644 --- a/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp +++ b/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,8 +29,10 @@ #include "config.h" #include "IDBCallbacksProxy.h" +#if ENABLE(INDEXED_DATABASE) + +#include "IDBDatabaseBackendProxy.h" #include "IDBDatabaseError.h" -#include "IDBDatabaseProxy.h" #include "WebIDBCallbacks.h" #include "WebIDBCursorImpl.h" #include "WebIDBDatabaseImpl.h" @@ -39,16 +41,16 @@ #include "WebIDBTransactionImpl.h" #include "WebSerializedScriptValue.h" -#if ENABLE(INDEXED_DATABASE) +using namespace WebCore; -namespace WebCore { +namespace WebKit { -PassRefPtr<IDBCallbacksProxy> IDBCallbacksProxy::create(PassOwnPtr<WebKit::WebIDBCallbacks> callbacks) +PassRefPtr<IDBCallbacksProxy> IDBCallbacksProxy::create(PassOwnPtr<WebIDBCallbacks> callbacks) { return adoptRef(new IDBCallbacksProxy(callbacks)); } -IDBCallbacksProxy::IDBCallbacksProxy(PassOwnPtr<WebKit::WebIDBCallbacks> callbacks) +IDBCallbacksProxy::IDBCallbacksProxy(PassOwnPtr<WebIDBCallbacks> callbacks) : m_callbacks(callbacks) { } @@ -59,32 +61,32 @@ IDBCallbacksProxy::~IDBCallbacksProxy() void IDBCallbacksProxy::onError(PassRefPtr<IDBDatabaseError> idbDatabaseError) { - m_callbacks->onError(WebKit::WebIDBDatabaseError(idbDatabaseError)); + m_callbacks->onError(WebIDBDatabaseError(idbDatabaseError)); } void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBCursorBackendInterface> idbCursorBackend) { - m_callbacks->onSuccess(new WebKit::WebIDBCursorImpl(idbCursorBackend)); + m_callbacks->onSuccess(new WebIDBCursorImpl(idbCursorBackend)); } void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBDatabaseBackendInterface> backend) { - m_callbacks->onSuccess(new WebKit::WebIDBDatabaseImpl(backend)); + m_callbacks->onSuccess(new WebIDBDatabaseImpl(backend)); } void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBKey> idbKey) { - m_callbacks->onSuccess(WebKit::WebIDBKey(idbKey)); + m_callbacks->onSuccess(WebIDBKey(idbKey)); } void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBTransactionBackendInterface> backend) { - m_callbacks->onSuccess(new WebKit::WebIDBTransactionImpl(backend)); + m_callbacks->onSuccess(new WebIDBTransactionImpl(backend)); } void IDBCallbacksProxy::onSuccess(PassRefPtr<SerializedScriptValue> serializedScriptValue) { - m_callbacks->onSuccess(WebKit::WebSerializedScriptValue(serializedScriptValue)); + m_callbacks->onSuccess(WebSerializedScriptValue(serializedScriptValue)); } void IDBCallbacksProxy::onBlocked() @@ -92,6 +94,6 @@ void IDBCallbacksProxy::onBlocked() m_callbacks->onBlocked(); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBCallbacksProxy.h b/Source/WebKit/chromium/src/IDBCallbacksProxy.h index 6829845..e9f45ff 100644 --- a/Source/WebKit/chromium/src/IDBCallbacksProxy.h +++ b/Source/WebKit/chromium/src/IDBCallbacksProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,40 +29,37 @@ #ifndef IDBCallbacksProxy_h #define IDBCallbacksProxy_h +#if ENABLE(INDEXED_DATABASE) + #include "IDBCallbacks.h" #include <wtf/PassOwnPtr.h> #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> -#if ENABLE(INDEXED_DATABASE) - namespace WebKit { -class WebIDBCallbacks; -} -namespace WebCore { +class WebIDBCallbacks; -class IDBCallbacksProxy : public IDBCallbacks { +class IDBCallbacksProxy : public WebCore::IDBCallbacks { public: - static PassRefPtr<IDBCallbacksProxy> create(PassOwnPtr<WebKit::WebIDBCallbacks>); + static PassRefPtr<IDBCallbacksProxy> create(PassOwnPtr<WebIDBCallbacks>); virtual ~IDBCallbacksProxy(); - virtual void onError(PassRefPtr<IDBDatabaseError>); - virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>); - virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>); - virtual void onSuccess(PassRefPtr<IDBKey>); - virtual void onSuccess(PassRefPtr<IDBTransactionBackendInterface>); - virtual void onSuccess(PassRefPtr<SerializedScriptValue>); + virtual void onError(PassRefPtr<WebCore::IDBDatabaseError>); + virtual void onSuccess(PassRefPtr<WebCore::IDBCursorBackendInterface>); + virtual void onSuccess(PassRefPtr<WebCore::IDBDatabaseBackendInterface>); + virtual void onSuccess(PassRefPtr<WebCore::IDBKey>); + virtual void onSuccess(PassRefPtr<WebCore::IDBTransactionBackendInterface>); + virtual void onSuccess(PassRefPtr<WebCore::SerializedScriptValue>); virtual void onBlocked(); private: - IDBCallbacksProxy(PassOwnPtr<WebKit::WebIDBCallbacks>); + IDBCallbacksProxy(PassOwnPtr<WebIDBCallbacks>); - OwnPtr<WebKit::WebIDBCallbacks> m_callbacks; + OwnPtr<WebIDBCallbacks> m_callbacks; }; - -} // namespace WebCore +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp b/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp index b3b9ea7..7dab6a2 100644 --- a/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -36,14 +36,16 @@ #include "WebIDBKey.h" #include "WebSerializedScriptValue.h" -namespace WebCore { +using namespace WebCore; -PassRefPtr<IDBCursorBackendInterface> IDBCursorBackendProxy::create(PassOwnPtr<WebKit::WebIDBCursor> idbCursor) +namespace WebKit { + +PassRefPtr<IDBCursorBackendInterface> IDBCursorBackendProxy::create(PassOwnPtr<WebIDBCursor> idbCursor) { return adoptRef(new IDBCursorBackendProxy(idbCursor)); } -IDBCursorBackendProxy::IDBCursorBackendProxy(PassOwnPtr<WebKit::WebIDBCursor> idbCursor) +IDBCursorBackendProxy::IDBCursorBackendProxy(PassOwnPtr<WebIDBCursor> idbCursor) : m_idbCursor(idbCursor) { } @@ -87,6 +89,6 @@ void IDBCursorBackendProxy::deleteFunction(PassRefPtr<IDBCallbacks> callbacks, E m_idbCursor->deleteFunction(new WebIDBCallbacksImpl(callbacks), ec); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBCursorBackendProxy.h b/Source/WebKit/chromium/src/IDBCursorBackendProxy.h index 0c2e1c7..d725360 100644 --- a/Source/WebKit/chromium/src/IDBCursorBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBCursorBackendProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -35,28 +35,28 @@ #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> -namespace WebCore { +namespace WebKit { -class IDBCursorBackendProxy : public IDBCursorBackendInterface { +class IDBCursorBackendProxy : public WebCore::IDBCursorBackendInterface { public: - static PassRefPtr<IDBCursorBackendInterface> create(PassOwnPtr<WebKit::WebIDBCursor>); + static PassRefPtr<WebCore::IDBCursorBackendInterface> create(PassOwnPtr<WebIDBCursor>); virtual ~IDBCursorBackendProxy(); virtual unsigned short direction() const; - virtual PassRefPtr<IDBKey> key() const; - virtual PassRefPtr<IDBKey> primaryKey() const; - virtual PassRefPtr<SerializedScriptValue> value() const; - virtual void update(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBCallbacks>, ExceptionCode&); - virtual void continueFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, ExceptionCode&); - virtual void deleteFunction(PassRefPtr<IDBCallbacks>, ExceptionCode&); + virtual PassRefPtr<WebCore::IDBKey> key() const; + virtual PassRefPtr<WebCore::IDBKey> primaryKey() const; + virtual PassRefPtr<WebCore::SerializedScriptValue> value() const; + virtual void update(PassRefPtr<WebCore::SerializedScriptValue>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::ExceptionCode&); + virtual void continueFunction(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::ExceptionCode&); + virtual void deleteFunction(PassRefPtr<WebCore::IDBCallbacks>, WebCore::ExceptionCode&); private: - IDBCursorBackendProxy(PassOwnPtr<WebKit::WebIDBCursor>); + IDBCursorBackendProxy(PassOwnPtr<WebIDBCursor>); - OwnPtr<WebKit::WebIDBCursor> m_idbCursor; + OwnPtr<WebIDBCursor> m_idbCursor; }; -} // namespace WebCore +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/src/IDBDatabaseProxy.cpp b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp index 7fe7378..7e5ecc3 100644 --- a/Source/WebKit/chromium/src/IDBDatabaseProxy.cpp +++ b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -24,12 +24,14 @@ */ #include "config.h" -#include "IDBDatabaseProxy.h" +#include "IDBDatabaseBackendProxy.h" + +#if ENABLE(INDEXED_DATABASE) #include "DOMStringList.h" #include "IDBCallbacks.h" #include "IDBDatabaseCallbacks.h" -#include "IDBObjectStoreProxy.h" +#include "IDBObjectStoreBackendProxy.h" #include "IDBTransactionBackendProxy.h" #include "WebDOMStringList.h" #include "WebFrameImpl.h" @@ -40,51 +42,51 @@ #include "WebIDBObjectStore.h" #include "WebIDBTransaction.h" -#if ENABLE(INDEXED_DATABASE) +using namespace WebCore; -namespace WebCore { +namespace WebKit { -PassRefPtr<IDBDatabaseBackendInterface> IDBDatabaseProxy::create(PassOwnPtr<WebKit::WebIDBDatabase> database) +PassRefPtr<IDBDatabaseBackendInterface> IDBDatabaseBackendProxy::create(PassOwnPtr<WebIDBDatabase> database) { - return adoptRef(new IDBDatabaseProxy(database)); + return adoptRef(new IDBDatabaseBackendProxy(database)); } -IDBDatabaseProxy::IDBDatabaseProxy(PassOwnPtr<WebKit::WebIDBDatabase> database) +IDBDatabaseBackendProxy::IDBDatabaseBackendProxy(PassOwnPtr<WebIDBDatabase> database) : m_webIDBDatabase(database) { } -IDBDatabaseProxy::~IDBDatabaseProxy() +IDBDatabaseBackendProxy::~IDBDatabaseBackendProxy() { } -String IDBDatabaseProxy::name() const +String IDBDatabaseBackendProxy::name() const { return m_webIDBDatabase->name(); } -String IDBDatabaseProxy::version() const +String IDBDatabaseBackendProxy::version() const { return m_webIDBDatabase->version(); } -PassRefPtr<DOMStringList> IDBDatabaseProxy::objectStoreNames() const +PassRefPtr<DOMStringList> IDBDatabaseBackendProxy::objectStoreNames() const { return m_webIDBDatabase->objectStoreNames(); } -PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseProxy::createObjectStore(const String& name, const String& keyPath, bool autoIncrement, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseBackendProxy::createObjectStore(const String& name, const String& keyPath, bool autoIncrement, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction); - WebKit::WebIDBObjectStore* objectStore = m_webIDBDatabase->createObjectStore(name, keyPath, autoIncrement, *transactionProxy->getWebIDBTransaction(), ec); + WebIDBObjectStore* objectStore = m_webIDBDatabase->createObjectStore(name, keyPath, autoIncrement, *transactionProxy->getWebIDBTransaction(), ec); if (!objectStore) return 0; - return IDBObjectStoreProxy::create(objectStore); + return IDBObjectStoreBackendProxy::create(objectStore); } -void IDBDatabaseProxy::deleteObjectStore(const String& name, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBDatabaseBackendProxy::deleteObjectStore(const String& name, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. @@ -92,15 +94,15 @@ void IDBDatabaseProxy::deleteObjectStore(const String& name, IDBTransactionBacke m_webIDBDatabase->deleteObjectStore(name, *transactionProxy->getWebIDBTransaction(), ec); } -void IDBDatabaseProxy::setVersion(const String& version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks, ExceptionCode& ec) +void IDBDatabaseBackendProxy::setVersion(const String& version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks, ExceptionCode& ec) { m_webIDBDatabase->setVersion(version, new WebIDBCallbacksImpl(callbacks), ec); } -PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseProxy::transaction(DOMStringList* storeNames, unsigned short mode, ExceptionCode& ec) +PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseBackendProxy::transaction(DOMStringList* storeNames, unsigned short mode, ExceptionCode& ec) { - WebKit::WebDOMStringList names(storeNames); - WebKit::WebIDBTransaction* transaction = m_webIDBDatabase->transaction(names, mode, ec); + WebDOMStringList names(storeNames); + WebIDBTransaction* transaction = m_webIDBDatabase->transaction(names, mode, ec); if (!transaction) { ASSERT(ec); return 0; @@ -108,16 +110,16 @@ PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseProxy::transaction(DOMStri return IDBTransactionBackendProxy::create(transaction); } -void IDBDatabaseProxy::close(PassRefPtr<IDBDatabaseCallbacks>) +void IDBDatabaseBackendProxy::close(PassRefPtr<IDBDatabaseCallbacks>) { m_webIDBDatabase->close(); } -void IDBDatabaseProxy::open(PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks) +void IDBDatabaseBackendProxy::open(PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks) { m_webIDBDatabase->open(new WebIDBDatabaseCallbacksImpl(databaseCallbacks)); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBDatabaseProxy.h b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h index c3e8346..5a5baf2 100644 --- a/Source/WebKit/chromium/src/IDBDatabaseProxy.h +++ b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,45 +23,45 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef IDBDatabaseProxy_h -#define IDBDatabaseProxy_h +#ifndef IDBDatabaseBackendProxy_h +#define IDBDatabaseBackendProxy_h + +#if ENABLE(INDEXED_DATABASE) #include "IDBDatabaseBackendInterface.h" #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> #include <wtf/PassRefPtr.h> -#if ENABLE(INDEXED_DATABASE) - -namespace WebKit { class WebIDBDatabase; } +namespace WebKit { -namespace WebCore { +class WebIDBDatabase; -class IDBDatabaseProxy : public IDBDatabaseBackendInterface { +class IDBDatabaseBackendProxy : public WebCore::IDBDatabaseBackendInterface { public: - static PassRefPtr<IDBDatabaseBackendInterface> create(PassOwnPtr<WebKit::WebIDBDatabase>); - virtual ~IDBDatabaseProxy(); + static PassRefPtr<WebCore::IDBDatabaseBackendInterface> create(PassOwnPtr<WebIDBDatabase>); + virtual ~IDBDatabaseBackendProxy(); virtual String name() const; virtual String version() const; - virtual PassRefPtr<DOMStringList> objectStoreNames() const; + virtual PassRefPtr<WebCore::DOMStringList> objectStoreNames() const; - virtual PassRefPtr<IDBObjectStoreBackendInterface> createObjectStore(const String& name, const String& keyPath, bool autoIncrement, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void deleteObjectStore(const String& name, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void setVersion(const String& version, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, ExceptionCode&); - virtual PassRefPtr<IDBTransactionBackendInterface> transaction(DOMStringList* storeNames, unsigned short mode, ExceptionCode&); - virtual void close(PassRefPtr<IDBDatabaseCallbacks>); + virtual PassRefPtr<WebCore::IDBObjectStoreBackendInterface> createObjectStore(const String& name, const String& keyPath, bool autoIncrement, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void deleteObjectStore(const String& name, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void setVersion(const String& version, PassRefPtr<WebCore::IDBCallbacks>, PassRefPtr<WebCore::IDBDatabaseCallbacks>, WebCore::ExceptionCode&); + virtual PassRefPtr<WebCore::IDBTransactionBackendInterface> transaction(WebCore::DOMStringList* storeNames, unsigned short mode, WebCore::ExceptionCode&); + virtual void close(PassRefPtr<WebCore::IDBDatabaseCallbacks>); - virtual void open(PassRefPtr<IDBDatabaseCallbacks>); + virtual void open(PassRefPtr<WebCore::IDBDatabaseCallbacks>); private: - IDBDatabaseProxy(PassOwnPtr<WebKit::WebIDBDatabase>); + IDBDatabaseBackendProxy(PassOwnPtr<WebIDBDatabase>); - OwnPtr<WebKit::WebIDBDatabase> m_webIDBDatabase; + OwnPtr<WebIDBDatabase> m_webIDBDatabase; }; -} // namespace WebCore +} // namespace WebKit #endif -#endif // IDBDatabaseProxy_h +#endif // IDBDatabaseBackendProxy_h diff --git a/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp b/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp index 28c134f..816faf6 100644 --- a/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp +++ b/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp @@ -30,14 +30,16 @@ #include "WebIDBDatabaseCallbacks.h" -namespace WebCore { +using namespace WebCore; -PassRefPtr<IDBDatabaseCallbacksProxy> IDBDatabaseCallbacksProxy::create(PassOwnPtr<WebKit::WebIDBDatabaseCallbacks> callbacks) +namespace WebKit { + +PassRefPtr<IDBDatabaseCallbacksProxy> IDBDatabaseCallbacksProxy::create(PassOwnPtr<WebIDBDatabaseCallbacks> callbacks) { return adoptRef(new IDBDatabaseCallbacksProxy(callbacks)); } -IDBDatabaseCallbacksProxy::IDBDatabaseCallbacksProxy(PassOwnPtr<WebKit::WebIDBDatabaseCallbacks> callbacks) +IDBDatabaseCallbacksProxy::IDBDatabaseCallbacksProxy(PassOwnPtr<WebIDBDatabaseCallbacks> callbacks) : m_callbacks(callbacks) { } @@ -51,6 +53,6 @@ void IDBDatabaseCallbacksProxy::onVersionChange(const String& requestedVersion) m_callbacks->onVersionChange(requestedVersion); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h b/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h index 9fd7a0b..affdce7 100644 --- a/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h +++ b/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h @@ -26,30 +26,29 @@ #ifndef IDBDatabaseCallbacksProxy_h #define IDBDatabaseCallbacksProxy_h -#include "IDBDatabaseCallbacks.h" - #if ENABLE(INDEXED_DATABASE) +#include "IDBDatabaseCallbacks.h" #include <wtf/PassOwnPtr.h> -namespace WebKit { class WebIDBDatabaseCallbacks; } +namespace WebKit { -namespace WebCore { +class WebIDBDatabaseCallbacks; -class IDBDatabaseCallbacksProxy : public IDBDatabaseCallbacks { +class IDBDatabaseCallbacksProxy : public WebCore::IDBDatabaseCallbacks { public: - static PassRefPtr<IDBDatabaseCallbacksProxy> create(PassOwnPtr<WebKit::WebIDBDatabaseCallbacks>); + static PassRefPtr<IDBDatabaseCallbacksProxy> create(PassOwnPtr<WebIDBDatabaseCallbacks>); virtual ~IDBDatabaseCallbacksProxy(); virtual void onVersionChange(const String& requestedVersion); private: - IDBDatabaseCallbacksProxy(PassOwnPtr<WebKit::WebIDBDatabaseCallbacks>); + IDBDatabaseCallbacksProxy(PassOwnPtr<WebIDBDatabaseCallbacks>); - OwnPtr<WebKit::WebIDBDatabaseCallbacks> m_callbacks; + OwnPtr<WebIDBDatabaseCallbacks> m_callbacks; }; -} // namespace WebCore +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp index 9e5ccc0..1824eb8 100755 --- a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,9 +29,11 @@ #include "config.h" #include "IDBFactoryBackendProxy.h" +#if ENABLE(INDEXED_DATABASE) + #include "DOMStringList.h" +#include "IDBDatabaseBackendProxy.h" #include "IDBDatabaseError.h" -#include "IDBDatabaseProxy.h" #include "WebFrameImpl.h" #include "WebIDBCallbacksImpl.h" #include "WebIDBDatabase.h" @@ -41,9 +43,9 @@ #include "WebKitClient.h" #include "WebVector.h" -#if ENABLE(INDEXED_DATABASE) +using namespace WebCore; -namespace WebCore { +namespace WebKit { PassRefPtr<IDBFactoryBackendInterface> IDBFactoryBackendProxy::create() { @@ -51,7 +53,7 @@ PassRefPtr<IDBFactoryBackendInterface> IDBFactoryBackendProxy::create() } IDBFactoryBackendProxy::IDBFactoryBackendProxy() - : m_webIDBFactory(WebKit::webKitClient()->idbFactory()) + : m_webIDBFactory(webKitClient()->idbFactory()) { } @@ -61,10 +63,10 @@ IDBFactoryBackendProxy::~IDBFactoryBackendProxy() void IDBFactoryBackendProxy::open(const String& name, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame, const String& dataDir, int64_t maximumSize, BackingStoreType backingStoreType) { - WebKit::WebFrame* webFrame = WebKit::WebFrameImpl::fromFrame(frame); - m_webIDBFactory->open(name, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir, maximumSize, static_cast<WebKit::WebIDBFactory::BackingStoreType>(backingStoreType)); + WebFrame* webFrame = WebFrameImpl::fromFrame(frame); + m_webIDBFactory->open(name, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir, maximumSize, static_cast<WebIDBFactory::BackingStoreType>(backingStoreType)); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h index 593051e..89ed355 100755 --- a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,32 +29,32 @@ #ifndef IDBFactoryBackendProxy_h #define IDBFactoryBackendProxy_h -#include "IDBFactoryBackendInterface.h" - #if ENABLE(INDEXED_DATABASE) -namespace WebKit { class WebIDBFactory; } +#include "IDBFactoryBackendInterface.h" + +namespace WebCore { class DOMStringList; } -namespace WebCore { +namespace WebKit { -class DOMStringList; +class WebIDBFactory; -class IDBFactoryBackendProxy : public IDBFactoryBackendInterface { +class IDBFactoryBackendProxy : public WebCore::IDBFactoryBackendInterface { public: - static PassRefPtr<IDBFactoryBackendInterface> create(); + static PassRefPtr<WebCore::IDBFactoryBackendInterface> create(); virtual ~IDBFactoryBackendProxy(); - PassRefPtr<DOMStringList> databases(void) const; - virtual void open(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir, int64_t maximumSize, BackingStoreType); + PassRefPtr<WebCore::DOMStringList> databases(void) const; + virtual void open(const String& name, PassRefPtr<WebCore::IDBCallbacks>, PassRefPtr<WebCore::SecurityOrigin>, WebCore::Frame*, const String& dataDir, int64_t maximumSize, BackingStoreType); private: IDBFactoryBackendProxy(); // We don't own this pointer (unlike all the other proxy classes which do). - WebKit::WebIDBFactory* m_webIDBFactory; + WebIDBFactory* m_webIDBFactory; }; -} // namespace WebCore +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp b/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp index 410750e..556c9b6 100644 --- a/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -37,14 +37,16 @@ #include "WebIDBKey.h" #include "WebIDBKeyRange.h" -namespace WebCore { +using namespace WebCore; -PassRefPtr<IDBIndexBackendInterface> IDBIndexBackendProxy::create(PassOwnPtr<WebKit::WebIDBIndex> index) +namespace WebKit { + +PassRefPtr<IDBIndexBackendInterface> IDBIndexBackendProxy::create(PassOwnPtr<WebIDBIndex> index) { return adoptRef(new IDBIndexBackendProxy(index)); } -IDBIndexBackendProxy::IDBIndexBackendProxy(PassOwnPtr<WebKit::WebIDBIndex> index) +IDBIndexBackendProxy::IDBIndexBackendProxy(PassOwnPtr<WebIDBIndex> index) : m_webIDBIndex(index) { } @@ -105,6 +107,6 @@ void IDBIndexBackendProxy::getKey(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallback m_webIDBIndex->getKey(key, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBIndexBackendProxy.h b/Source/WebKit/chromium/src/IDBIndexBackendProxy.h index e9de05a..b63640f 100644 --- a/Source/WebKit/chromium/src/IDBIndexBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBIndexBackendProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,19 +26,19 @@ #ifndef IDBIndexBackendProxy_h #define IDBIndexBackendProxy_h +#if ENABLE(INDEXED_DATABASE) + #include "IDBIndexBackendInterface.h" #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> -#if ENABLE(INDEXED_DATABASE) - -namespace WebKit { class WebIDBIndex; } +namespace WebKit { -namespace WebCore { +class WebIDBIndex; -class IDBIndexBackendProxy : public IDBIndexBackendInterface { +class IDBIndexBackendProxy : public WebCore::IDBIndexBackendInterface { public: - static PassRefPtr<IDBIndexBackendInterface> create(PassOwnPtr<WebKit::WebIDBIndex>); + static PassRefPtr<IDBIndexBackendInterface> create(PassOwnPtr<WebIDBIndex>); virtual ~IDBIndexBackendProxy(); virtual String name(); @@ -46,18 +46,18 @@ public: virtual String keyPath(); virtual bool unique(); - virtual void openCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void openKeyCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void get(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void getKey(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); + virtual void openCursor(PassRefPtr<WebCore::IDBKeyRange>, unsigned short direction, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void openKeyCursor(PassRefPtr<WebCore::IDBKeyRange>, unsigned short direction, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void get(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void getKey(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); private: - IDBIndexBackendProxy(PassOwnPtr<WebKit::WebIDBIndex>); + IDBIndexBackendProxy(PassOwnPtr<WebIDBIndex>); - OwnPtr<WebKit::WebIDBIndex> m_webIDBIndex; + OwnPtr<WebIDBIndex> m_webIDBIndex; }; -} // namespace WebCore +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/src/IDBObjectStoreProxy.cpp b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp index d6871e0..2a0e075 100755 --- a/Source/WebKit/chromium/src/IDBObjectStoreProxy.cpp +++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -24,7 +24,9 @@ */ #include "config.h" -#include "IDBObjectStoreProxy.h" +#include "IDBObjectStoreBackendProxy.h" + +#if ENABLE(INDEXED_DATABASE) #include "DOMStringList.h" #include "IDBCallbacks.h" @@ -39,40 +41,40 @@ #include "WebIDBTransactionImpl.h" #include "WebSerializedScriptValue.h" -#if ENABLE(INDEXED_DATABASE) +using namespace WebCore; -namespace WebCore { +namespace WebKit { -PassRefPtr<IDBObjectStoreBackendInterface> IDBObjectStoreProxy::create(PassOwnPtr<WebKit::WebIDBObjectStore> objectStore) +PassRefPtr<IDBObjectStoreBackendInterface> IDBObjectStoreBackendProxy::create(PassOwnPtr<WebIDBObjectStore> objectStore) { - return adoptRef(new IDBObjectStoreProxy(objectStore)); + return adoptRef(new IDBObjectStoreBackendProxy(objectStore)); } -IDBObjectStoreProxy::IDBObjectStoreProxy(PassOwnPtr<WebKit::WebIDBObjectStore> objectStore) +IDBObjectStoreBackendProxy::IDBObjectStoreBackendProxy(PassOwnPtr<WebIDBObjectStore> objectStore) : m_webIDBObjectStore(objectStore) { } -IDBObjectStoreProxy::~IDBObjectStoreProxy() +IDBObjectStoreBackendProxy::~IDBObjectStoreBackendProxy() { } -String IDBObjectStoreProxy::name() const +String IDBObjectStoreBackendProxy::name() const { return m_webIDBObjectStore->name(); } -String IDBObjectStoreProxy::keyPath() const +String IDBObjectStoreBackendProxy::keyPath() const { return m_webIDBObjectStore->keyPath(); } -PassRefPtr<DOMStringList> IDBObjectStoreProxy::indexNames() const +PassRefPtr<DOMStringList> IDBObjectStoreBackendProxy::indexNames() const { return m_webIDBObjectStore->indexNames(); } -void IDBObjectStoreProxy::get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBObjectStoreBackendProxy::get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. @@ -80,15 +82,15 @@ void IDBObjectStoreProxy::get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> c m_webIDBObjectStore->get(key, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } -void IDBObjectStoreProxy::put(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBObjectStoreBackendProxy::put(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction); - m_webIDBObjectStore->put(value, key, static_cast<WebKit::WebIDBObjectStore::PutMode>(putMode), new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); + m_webIDBObjectStore->put(value, key, static_cast<WebIDBObjectStore::PutMode>(putMode), new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } -void IDBObjectStoreProxy::deleteFunction(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBObjectStoreBackendProxy::deleteFunction(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. @@ -96,7 +98,7 @@ void IDBObjectStoreProxy::deleteFunction(PassRefPtr<IDBKey> key, PassRefPtr<IDBC m_webIDBObjectStore->deleteFunction(key, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } -void IDBObjectStoreProxy::clear(PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBObjectStoreBackendProxy::clear(PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. @@ -104,26 +106,26 @@ void IDBObjectStoreProxy::clear(PassRefPtr<IDBCallbacks> callbacks, IDBTransacti m_webIDBObjectStore->clear(new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } -PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreProxy::createIndex(const String& name, const String& keyPath, bool unique, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendProxy::createIndex(const String& name, const String& keyPath, bool unique, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction); - WebKit::WebIDBIndex* index = m_webIDBObjectStore->createIndex(name, keyPath, unique, *transactionProxy->getWebIDBTransaction(), ec); + WebIDBIndex* index = m_webIDBObjectStore->createIndex(name, keyPath, unique, *transactionProxy->getWebIDBTransaction(), ec); if (!index) return 0; return IDBIndexBackendProxy::create(index); } -PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreProxy::index(const String& name, ExceptionCode& ec) +PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendProxy::index(const String& name, ExceptionCode& ec) { - WebKit::WebIDBIndex* index = m_webIDBObjectStore->index(name, ec); + WebIDBIndex* index = m_webIDBObjectStore->index(name, ec); if (!index) return 0; return IDBIndexBackendProxy::create(index); } -void IDBObjectStoreProxy::deleteIndex(const String& name, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBObjectStoreBackendProxy::deleteIndex(const String& name, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. @@ -131,7 +133,7 @@ void IDBObjectStoreProxy::deleteIndex(const String& name, IDBTransactionBackendI m_webIDBObjectStore->deleteIndex(name, *transactionProxy->getWebIDBTransaction(), ec); } -void IDBObjectStoreProxy::openCursor(PassRefPtr<IDBKeyRange> range, unsigned short direction, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBObjectStoreBackendProxy::openCursor(PassRefPtr<IDBKeyRange> range, unsigned short direction, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. @@ -139,6 +141,6 @@ void IDBObjectStoreProxy::openCursor(PassRefPtr<IDBKeyRange> range, unsigned sho m_webIDBObjectStore->openCursor(range, direction, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h new file mode 100755 index 0000000..cb0ee32 --- /dev/null +++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2011 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef IDBObjectStoreBackendProxy_h +#define IDBObjectStoreBackendProxy_h + +#if ENABLE(INDEXED_DATABASE) + +#include "IDBObjectStoreBackendInterface.h" +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> +#include <wtf/PassRefPtr.h> + +namespace WebKit { + +class WebIDBObjectStore; + +class IDBObjectStoreBackendProxy : public WebCore::IDBObjectStoreBackendInterface { +public: + static PassRefPtr<WebCore::IDBObjectStoreBackendInterface> create(PassOwnPtr<WebIDBObjectStore>); + virtual ~IDBObjectStoreBackendProxy(); + + virtual String name() const; + virtual String keyPath() const; + virtual PassRefPtr<WebCore::DOMStringList> indexNames() const; + + virtual void get(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void put(PassRefPtr<WebCore::SerializedScriptValue>, PassRefPtr<WebCore::IDBKey>, PutMode, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void deleteFunction(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void clear(PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + + PassRefPtr<WebCore::IDBIndexBackendInterface> createIndex(const String& name, const String& keyPath, bool unique, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + PassRefPtr<WebCore::IDBIndexBackendInterface> index(const String& name, WebCore::ExceptionCode&); + void deleteIndex(const String& name, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + + virtual void openCursor(PassRefPtr<WebCore::IDBKeyRange>, unsigned short direction, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + +private: + IDBObjectStoreBackendProxy(PassOwnPtr<WebIDBObjectStore>); + + OwnPtr<WebIDBObjectStore> m_webIDBObjectStore; +}; + +} // namespace WebKit + +#endif + +#endif // IDBObjectStoreBackendProxy_h diff --git a/Source/WebKit/chromium/src/IDBObjectStoreProxy.h b/Source/WebKit/chromium/src/IDBObjectStoreProxy.h deleted file mode 100755 index a6e3748..0000000 --- a/Source/WebKit/chromium/src/IDBObjectStoreProxy.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef IDBObjectStoreProxy_h -#define IDBObjectStoreProxy_h - -#include "IDBObjectStoreBackendInterface.h" -#include <wtf/OwnPtr.h> -#include <wtf/PassOwnPtr.h> -#include <wtf/PassRefPtr.h> - -#if ENABLE(INDEXED_DATABASE) - -namespace WebKit { class WebIDBObjectStore; } - -namespace WebCore { - -class IDBObjectStoreProxy : public IDBObjectStoreBackendInterface { -public: - static PassRefPtr<IDBObjectStoreBackendInterface> create(PassOwnPtr<WebKit::WebIDBObjectStore>); - virtual ~IDBObjectStoreProxy(); - - virtual String name() const; - virtual String keyPath() const; - virtual PassRefPtr<DOMStringList> indexNames() const; - - virtual void get(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void put(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, PutMode, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void deleteFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void clear(PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - - PassRefPtr<IDBIndexBackendInterface> createIndex(const String& name, const String& keyPath, bool unique, IDBTransactionBackendInterface*, ExceptionCode&); - PassRefPtr<IDBIndexBackendInterface> index(const String& name, ExceptionCode&); - void deleteIndex(const String& name, IDBTransactionBackendInterface*, ExceptionCode&); - - virtual void openCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - -private: - IDBObjectStoreProxy(PassOwnPtr<WebKit::WebIDBObjectStore>); - - OwnPtr<WebKit::WebIDBObjectStore> m_webIDBObjectStore; -}; - -} // namespace WebCore - -#endif - -#endif // IDBObjectStoreProxy_h diff --git a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp b/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp index 95c90d5..6d91f48 100644 --- a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,21 +28,23 @@ #if ENABLE(INDEXED_DATABASE) -#include "IDBObjectStoreProxy.h" +#include "IDBObjectStoreBackendProxy.h" #include "IDBTransactionCallbacks.h" #include "WebIDBDatabaseError.h" #include "WebIDBObjectStore.h" #include "WebIDBTransaction.h" #include "WebIDBTransactionCallbacksImpl.h" -namespace WebCore { +using namespace WebCore; -PassRefPtr<IDBTransactionBackendInterface> IDBTransactionBackendProxy::create(PassOwnPtr<WebKit::WebIDBTransaction> transaction) +namespace WebKit { + +PassRefPtr<IDBTransactionBackendInterface> IDBTransactionBackendProxy::create(PassOwnPtr<WebIDBTransaction> transaction) { return adoptRef(new IDBTransactionBackendProxy(transaction)); } -IDBTransactionBackendProxy::IDBTransactionBackendProxy(PassOwnPtr<WebKit::WebIDBTransaction> transaction) +IDBTransactionBackendProxy::IDBTransactionBackendProxy(PassOwnPtr<WebIDBTransaction> transaction) : m_webIDBTransaction(transaction) { ASSERT(m_webIDBTransaction); @@ -54,10 +56,10 @@ IDBTransactionBackendProxy::~IDBTransactionBackendProxy() PassRefPtr<IDBObjectStoreBackendInterface> IDBTransactionBackendProxy::objectStore(const String& name, ExceptionCode& ec) { - WebKit::WebIDBObjectStore* objectStore = m_webIDBTransaction->objectStore(name, ec); + WebIDBObjectStore* objectStore = m_webIDBTransaction->objectStore(name, ec); if (!objectStore) return 0; - return IDBObjectStoreProxy::create(objectStore); + return IDBObjectStoreBackendProxy::create(objectStore); } unsigned short IDBTransactionBackendProxy::mode() const @@ -88,6 +90,6 @@ void IDBTransactionBackendProxy::setCallbacks(IDBTransactionCallbacks* callbacks m_webIDBTransaction->setCallbacks(new WebIDBTransactionCallbacksImpl(callbacks)); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h b/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h index 96d7293..103f552 100644 --- a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,38 +26,37 @@ #ifndef IDBTransactionBackendProxy_h #define IDBTransactionBackendProxy_h -#include "IDBTransactionBackendInterface.h" - #if ENABLE(INDEXED_DATABASE) +#include "IDBTransactionBackendInterface.h" #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> -namespace WebKit { class WebIDBTransaction; } +namespace WebKit { -namespace WebCore { +class WebIDBTransaction; -class IDBTransactionBackendProxy : public IDBTransactionBackendInterface { +class IDBTransactionBackendProxy : public WebCore::IDBTransactionBackendInterface { public: - static PassRefPtr<IDBTransactionBackendInterface> create(PassOwnPtr<WebKit::WebIDBTransaction>); + static PassRefPtr<IDBTransactionBackendInterface> create(PassOwnPtr<WebIDBTransaction>); virtual ~IDBTransactionBackendProxy(); - virtual PassRefPtr<IDBObjectStoreBackendInterface> objectStore(const String& name, ExceptionCode&); + virtual PassRefPtr<WebCore::IDBObjectStoreBackendInterface> objectStore(const String& name, WebCore::ExceptionCode&); virtual unsigned short mode() const; virtual void abort(); - virtual bool scheduleTask(PassOwnPtr<ScriptExecutionContext::Task>, PassOwnPtr<ScriptExecutionContext::Task>); + virtual bool scheduleTask(PassOwnPtr<WebCore::ScriptExecutionContext::Task>, PassOwnPtr<WebCore::ScriptExecutionContext::Task>); virtual void didCompleteTaskEvents(); - virtual void setCallbacks(IDBTransactionCallbacks*); + virtual void setCallbacks(WebCore::IDBTransactionCallbacks*); - WebKit::WebIDBTransaction* getWebIDBTransaction() const { return m_webIDBTransaction.get(); } + WebIDBTransaction* getWebIDBTransaction() const { return m_webIDBTransaction.get(); } private: - IDBTransactionBackendProxy(PassOwnPtr<WebKit::WebIDBTransaction>); + IDBTransactionBackendProxy(PassOwnPtr<WebIDBTransaction>); - OwnPtr<WebKit::WebIDBTransaction> m_webIDBTransaction; + OwnPtr<WebIDBTransaction> m_webIDBTransaction; }; -} // namespace WebCore +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.cpp b/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.cpp index ebda1dd..83d7e3a 100644 --- a/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.cpp +++ b/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,18 +29,20 @@ #include "config.h" #include "IDBTransactionCallbacksProxy.h" +#if ENABLE(INDEXED_DATABASE) + #include "WebIDBTransactionCallbacks.h" -#if ENABLE(INDEXED_DATABASE) +using namespace WebCore; -namespace WebCore { +namespace WebKit { -PassRefPtr<IDBTransactionCallbacksProxy> IDBTransactionCallbacksProxy::create(PassOwnPtr<WebKit::WebIDBTransactionCallbacks> callbacks) +PassRefPtr<IDBTransactionCallbacksProxy> IDBTransactionCallbacksProxy::create(PassOwnPtr<WebIDBTransactionCallbacks> callbacks) { return adoptRef(new IDBTransactionCallbacksProxy(callbacks)); } -IDBTransactionCallbacksProxy::IDBTransactionCallbacksProxy(PassOwnPtr<WebKit::WebIDBTransactionCallbacks> callbacks) +IDBTransactionCallbacksProxy::IDBTransactionCallbacksProxy(PassOwnPtr<WebIDBTransactionCallbacks> callbacks) : m_callbacks(callbacks) { } @@ -59,6 +61,6 @@ void IDBTransactionCallbacksProxy::onComplete() m_callbacks->onComplete(); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.h b/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.h index 79c32f6..044eecf 100644 --- a/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.h +++ b/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,33 +29,32 @@ #ifndef IDBTransactionCallbacksProxy_h #define IDBTransactionCallbacksProxy_h -#include "IDBTransactionCallbacks.h" - #if ENABLE(INDEXED_DATABASE) +#include "IDBTransactionCallbacks.h" #include <wtf/PassOwnPtr.h> #include <wtf/PassRefPtr.h> -namespace WebKit { class WebIDBTransactionCallbacks; } +namespace WebKit { -namespace WebCore { +class WebIDBTransactionCallbacks; -class IDBTransactionCallbacksProxy : public IDBTransactionCallbacks { +class IDBTransactionCallbacksProxy : public WebCore::IDBTransactionCallbacks { public: - static PassRefPtr<IDBTransactionCallbacksProxy> create(PassOwnPtr<WebKit::WebIDBTransactionCallbacks>); + static PassRefPtr<IDBTransactionCallbacksProxy> create(PassOwnPtr<WebIDBTransactionCallbacks>); virtual ~IDBTransactionCallbacksProxy(); virtual void onAbort(); virtual void onComplete(); private: - IDBTransactionCallbacksProxy(PassOwnPtr<WebKit::WebIDBTransactionCallbacks>); + IDBTransactionCallbacksProxy(PassOwnPtr<WebIDBTransactionCallbacks>); - OwnPtr<WebKit::WebIDBTransactionCallbacks> m_callbacks; + OwnPtr<WebIDBTransactionCallbacks> m_callbacks; }; -} // namespace WebCore +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/src/PlatformBridge.cpp b/Source/WebKit/chromium/src/PlatformBridge.cpp index d825d24..bbed1ba 100644 --- a/Source/WebKit/chromium/src/PlatformBridge.cpp +++ b/Source/WebKit/chromium/src/PlatformBridge.cpp @@ -61,7 +61,7 @@ #include "WebViewImpl.h" #include "WebWorkerClientImpl.h" -#if PLATFORM(CG) +#if USE(CG) #include <CoreGraphics/CGContext.h> #endif @@ -178,6 +178,12 @@ void PlatformBridge::clipboardReadHTML( *sourceURL = url; } +PassRefPtr<SharedBuffer> PlatformBridge::clipboardReadImage( + PasteboardPrivate::ClipboardBuffer buffer) +{ + return webKitClient()->clipboard()->readImage(static_cast<WebClipboard::Buffer>(buffer)); +} + void PlatformBridge::clipboardWriteSelection(const String& htmlText, const KURL& sourceURL, const String& plainText, diff --git a/Source/WebKit/chromium/src/ResourceHandle.cpp b/Source/WebKit/chromium/src/ResourceHandle.cpp index f88a48a..a11e0c3 100644 --- a/Source/WebKit/chromium/src/ResourceHandle.cpp +++ b/Source/WebKit/chromium/src/ResourceHandle.cpp @@ -72,10 +72,7 @@ public: virtual void didSendData( WebURLLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent); virtual void didReceiveResponse(WebURLLoader*, const WebURLResponse&); - virtual void didReceiveData2(WebURLLoader*, const char* data, int dataLength, int lengthReceived); - - // FIXME(vsevik): remove once not used downstream - virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength); + virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength, int encodedDataLength); virtual void didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength); virtual void didFinishLoading(WebURLLoader*, double finishTime); @@ -163,20 +160,14 @@ void ResourceHandleInternal::didReceiveResponse(WebURLLoader*, const WebURLRespo m_client->didReceiveResponse(m_owner, response.toResourceResponse()); } -// FIXME(vsevik): remove once not used -void ResourceHandleInternal::didReceiveData(WebURLLoader* webURLLoader, const char* data, int dataLength) -{ - didReceiveData2(webURLLoader, data, dataLength, -1); -} - -void ResourceHandleInternal::didReceiveData2(WebURLLoader*, const char* data, int dataLength, int lengthReceived) +void ResourceHandleInternal::didReceiveData(WebURLLoader*, const char* data, int dataLength, int encodedDataLength) { ASSERT(m_client); if (m_state != ConnectionStateReceivedResponse && m_state != ConnectionStateReceivingData) CRASH(); m_state = ConnectionStateReceivingData; - m_client->didReceiveData(m_owner, data, dataLength, lengthReceived); + m_client->didReceiveData(m_owner, data, dataLength, encodedDataLength); } void ResourceHandleInternal::didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength) diff --git a/Source/WebKit/chromium/src/StorageInfoChromium.cpp b/Source/WebKit/chromium/src/StorageInfoChromium.cpp new file mode 100644 index 0000000..5f58c2c --- /dev/null +++ b/Source/WebKit/chromium/src/StorageInfoChromium.cpp @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2011 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "StorageInfo.h" + +#if ENABLE(QUOTA) + +#include "DOMCoreException.h" +#include "Document.h" +#include "ScriptExecutionContext.h" +#include "StorageInfoErrorCallback.h" +#include "StorageInfoQuotaCallback.h" +#include "StorageInfoUsageCallback.h" +#include "WebFrameClient.h" +#include "WebFrameImpl.h" +#include "WebStorageQuotaCallbacksImpl.h" +#include "WebStorageQuotaType.h" + +using namespace WebKit; + +namespace WebCore { + +namespace { +void fireStorageInfoErrorCallback(PassRefPtr<StorageInfoErrorCallback> errorCallback, ExceptionCode ec) +{ + ASSERT(errorCallback); + ExceptionCodeDescription description; + getExceptionCodeDescription(ec, description); + errorCallback->handleEvent(DOMCoreException::create(description).get()); +} +} + +void StorageInfo::queryUsageAndQuota(ScriptExecutionContext* context, int storageType, PassRefPtr<StorageInfoUsageCallback> successCallback, PassRefPtr<StorageInfoErrorCallback> errorCallback) +{ + ASSERT(context); + if (storageType != WebStorageQuotaTypeTemporary && storageType != WebStorageQuotaTypePersistent) { + // Unknown storage type is requested. + fireStorageInfoErrorCallback(errorCallback, NOT_SUPPORTED_ERR); + return; + } + if (context->isDocument()) { + Document* document = static_cast<Document*>(context); + WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame()); + webFrame->client()->queryStorageUsageAndQuota(webFrame, static_cast<WebStorageQuotaType>(storageType), new WebStorageQuotaCallbacksImpl(successCallback, errorCallback)); + } else if (errorCallback) { + // FIXME: calling this on worker is not yet supported. + fireStorageInfoErrorCallback(errorCallback, NOT_SUPPORTED_ERR); + } +} + +void StorageInfo::requestQuota(ScriptExecutionContext* context, int storageType, unsigned long long newQuotaInBytes, PassRefPtr<StorageInfoQuotaCallback> successCallback, PassRefPtr<StorageInfoErrorCallback> errorCallback) +{ + ASSERT(context); + if (storageType != WebStorageQuotaTypeTemporary && storageType != WebStorageQuotaTypePersistent) { + // Unknown storage type is requested. + fireStorageInfoErrorCallback(errorCallback, NOT_SUPPORTED_ERR); + return; + } + if (context->isDocument()) { + Document* document = static_cast<Document*>(context); + WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame()); + webFrame->client()->requestStorageQuota(webFrame, static_cast<WebStorageQuotaType>(storageType), newQuotaInBytes, new WebStorageQuotaCallbacksImpl(successCallback, errorCallback)); + } else if (errorCallback) { + // FIXME: calling this on worker is not yet supported. + fireStorageInfoErrorCallback(errorCallback, NOT_SUPPORTED_ERR); + } +} + +} // namespace WebCore + +#endif // ENABLE(QUOTA) diff --git a/Source/WebKit/chromium/src/VideoFrameChromiumImpl.h b/Source/WebKit/chromium/src/VideoFrameChromiumImpl.h index ca7f88b..44a3cc7 100644 --- a/Source/WebKit/chromium/src/VideoFrameChromiumImpl.h +++ b/Source/WebKit/chromium/src/VideoFrameChromiumImpl.h @@ -34,16 +34,14 @@ #include "VideoFrameChromium.h" #include "WebVideoFrame.h" -using namespace WebCore; - namespace WebKit { // A wrapper class for WebKit::WebVideoFrame. Objects can be created in WebKit // and used in WebCore because of the VideoFrameChromium interface. -class VideoFrameChromiumImpl : public VideoFrameChromium { +class VideoFrameChromiumImpl : public WebCore::VideoFrameChromium { public: // Converts a WebCore::VideoFrameChromium to a WebKit::WebVideoFrame. - static WebVideoFrame* toWebVideoFrame(VideoFrameChromium*); + static WebVideoFrame* toWebVideoFrame(WebCore::VideoFrameChromium*); // Creates a VideoFrameChromiumImpl object to wrap the given WebVideoFrame. // The VideoFrameChromiumImpl does not take ownership of the WebVideoFrame @@ -59,7 +57,7 @@ public: virtual int stride(unsigned plane) const; virtual const void* data(unsigned plane) const; virtual unsigned texture(unsigned plane) const; - virtual const IntSize requiredTextureSize(unsigned plane) const; + virtual const WebCore::IntSize requiredTextureSize(unsigned plane) const; virtual bool hasPaddingBytes(unsigned plane) const; private: diff --git a/Source/WebKit/chromium/src/WebDOMEventListener.cpp b/Source/WebKit/chromium/src/WebDOMEventListener.cpp index 93c1640..55d71a7 100644 --- a/Source/WebKit/chromium/src/WebDOMEventListener.cpp +++ b/Source/WebKit/chromium/src/WebDOMEventListener.cpp @@ -33,6 +33,8 @@ #include "WebDOMEventListenerPrivate.h" +using namespace WebCore; + namespace WebKit { WebDOMEventListener::WebDOMEventListener() diff --git a/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.cpp b/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.cpp index 4edbeef..fb05823 100644 --- a/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.cpp +++ b/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.cpp @@ -34,6 +34,8 @@ #include "EventListenerWrapper.h" #include "WebDOMEventListener.h" +using namespace WebCore; + namespace WebKit { WebDOMEventListenerPrivate::WebDOMEventListenerPrivate(WebDOMEventListener* webDOMEventListener) diff --git a/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.h b/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.h index c86f427..2fe443f 100644 --- a/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.h +++ b/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.h @@ -39,8 +39,6 @@ namespace WebCore { class Node; } -using namespace WebCore; - namespace WebKit { class EventListenerWrapper; @@ -52,12 +50,12 @@ public: ~WebDOMEventListenerPrivate(); EventListenerWrapper* createEventListenerWrapper( - const WebString& eventType, bool useCapture, Node* node); + const WebString& eventType, bool useCapture, WebCore::Node*); // Gets the ListenerEventWrapper for a specific node. // Used by WebNode::removeDOMEventListener(). EventListenerWrapper* getEventListenerWrapper( - const WebString& eventType, bool useCapture, Node* node); + const WebString& eventType, bool useCapture, WebCore::Node*); // Called by the WebDOMEventListener when it is about to be deleted. void webDOMEventListenerDeleted(); @@ -68,7 +66,7 @@ public: struct ListenerInfo { ListenerInfo(const WebString& eventType, bool useCapture, EventListenerWrapper* eventListenerWrapper, - Node* node) + WebCore::Node* node) : eventType(eventType) , useCapture(useCapture) , eventListenerWrapper(eventListenerWrapper) @@ -79,7 +77,7 @@ public: WebString eventType; bool useCapture; EventListenerWrapper* eventListenerWrapper; - Node* node; + WebCore::Node* node; }; private: diff --git a/Source/WebKit/chromium/src/WebDataSourceImpl.cpp b/Source/WebKit/chromium/src/WebDataSourceImpl.cpp index 1366a80..3170aff 100644 --- a/Source/WebKit/chromium/src/WebDataSourceImpl.cpp +++ b/Source/WebKit/chromium/src/WebDataSourceImpl.cpp @@ -82,7 +82,8 @@ void WebDataSourceImpl::redirectChain(WebVector<WebURL>& result) const WebString WebDataSourceImpl::pageTitle() const { - return title(); + // FIXME: use direction of title as well. + return title().string(); } WebNavigationType WebDataSourceImpl::navigationType() const diff --git a/Source/WebKit/chromium/src/WebElement.cpp b/Source/WebKit/chromium/src/WebElement.cpp index ee7ec09..66e3e95 100644 --- a/Source/WebKit/chromium/src/WebElement.cpp +++ b/Source/WebKit/chromium/src/WebElement.cpp @@ -92,7 +92,7 @@ WebString WebElement::innerText() const WebNode WebElement::shadowRoot() { - return adoptRef(unwrap<Element>()->shadowRoot()); + return adoptRef(static_cast<Node*>(unwrap<Element>()->shadowRoot())); } WebString WebElement::computeInheritedLanguage() const diff --git a/Source/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp b/Source/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp index ef2409c..d7583c5 100644 --- a/Source/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp +++ b/Source/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp @@ -46,8 +46,7 @@ void WebFileChooserCompletionImpl::didChooseFile(const WebVector<WebString>& fil { if (fileNames.size() == 1) m_fileChooser->chooseFile(fileNames[0]); - else { - // This clause handles a case of file_names.size()==0 too. + else if (fileNames.size() > 0) { Vector<WTF::String> paths; for (size_t i = 0; i < fileNames.size(); ++i) paths.append(fileNames[i]); diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp index fdfb14e..c06087d 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.cpp +++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp @@ -90,6 +90,7 @@ #include "FrameLoader.h" #include "FrameTree.h" #include "FrameView.h" +#include "HitTestResult.h" #include "HTMLCollection.h" #include "HTMLFormElement.h" #include "HTMLFrameOwnerElement.h" @@ -106,6 +107,7 @@ #include "PluginDocument.h" #include "PrintContext.h" #include "RenderFrame.h" +#include "RenderLayer.h" #include "RenderObject.h" #include "RenderTreeAsText.h" #include "RenderView.h" @@ -140,6 +142,7 @@ #include "WebPerformance.h" #include "WebPlugin.h" #include "WebPluginContainerImpl.h" +#include "WebPoint.h" #include "WebRange.h" #include "WebRect.h" #include "WebScriptSource.h" @@ -161,8 +164,13 @@ #if USE(V8) #include "AsyncFileSystem.h" #include "AsyncFileSystemChromium.h" +#include "DirectoryEntry.h" #include "DOMFileSystem.h" +#include "FileEntry.h" +#include "V8DirectoryEntry.h" #include "V8DOMFileSystem.h" +#include "V8FileEntry.h" +#include "WebFileSystem.h" #endif using namespace WebCore; @@ -473,6 +481,13 @@ WebFrame* WebFrame::frameForCurrentContext() return WebFrameImpl::fromFrame(frame); } +#if WEBKIT_USING_V8 +WebFrame* WebFrame::frameForContext(v8::Handle<v8::Context> context) +{ + return WebFrameImpl::fromFrame(V8Proxy::retrieveFrame(context)); +} +#endif + WebFrame* WebFrame::fromFrameOwnerElement(const WebElement& element) { return WebFrameImpl::fromFrameOwnerElement( @@ -841,12 +856,24 @@ v8::Local<v8::Context> WebFrameImpl::mainWorldScriptContext() const return V8Proxy::mainWorldContext(m_frame); } -v8::Handle<v8::Value> WebFrameImpl::createFileSystem(int type, +v8::Handle<v8::Value> WebFrameImpl::createFileSystem(WebFileSystem::Type type, const WebString& name, const WebString& path) { return toV8(DOMFileSystem::create(frame()->document(), name, AsyncFileSystemChromium::create(static_cast<AsyncFileSystem::Type>(type), path))); } + +v8::Handle<v8::Value> WebFrameImpl::createFileEntry(WebFileSystem::Type type, + const WebString& fileSystemName, + const WebString& fileSystemPath, + const WebString& filePath, + bool isDirectory) +{ + RefPtr<DOMFileSystemBase> fileSystem = DOMFileSystem::create(frame()->document(), fileSystemName, AsyncFileSystemChromium::create(static_cast<AsyncFileSystem::Type>(type), fileSystemPath)); + if (isDirectory) + return toV8(DirectoryEntry::create(fileSystem, filePath)); + return toV8(FileEntry::create(fileSystem, filePath)); +} #endif bool WebFrameImpl::insertStyleText( @@ -1305,6 +1332,39 @@ bool WebFrameImpl::selectWordAroundCaret() return true; } +void WebFrameImpl::selectRange(const WebPoint& start, const WebPoint& end) +{ + VisibleSelection selection(visiblePositionForWindowPoint(start), + visiblePositionForWindowPoint(end)); + + if (frame()->selection()->shouldChangeSelection(selection)) + frame()->selection()->setSelection(selection, CharacterGranularity, + MakeNonDirectionalSelection); +} + +VisiblePosition WebFrameImpl::visiblePositionForWindowPoint(const WebPoint& point) +{ + HitTestRequest::HitTestRequestType hitType = HitTestRequest::MouseMove; + hitType |= HitTestRequest::ReadOnly; + hitType |= HitTestRequest::Active; + HitTestRequest request(hitType); + FrameView* view = frame()->view(); + HitTestResult result(view->windowToContents( + view->convertFromContainingWindow(IntPoint(point.x, point.y)))); + + frame()->document()->renderView()->layer()->hitTest(request, result); + + // Matching the logic in MouseEventWithHitTestResults::targetNode() + Node* node = result.innerNode(); + if (!node) + return VisiblePosition(); + Element* element = node->parentElement(); + if (!node->inDocument() && element && element->inDocument()) + node = element; + + return node->renderer()->positionForPoint(result.localPoint()); +} + int WebFrameImpl::printBegin(const WebSize& pageSize, const WebNode& constrainToNode, int printerDPI, @@ -1366,7 +1426,13 @@ float WebFrameImpl::printPage(int page, WebCanvas* canvas) return 0; } - return m_printContext->spoolPage(GraphicsContextBuilder(canvas).context(), page); + GraphicsContextBuilder builder(canvas); + GraphicsContext& gc = builder.context(); +#if WEBKIT_USING_SKIA + gc.platformContext()->setPrinting(true); +#endif + + return m_printContext->spoolPage(gc, page); } void WebFrameImpl::printEnd() @@ -1482,12 +1548,8 @@ bool WebFrameImpl::find(int identifier, m_activeMatchIndex = m_lastMatchCount - 1; } if (selectionRect) { - WebRect rect = frame()->view()->convertToContainingWindow(currSelectionRect); - rect.x -= frameView()->scrollOffset().width(); - rect.y -= frameView()->scrollOffset().height(); - *selectionRect = rect; - - reportFindInPageSelection(rect, m_activeMatchIndex + 1, identifier); + *selectionRect = frameView()->contentsToWindow(currSelectionRect); + reportFindInPageSelection(*selectionRect, m_activeMatchIndex + 1, identifier); } } } else { @@ -1624,10 +1686,8 @@ void WebFrameImpl::scopeStringMatches(int identifier, m_locatingActiveRect = false; // Notify browser of new location for the selected rectangle. - resultBounds.move(-frameView()->scrollOffset().width(), - -frameView()->scrollOffset().height()); reportFindInPageSelection( - frame()->view()->convertToContainingWindow(resultBounds), + frameView()->contentsToWindow(resultBounds), m_activeMatchIndex + 1, identifier); } diff --git a/Source/WebKit/chromium/src/WebFrameImpl.h b/Source/WebKit/chromium/src/WebFrameImpl.h index 6129de1..572408a 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.h +++ b/Source/WebKit/chromium/src/WebFrameImpl.h @@ -109,9 +109,14 @@ public: virtual v8::Handle<v8::Value> executeScriptAndReturnValue( const WebScriptSource&); virtual v8::Local<v8::Context> mainWorldScriptContext() const; - virtual v8::Handle<v8::Value> createFileSystem(int type, + virtual v8::Handle<v8::Value> createFileSystem(WebFileSystem::Type, const WebString& name, const WebString& path); + virtual v8::Handle<v8::Value> createFileEntry(WebFileSystem::Type, + const WebString& fileSystemName, + const WebString& fileSystemPath, + const WebString& filePath, + bool isDirectory); #endif virtual bool insertStyleText(const WebString& css, const WebString& id); virtual void reload(bool ignoreCache); @@ -157,6 +162,7 @@ public: virtual WebString selectionAsText() const; virtual WebString selectionAsMarkup() const; virtual bool selectWordAroundCaret(); + virtual void selectRange(const WebPoint& start, const WebPoint& end); virtual int printBegin(const WebSize& pageSize, const WebNode& constrainToNode, int printerDPI, @@ -326,6 +332,9 @@ private: void loadJavaScriptURL(const WebCore::KURL&); + // Returns a hit-tested VisiblePosition for the given point + WebCore::VisiblePosition visiblePositionForWindowPoint(const WebPoint&); + FrameLoaderClientImpl m_frameLoaderClient; WebFrameClient* m_client; diff --git a/Source/WebKit/chromium/src/WebHTTPLoadInfo.cpp b/Source/WebKit/chromium/src/WebHTTPLoadInfo.cpp index 876a489..9cb4aaa 100644 --- a/Source/WebKit/chromium/src/WebHTTPLoadInfo.cpp +++ b/Source/WebKit/chromium/src/WebHTTPLoadInfo.cpp @@ -89,6 +89,18 @@ void WebHTTPLoadInfo::setHTTPStatusText(const WebString& statusText) m_private->httpStatusText = statusText; } +long long WebHTTPLoadInfo::encodedDataLength() const +{ + ASSERT(!m_private.isNull()); + return m_private->encodedDataLength; +} + +void WebHTTPLoadInfo::setEncodedDataLength(long long encodedDataLength) +{ + ASSERT(!m_private.isNull()); + m_private->encodedDataLength = encodedDataLength; +} + static void addHeader(HTTPHeaderMap* map, const WebString& name, const WebString& value) { pair<HTTPHeaderMap::iterator, bool> result = map->add(name, value); @@ -108,4 +120,28 @@ void WebHTTPLoadInfo::addResponseHeader(const WebString& name, const WebString& addHeader(&m_private->responseHeaders, name, value); } +WebString WebHTTPLoadInfo::requestHeadersText() const +{ + ASSERT(!m_private.isNull()); + return m_private->requestHeadersText; +} + +void WebHTTPLoadInfo::setRequestHeadersText(const WebString& headersText) +{ + ASSERT(!m_private.isNull()); + m_private->requestHeadersText = headersText; +} + +WebString WebHTTPLoadInfo::responseHeadersText() const +{ + ASSERT(!m_private.isNull()); + return m_private->responseHeadersText; +} + +void WebHTTPLoadInfo::setResponseHeadersText(const WebString& headersText) +{ + ASSERT(!m_private.isNull()); + m_private->responseHeadersText = headersText; +} + } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp index ce307a4..24d3f6c 100644 --- a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,10 +26,12 @@ #include "config.h" #include "WebIDBCallbacksImpl.h" +#if ENABLE(INDEXED_DATABASE) + #include "IDBCallbacks.h" #include "IDBCursorBackendProxy.h" +#include "IDBDatabaseBackendProxy.h" #include "IDBDatabaseError.h" -#include "IDBDatabaseProxy.h" #include "IDBKey.h" #include "IDBTransactionBackendProxy.h" #include "WebIDBCallbacks.h" @@ -39,9 +41,9 @@ #include "WebIDBTransaction.h" #include "WebSerializedScriptValue.h" -#if ENABLE(INDEXED_DATABASE) +using namespace WebCore; -namespace WebCore { +namespace WebKit { WebIDBCallbacksImpl::WebIDBCallbacksImpl(PassRefPtr<IDBCallbacks> callbacks) : m_callbacks(callbacks) @@ -52,32 +54,32 @@ WebIDBCallbacksImpl::~WebIDBCallbacksImpl() { } -void WebIDBCallbacksImpl::onError(const WebKit::WebIDBDatabaseError& error) +void WebIDBCallbacksImpl::onError(const WebIDBDatabaseError& error) { m_callbacks->onError(error); } -void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBCursor* cursor) +void WebIDBCallbacksImpl::onSuccess(WebIDBCursor* cursor) { m_callbacks->onSuccess(IDBCursorBackendProxy::create(cursor)); } -void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBDatabase* webKitInstance) +void WebIDBCallbacksImpl::onSuccess(WebIDBDatabase* webKitInstance) { - m_callbacks->onSuccess(IDBDatabaseProxy::create(webKitInstance)); + m_callbacks->onSuccess(IDBDatabaseBackendProxy::create(webKitInstance)); } -void WebIDBCallbacksImpl::onSuccess(const WebKit::WebIDBKey& key) +void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key) { m_callbacks->onSuccess(key); } -void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBTransaction* webKitInstance) +void WebIDBCallbacksImpl::onSuccess(WebIDBTransaction* webKitInstance) { m_callbacks->onSuccess(IDBTransactionBackendProxy::create(webKitInstance)); } -void WebIDBCallbacksImpl::onSuccess(const WebKit::WebSerializedScriptValue& serializedScriptValue) +void WebIDBCallbacksImpl::onSuccess(const WebSerializedScriptValue& serializedScriptValue) { m_callbacks->onSuccess(serializedScriptValue); } @@ -87,6 +89,6 @@ void WebIDBCallbacksImpl::onBlocked() m_callbacks->onBlocked(); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h index 057aa25..c486601 100644 --- a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h +++ b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,35 +26,35 @@ #ifndef WebIDBCallbacksImpl_h #define WebIDBCallbacksImpl_h +#if ENABLE(INDEXED_DATABASE) + #include "WebIDBCallbacks.h" #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> -#if ENABLE(INDEXED_DATABASE) - -namespace WebCore { +namespace WebCore { class IDBCallbacks; } -class IDBCallbacks; +namespace WebKit { -class WebIDBCallbacksImpl : public WebKit::WebIDBCallbacks { +class WebIDBCallbacksImpl : public WebIDBCallbacks { public: - WebIDBCallbacksImpl(PassRefPtr<IDBCallbacks>); + WebIDBCallbacksImpl(PassRefPtr<WebCore::IDBCallbacks>); virtual ~WebIDBCallbacksImpl(); - virtual void onError(const WebKit::WebIDBDatabaseError&); - virtual void onSuccess(WebKit::WebIDBCursor*); - virtual void onSuccess(WebKit::WebIDBDatabase*); - virtual void onSuccess(const WebKit::WebIDBKey&); - virtual void onSuccess(WebKit::WebIDBTransaction*); - virtual void onSuccess(const WebKit::WebSerializedScriptValue&); + virtual void onError(const WebIDBDatabaseError&); + virtual void onSuccess(WebIDBCursor*); + virtual void onSuccess(WebIDBDatabase*); + virtual void onSuccess(const WebIDBKey&); + virtual void onSuccess(WebIDBTransaction*); + virtual void onSuccess(const WebSerializedScriptValue&); virtual void onBlocked(); private: - RefPtr<IDBCallbacks> m_callbacks; + RefPtr<WebCore::IDBCallbacks> m_callbacks; }; -} // namespace WebCore +} // namespace WebKit -#endif +#endif // ENABLE(INDEXED_DATABASE) #endif // WebIDBCallbacksImpl_h diff --git a/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp b/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp index 86c4f57..6c0012e 100644 --- a/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #include "config.h" #include "WebIDBCursorImpl.h" +#if ENABLE(INDEXED_DATABASE) + #include "IDBAny.h" #include "IDBCallbacksProxy.h" #include "IDBCursorBackendInterface.h" @@ -80,4 +82,6 @@ void WebIDBCursorImpl::deleteFunction(WebIDBCallbacks* callbacks, WebExceptionCo m_idbCursorBackend->deleteFunction(IDBCallbacksProxy::create(callbacks), ec); } -} // namespace WebCore +} // namespace WebKit + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBCursorImpl.h b/Source/WebKit/chromium/src/WebIDBCursorImpl.h index de17a99..c237920 100644 --- a/Source/WebKit/chromium/src/WebIDBCursorImpl.h +++ b/Source/WebKit/chromium/src/WebIDBCursorImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #ifndef WebIDBCursorImpl_h #define WebIDBCursorImpl_h +#if ENABLE(INDEXED_DATABASE) + #include "WebCommon.h" #include "WebExceptionCode.h" #include "WebIDBCursor.h" @@ -56,4 +58,6 @@ public: } // namespace WebKit +#endif // ENABLE(INDEXED_DATABASE) + #endif // WebIDBCursorImpl_h diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp index 3ca0274..0fec84a 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp @@ -31,7 +31,9 @@ #include "IDBDatabaseCallbacks.h" #include "WebString.h" -namespace WebCore { +using namespace WebCore; + +namespace WebKit { WebIDBDatabaseCallbacksImpl::WebIDBDatabaseCallbacksImpl(PassRefPtr<IDBDatabaseCallbacks> callbacks) : m_callbacks(callbacks) @@ -42,11 +44,11 @@ WebIDBDatabaseCallbacksImpl::~WebIDBDatabaseCallbacksImpl() { } -void WebIDBDatabaseCallbacksImpl::onVersionChange(const WebKit::WebString& version) +void WebIDBDatabaseCallbacksImpl::onVersionChange(const WebString& version) { m_callbacks->onVersionChange(version); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h b/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h index ba3dc5e..d4916af 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h +++ b/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h @@ -34,23 +34,23 @@ #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> -namespace WebCore { +namespace WebCore { class IDBDatabaseCallbacks; } -class IDBDatabaseCallbacks; +namespace WebKit { -class WebIDBDatabaseCallbacksImpl : public WebKit::WebIDBDatabaseCallbacks { +class WebIDBDatabaseCallbacksImpl : public WebIDBDatabaseCallbacks { public: - WebIDBDatabaseCallbacksImpl(PassRefPtr<IDBDatabaseCallbacks>); + WebIDBDatabaseCallbacksImpl(PassRefPtr<WebCore::IDBDatabaseCallbacks>); virtual ~WebIDBDatabaseCallbacksImpl(); - virtual void onVersionChange(const WebKit::WebString& version); + virtual void onVersionChange(const WebString& version); private: - RefPtr<IDBDatabaseCallbacks> m_callbacks; + RefPtr<WebCore::IDBDatabaseCallbacks> m_callbacks; }; -} // namespace WebCore +} // namespace WebKit -#endif +#endif // ENABLE(INDEXED_DATABASE) #endif // WebIDBDatabaseCallbacksImpl_h diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseError.cpp b/Source/WebKit/chromium/src/WebIDBDatabaseError.cpp index 7413ae6..25e202c 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseError.cpp +++ b/Source/WebKit/chromium/src/WebIDBDatabaseError.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,11 +31,11 @@ #include "config.h" #include "WebIDBDatabaseError.h" +#if ENABLE(INDEXED_DATABASE) + #include "IDBDatabaseError.h" #include "WebString.h" -#if ENABLE(INDEXED_DATABASE) - using namespace WebCore; namespace WebKit { diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp index 2a97923..92dd5ad 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #include "config.h" #include "WebIDBDatabaseImpl.h" +#if ENABLE(INDEXED_DATABASE) + #include "DOMStringList.h" #include "IDBCallbacksProxy.h" #include "IDBDatabaseBackendInterface.h" @@ -36,8 +38,6 @@ #include "WebIDBObjectStoreImpl.h" #include "WebIDBTransactionImpl.h" -#if ENABLE(INDEXED_DATABASE) - using namespace WebCore; namespace WebKit { @@ -112,6 +112,6 @@ void WebIDBDatabaseImpl::open(WebIDBDatabaseCallbacks* callbacks) m_databaseBackend->open(m_databaseCallbacks); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h index 0e1d03e..061f5c2 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h +++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,19 +26,19 @@ #ifndef WebIDBDatabaseImpl_h #define WebIDBDatabaseImpl_h +#if ENABLE(INDEXED_DATABASE) + #include "WebCommon.h" #include "WebExceptionCode.h" #include "WebIDBDatabase.h" #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> -namespace WebCore { -class IDBDatabaseBackendInterface; -class IDBDatabaseCallbacksProxy; -} +namespace WebCore { class IDBDatabaseBackendInterface; } namespace WebKit { +class IDBDatabaseCallbacksProxy; class WebIDBDatabaseCallbacks; class WebIDBObjectStore; class WebIDBTransaction; @@ -63,9 +63,11 @@ public: private: WTF::RefPtr<WebCore::IDBDatabaseBackendInterface> m_databaseBackend; - WTF::RefPtr<WebCore::IDBDatabaseCallbacksProxy> m_databaseCallbacks; + WTF::RefPtr<IDBDatabaseCallbacksProxy> m_databaseCallbacks; }; } // namespace WebKit #endif // WebIDBDatabaseImpl_h + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp b/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp index 3e21af5..793698e 100755 --- a/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,6 +31,8 @@ #include "config.h" #include "WebIDBFactoryImpl.h" +#if ENABLE(INDEXED_DATABASE) + #include "DOMStringList.h" #include "IDBCallbacksProxy.h" #include "IDBFactoryBackendImpl.h" @@ -38,8 +40,6 @@ #include "WebIDBDatabaseError.h" #include <wtf/OwnPtr.h> -#if ENABLE(INDEXED_DATABASE) - using namespace WebCore; namespace WebKit { @@ -50,7 +50,7 @@ WebIDBFactory* WebIDBFactory::create() } WebIDBFactoryImpl::WebIDBFactoryImpl() - : m_idbFactoryBackend(WebCore::IDBFactoryBackendImpl::create()) + : m_idbFactoryBackend(IDBFactoryBackendImpl::create()) { } diff --git a/Source/WebKit/chromium/src/WebIDBFactoryImpl.h b/Source/WebKit/chromium/src/WebIDBFactoryImpl.h index 0ffd289..62bd9ed 100755 --- a/Source/WebKit/chromium/src/WebIDBFactoryImpl.h +++ b/Source/WebKit/chromium/src/WebIDBFactoryImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,6 +29,8 @@ #ifndef WebIDBFactoryImpl_h #define WebIDBFactoryImpl_h +#if ENABLE(INDEXED_DATABASE) + #include "WebDOMStringList.h" #include "WebIDBFactory.h" #include <wtf/RefPtr.h> @@ -50,4 +52,6 @@ private: } // namespace WebKit +#endif // ENABLE(INDEXED_DATABASE) + #endif // WebIDBFactoryImpl_h diff --git a/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp b/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp index 6e8e1f2..fa33da9 100644 --- a/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #include "config.h" #include "WebIDBIndexImpl.h" +#if ENABLE(INDEXED_DATABASE) + #include "IDBCallbacksProxy.h" #include "IDBIndex.h" #include "IDBKeyRange.h" @@ -33,8 +35,6 @@ #include "WebIDBKey.h" #include "WebIDBKeyRange.h" -#if ENABLE(INDEXED_DATABASE) - using namespace WebCore; namespace WebKit { @@ -88,6 +88,6 @@ void WebIDBIndexImpl::getKey(const WebIDBKey& keyRange, WebIDBCallbacks* callbac m_backend->getKey(keyRange, IDBCallbacksProxy::create(callbacks), transaction.getIDBTransactionBackendInterface(), ec); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBIndexImpl.h b/Source/WebKit/chromium/src/WebIDBIndexImpl.h index f68da7f..b047c2f 100644 --- a/Source/WebKit/chromium/src/WebIDBIndexImpl.h +++ b/Source/WebKit/chromium/src/WebIDBIndexImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #ifndef WebIDBIndexImpl_h #define WebIDBIndexImpl_h +#if ENABLE(INDEXED_DATABASE) + #include "WebCommon.h" #include "WebIDBIndex.h" #include <wtf/PassRefPtr.h> @@ -57,4 +59,6 @@ private: } // namespace WebKit +#endif // ENABLE(INDEXED_DATABASE) + #endif // WebIDBIndexImpl_h diff --git a/Source/WebKit/chromium/src/WebIDBKey.cpp b/Source/WebKit/chromium/src/WebIDBKey.cpp index a20146e..f20347a 100644 --- a/Source/WebKit/chromium/src/WebIDBKey.cpp +++ b/Source/WebKit/chromium/src/WebIDBKey.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -80,7 +80,7 @@ WebIDBKey WebIDBKey::createFromValueAndKeyPath(const WebSerializedScriptValue& s { if (serializedScriptValue.isNull()) return WebIDBKey::createInvalid(); - return WebCore::createIDBKeyFromSerializedValueAndKeyPath(serializedScriptValue, idbKeyPath); + return createIDBKeyFromSerializedValueAndKeyPath(serializedScriptValue, idbKeyPath); } WebSerializedScriptValue WebIDBKey::injectIDBKeyIntoSerializedValue(const WebIDBKey& key, const WebSerializedScriptValue& value, const WebIDBKeyPath& path) diff --git a/Source/WebKit/chromium/src/WebIDBKeyPath.cpp b/Source/WebKit/chromium/src/WebIDBKeyPath.cpp index 9eb33d6..309c0d9 100644 --- a/Source/WebKit/chromium/src/WebIDBKeyPath.cpp +++ b/Source/WebKit/chromium/src/WebIDBKeyPath.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -67,7 +67,7 @@ void WebIDBKeyPath::reset() m_private.reset(0); } -WebIDBKeyPath::operator const WTF::Vector<WebCore::IDBKeyPathElement, 0>&() const +WebIDBKeyPath::operator const WTF::Vector<IDBKeyPathElement, 0>&() const { return *m_private.get(); } diff --git a/Source/WebKit/chromium/src/WebIDBKeyRange.cpp b/Source/WebKit/chromium/src/WebIDBKeyRange.cpp index 517ff00..ea641e9 100644 --- a/Source/WebKit/chromium/src/WebIDBKeyRange.cpp +++ b/Source/WebKit/chromium/src/WebIDBKeyRange.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,11 +26,13 @@ #include "config.h" #include "WebIDBKeyRange.h" +#if ENABLE(INDEXED_DATABASE) + #include "IDBKey.h" #include "IDBKeyRange.h" #include "WebIDBKey.h" -using WebCore::IDBKeyRange; +using namespace WebCore; namespace WebKit { @@ -93,3 +95,5 @@ WebIDBKeyRange::operator PassRefPtr<IDBKeyRange>() const } } // namespace WebKit + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp index 56e354d..0a67f36 100755 --- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #include "config.h" #include "WebIDBObjectStoreImpl.h" +#if ENABLE(INDEXED_DATABASE) + #include "DOMStringList.h" #include "IDBCallbacksProxy.h" #include "IDBIndexBackendInterface.h" @@ -37,8 +39,6 @@ #include "WebIDBTransaction.h" #include "WebSerializedScriptValue.h" -#if ENABLE(INDEXED_DATABASE) - using namespace WebCore; namespace WebKit { @@ -113,6 +113,6 @@ void WebIDBObjectStoreImpl::openCursor(const WebIDBKeyRange& keyRange, unsigned m_objectStore->openCursor(keyRange, direction, IDBCallbacksProxy::create(callbacks), transaction.getIDBTransactionBackendInterface(), ec); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h index 3e2dfab..f1093ed 100755 --- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h +++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #ifndef WebIDBObjectStoreImpl_h #define WebIDBObjectStoreImpl_h +#if ENABLE(INDEXED_DATABASE) + #include "WebCommon.h" #include "WebIDBObjectStore.h" #include <wtf/PassRefPtr.h> @@ -64,4 +66,6 @@ public: } // namespace WebKit +#endif // ENABLE(INDEXED_DATABASE) + #endif // WebIDBObjectStoreImpl_h diff --git a/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.cpp index 848182e..2f16477 100644 --- a/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,9 @@ #include "IDBTransactionCallbacks.h" -namespace WebCore { +using namespace WebCore; + +namespace WebKit { WebIDBTransactionCallbacksImpl::WebIDBTransactionCallbacksImpl(PassRefPtr<IDBTransactionCallbacks> callbacks) : m_callbacks(callbacks) @@ -51,6 +53,6 @@ void WebIDBTransactionCallbacksImpl::onComplete() m_callbacks->onComplete(); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.h b/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.h index 416ac3c..8acb095 100644 --- a/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.h +++ b/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,24 +32,24 @@ #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> -namespace WebCore { +namespace WebCore { class IDBTransactionCallbacks; } -class IDBTransactionCallbacks; +namespace WebKit { -class WebIDBTransactionCallbacksImpl : public WebKit::WebIDBTransactionCallbacks { +class WebIDBTransactionCallbacksImpl : public WebIDBTransactionCallbacks { public: - WebIDBTransactionCallbacksImpl(PassRefPtr<IDBTransactionCallbacks>); + WebIDBTransactionCallbacksImpl(PassRefPtr<WebCore::IDBTransactionCallbacks>); virtual ~WebIDBTransactionCallbacksImpl(); virtual void onAbort(); virtual void onComplete(); private: - RefPtr<IDBTransactionCallbacks> m_callbacks; + RefPtr<WebCore::IDBTransactionCallbacks> m_callbacks; }; -} // namespace WebCore +} // namespace WebKit -#endif +#endif // ENABLE(INDEXED_DATABASE) #endif // WebIDBTransactionCallbacksImpl_h diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp index abe9cbf..dbea93e 100644 --- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp +++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp @@ -189,12 +189,18 @@ void WebMediaPlayerClientImpl::playbackStateChanged() m_mediaPlayer->playbackStateChanged(); } +WebMediaPlayer::Preload WebMediaPlayerClientImpl::preload() const +{ + if (m_mediaPlayer) + return static_cast<WebMediaPlayer::Preload>(m_mediaPlayer->preload()); + return static_cast<WebMediaPlayer::Preload>(m_preload); +} + // MediaPlayerPrivateInterface ------------------------------------------------- void WebMediaPlayerClientImpl::load(const String& url) { - Frame* frame = static_cast<HTMLMediaElement*>( - m_mediaPlayer->mediaPlayerClient())->document()->frame(); + m_url = url; // Video frame object is owned by WebMediaPlayer. Before destroying // WebMediaPlayer all frames need to be released. @@ -203,9 +209,19 @@ void WebMediaPlayerClientImpl::load(const String& url) m_videoLayer->releaseCurrentFrame(); #endif + if (m_preload == MediaPlayer::None) { + m_webMediaPlayer.clear(); + m_delayingLoad = true; + } else + loadInternal(); +} + +void WebMediaPlayerClientImpl::loadInternal() +{ + Frame* frame = static_cast<HTMLMediaElement*>(m_mediaPlayer->mediaPlayerClient())->document()->frame(); m_webMediaPlayer.set(createWebMediaPlayer(this, frame)); if (m_webMediaPlayer.get()) - m_webMediaPlayer->load(KURL(ParsedURLString, url)); + m_webMediaPlayer->load(KURL(ParsedURLString, m_url)); } void WebMediaPlayerClientImpl::cancelLoad() @@ -242,6 +258,12 @@ void WebMediaPlayerClientImpl::pause() m_webMediaPlayer->pause(); } +void WebMediaPlayerClientImpl::prepareToPlay() +{ + if (m_delayingLoad) + startDelayedLoad(); +} + IntSize WebMediaPlayerClientImpl::naturalSize() const { if (m_webMediaPlayer.get()) @@ -438,10 +460,15 @@ void WebMediaPlayerClientImpl::paintCurrentFrameInContext(GraphicsContext* conte } } -void WebMediaPlayerClientImpl::setAutobuffer(bool autoBuffer) +void WebMediaPlayerClientImpl::setPreload(MediaPlayer::Preload preload) { + m_preload = preload; + if (m_webMediaPlayer.get()) - m_webMediaPlayer->setAutoBuffer(autoBuffer); + m_webMediaPlayer->setPreload(static_cast<WebMediaPlayer::Preload>(preload)); + + if (m_delayingLoad && m_preload != MediaPlayer::None) + startDelayedLoad(); } bool WebMediaPlayerClientImpl::hasSingleSecurityOrigin() const @@ -566,8 +593,20 @@ MediaPlayer::SupportsType WebMediaPlayerClientImpl::supportsType(const String& t return MediaPlayer::IsNotSupported; } +void WebMediaPlayerClientImpl::startDelayedLoad() +{ + ASSERT(m_delayingLoad); + ASSERT(!m_webMediaPlayer.get()); + + m_delayingLoad = false; + + loadInternal(); +} + WebMediaPlayerClientImpl::WebMediaPlayerClientImpl() : m_mediaPlayer(0) + , m_delayingLoad(false) + , m_preload(MediaPlayer::MetaData) #if USE(ACCELERATED_COMPOSITING) , m_videoLayer(0) , m_supportsAcceleratedCompositing(false) diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h index 22030b3..a08bb3a 100644 --- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h +++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h @@ -77,6 +77,7 @@ public: virtual void sawUnsupportedTracks(); virtual float volume() const; virtual void playbackStateChanged(); + virtual WebMediaPlayer::Preload preload() const; // MediaPlayerPrivateInterface methods: virtual void load(const WTF::String& url); @@ -87,6 +88,7 @@ public: virtual WebCore::PlatformMedia platformMedia() const; virtual void play(); virtual void pause(); + virtual void prepareToPlay(); virtual bool supportsFullscreen() const; virtual bool supportsSave() const; virtual WebCore::IntSize naturalSize() const; @@ -106,13 +108,13 @@ public: virtual float maxTimeSeekable() const; virtual WTF::PassRefPtr<WebCore::TimeRanges> buffered() const; virtual int dataRate() const; - virtual void setAutobuffer(bool); virtual bool totalBytesKnown() const; virtual unsigned totalBytes() const; virtual unsigned bytesLoaded() const; virtual void setSize(const WebCore::IntSize&); virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect&); virtual void paintCurrentFrameInContext(WebCore::GraphicsContext*, const WebCore::IntRect&); + virtual void setPreload(WebCore::MediaPlayer::Preload); virtual bool hasSingleSecurityOrigin() const; virtual WebCore::MediaPlayer::MovieLoadType movieLoadType() const; virtual unsigned decodedFrameCount() const; @@ -129,6 +131,8 @@ public: private: WebMediaPlayerClientImpl(); + void startDelayedLoad(); + void loadInternal(); static WebCore::MediaPlayerPrivateInterface* create(WebCore::MediaPlayer*); static void getSupportedTypes(WTF::HashSet<WTF::String>&); @@ -140,6 +144,9 @@ private: WebCore::MediaPlayer* m_mediaPlayer; OwnPtr<WebMediaPlayer> m_webMediaPlayer; + String m_url; + bool m_delayingLoad; + WebCore::MediaPlayer::Preload m_preload; #if USE(ACCELERATED_COMPOSITING) RefPtr<WebCore::VideoLayerChromium> m_videoLayer; bool m_supportsAcceleratedCompositing; diff --git a/Source/WebKit/chromium/src/WebNode.cpp b/Source/WebKit/chromium/src/WebNode.cpp index 68b6f13..cfb8528 100644 --- a/Source/WebKit/chromium/src/WebNode.cpp +++ b/Source/WebKit/chromium/src/WebNode.cpp @@ -152,7 +152,7 @@ bool WebNode::isFocusable() const bool WebNode::isContentEditable() const { - return m_private->rendererIsEditable(); + return m_private->isContentEditable(); } bool WebNode::isElementNode() const diff --git a/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp b/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp index 4b65b9e..280747f 100644 --- a/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp +++ b/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp @@ -295,7 +295,7 @@ void WebPageSerializerImpl::encodeAndFlushBuffer( status); } -void WebPageSerializerImpl::openTagToString(const Element* element, +void WebPageSerializerImpl::openTagToString(Element* element, SerializeDomParam* param) { // FIXME: use StringBuilder instead of String. @@ -328,11 +328,13 @@ void WebPageSerializerImpl::openTagToString(const Element* element, result += attrValue; else { // Get the absolute link - String completeURL = param->document->completeURL(attrValue); + WebFrameImpl* subFrame = WebFrameImpl::fromFrameOwnerElement(element); + String completeURL = subFrame ? subFrame->frame()->document()->url() : + param->document->completeURL(attrValue); // Check whether we have local files for those link. if (m_localLinks.contains(completeURL)) { - if (!m_localDirectoryName.isEmpty()) - result += "./" + m_localDirectoryName + "/"; + if (!param->directoryName.isEmpty()) + result += "./" + param->directoryName + "/"; result += m_localLinks.get(completeURL); } else result += completeURL; @@ -360,7 +362,7 @@ void WebPageSerializerImpl::openTagToString(const Element* element, } // Serialize end tag of an specified element. -void WebPageSerializerImpl::endTagToString(const Element* element, +void WebPageSerializerImpl::endTagToString(Element* element, SerializeDomParam* param) { bool needSkip; @@ -397,18 +399,18 @@ void WebPageSerializerImpl::endTagToString(const Element* element, saveHTMLContentToBuffer(result, param); } -void WebPageSerializerImpl::buildContentForNode(const Node* node, +void WebPageSerializerImpl::buildContentForNode(Node* node, SerializeDomParam* param) { switch (node->nodeType()) { case Node::ELEMENT_NODE: // Process open tag of element. - openTagToString(static_cast<const Element*>(node), param); + openTagToString(static_cast<Element*>(node), param); // Walk through the children nodes and process it. - for (const Node *child = node->firstChild(); child; child = child->nextSibling()) + for (Node *child = node->firstChild(); child; child = child->nextSibling()) buildContentForNode(child, param); // Process end tag of element. - endTagToString(static_cast<const Element*>(node), param); + endTagToString(static_cast<Element*>(node), param); break; case Node::TEXT_NODE: saveHTMLContentToBuffer(createMarkup(node), param); diff --git a/Source/WebKit/chromium/src/WebPageSerializerImpl.h b/Source/WebKit/chromium/src/WebPageSerializerImpl.h index 5ee8805..b53bd66 100644 --- a/Source/WebKit/chromium/src/WebPageSerializerImpl.h +++ b/Source/WebKit/chromium/src/WebPageSerializerImpl.h @@ -174,13 +174,13 @@ private: SerializeDomParam* param, FlushOption); // Serialize open tag of an specified element. - void openTagToString(const WebCore::Element* element, + void openTagToString(WebCore::Element*, SerializeDomParam* param); // Serialize end tag of an specified element. - void endTagToString(const WebCore::Element* element, + void endTagToString(WebCore::Element*, SerializeDomParam* param); // Build content for a specified node - void buildContentForNode(const WebCore::Node* node, + void buildContentForNode(WebCore::Node*, SerializeDomParam* param); }; diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp index 40f8625..150f173 100644 --- a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp +++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp @@ -480,12 +480,11 @@ void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event) return; if (event->type() == eventNames().mousedownEvent) { - // Ensure that the frame containing the plugin has focus. Frame* containingFrame = parentView->frame(); if (Page* currentPage = containingFrame->page()) - currentPage->focusController()->setFocusedFrame(containingFrame); - // Give focus to our containing HTMLPluginElement. - containingFrame->document()->setFocusedNode(m_element); + currentPage->focusController()->setFocusedNode(m_element, containingFrame); + else + containingFrame->document()->setFocusedNode(m_element); } WebCursorInfo cursorInfo; diff --git a/Source/WebKit/chromium/src/WebPopupMenuImpl.h b/Source/WebKit/chromium/src/WebPopupMenuImpl.h index 7bb9f7e..58a883f 100644 --- a/Source/WebKit/chromium/src/WebPopupMenuImpl.h +++ b/Source/WebKit/chromium/src/WebPopupMenuImpl.h @@ -78,6 +78,7 @@ public: virtual bool confirmComposition(const WebString& text); virtual WebTextInputType textInputType(); virtual WebRect caretOrSelectionBounds(); + virtual bool selectionRange(WebPoint& start, WebPoint& end) const { return false; } virtual void setTextDirection(WebTextDirection direction); virtual bool isAcceleratedCompositingActive() const { return false; } diff --git a/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp b/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp index 256bf56..5d64cc8 100644 --- a/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp +++ b/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp @@ -320,4 +320,20 @@ bool WebRuntimeFeatures::isJavaScriptI18NAPIEnabled() #endif } +void WebRuntimeFeatures::enableQuota(bool enable) +{ +#if ENABLE(QUOTA) + RuntimeEnabledFeatures::setQuotaEnabled(enable); +#endif +} + +bool WebRuntimeFeatures::isQuotaEnabled() +{ +#if ENABLE(QUOTA) + return RuntimeEnabledFeatures::quotaEnabled(); +#else + return false; +#endif +} + } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebScrollbarImpl.cpp b/Source/WebKit/chromium/src/WebScrollbarImpl.cpp index 57ea92e..41fac66 100644 --- a/Source/WebKit/chromium/src/WebScrollbarImpl.cpp +++ b/Source/WebKit/chromium/src/WebScrollbarImpl.cpp @@ -281,12 +281,16 @@ void WebScrollbarImpl::invalidateScrollbarRect(Scrollbar*, const IntRect& rect) m_client->invalidateScrollbarRect(this, webrect); } +void WebScrollbarImpl::invalidateScrollCornerRect(const IntRect&) +{ +} + bool WebScrollbarImpl::isActive() const { return true; } -bool WebScrollbarImpl::scrollbarCornerPresent() const +bool WebScrollbarImpl::isScrollCornerVisible() const { return false; } diff --git a/Source/WebKit/chromium/src/WebScrollbarImpl.h b/Source/WebKit/chromium/src/WebScrollbarImpl.h index ac120cf..82fdbfd 100644 --- a/Source/WebKit/chromium/src/WebScrollbarImpl.h +++ b/Source/WebKit/chromium/src/WebScrollbarImpl.h @@ -62,8 +62,10 @@ public: virtual int scrollPosition(WebCore::Scrollbar*) const; virtual void setScrollOffset(const WebCore::IntPoint&); virtual void invalidateScrollbarRect(WebCore::Scrollbar*, const WebCore::IntRect&); + virtual void invalidateScrollCornerRect(const WebCore::IntRect&); virtual bool isActive() const; - virtual bool scrollbarCornerPresent() const; + virtual WebCore::IntRect scrollCornerRect() const { return WebCore::IntRect(); } + virtual bool isScrollCornerVisible() const; virtual void getTickmarks(Vector<WebCore::IntRect>&) const; virtual WebCore::Scrollbar* horizontalScrollbar() const; virtual WebCore::Scrollbar* verticalScrollbar() const; diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.cpp b/Source/WebKit/chromium/src/WebSettingsImpl.cpp index 1089af9..c5b60cc 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.cpp +++ b/Source/WebKit/chromium/src/WebSettingsImpl.cpp @@ -343,6 +343,11 @@ void WebSettingsImpl::setAcceleratedCompositingForAnimationEnabled(bool enabled) m_settings->setAcceleratedCompositingForAnimationEnabled(enabled); } +void WebSettingsImpl::setAcceleratedDrawingEnabled(bool enabled) +{ + m_settings->setAcceleratedDrawingEnabled(enabled); +} + void WebSettingsImpl::setAccelerated2dCanvasEnabled(bool enabled) { m_settings->setAccelerated2dCanvasEnabled(enabled); @@ -373,6 +378,11 @@ void WebSettingsImpl::setInteractiveFormValidationEnabled(bool enabled) m_settings->setInteractiveFormValidationEnabled(enabled); } +void WebSettingsImpl::setValidationMessageTimerMagnification(int newValue) +{ + m_settings->setValidationMessageTimerMagnification(newValue); +} + void WebSettingsImpl::setMinimumTimerInterval(double interval) { m_settings->setMinDOMTimerInterval(interval); diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.h b/Source/WebKit/chromium/src/WebSettingsImpl.h index d0319f8..57aa804 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.h +++ b/Source/WebKit/chromium/src/WebSettingsImpl.h @@ -101,13 +101,15 @@ public: virtual void setAcceleratedCompositingForVideoEnabled(bool); virtual void setAcceleratedCompositingForPluginsEnabled(bool); virtual void setAcceleratedCompositingForCanvasEnabled(bool); - virtual void setAcceleratedCompositingForAnimationEnabled(bool); + virtual void setAcceleratedCompositingForAnimationEnabled(bool); virtual void setAccelerated2dCanvasEnabled(bool); + virtual void setAcceleratedDrawingEnabled(bool); virtual void setMemoryInfoEnabled(bool); virtual void setHyperlinkAuditingEnabled(bool); virtual void setAsynchronousSpellCheckingEnabled(bool); virtual void setCaretBrowsingEnabled(bool); virtual void setInteractiveFormValidationEnabled(bool); + virtual void setValidationMessageTimerMagnification(int); virtual void setMinimumTimerInterval(double); virtual void setFullScreenEnabled(bool); diff --git a/Source/WebKit/chromium/src/WebStorageQuotaCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebStorageQuotaCallbacksImpl.cpp new file mode 100644 index 0000000..75a3a8a --- /dev/null +++ b/Source/WebKit/chromium/src/WebStorageQuotaCallbacksImpl.cpp @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2011 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebStorageQuotaCallbacksImpl.h" + +#if ENABLE(QUOTA) + +#include "DOMCoreException.h" +#include "StorageInfoErrorCallback.h" +#include "StorageInfoQuotaCallback.h" +#include "StorageInfoUsageCallback.h" + +using namespace WebCore; + +namespace WebKit { + +WebStorageQuotaCallbacksImpl::WebStorageQuotaCallbacksImpl(PassRefPtr<WebCore::StorageInfoUsageCallback> usageCallback, PassRefPtr<WebCore::StorageInfoErrorCallback> errorCallback) + : m_usageCallback(usageCallback) + , m_errorCallback(errorCallback) +{ +} + +WebStorageQuotaCallbacksImpl::WebStorageQuotaCallbacksImpl(PassRefPtr<WebCore::StorageInfoQuotaCallback> quotaCallback, PassRefPtr<WebCore::StorageInfoErrorCallback> errorCallback) + : m_quotaCallback(quotaCallback) + , m_errorCallback(errorCallback) +{ +} + +WebStorageQuotaCallbacksImpl::~WebStorageQuotaCallbacksImpl() +{ +} + +void WebStorageQuotaCallbacksImpl::didQueryStorageUsageAndQuota(unsigned long long usageInBytes, unsigned long long quotaInBytes) +{ + if (m_usageCallback) + m_usageCallback->handleEvent(usageInBytes, quotaInBytes); + delete this; +} + +void WebStorageQuotaCallbacksImpl::didGrantStorageQuota(unsigned long long grantedQuotaInBytes) +{ + if (m_quotaCallback) + m_quotaCallback->handleEvent(grantedQuotaInBytes); + delete this; +} + +void WebStorageQuotaCallbacksImpl::didFail(WebStorageQuotaError error) +{ + if (m_errorCallback) { + ExceptionCodeDescription description; + getExceptionCodeDescription(static_cast<ExceptionCode>(error), description); + m_errorCallback->handleEvent(DOMCoreException::create(description).get()); + } + delete this; +} + +} // namespace WebKit + +#endif // ENABLE(QUOTA) diff --git a/Source/WebKit/chromium/src/WebStorageQuotaCallbacksImpl.h b/Source/WebKit/chromium/src/WebStorageQuotaCallbacksImpl.h new file mode 100644 index 0000000..e8209f5 --- /dev/null +++ b/Source/WebKit/chromium/src/WebStorageQuotaCallbacksImpl.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2011 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebStorageQuotaCallbacksImpl_h +#define WebStorageQuotaCallbacksImpl_h + +#include "WebStorageQuotaCallbacks.h" +#include <wtf/PassOwnPtr.h> +#include <wtf/PassRefPtr.h> +#include <wtf/RefPtr.h> + +namespace WebCore { +class StorageInfoErrorCallback; +class StorageInfoQuotaCallback; +class StorageInfoUsageCallback; +} + +namespace WebKit { + +class WebStorageQuotaCallbacksImpl : public WebStorageQuotaCallbacks { +public: + // The class is self-destructed and thus we have bare constructors. + WebStorageQuotaCallbacksImpl(PassRefPtr<WebCore::StorageInfoUsageCallback>, PassRefPtr<WebCore::StorageInfoErrorCallback>); + WebStorageQuotaCallbacksImpl(PassRefPtr<WebCore::StorageInfoQuotaCallback>, PassRefPtr<WebCore::StorageInfoErrorCallback>); + + virtual ~WebStorageQuotaCallbacksImpl(); + + virtual void didQueryStorageUsageAndQuota(unsigned long long usageInBytes, unsigned long long quotaInBytes); + virtual void didGrantStorageQuota(unsigned long long grantedQuotaInBytes); + virtual void didFail(WebStorageQuotaError); + +private: + RefPtr<WebCore::StorageInfoUsageCallback> m_usageCallback; + RefPtr<WebCore::StorageInfoQuotaCallback> m_quotaCallback; + RefPtr<WebCore::StorageInfoErrorCallback> m_errorCallback; +}; + +} // namespace WebKit + +#endif // WebStorageQuotaCallbacksImpl_h diff --git a/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp b/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp index b9e5227..f5a6604 100644 --- a/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp +++ b/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp @@ -34,16 +34,31 @@ #include "SpellChecker.h" #include "WebTextCheckingResult.h" #include "WebVector.h" +#include <wtf/Assertions.h> using namespace WebCore; namespace WebKit { -static Vector<SpellCheckingResult> toCoreResults(const WebVector<WebTextCheckingResult>& results) +static TextCheckingType toCoreCheckingType(WebTextCheckingResult::Error error) { - Vector<SpellCheckingResult> coreResults; - for (size_t i = 0; i < results.size(); ++i) - coreResults.append(SpellCheckingResult(static_cast<DocumentMarker::MarkerType>(results[i].error), results[i].position, results[i].length)); + if (error == WebTextCheckingResult::ErrorSpelling) + return TextCheckingTypeSpelling; + ASSERT(error == WebTextCheckingResult::ErrorGrammar); + return TextCheckingTypeGrammar; +} + +static Vector<TextCheckingResult> toCoreResults(const WebVector<WebTextCheckingResult>& results) +{ + Vector<TextCheckingResult> coreResults; + for (size_t i = 0; i < results.size(); ++i) { + TextCheckingResult coreResult; + coreResult.type = toCoreCheckingType(results[i].error); + coreResult.location = results[i].position; + coreResult.length = results[i].length; + coreResults.append(coreResult); + } + return coreResults; } diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp index 4efa880..2438a94 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.cpp +++ b/Source/WebKit/chromium/src/WebViewImpl.cpp @@ -102,6 +102,7 @@ #include "WebDevToolsAgentPrivate.h" #include "WebDragData.h" #include "WebFrameImpl.h" +#include "WebGraphicsContext3D.h" #include "WebImage.h" #include "WebInputElement.h" #include "WebInputEvent.h" @@ -125,7 +126,7 @@ #include <wtf/CurrentTime.h> #include <wtf/RefPtr.h> -#if PLATFORM(CG) +#if USE(CG) #include <CoreGraphics/CGBitmapContext.h> #include <CoreGraphics/CGContext.h> #endif @@ -620,11 +621,6 @@ bool WebViewImpl::keyEvent(const WebKeyboardEvent& event) } #endif // OS(WINDOWS) || OS(LINUX) || OS(FREEBSD) - // It's not clear if we should continue after detecting a capslock keypress. - // I'll err on the side of continuing, which is the pre-existing behaviour. - if (event.windowsKeyCode == VKEY_CAPITAL) - handler->capsLockStateMayHaveChanged(); - PlatformKeyboardEventBuilder evt(event); if (handler->keyEvent(evt)) { @@ -1043,7 +1039,7 @@ void WebViewImpl::doPixelReadbackToCanvas(WebCanvas* canvas, const IntRect& rect // PlatformGraphicsContext is actually a pointer to PlatformContextSkia GraphicsContext gc(reinterpret_cast<PlatformGraphicsContext*>(&context)); int bitmapHeight = canvas->getDevice()->accessBitmap(false).height(); -#elif PLATFORM(CG) +#elif USE(CG) GraphicsContext gc(canvas); int bitmapHeight = CGBitmapContextGetHeight(reinterpret_cast<CGContextRef>(canvas)); #else @@ -1273,7 +1269,7 @@ void WebViewImpl::setFocus(bool enable) Element* element = static_cast<Element*>(focusedNode); if (element->isTextFormControl()) element->updateFocusAppearance(true); - else if (focusedNode->rendererIsEditable()) { + else if (focusedNode->isContentEditable()) { // updateFocusAppearance() selects all the text of // contentseditable DIVs. So we set the selection explicitly // instead. Note that this has the side effect of moving the @@ -1335,7 +1331,7 @@ bool WebViewImpl::setComposition( PassRefPtr<Range> range = editor->compositionRange(); if (range) { const Node* node = range->startContainer(); - if (!node || !node->rendererIsEditable()) + if (!node || !node->isContentEditable()) return false; } @@ -1384,7 +1380,7 @@ bool WebViewImpl::confirmComposition(const WebString& text) PassRefPtr<Range> range = editor->compositionRange(); if (range) { const Node* node = range->startContainer(); - if (!node || !node->rendererIsEditable()) + if (!node || !node->isContentEditable()) return false; } @@ -1443,22 +1439,53 @@ WebRect WebViewImpl::caretOrSelectionBounds() if (!view) return rect; - const Node* node = controller->start().deprecatedNode(); + const Node* node = controller->base().containerNode(); if (!node || !node->renderer()) return rect; if (controller->isCaret()) rect = view->contentsToWindow(controller->absoluteCaretBounds()); else if (controller->isRange()) { - node = controller->end().deprecatedNode(); - if (!node || !node->renderer()) - return rect; + node = controller->extent().containerNode(); RefPtr<Range> range = controller->toNormalizedRange(); + if (!node || !node->renderer() || !range) + return rect; rect = view->contentsToWindow(focused->editor()->firstRectForRange(range.get())); } return rect; } +bool WebViewImpl::selectionRange(WebPoint& start, WebPoint& end) const +{ + const Frame* frame = focusedWebCoreFrame(); + if (!frame) + return false; + RefPtr<Range> selectedRange = frame->selection()->toNormalizedRange(); + RefPtr<Range> range(Range::create(selectedRange->startContainer()->document(), + selectedRange->startContainer(), + selectedRange->startOffset(), + selectedRange->startContainer(), + selectedRange->startOffset())); + + IntRect rect = frame->editor()->firstRectForRange(range.get()); + start.x = rect.x(); + start.y = rect.y() + rect.height() - 1; + + range = Range::create(selectedRange->endContainer()->document(), + selectedRange->endContainer(), + selectedRange->endOffset(), + selectedRange->endContainer(), + selectedRange->endOffset()); + + rect = frame->editor()->firstRectForRange(range.get()); + end.x = rect.x() + rect.width() - 1; + end.y = rect.y() + rect.height() - 1; + + start = frame->view()->contentsToWindow(start); + end = frame->view()->contentsToWindow(end); + return true; +} + void WebViewImpl::setTextDirection(WebTextDirection direction) { // The Editor::setBaseWritingDirection() function checks if we can change @@ -1793,21 +1820,6 @@ void WebViewImpl::dragSourceSystemDragEnded() } WebDragOperation WebViewImpl::dragTargetDragEnter( - const WebDragData& webDragData, int identity, // FIXME: remove identity from this function signature. - const WebPoint& clientPoint, - const WebPoint& screenPoint, - WebDragOperationsMask operationsAllowed) -{ - ASSERT(!m_currentDragData.get()); - - m_currentDragData = webDragData; - UNUSED_PARAM(identity); - m_operationsAllowed = operationsAllowed; - - return dragTargetDragEnterOrOver(clientPoint, screenPoint, DragEnter); -} - -WebDragOperation WebViewImpl::dragTargetDragEnter( const WebDragData& webDragData, const WebPoint& clientPoint, const WebPoint& screenPoint, @@ -2367,35 +2379,6 @@ private: WebViewImpl* m_webViewImpl; }; -class WebViewImplScrollbarPainter : public TilePaintInterface { - WTF_MAKE_NONCOPYABLE(WebViewImplScrollbarPainter); -public: - static PassOwnPtr<WebViewImplScrollbarPainter> create(WebViewImpl* webViewImpl) - { - return adoptPtr(new WebViewImplScrollbarPainter(webViewImpl)); - } - - virtual void paint(GraphicsContext& context, const IntRect& contentRect) - { - Page* page = m_webViewImpl->page(); - if (!page) - return; - FrameView* view = page->mainFrame()->view(); - - context.translate(static_cast<float>(view->scrollX()), static_cast<float>(view->scrollY())); - IntRect windowRect = view->contentsToWindow(contentRect); - view->paintScrollbars(&context, windowRect); - } - -private: - explicit WebViewImplScrollbarPainter(WebViewImpl* webViewImpl) - : m_webViewImpl(webViewImpl) - { - } - - WebViewImpl* m_webViewImpl; -}; - void WebViewImpl::setIsAcceleratedCompositingActive(bool active) { PlatformBridge::histogramEnumeration("GPU.setIsAcceleratedCompositingActive", active * 2 + m_isAcceleratedCompositingActive, 4); @@ -2425,7 +2408,8 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) context->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); } - m_layerRenderer = LayerRendererChromium::create(context.release(), WebViewImplContentPainter::create(this), WebViewImplScrollbarPainter::create(this)); + + m_layerRenderer = LayerRendererChromium::create(context.release(), WebViewImplContentPainter::create(this)); if (m_layerRenderer) { m_client->didActivateAcceleratedCompositing(true); m_isAcceleratedCompositingActive = true; @@ -2463,10 +2447,13 @@ void WebViewImpl::doComposite() void WebViewImpl::reallocateRenderer() { - RefPtr<GraphicsContext3D> newContext = GraphicsContext3D::create( + RefPtr<GraphicsContext3D> newContext = m_temporaryOnscreenGraphicsContext3D.get(); + WebGraphicsContext3D* webContext = GraphicsContext3DInternal::extractWebGraphicsContext3D(newContext.get()); + if (!newContext || !webContext || webContext->isContextLost()) + newContext = GraphicsContext3D::create( getCompositorContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); // GraphicsContext3D::create might fail and return 0, in that case LayerRendererChromium::create will also return 0. - RefPtr<LayerRendererChromium> layerRenderer = LayerRendererChromium::create(newContext, WebViewImplContentPainter::create(this), WebViewImplScrollbarPainter::create(this)); + RefPtr<LayerRendererChromium> layerRenderer = LayerRendererChromium::create(newContext, WebViewImplContentPainter::create(this)); // Reattach the root layer. Child layers will get reattached as a side effect of updateLayersRecursive. if (layerRenderer) { @@ -2506,18 +2493,20 @@ WebGraphicsContext3D* WebViewImpl::graphicsContext3D() { #if USE(ACCELERATED_COMPOSITING) if (m_page->settings()->acceleratedCompositingEnabled() && allowsAcceleratedCompositing()) { - GraphicsContext3D* context = 0; - if (m_layerRenderer) - context = m_layerRenderer->context(); - else if (m_temporaryOnscreenGraphicsContext3D) - context = m_temporaryOnscreenGraphicsContext3D.get(); - else { - m_temporaryOnscreenGraphicsContext3D = GraphicsContext3D::create(getCompositorContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); - if (m_temporaryOnscreenGraphicsContext3D) - m_temporaryOnscreenGraphicsContext3D->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); - context = m_temporaryOnscreenGraphicsContext3D.get(); + if (m_layerRenderer) { + WebGraphicsContext3D* webContext = GraphicsContext3DInternal::extractWebGraphicsContext3D(m_layerRenderer->context()); + if (webContext && !webContext->isContextLost()) + return webContext; + } + if (m_temporaryOnscreenGraphicsContext3D) { + WebGraphicsContext3D* webContext = GraphicsContext3DInternal::extractWebGraphicsContext3D(m_temporaryOnscreenGraphicsContext3D.get()); + if (webContext && !webContext->isContextLost()) + return webContext; } - return GraphicsContext3DInternal::extractWebGraphicsContext3D(context); + m_temporaryOnscreenGraphicsContext3D = GraphicsContext3D::create(getCompositorContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); + if (m_temporaryOnscreenGraphicsContext3D) + m_temporaryOnscreenGraphicsContext3D->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); + return GraphicsContext3DInternal::extractWebGraphicsContext3D(m_temporaryOnscreenGraphicsContext3D.get()); } #endif return 0; diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h index 66b2908..f10202f 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.h +++ b/Source/WebKit/chromium/src/WebViewImpl.h @@ -109,6 +109,7 @@ public: virtual bool confirmComposition(const WebString& text); virtual WebTextInputType textInputType(); virtual WebRect caretOrSelectionBounds(); + virtual bool selectionRange(WebPoint& start, WebPoint& end) const; virtual void setTextDirection(WebTextDirection direction); virtual bool isAcceleratedCompositingActive() const; @@ -157,11 +158,6 @@ public: WebDragOperation operation); virtual void dragSourceSystemDragEnded(); virtual WebDragOperation dragTargetDragEnter( - const WebDragData&, int identity, // FIXME: remove identity from this function signature. - const WebPoint& clientPoint, - const WebPoint& screenPoint, - WebDragOperationsMask operationsAllowed); - virtual WebDragOperation dragTargetDragEnter( const WebDragData&, const WebPoint& clientPoint, const WebPoint& screenPoint, diff --git a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp index d05322f..5147e15 100644 --- a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp +++ b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp @@ -45,6 +45,7 @@ #include "WorkerThread.h" #include <wtf/MainThread.h> #include <wtf/Threading.h> +#include <wtf/UnusedParam.h> namespace WebCore { @@ -337,26 +338,14 @@ void WorkerFileSystemCallbacksBridge::didReadDirectoryOnWorkerThread(ScriptExecu bridge->m_callbacksOnWorkerThread->didReadDirectory(entries, hasMore); } -bool WorkerFileSystemCallbacksBridge::derefIfWorkerIsStopped() -{ - WebWorkerBase* worker = 0; - { - MutexLocker locker(m_mutex); - worker = m_worker; - } - if (!worker) { - m_selfRef.clear(); - return true; - } - return false; -} - -void WorkerFileSystemCallbacksBridge::runTaskOnMainThread(WebCore::ScriptExecutionContext* scriptExecutionContext, WorkerFileSystemCallbacksBridge* bridge, PassOwnPtr<WebCore::ScriptExecutionContext::Task> taskToRun) +void WorkerFileSystemCallbacksBridge::runTaskOnMainThread(WebCore::ScriptExecutionContext* scriptExecutionContext, PassRefPtr<WorkerFileSystemCallbacksBridge> bridge, PassOwnPtr<WebCore::ScriptExecutionContext::Task> taskToRun) { ASSERT(isMainThread()); - if (bridge->derefIfWorkerIsStopped()) - return; + + // Every task run will result in one call to mayPostTaskToWorker, which is where this ref is released. + WorkerFileSystemCallbacksBridge* leaked = bridge.leakRef(); + UNUSED_PARAM(leaked); taskToRun->performTask(scriptExecutionContext); } @@ -372,19 +361,22 @@ void WorkerFileSystemCallbacksBridge::runTaskOnWorkerThread(WebCore::ScriptExecu void WorkerFileSystemCallbacksBridge::dispatchTaskToMainThread(PassOwnPtr<WebCore::ScriptExecutionContext::Task> task) { - ASSERT(!m_selfRef); ASSERT(m_worker); ASSERT(m_workerContext->isContextThread()); - m_selfRef = this; - m_worker->dispatchTaskToMainThread(createCallbackTask(&runTaskOnMainThread, this, task)); + m_worker->dispatchTaskToMainThread(createCallbackTask(&runTaskOnMainThread, RefPtr<WorkerFileSystemCallbacksBridge>(this).release(), task)); } void WorkerFileSystemCallbacksBridge::mayPostTaskToWorker(PassOwnPtr<ScriptExecutionContext::Task> task, const String& mode) { ASSERT(isMainThread()); + + // Balancing out the ref() done in runTaskOnMainThread. (Since m_mutex is a member and the deref may result + // in the destruction of WorkerFileSystemCallbacksBridge, the ordering of the RefPtr and the MutexLocker + // is very important, to ensure that the m_mutex is still valid when it gets unlocked.) + RefPtr<WorkerFileSystemCallbacksBridge> bridge = adoptRef(this); MutexLocker locker(m_mutex); if (m_worker) - m_worker->postTaskForModeToWorkerContext(createCallbackTask(&runTaskOnWorkerThread, m_selfRef.release(), task), mode); + m_worker->postTaskForModeToWorkerContext(createCallbackTask(&runTaskOnWorkerThread, bridge, task), mode); } } // namespace WebCore diff --git a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h index 9a869dc..5af8529 100644 --- a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h +++ b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h @@ -122,25 +122,18 @@ private: friend class MainThreadFileSystemCallbacks; // Methods that dispatch WebFileSystemCallbacks on the worker threads. - // They release a selfRef of the WorkerFileSystemCallbacksBridge. static void didFailOnWorkerThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*, WebFileError); static void didOpenFileSystemOnWorkerThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*, const String& name, const String& rootPath); static void didSucceedOnWorkerThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*); static void didReadMetadataOnWorkerThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*, const WebFileInfo&); static void didReadDirectoryOnWorkerThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*, const WebVector<WebFileSystemEntry>&, bool hasMore); - // For early-exist; this deref's selfRef and returns true if the worker is already null. - bool derefIfWorkerIsStopped(); - - static void runTaskOnMainThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*, PassOwnPtr<WebCore::ScriptExecutionContext::Task>); + static void runTaskOnMainThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge>, PassOwnPtr<WebCore::ScriptExecutionContext::Task>); static void runTaskOnWorkerThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge>, PassOwnPtr<WebCore::ScriptExecutionContext::Task>); void dispatchTaskToMainThread(PassOwnPtr<WebCore::ScriptExecutionContext::Task>); void mayPostTaskToWorker(PassOwnPtr<WebCore::ScriptExecutionContext::Task>, const String& mode); - // m_selfRef keeps a reference to itself while there's a pending callback on the main thread. - RefPtr<WorkerFileSystemCallbacksBridge> m_selfRef; - Mutex m_mutex; WebWorkerBase* m_worker; WebCore::ScriptExecutionContext* m_workerContext; diff --git a/Source/WebKit/chromium/src/js/DevTools.js b/Source/WebKit/chromium/src/js/DevTools.js index 7a3eb8d..e6b7537 100644 --- a/Source/WebKit/chromium/src/js/DevTools.js +++ b/Source/WebKit/chromium/src/js/DevTools.js @@ -169,6 +169,10 @@ WebInspector.platformExtensionAPI = function(tabId) return tabId; } webInspector.inspectedWindow.__proto__.__defineGetter__("tabId", getTabId); + chrome = window.chrome || {}; + chrome.devTools = chrome.devTools || {}; + for (var property in webInspector) + chrome.devTools[property] = webInspector[property]; } WebInspector.buildPlatformExtensionAPI = function() diff --git a/Source/WebKit/chromium/src/js/Tests.js b/Source/WebKit/chromium/src/js/Tests.js index 1d98656..220cf89 100644 --- a/Source/WebKit/chromium/src/js/Tests.js +++ b/Source/WebKit/chromium/src/js/Tests.js @@ -81,7 +81,6 @@ TestSuite.prototype.assertEquals = function(expected, actual, opt_message) } }; - /** * True assertion tests that value == true. * @param {Object} value Actual object. @@ -522,6 +521,105 @@ TestSuite.prototype.testPauseWhenScriptIsRunning = function() /** + * Tests network size. + */ +TestSuite.prototype.testNetworkSize = function() +{ + var test = this; + + function finishResource(resource, finishTime) + { + test.assertEquals(221, resource.transferSize, "Incorrect total encoded data length"); + test.assertEquals(25, resource.resourceSize, "Incorrect total data length"); + test.releaseControl(); + } + + this.addSniffer(WebInspector.NetworkDispatcher.prototype, "_finishResource", finishResource); + + // Reload inspected page to sniff network events + test.evaluateInConsole_("window.location.reload(true);", function(resultText) {}); + + this.takeControl(); +}; + + +/** + * Tests network sync size. + */ +TestSuite.prototype.testNetworkSyncSize = function() +{ + var test = this; + + function finishResource(resource, finishTime) + { + test.assertEquals(221, resource.transferSize, "Incorrect total encoded data length"); + test.assertEquals(25, resource.resourceSize, "Incorrect total data length"); + test.releaseControl(); + } + + this.addSniffer(WebInspector.NetworkDispatcher.prototype, "_finishResource", finishResource); + + // Send synchronous XHR to sniff network events + test.evaluateInConsole_("var xhr = new XMLHttpRequest(); xhr.open(\"GET\", \"chunked\", false); xhr.send(null);", function() {}); + + this.takeControl(); +}; + + +/** + * Tests network raw headers text. + */ +TestSuite.prototype.testNetworkRawHeadersText = function() +{ + var test = this; + + function finishResource(resource, finishTime) + { + var rawResponseHeadersText = resource.rawResponseHeadersText + if (!rawResponseHeadersText) + test.fail("Failure: resource does not have raw response header text"); + test.assertEquals(166, resource.rawResponseHeadersText.length, "Incorrect raw response header text length"); + test.releaseControl(); + } + + this.addSniffer(WebInspector.NetworkDispatcher.prototype, "_finishResource", finishResource); + + // Reload inspected page to sniff network events + test.evaluateInConsole_("window.location.reload(true);", function(resultText) {}); + + this.takeControl(); +}; + + +/** + * Tests network timing. + */ +TestSuite.prototype.testNetworkTiming = function() +{ + var test = this; + + function finishResource(resource, finishTime) + { + test.assertTrue(resource.timing.receiveHeadersEnd - resource.timing.connectStart >= 100, + "Time between receiveHeadersEnd and connectStart should be >=100ms, but was " + + "receiveHeadersEnd=" + resource.timing.receiveHeadersEnd + ", connectStart=" + resource.timing.connectStart + "."); + test.assertTrue(resource.endTime - resource.startTime >= 0.2, + "Time between endTime and startTime should be >=200ms, but was " + + "endtime=" + resource.endTime + ", startTime=" + resource.startTime + "."); + + test.releaseControl(); + } + + this.addSniffer(WebInspector.NetworkDispatcher.prototype, "_finishResource", finishResource); + + // Reload inspected page to sniff network events + test.evaluateInConsole_("window.location.reload(true);", function(resultText) {}); + + this.takeControl(); +}; + + +/** * Serializes options collection to string. * @param {HTMLOptionsCollection} options * @return {string} diff --git a/Source/WebKit/chromium/tests/CCThreadTaskTest.cpp b/Source/WebKit/chromium/tests/CCThreadTaskTest.cpp new file mode 100644 index 0000000..1c5f877 --- /dev/null +++ b/Source/WebKit/chromium/tests/CCThreadTaskTest.cpp @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2011 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#include "cc/CCThreadTask.h" + +#include <gmock/gmock.h> +#include <gtest/gtest.h> + +using namespace WTF; +using namespace WebCore; + +namespace { + +class Mock { +public: + MOCK_METHOD0(method0, void()); + MOCK_METHOD1(method1, void(int a1)); + MOCK_METHOD2(method2, void(int a1, int a2)); + MOCK_METHOD3(method3, void(int a1, int a2, int a3)); + MOCK_METHOD4(method4, void(int a1, int a2, int a3, int a4)); +}; + +TEST(CCThreadTaskTest, runnableMethods) +{ + Mock mock; + EXPECT_CALL(mock, method0()).Times(1); + EXPECT_CALL(mock, method1(9)).Times(1); + EXPECT_CALL(mock, method2(9, 8)).Times(1); + EXPECT_CALL(mock, method3(9, 8, 7)).Times(1); + EXPECT_CALL(mock, method4(9, 8, 7, 6)).Times(1); + + createCCThreadTask(&mock, &Mock::method0)->performTask(); + createCCThreadTask(&mock, &Mock::method1, 9)->performTask(); + createCCThreadTask(&mock, &Mock::method2, 9, 8)->performTask(); + createCCThreadTask(&mock, &Mock::method3, 9, 8, 7)->performTask(); + createCCThreadTask(&mock, &Mock::method4, 9, 8, 7, 6)->performTask(); +} + +} // namespace diff --git a/Source/WebKit/chromium/tests/CCThreadTest.cpp b/Source/WebKit/chromium/tests/CCThreadTest.cpp new file mode 100644 index 0000000..04fba46 --- /dev/null +++ b/Source/WebKit/chromium/tests/CCThreadTest.cpp @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2011 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#include "cc/CCThread.h" + +#include "cc/CCCompletionEvent.h" +#include "cc/CCMainThreadTask.h" +#include "cc/CCThreadTask.h" +#include <gtest/gtest.h> +#include <webkit/support/webkit_support.h> + +using namespace WebCore; + +namespace { + +class PingPongUsingCondition { +public: + void ping(CCCompletionEvent* completion) + { + hitThreadID = currentThread(); + completion->signal(); + } + + ThreadIdentifier hitThreadID; +}; + + +TEST(CCThreadTest, pingPongUsingCondition) +{ + OwnPtr<CCThread> thread = CCThread::create(); + PingPongUsingCondition target; + CCCompletionEvent completion; + thread->postTask(createCCThreadTask(&target, &PingPongUsingCondition::ping, &completion)); + completion.wait(); + + EXPECT_EQ(thread->threadID(), target.hitThreadID); +} + +class PingPongTestUsingTasks { +public: + void ping() + { + CCMainThread::postTask(createMainThreadTask(this, &PingPongTestUsingTasks::pong)); + hit = true; + } + + void pong() + { + EXPECT_TRUE(isMainThread()); + webkit_support::QuitMessageLoop(); + } + + bool hit; +}; + +TEST(CCThreadTest, startPostAndWaitOnCondition) +{ + OwnPtr<CCThread> thread = CCThread::create(); + + PingPongTestUsingTasks target; + thread->postTask(createCCThreadTask(&target, &PingPongTestUsingTasks::ping)); + webkit_support::RunMessageLoop(); + + EXPECT_TRUE(target.hit); +} + +} // namespace diff --git a/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp b/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp index 0454ea9..ac4282b 100644 --- a/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp +++ b/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp @@ -53,7 +53,6 @@ public: } private: - v8::Locker m_locker; v8::HandleScope m_scope; v8::Persistent<v8::Context> m_context; }; diff --git a/Source/WebKit/chromium/tests/PopupMenuTest.cpp b/Source/WebKit/chromium/tests/PopupMenuTest.cpp index 8c53ffc..5a18708 100644 --- a/Source/WebKit/chromium/tests/PopupMenuTest.cpp +++ b/Source/WebKit/chromium/tests/PopupMenuTest.cpp @@ -142,6 +142,7 @@ public: virtual bool confirmComposition(const WebString& text) { return true; } virtual WebTextInputType textInputType() { return WebKit::WebTextInputTypeNone; } virtual WebRect caretOrSelectionBounds() { return WebRect(); } + virtual bool selectionRange(WebPoint& start, WebPoint& end) const { return false; } virtual void setTextDirection(WebTextDirection) { } }; diff --git a/Source/WebKit/chromium/tests/RunAllTests.cpp b/Source/WebKit/chromium/tests/RunAllTests.cpp index b213de7..500c3dc 100644 --- a/Source/WebKit/chromium/tests/RunAllTests.cpp +++ b/Source/WebKit/chromium/tests/RunAllTests.cpp @@ -39,8 +39,11 @@ #include "WebUnitTests.h" #endif +#include <gmock/gmock.h> + int main(int argc, char** argv) { + ::testing::InitGoogleMock(&argc, argv); TestSuite testSuite(argc, argv); // TestSuite must be created before SetUpTestEnvironment so it performs // initializations needed by WebKit support. diff --git a/Source/WebKit/chromium/tests/TilingDataTest.cpp b/Source/WebKit/chromium/tests/TilingDataTest.cpp index a41f7fe..7573dc7 100755 --- a/Source/WebKit/chromium/tests/TilingDataTest.cpp +++ b/Source/WebKit/chromium/tests/TilingDataTest.cpp @@ -49,6 +49,24 @@ TEST(TilingDataTest, numTiles_NoTiling) TEST(TilingDataTest, numTiles_TilingNoBorders) { + EXPECT_EQ(0, TilingData(0, 0, 0, false).numTiles()); + EXPECT_EQ(0, TilingData(0, 4, 0, false).numTiles()); + EXPECT_EQ(0, TilingData(0, 0, 4, false).numTiles()); + EXPECT_EQ(0, TilingData(4, 4, 0, false).numTiles()); + EXPECT_EQ(0, TilingData(4, 0, 4, false).numTiles()); + EXPECT_EQ(0, TilingData(-8, 1, 1, false).numTiles()); + EXPECT_EQ(0, TilingData(-1, 1, 1, false).numTiles()); + EXPECT_EQ(0, TilingData(0, 1, 1, false).numTiles()); + + EXPECT_EQ(1, TilingData(1, 1, 1, false).numTiles()); + EXPECT_EQ(2, TilingData(1, 1, 2, false).numTiles()); + EXPECT_EQ(2, TilingData(1, 2, 1, false).numTiles()); + EXPECT_EQ(1, TilingData(2, 1, 1, false).numTiles()); + EXPECT_EQ(1, TilingData(2, 1, 2, false).numTiles()); + EXPECT_EQ(1, TilingData(2, 2, 1, false).numTiles()); + EXPECT_EQ(1, TilingData(2, 2, 2, false).numTiles()); + EXPECT_EQ(1, TilingData(3, 3, 3, false).numTiles()); + EXPECT_EQ(1, TilingData(4, 1, 4, false).numTiles()); EXPECT_EQ(1, TilingData(4, 2, 4, false).numTiles()); EXPECT_EQ(1, TilingData(4, 3, 4, false).numTiles()); @@ -82,6 +100,23 @@ TEST(TilingDataTest, numTiles_TilingNoBorders) TEST(TilingDataTest, numTiles_TilingWithBorders) { + EXPECT_EQ(0, TilingData(0, 0, 0, true).numTiles()); + EXPECT_EQ(0, TilingData(0, 4, 0, true).numTiles()); + EXPECT_EQ(0, TilingData(0, 0, 4, true).numTiles()); + EXPECT_EQ(0, TilingData(4, 4, 0, true).numTiles()); + EXPECT_EQ(0, TilingData(4, 0, 4, true).numTiles()); + EXPECT_EQ(0, TilingData(-8, 1, 1, true).numTiles()); + EXPECT_EQ(0, TilingData(-1, 1, 1, true).numTiles()); + EXPECT_EQ(0, TilingData(0, 1, 1, true).numTiles()); + + EXPECT_EQ(1, TilingData(1, 1, 1, true).numTiles()); + EXPECT_EQ(0, TilingData(1, 1, 2, true).numTiles()); + EXPECT_EQ(0, TilingData(1, 2, 1, true).numTiles()); + EXPECT_EQ(1, TilingData(2, 1, 1, true).numTiles()); + EXPECT_EQ(1, TilingData(2, 1, 2, true).numTiles()); + EXPECT_EQ(1, TilingData(2, 2, 1, true).numTiles()); + EXPECT_EQ(1, TilingData(2, 2, 2, true).numTiles()); + EXPECT_EQ(1, TilingData(3, 1, 3, true).numTiles()); EXPECT_EQ(1, TilingData(3, 2, 3, true).numTiles()); EXPECT_EQ(1, TilingData(3, 3, 3, true).numTiles()); @@ -361,7 +396,7 @@ TEST(TilingDataTest, setTotalSize) EXPECT_EQ(2, data.tileSizeY(2)); } -TEST(TilingDataTest, setMaxTextureSize) +TEST(TilingDataTest, setMaxTextureSizeNoBorders) { TilingData data(8, 16, 32, false); EXPECT_EQ(2, data.numTilesX()); @@ -383,4 +418,26 @@ TEST(TilingDataTest, setMaxTextureSize) EXPECT_EQ(7, data.numTilesY()); } +TEST(TilingDataTest, setMaxTextureSizeBorders) +{ + TilingData data(8, 16, 32, true); + EXPECT_EQ(3, data.numTilesX()); + EXPECT_EQ(5, data.numTilesY()); + + data.setMaxTextureSize(32); + EXPECT_EQ(32, data.maxTextureSize()); + EXPECT_EQ(1, data.numTilesX()); + EXPECT_EQ(1, data.numTilesY()); + + data.setMaxTextureSize(2); + EXPECT_EQ(2, data.maxTextureSize()); + EXPECT_EQ(0, data.numTilesX()); + EXPECT_EQ(0, data.numTilesY()); + + data.setMaxTextureSize(5); + EXPECT_EQ(5, data.maxTextureSize()); + EXPECT_EQ(5, data.numTilesX()); + EXPECT_EQ(10, data.numTilesY()); +} + } // namespace diff --git a/Source/WebKit/chromium/tests/TransparencyWinTest.cpp b/Source/WebKit/chromium/tests/TransparencyWinTest.cpp index ee3307f..191bf9e 100644 --- a/Source/WebKit/chromium/tests/TransparencyWinTest.cpp +++ b/Source/WebKit/chromium/tests/TransparencyWinTest.cpp @@ -50,8 +50,8 @@ static FloatRect RECTToFloatRect(const RECT* rect) static void drawNativeRect(GraphicsContext* context, int x, int y, int w, int h) { - skia::PlatformCanvas* canvas = context->platformContext()->canvas(); - HDC dc = canvas->beginPlatformPaint(); + SkCanvas* canvas = context->platformContext()->canvas(); + HDC dc = skia::BeginPlatformPaint(canvas); RECT innerRc; innerRc.left = x; @@ -61,13 +61,12 @@ static void drawNativeRect(GraphicsContext* context, FillRect(dc, &innerRc, reinterpret_cast<HBRUSH>(GetStockObject(BLACK_BRUSH))); - canvas->endPlatformPaint(); + skia::EndPlatformPaint(canvas); } static Color getPixelAt(GraphicsContext* context, int x, int y) { - const SkBitmap& bitmap = context->platformContext()->canvas()-> - getTopPlatformDevice().accessBitmap(false); + const SkBitmap& bitmap = context->platformContext()->canvas()->getTopDevice()->accessBitmap(false); return Color(*reinterpret_cast<const RGBA32*>(bitmap.getAddr32(x, y))); } @@ -75,8 +74,7 @@ static Color getPixelAt(GraphicsContext* context, int x, int y) // Windows messing it up. static void clearTopLayerAlphaChannel(GraphicsContext* context) { - SkBitmap& bitmap = const_cast<SkBitmap&>(context->platformContext()-> - canvas()->getTopPlatformDevice().accessBitmap(false)); + SkBitmap& bitmap = const_cast<SkBitmap&>(context->platformContext()->canvas()->getTopDevice()->accessBitmap(false)); for (int y = 0; y < bitmap.height(); y++) { uint32_t* row = bitmap.getAddr32(0, y); for (int x = 0; x < bitmap.width(); x++) @@ -87,8 +85,7 @@ static void clearTopLayerAlphaChannel(GraphicsContext* context) // Clears the alpha channel on the specified pixel. static void clearTopLayerAlphaPixel(GraphicsContext* context, int x, int y) { - SkBitmap& bitmap = const_cast<SkBitmap&>(context->platformContext()-> - canvas()->getTopPlatformDevice().accessBitmap(false)); + SkBitmap& bitmap = const_cast<SkBitmap&>(context->platformContext()->canvas()->getTopDevice()->accessBitmap(false)); *bitmap.getAddr32(x, y) &= 0x00FFFFFF; } @@ -559,9 +556,7 @@ TEST(TransparencyWin, Scale) // the helper goes out of scope. We don't want to call // clearTopLayerAlphaChannel because that will actually clear the whole // canvas (since we have no extra layer!). - SkBitmap& bitmap = const_cast<SkBitmap&>(helper.context()-> - platformContext()->canvas()->getTopPlatformDevice(). - accessBitmap(false)); + SkBitmap& bitmap = const_cast<SkBitmap&>(helper.context()->platformContext()->canvas()->getTopDevice()->accessBitmap(false)); *bitmap.getAddr32(2, 2) &= 0x00FFFFFF; helper.composite(); } diff --git a/Source/WebKit/chromium/tests/UniscribeHelperTest.cpp b/Source/WebKit/chromium/tests/UniscribeHelperTest.cpp index 8aaed11..ec88f43 100644 --- a/Source/WebKit/chromium/tests/UniscribeHelperTest.cpp +++ b/Source/WebKit/chromium/tests/UniscribeHelperTest.cpp @@ -115,7 +115,7 @@ TEST_F(UniscribeTest, TooBig) { UniscribeHelper uniscribe( input.characters(), static_cast<int>(input.length()), - false, hfont, scriptCache, &properties); + false, hfont, scriptCache, &properties, 0); uniscribe.initWithOptionalLengthProtection(false); // There should be one shaping entry, with nothing in it. @@ -148,7 +148,7 @@ TEST_F(UniscribeTest, TooBig) { UniscribeHelper uniscribe( input.characters(), static_cast<int>(input.length()), - false, hfont, scriptCache, &properties); + false, hfont, scriptCache, &properties, 0); uniscribe.initWithOptionalLengthProtection(true); // There should be 0 runs and shapes. diff --git a/Source/WebKit/chromium/tests/WebFrameTest.cpp b/Source/WebKit/chromium/tests/WebFrameTest.cpp index 891fa83..b38d544 100644 --- a/Source/WebKit/chromium/tests/WebFrameTest.cpp +++ b/Source/WebKit/chromium/tests/WebFrameTest.cpp @@ -35,11 +35,13 @@ #include <webkit/support/webkit_support.h> #include "WebFrame.h" #include "WebFrameClient.h" +#include "WebSettings.h" #include "WebString.h" #include "WebURL.h" #include "WebURLRequest.h" #include "WebURLResponse.h" #include "WebView.h" +#include "v8.h" using namespace WebKit; @@ -47,25 +49,44 @@ namespace { class WebFrameTest : public testing::Test { public: - WebFrameTest() {} + WebFrameTest() + : baseURL("http://www.test.com/") + { + } virtual void TearDown() { webkit_support::UnregisterAllMockedURLs(); } - void registerMockedURLLoad(const WebURL& url, const WebURLResponse& response, const WebString& fileName) + void registerMockedURLLoad(const std::string& fileName) { + WebURLResponse response; + response.initialize(); + response.setMIMEType("text/html"); + std::string filePath = webkit_support::GetWebKitRootDir().utf8(); - filePath.append("/Source/WebKit/chromium/tests/data/"); - filePath.append(fileName.utf8()); - webkit_support::RegisterMockedURL(url, response, WebString::fromUTF8(filePath)); + filePath += "/Source/WebKit/chromium/tests/data/"; + filePath += fileName; + + webkit_support::RegisterMockedURL(WebURL(GURL(baseURL + fileName)), response, WebString::fromUTF8(filePath)); } void serveRequests() { webkit_support::ServeAsynchronousMockedRequests(); } + + void loadFrame(WebFrame* frame, const std::string& fileName) + { + WebURLRequest urlRequest; + urlRequest.initialize(); + urlRequest.setURL(WebURL(GURL(baseURL + fileName))); + frame->loadRequest(urlRequest); + } + +protected: + std::string baseURL; }; class TestWebFrameClient : public WebFrameClient { @@ -73,31 +94,17 @@ class TestWebFrameClient : public WebFrameClient { TEST_F(WebFrameTest, ContentText) { - // Register our resources. - WebURLResponse response; - response.initialize(); - response.setMIMEType("text/html"); - std::string rootURL = "http://www.test.com/"; - const char* files[] = { "iframes_test.html", "visible_iframe.html", - "invisible_iframe.html", "zero_sized_iframe.html" }; - for (int i = 0; i < (sizeof(files) / sizeof(char*)); ++i) { - WebURL webURL = GURL(rootURL + files[i]); - registerMockedURLLoad(webURL, response, WebString::fromUTF8(files[i])); - } + registerMockedURLLoad("iframes_test.html"); + registerMockedURLLoad("visible_iframe.html"); + registerMockedURLLoad("invisible_iframe.html"); + registerMockedURLLoad("zero_sized_iframe.html"); - // Create and initialize the WebView. + // Create and initialize the WebView. TestWebFrameClient webFrameClient; WebView* webView = WebView::create(0); webView->initializeMainFrame(&webFrameClient); - // Load the main frame URL. - WebURL testURL(GURL(rootURL + files[0])); - WebURLRequest urlRequest; - urlRequest.initialize(); - urlRequest.setURL(testURL); - webView->mainFrame()->loadRequest(urlRequest); - - // Load all pending asynchronous requests. + loadFrame(webView->mainFrame(), "iframes_test.html"); serveRequests(); // Now retrieve the frames text and test it only includes visible elements. @@ -111,4 +118,31 @@ TEST_F(WebFrameTest, ContentText) webView->close(); } +TEST_F(WebFrameTest, FrameForEnteredContext) +{ + registerMockedURLLoad("iframes_test.html"); + registerMockedURLLoad("visible_iframe.html"); + registerMockedURLLoad("invisible_iframe.html"); + registerMockedURLLoad("zero_sized_iframe.html"); + + // Create and initialize the WebView. + TestWebFrameClient webFrameClient; + WebView* webView = WebView::create(0); + webView->settings()->setJavaScriptEnabled(true); + webView->initializeMainFrame(&webFrameClient); + + loadFrame(webView->mainFrame(), "iframes_test.html"); + serveRequests(); + + v8::HandleScope scope; + EXPECT_EQ(webView->mainFrame(), + WebFrame::frameForContext( + webView->mainFrame()->mainWorldScriptContext())); + EXPECT_EQ(webView->mainFrame()->firstChild(), + WebFrame::frameForContext( + webView->mainFrame()->firstChild()->mainWorldScriptContext())); + + webView->close(); +} + } |