diff options
author | Steve Block <steveblock@google.com> | 2010-08-27 11:02:25 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-09-02 17:17:20 +0100 |
commit | e8b154fd68f9b33be40a3590e58347f353835f5c (patch) | |
tree | 0733ce26384183245aaa5656af26c653636fe6c1 /WebKit/chromium | |
parent | da56157816334089526a7a115a85fd85a6e9a1dc (diff) | |
download | external_webkit-e8b154fd68f9b33be40a3590e58347f353835f5c.zip external_webkit-e8b154fd68f9b33be40a3590e58347f353835f5c.tar.gz external_webkit-e8b154fd68f9b33be40a3590e58347f353835f5c.tar.bz2 |
Merge WebKit at r66079 : Initial merge by git
Change-Id: Ie2e1440fb9d487d24e52c247342c076fecaecac7
Diffstat (limited to 'WebKit/chromium')
99 files changed, 3962 insertions, 615 deletions
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog index 0a07733..6b0b3fa 100644 --- a/WebKit/chromium/ChangeLog +++ b/WebKit/chromium/ChangeLog @@ -1,3 +1,699 @@ +2010-08-25 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r66074. + http://trac.webkit.org/changeset/66074 + https://bugs.webkit.org/show_bug.cgi?id=44660 + + Chromium canary turned red (Requested by yuzo on #webkit). + + * features.gypi: + * public/WebRuntimeFeatures.h: + * src/WebRuntimeFeatures.cpp: + +2010-08-25 Michael Nordman <michaeln@google.com> + + Reviewed by David Levin. + + https://bugs.webkit.org/show_bug.cgi?id=44133 + WebKitAPI to allow runtime enablement of XmlHttpRequest.responseBlob. + + * features.gypi: Define ENABLE_XHR_RESPONSE_BLOB. + * public/WebRuntimeFeatures.h: + * src/WebRuntimeFeatures.cpp: + (WebKit::WebRuntimeFeatures::enableXHRResponseBlob): + (WebKit::WebRuntimeFeatures::isXHRResponseBlobEnabled): + +2010-08-24 Victoria Kirst <vrk@google.com> + + Reviewed by Darin Fisher. + + Adding a way to communicate video frames between Chromium and WebKit. + The WebKit side acts as a middleman between Chromium and WebCore. + The VideoFrameChromiumImpl is not being used by WebCore yet, as there + still needs to be an implementation of WebVideoFrame in Chromium + -- coming soon in a subsequent patch. + + API changes for Video Frame sharing between WebKit and Chromium + https://bugs.webkit.org/show_bug.cgi?id=44539 + + * WebKit.gyp: + * public/WebMediaPlayer.h: + (WebKit::WebMediaPlayer::getCurrentFrame): + (WebKit::WebMediaPlayer::putCurrentFrame): + * public/WebVideoFrame.h: Added. + * src/VideoFrameChromiumImpl.cpp: Added. + (WebKit::VideoFrameChromiumImpl::toWebVideoFrame): + (WebKit::VideoFrameChromiumImpl::VideoFrameChromiumImpl): + (WebKit::VideoFrameChromiumImpl::type): + (WebKit::VideoFrameChromiumImpl::format): + (WebKit::VideoFrameChromiumImpl::width): + (WebKit::VideoFrameChromiumImpl::height): + (WebKit::VideoFrameChromiumImpl::planes): + (WebKit::VideoFrameChromiumImpl::stride): + (WebKit::VideoFrameChromiumImpl::data): + * src/VideoFrameChromiumImpl.h: Added. + * src/WebMediaPlayerClientImpl.cpp: + (WebKit::WebMediaPlayerClientImpl::getCurrentFrame): + (WebKit::WebMediaPlayerClientImpl::putCurrentFrame): + (WebKit::WebMediaPlayerClientImpl::create): + * src/WebMediaPlayerClientImpl.h: + +2010-08-25 Eric Seidel <eric@webkit.org> + + Unreviewed. Build fix. + + Make Chromiums Broken WebPageSerializerImpl compile again + https://bugs.webkit.org/show_bug.cgi?id=44652 + + Make it compile again. This code is still horribly wrong. + + * src/WebPageSerializerImpl.cpp: + (WebKit::WebPageSerializerImpl::endTagToString): + +2010-08-20 Zhenyao Mo <zmo@google.com> + + Reviewed by Kenneth Russell. + + WebGL must enforce restrictions even if running on OpenGL ES 2.0 + https://bugs.webkit.org/show_bug.cgi?id=42908 + + * public/WebGraphicsContext3D.h: Add two new flags. + * src/GraphicsContext3D.cpp: Ditto. + (WebCore::GraphicsContext3DInternal::isGLES2NPOTStrict): + (WebCore::GraphicsContext3DInternal::isErrorGeneratedOnOutOfBoundsAccesses): + (WebCore::GraphicsContext3D::isGLES2NPOTStrict): + (WebCore::GraphicsContext3D::isErrorGeneratedOnOutOfBoundsAccesses): + * src/WebGraphicsContext3DDefaultImpl.cpp: Ditto. + (WebKit::WebGraphicsContext3DDefaultImpl::isGLES2NPOTStrict): + (WebKit::WebGraphicsContext3DDefaultImpl::isErrorGeneratedOnOutOfBoundsAccesses): + * src/WebGraphicsContext3DDefaultImpl.h: Ditto. + +2010-08-24 Zhenyao Mo <zmo@google.com> + + Reviewed by Kenneth Russell. + + Passing premultiplyAlpha=false to tex{Sub}Image2D loses information (skia) + https://bugs.webkit.org/show_bug.cgi?id=38282 + + * src/WebImageDecoder.cpp: + (WebKit::WebImageDecoder::init): Add premultiplyAlpha flag. + +2010-08-25 Satish Sampath <satish@chromium.org> + + Reviewed by Jeremy Orlow. + + Pass the element's bounds to embedder during speech recognition. + https://bugs.webkit.org/show_bug.cgi?id=44427 + + * public/WebSpeechInputController.h: + (WebKit::WebSpeechInputController::startRecognition): + (WebKit::WebSpeechInputController::cancelRecognition): + (WebKit::WebSpeechInputController::stopRecording): + * src/SpeechInputClientImpl.cpp: + (WebKit::SpeechInputClientImpl::startRecognition): + * src/SpeechInputClientImpl.h: + * src/WebSpeechInputControllerMockImpl.cpp: + (WebKit::WebSpeechInputControllerMockImpl::startRecognition): + * src/WebSpeechInputControllerMockImpl.h: + +2010-08-25 Pawel Hajdan <phajdan.jr@chromium.org> + + Reviewed by Darin Fisher. + + Add an assertion to prevent re-initializing WebKit. + https://bugs.webkit.org/show_bug.cgi?id=44545 + + This will help prevent crashes like: + - http://code.google.com/p/chromium/issues/detail?id=52731 + - http://code.google.com/p/chromium/issues/detail?id=52643 + + * src/WebKit.cpp: + (WebKit::initialize): + +2010-08-25 Jay Civelli <jcivelli@chromium.org> + + Reviewed by Dimitri Glazkov. + + Adding missing test files and reenabling the WebFrame unit-test. + https://bugs.webkit.org/show_bug.cgi?id=44492 + + * tests/WebFrameTest.cpp: + (WebKit::TEST_F): + * tests/data/iframes_test.html: Added. + * tests/data/invisible_iframe.html: Added. + * tests/data/visible_iframe.html: Added. + * tests/data/zero_sized_iframe.html: Added. + +2010-08-25 Kent Tamura <tkent@chromium.org> + + Unreviewed, build fix. + + * DEPS: Roll Chromium revision to 57298 to fix upstream build. + +2010-08-24 Dumitru Daniliuc <dumi@chromium.org> + + Reviewed by Adam Barth. + + Build fix: Remove setHTML5ParserEnabled(), it's no longer used. + + * public/WebSettings.h: + * src/WebSettingsImpl.cpp: + * src/WebSettingsImpl.h: + +2010-08-24 Jian Li <jianli@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] WebBlobRegistry cleanup. + https://bugs.webkit.org/show_bug.cgi?id=44571 + + Remove unneeded method from WebBlobRegistry interface. + Also remove unneeded WebBlobRegistryImpl.* files. They're already + excluded from gyp files. + + * public/WebBlobRegistry.h: + * src/WebBlobRegistryImpl.cpp: Removed. + * src/WebBlobRegistryImpl.h: Removed. + +2010-08-24 Adam Barth <abarth@webkit.org> + + Reviewed by Dimitri Glazkov. + + [Chromium] Hulu popups are blocked + https://bugs.webkit.org/show_bug.cgi?id=44572 + + We were blocking popups created by Flash Player because we were never + setting the UserGestureIndicator for events. Most WebKit ports handle + events through EventHandler, but Chromium is special (for some unknown + reason) and dispatches events directly. That means Chromium misses out + on some of the work done by EventHandler, including setting the + UserGestureIndicator. + + I suspect this is covered by an existing LayoutTest, but I don't have + the ability to run the Chromium LayoutTests on this machine. :( + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::handleInputEvent): + +2010-08-24 Jian Li <jianli@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Update WebBlobData. + https://bugs.webkit.org/show_bug.cgi?id=44481 + + Some changes to WebBlobData to match with chromium implementation. + 1) Change to use WebCString for data, instead of WebData. + 2) Separate path from URL. + + * public/WebBlobData.h: + * src/WebBlobData.cpp: + (WebKit::WebBlobData::itemAt): + (WebKit::WebBlobData::appendData): + (WebKit::WebBlobData::appendBlob): + * src/WebBlobStorageData.cpp: + (WebKit::WebBlobStorageData::itemAt): + +2010-08-24 Marcus Bulach <bulach@chromium.org> + + Reviewed by Jeremy Orlow. + + Hooks IDBKeyPath with IDBObjectStorage::put. + https://bugs.webkit.org/show_bug.cgi?id=44275 + + Adds a mechanism to extract an IDBKey from SerializedScriptValue using IDBKeyPath + during IDBObjectStorage::put. + + * public/WebIDBKey.h: + (WebKit::WebIDBKey::WebIDBKey): + * public/WebKitClient.h: + (WebKit::WebKitClient::createIDBKeysFromSerializedValuesAndKeyPath): + * src/ChromiumBridge.cpp: + (WebCore::ChromiumBridge::createIDBKeysFromSerializedValuesAndKeyPath): + +2010-08-24 Kent Tamura <tkent@chromium.org> + + Reviewed by Jeremy Orlow. + + [DRT/Chromium] Support for IndexedDB tests + https://bugs.webkit.org/show_bug.cgi?id=44490 + + * DEPS: Roll Chromium to r57145 to have a webkit_support change. + +2010-08-24 Roland Steiner <rolandsteiner@chromium.org> + + Unreviewed build fix. + + put the "DISABLED_" in front of the right identifier. + + * tests/WebFrameTest.cpp: + (WebKit::TEST_F): + +2010-08-23 Roland Steiner <rolandsteiner@chromium.org> + + Reviewed by Tamura Kent. + + Disable failing test + https://bugs.webkit.org/show_bug.cgi?id=44492 + + * tests/WebFrameTest.cpp: + (WebKit::TEST_F): + +2010-08-23 Jay Civelli <jcivelli@chromium.org> + + Reviewed by Darin Fisher. + + Made WebFrame not report the text from hidden frames. + (some pages contain hidden frames with garbage text that + should not be indexed or used to detect the page's language). + https://bugs.webkit.org/show_bug.cgi?id=39456 + + * WebKit.gyp: + * public/WebCString.h: + (WebKit::operator<): + * public/WebURL.h: + (WebKit::operator<): + * src/WebCString.cpp: + (WebKit::WebCString::compare): + * src/WebFrameImpl.cpp: + (WebKit::frameContentAsPlainText): + * tests/RunAllTests.cpp: + (main): + * tests/WebFrameTest.cpp: Added. + +2010-08-23 Kent Tamura <tkent@chromium.org> + + Unreviewed, build fix for r65852. + + * src/WebNode.cpp: + (WebKit::WebNode::parentNode): + +2010-08-23 Kenneth Russell <kbr@google.com> + + Reviewed by Dimitri Glazkov. + + Remove references to ArrayBuffer and ArrayBufferView from GraphicsContext3D + https://bugs.webkit.org/show_bug.cgi?id=44455 + + Updated Safari, Qt and Chromium WebGL ports to avoid referencing + ArrayBuffer and ArrayBufferView types from GraphicsContext3D. + + Ran all WebGL layout tests; no new regressions. Built and tested + WebKit on Mac OS X; built Chromium on Mac OS X and Linux. + + * src/GraphicsContext3D.cpp: + (WebCore::GraphicsContext3DInternal::bufferData): + (WebCore::GraphicsContext3DInternal::bufferSubData): + +2010-08-23 Jian Li <jianli@chromium.org> + + Reviewed by David Levin. + + Remove unneeded BlobRegistryImpl.* and WebBlobRegistryImpl.* from + chromium project files. + https://bugs.webkit.org/show_bug.cgi?id=44442 + + * WebKit.gyp: + +2010-08-23 Satish Sampath <satish@chromium.org> + + Reviewed by Jeremy Orlow. + + Remove obsolete public/API methods in chromium port + https://bugs.webkit.org/show_bug.cgi?id=44421 + + * public/WebSpeechInputController.h: + (WebKit::WebSpeechInputController::startRecognition): + (WebKit::WebSpeechInputController::cancelRecognition): + (WebKit::WebSpeechInputController::stopRecording): + * public/WebSpeechInputListener.h: + +2010-08-22 Daniel Bates <dbates@rim.com> + + Reviewed by Eric Seidel. + + Encapsulate document marker management into DocumentMarkerController + https://bugs.webkit.org/show_bug.cgi?id=44383 + + Modify call sites in the Chromium port to use DocumentMarkerController. + + No functionality was changed, so no new tests. + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::stopFinding): + (WebKit::WebFrameImpl::addMarker): + (WebKit::WebFrameImpl::setMarkerActive): + +2010-08-22 Jian Li <jianli@chromium.org> + + Reviewed by Darin Fisher. + + Add the blob URL member to FormData. + https://bugs.webkit.org/show_bug.cgi?id=44387 + + As the result of adding the blob URL member to the FormData, we need + to update the corresponding WebKit API for chromium. + + * public/WebHTTPBody.h: + (WebKit::WebHTTPBody::Element::): + * src/WebHTTPBody.cpp: + (WebKit::WebHTTPBody::elementAt): + (WebKit::WebHTTPBody::appendBlob): + +2010-08-20 Kinuko Yasuda <kinuko@chromium.org> + + Unreviewed; build fix for chromium (and remove duplicated ChangeLog entry). + +2010-08-20 James Robinson <jamesr@chromium.org> + + Synchronize default of use_accelerated_compositing gyp variable with downstream. Unreviewed. + + * features.gypi: + +2010-08-20 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Add chromium-side callback implementation for FileSystem API + https://bugs.webkit.org/show_bug.cgi?id=44350 + + Add WebFileSystemCallbacks that calls back the WebCore's implementation. + + * WebKit.gyp: + * src/WebFileSystemCallbacksImpl.cpp: Added. + * src/WebFileSystemCallbacksImpl.h: Added. + +2010-08-20 Tony Chang <tony@chromium.org> + + Reviewed by Kent Tamura. + + [chromium] fix a null pointer crash when dispatching JS keyboard events + https://bugs.webkit.org/show_bug.cgi?id=44313 + + * src/WebInputEventConversion.cpp: + (WebKit::WebKeyboardEventBuilder::WebKeyboardEventBuilder): + +2010-08-20 Jay Civelli <jcivelli@chromium.org> + + Reviewed by Darin Fisher. + + Removing the deprecated class WebEvent and friends. + https://bugs.webkit.org/show_bug.cgi?id=44296 + + * WebKit.gyp: + * public/WebEvent.h: Removed. + * public/WebEventListener.h: Removed. + * public/WebMutationEvent.h: Removed. + * public/WebNode.h: + * src/EventListenerWrapper.cpp: + (WebKit::EventListenerWrapper::webDOMEventListenerDeleted): + * src/EventListenerWrapper.h: + * src/WebEvent.cpp: Removed. + * src/WebEventListener.cpp: Removed. + * src/WebEventListenerPrivate.cpp: Removed. + * src/WebEventListenerPrivate.h: Removed. + * src/WebNode.cpp: + (WebKit::WebNode::removeEventListener): + +2010-08-19 Zhenyao Mo <zmo@google.com> + + Reviewed by Kenneth Russell. + + Fix failing WebGL tests in Chromium in-process-webgl port + https://bugs.webkit.org/show_bug.cgi?id=44305 + + * src/WebGraphicsContext3DDefaultImpl.cpp: + (WebKit::WebGraphicsContext3DDefaultImpl::getVertexAttribOffset): Add implementation. + +2010-08-19 Pavel Podivilov <podivilov@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: enable DOM breakpoints for chromium + https://bugs.webkit.org/show_bug.cgi?id=42886 + + * src/js/DevTools.js: + (WebInspector.loaded): + +2010-08-19 Vincent Scheib <scheib@chromium.org> + + Reviewed by David Levin. + + [chromium] TilingData::tilePositionY has typo of X where Y should be used + https://bugs.webkit.org/show_bug.cgi?id=44195 + + Unit tests added for tileSize and tilePosition. + + * tests/TilingDataTest.cpp: + (WebCore::TEST): + +2010-08-19 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by Darin Fisher. + + Add WebKit API for FileSystem API + https://bugs.webkit.org/show_bug.cgi?id=43151 + + Add asynchronous FileSystem interface to WebKit API for + FileSystem API. + http://dev.w3.org/2009/dap/file-system/file-dir-sys.html + + * WebKit.gyp: + * public/WebFileError.h: Added. + * public/WebFileSystem.h: Added. + * public/WebFileSystemEntry.h: Added. + * public/WebFileSystemCallbacks.h: Added. + * public/WebKitClient.h: + (WebKit::WebKitClient::fileSystem): + * public/WebFrameClient.h: + (WebKit::WebFrameClient::openFileSystem): + +2010-08-19 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by Jian Li. + + [Chromium] Rolls Chromium DEPS forward to 56564 + https://bugs.webkit.org/show_bug.cgi?id=44281 + + Roll Chromium DEPS forward to 56564 to include WebFileSystem + implementation changes. + + * DEPS: + +2010-08-19 Vincent Scheib <scheib@chromium.org> + + Reviewed by David Levin. + + Fixing previous Mac only build breakage with TilingDataTest.cpp + https://bugs.webkit.org/show_bug.cgi?id=44223 + + TilingDataTest.cpp included the wrong header, which had a compile + option around the definition of the WebCore namespace. Without the + namespace defined, error. Fixed by correctly including TilingData.h, + which has no conditional compilation. + + * WebKit.gyp: + * tests/TilingDataTest.cpp: + +2010-08-19 Jochen Eisinger <jochen@chromium.org> + + Reviewed by Pavel Feldman. + + concatenated_devtools_js should depend on inspector_protocol_sources + https://bugs.webkit.org/show_bug.cgi?id=44255 + + * WebKit.gyp: + +2010-08-19 Pavel Podivilov <podivilov@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: activate/deactivate breakpoints using v8 debugger flag. + https://bugs.webkit.org/show_bug.cgi?id=44112 + + * src/js/DebuggerScript.js: + (): + +2010-08-19 Andrei Popescu <andreip@google.com> + + Reviewed by Jeremy Orlow. + + [IndexedDB] Abort idle IDBTransactions when the JS context they were created in finishes execution. + https://bugs.webkit.org/show_bug.cgi?id=44101 + + * WebKit.gyp: + * public/WebIDBDatabase.h: + (WebKit::WebIDBDatabase::transaction): + * public/WebIDBFactory.h: + (WebKit::WebIDBFactory::abortPendingTransactions): + * public/WebIDBTransaction.h: Added. + (WebKit::WebIDBTransaction::~WebIDBTransaction): + (WebKit::WebIDBTransaction::mode): + (WebKit::WebIDBTransaction::objectStore): + (WebKit::WebIDBTransaction::abort): + (WebKit::WebIDBTransaction::id): + (WebKit::WebIDBTransaction::setCallbacks): + * public/WebIDBTransactionCallbacks.h: Added. + (WebKit::WebIDBTransactionCallbacks::~WebIDBTransactionCallbacks): + (WebKit::WebIDBTransactionCallbacks::onAbort): + (WebKit::WebIDBTransactionCallbacks::id): + * src/IDBDatabaseProxy.cpp: + (WebCore::IDBDatabaseProxy::transaction): + * src/IDBFactoryBackendProxy.cpp: + (WebCore::IDBFactoryBackendProxy::abortPendingTransactions): + * src/IDBFactoryBackendProxy.h: + * src/IDBTransactionBackendProxy.cpp: Added. + (WebCore::IDBTransactionBackendProxy::create): + (WebCore::IDBTransactionBackendProxy::IDBTransactionBackendProxy): + (WebCore::IDBTransactionBackendProxy::~IDBTransactionBackendProxy): + (WebCore::IDBTransactionBackendProxy::objectStore): + (WebCore::IDBTransactionBackendProxy::mode): + (WebCore::IDBTransactionBackendProxy::abort): + (WebCore::IDBTransactionBackendProxy::scheduleTask): + (WebCore::IDBTransactionBackendProxy::sqliteDatabase): + (WebCore::IDBTransactionBackendProxy::id): + (WebCore::IDBTransactionBackendProxy::setCallbacks): + * src/IDBTransactionBackendProxy.h: Added. + * src/IDBTransactionCallbacksProxy.cpp: Added. + (WebCore::IDBTransactionCallbacksProxy::create): + (WebCore::IDBTransactionCallbacksProxy::IDBTransactionCallbacksProxy): + (WebCore::IDBTransactionCallbacksProxy::~IDBTransactionCallbacksProxy): + (WebCore::IDBTransactionCallbacksProxy::onAbort): + (WebCore::IDBTransactionCallbacksProxy::id): + * src/IDBTransactionCallbacksProxy.h: Added. + * src/WebDOMStringList.cpp: + (WebKit::WebDOMStringList::length): + * src/WebIDBDatabaseImpl.cpp: + (WebKit::WebIDBDatabaseImpl::transaction): + * src/WebIDBDatabaseImpl.h: + * src/WebIDBFactoryImpl.cpp: + (WebKit::WebIDBFactoryImpl::abortPendingTransactions): + * src/WebIDBFactoryImpl.h: + * src/WebIDBTransactionCallbacksImpl.cpp: Added. + (WebCore::WebIDBTransactionCallbacksImpl::WebIDBTransactionCallbacksImpl): + (WebCore::WebIDBTransactionCallbacksImpl::~WebIDBTransactionCallbacksImpl): + (WebCore::WebIDBTransactionCallbacksImpl::onAbort): + (WebCore::WebIDBTransactionCallbacksImpl::id): + * src/WebIDBTransactionCallbacksImpl.h: Added. + * src/WebIDBTransactionImpl.cpp: Added. + (WebKit::WebIDBTransactionImpl::WebIDBTransactionImpl): + (WebKit::WebIDBTransactionImpl::~WebIDBTransactionImpl): + (WebKit::WebIDBTransactionImpl::mode): + (WebKit::WebIDBTransactionImpl::objectStore): + (WebKit::WebIDBTransactionImpl::abort): + (WebKit::WebIDBTransactionImpl::id): + (WebKit::WebIDBTransactionImpl::setCallbacks): + * src/WebIDBTransactionImpl.h: Added. + (WebKit::): + +2010-08-19 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Chromium DevTools: There is no need in resource-based InjectedScript.js source. + Now that we populate front-end after its onload handler, I don't think we need + to install injected script early. + https://bugs.webkit.org/show_bug.cgi?id=44029 + + * public/WebDevToolsAgentClient.h: + * src/WebDevToolsAgentImpl.cpp: + (WebKit::): + (WebKit::WebDevToolsAgentImpl::attach): + (WebKit::WebDevToolsAgentImpl::frontendLoaded): + +2010-08-19 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Chromium DevTools: remove setRuntimeFeatureEnabled API method that + is no longer used. + https://bugs.webkit.org/show_bug.cgi?id=44237 + + * public/WebDevToolsAgent.h: + * src/WebDevToolsAgentImpl.cpp: + * src/WebDevToolsAgentImpl.h: + +2010-08-18 Jian Li <jianli@chromium.org> + + Fix layout test crashes in chromium. + + * src/BlobRegistryProxy.cpp: + (WebCore::BlobRegistryProxy::registerBlobURL): + (WebCore::BlobRegistryProxy::unregisterBlobURL): + +2010-08-18 Jian Li <jianli@chromium.org> + + Fix chromium build break. + + * src/WebBlobStorageData.cpp: + (WebKit::WebBlobStorageData::itemAt): + +2010-08-18 Jian Li <jianli@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Chromium side implementation of blob data and blob registry. + https://bugs.webkit.org/show_bug.cgi?id=43871 + + * WebKit.gyp: + * public/WebBlobData.h: Added. + * public/WebBlobRegistry.h: Added. + * public/WebBlobStorageData.h: Added. + * public/WebKitClient.h: + (WebKit::WebKitClient::blobRegistry): + * src/BlobRegistryProxy.cpp: Added. + * src/BlobRegistryProxy.h: Added. + * src/WebBlobData.cpp: Added. + * src/WebBlobRegistryImpl.cpp: Added. + * src/WebBlobRegistryImpl.h: Added. + * src/WebBlobStorageData.cpp: Added. + +2010-08-18 Dumitru Daniliuc <dumi@chromium.org> + + Reviewed by Darin Fisher. + + Propagate the m_downloadFilePath correctly. + https://bugs.webkit.org/show_bug.cgi?id=44198 + + * src/WebURLRequest.cpp: + (WebKit::WebURLRequestPrivateImpl::WebURLRequestPrivateImpl): + * src/WebURLResponse.cpp: + (WebKit::WebURLResponsePrivateImpl::WebURLResponsePrivateImpl): + +2010-08-18 Victor Wang <victorw@chromium.org> + + Unreviewed. Fix chromium multi dll build. + + * public/WebIDBKeyPath.h: + +2010-08-18 Jay Civelli <jcivelli@chromium.org> + + Reviewed by Darin Fisher. + + Renaming the WebEvent to WebDOMEvent and adding a new event class + for mouse events so that the event listener API can be used to listen + to them. The renaming is needed as there already is a WebMouseEvent class. + https://bugs.webkit.org/show_bug.cgi?id=43453 + + * WebKit.gyp: + * public/WebDOMEvent.h: Added. + * public/WebDOMEventListener.h: Added. + * public/WebDOMMouseEvent.h: Added. + * public/WebDOMMutationEvent.h: Added. + * public/WebNode.h: + * src/EventListenerWrapper.cpp: + * src/EventListenerWrapper.h: + * src/WebDOMEvent.cpp: Added. + * src/WebDOMEventListener.cpp: Added. + * src/WebDOMEventListenerPrivate.cpp: Added. + * src/WebDOMEventListenerPrivate.h: Added. + * src/WebDOMMouseEvent.cpp: Added. + * src/WebDOMMutationEvent.cpp: Added. + * src/WebNode.cpp: + (WebKit::WebNode::isElementNode): + (WebKit::WebNode::addDOMEventListener): + (WebKit::WebNode::removeDOMEventListener): + 2010-08-17 Ilya Tikhonovsky <loislo@chromium.org> Reviewed by Yury Semikhatsky. diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS index b517e28..c189f59 100644 --- a/WebKit/chromium/DEPS +++ b/WebKit/chromium/DEPS @@ -32,7 +32,7 @@ vars = { 'chromium_svn': 'http://src.chromium.org/svn/trunk/src', - 'chromium_rev': '55695', + 'chromium_rev': '57298', } deps = { diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp index d12bee7..9443d8e 100644 --- a/WebKit/chromium/WebKit.gyp +++ b/WebKit/chromium/WebKit.gyp @@ -119,6 +119,9 @@ 'public/WebApplicationCacheHostClient.h', 'public/WebAttribute.h', 'public/WebBindings.h', + 'public/WebBlobData.h', + 'public/WebBlobRegistry.h', + 'public/WebBlobStorageData.h', 'public/WebCache.h', 'public/WebCanvas.h', 'public/WebClipboard.h', @@ -134,6 +137,10 @@ 'public/WebCrossOriginPreflightResultCache.h', 'public/WebCString.h', 'public/WebCursorInfo.h', + 'public/WebDOMEvent.h', + 'public/WebDOMEventListener.h', + 'public/WebDOMMouseEvent.h', + 'public/WebDOMMutationEvent.h', 'public/WebDOMStringList.h', 'public/WebData.h', 'public/WebDatabase.h', @@ -152,12 +159,13 @@ 'public/WebDragData.h', 'public/WebEditingAction.h', 'public/WebElement.h', - 'public/WebEvent.h', - 'public/WebEventListener.h', 'public/WebFileChooserCompletion.h', 'public/WebFileChooserParams.h', + 'public/WebFileError.h', 'public/WebFileInfo.h', 'public/WebFileSystem.h', + 'public/WebFileSystemCallbacks.h', + 'public/WebFileSystemEntry.h', 'public/WebFileUtilities.h', 'public/WebFindOptions.h', 'public/WebFloatPoint.h', @@ -189,6 +197,8 @@ 'public/WebIDBKey.h', 'public/WebIDBKeyPath.h', 'public/WebIDBObjectStore.h', + 'public/WebIDBTransaction.h', + 'public/WebIDBTransactionCallbacks.h', 'public/WebInputElement.h', 'public/WebInputEvent.h', 'public/WebKit.h', @@ -203,7 +213,6 @@ 'public/WebMessagePortChannel.h', 'public/WebMessagePortChannelClient.h', 'public/WebMimeRegistry.h', - 'public/WebMutationEvent.h', 'public/WebNamedNodeMap.h', 'public/WebNavigationType.h', 'public/WebNode.h', @@ -287,6 +296,8 @@ 'src/AutoFillPopupMenuClient.h', 'src/BackForwardListClientImpl.cpp', 'src/BackForwardListClientImpl.h', + 'src/BlobRegistryProxy.cpp', + 'src/BlobRegistryProxy.h', 'src/BoundObject.cpp', 'src/BoundObject.h', 'src/ChromeClientImpl.cpp', @@ -338,6 +349,10 @@ 'src/IDBIndexBackendProxy.h', 'src/IDBObjectStoreProxy.cpp', 'src/IDBObjectStoreProxy.h', + 'src/IDBTransactionBackendProxy.cpp', + 'src/IDBTransactionBackendProxy.h', + 'src/IDBTransactionCallbacksProxy.cpp', + 'src/IDBTransactionCallbacksProxy.h', 'src/InspectorClientImpl.cpp', 'src/InspectorClientImpl.h', 'src/InspectorFrontendClientImpl.cpp', @@ -367,6 +382,8 @@ 'src/StorageNamespaceProxy.cpp', 'src/StorageNamespaceProxy.h', 'src/TemporaryGlue.h', + 'src/VideoFrameChromiumImpl.cpp', + 'src/VideoFrameChromiumImpl.h', 'src/WebAccessibilityCache.cpp', 'src/WebAccessibilityCacheImpl.cpp', 'src/WebAccessibilityCacheImpl.h', @@ -375,12 +392,20 @@ 'src/WebAnimationControllerImpl.h', 'src/WebAttribute.cpp', 'src/WebBindings.cpp', + 'src/WebBlobData.cpp', + 'src/WebBlobStorageData.cpp', 'src/WebCache.cpp', 'src/WebColor.cpp', 'src/WebCommon.cpp', 'src/WebCrossOriginPreflightResultCache.cpp', 'src/WebCString.cpp', 'src/WebCursorInfo.cpp', + 'src/WebDOMEvent.cpp', + 'src/WebDOMEventListener.cpp', + 'src/WebDOMEventListenerPrivate.cpp', + 'src/WebDOMEventListenerPrivate.h', + 'src/WebDOMMouseEvent.cpp', + 'src/WebDOMMutationEvent.cpp', 'src/WebDOMStringList.cpp', 'src/WebData.cpp', 'src/WebDatabase.cpp', @@ -399,12 +424,10 @@ 'src/WebElement.cpp', 'src/WebEntities.cpp', 'src/WebEntities.h', - 'src/WebEvent.cpp', - 'src/WebEventListener.cpp', - 'src/WebEventListenerPrivate.cpp', - 'src/WebEventListenerPrivate.h', 'src/WebFileChooserCompletionImpl.cpp', 'src/WebFileChooserCompletionImpl.h', + 'src/WebFileSystemCallbacksImpl.cpp', + 'src/WebFileSystemCallbacksImpl.h', 'src/WebFontCache.cpp', 'src/WebFontDescription.cpp', 'src/WebFontImpl.cpp', @@ -438,6 +461,10 @@ 'src/WebIDBKeyRange.cpp', 'src/WebIDBObjectStoreImpl.cpp', 'src/WebIDBObjectStoreImpl.h', + 'src/WebIDBTransactionImpl.cpp', + 'src/WebIDBTransactionImpl.h', + 'src/WebIDBTransactionCallbacksImpl.cpp', + 'src/WebIDBTransactionCallbacksImpl.h', 'src/WebImageCG.cpp', 'src/WebImageDecoder.cpp', 'src/WebImageSkia.cpp', @@ -450,7 +477,6 @@ 'src/WebMediaElement.cpp', 'src/WebMediaPlayerClientImpl.cpp', 'src/WebMediaPlayerClientImpl.h', - 'src/WebMutationEvent.cpp', 'src/WebNamedNodeMap.cpp', 'src/WebNode.cpp', 'src/WebNodeCollection.cpp', @@ -666,7 +692,10 @@ { 'target_name': 'concatenated_devtools_js', 'type': 'none', - 'dependencies': ['devtools_html'], + 'dependencies': [ + 'devtools_html', + '../../WebCore/WebCore.gyp/WebCore.gyp:inspector_protocol_sources' + ], 'sources': ['<(PRODUCT_DIR)/resources/inspector/DevTools.js'], 'actions': [{ 'action_name': 'concatenate_devtools_js', @@ -707,6 +736,7 @@ '<(chromium_src_dir)/base/base.gyp:base_i18n', '<(chromium_src_dir)/base/base.gyp:test_support_base', '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib', + '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support', ], 'include_dirs': [ 'public', @@ -719,16 +749,16 @@ 'tests/KeyboardTest.cpp', 'tests/KURLTest.cpp', 'tests/RunAllTests.cpp', - # FIXME: This test is compile failing on mac. - # 'tests/TilingDataTest.cpp', + 'tests/TilingDataTest.cpp', ], 'conditions': [ ['OS=="win"', { 'sources': [ - # FIXME: Port PopupMenuTest to Linux and Mac. + # FIXME: Port PopupMenuTest and WebFrameTest to Linux and Mac. 'tests/PopupMenuTest.cpp', 'tests/TransparencyWinTest.cpp', 'tests/UniscribeHelperTest.cpp', + 'tests/WebFrameTest.cpp', ], }], ['OS=="mac"', { diff --git a/WebKit/chromium/features.gypi b/WebKit/chromium/features.gypi index e3092b3..61e5806 100644 --- a/WebKit/chromium/features.gypi +++ b/WebKit/chromium/features.gypi @@ -94,7 +94,7 @@ }], ], - 'use_accelerated_compositing%': 0, + 'use_accelerated_compositing%': 1, 'enable_svg%': 1, }, diff --git a/WebKit/chromium/public/WebBlobData.h b/WebKit/chromium/public/WebBlobData.h new file mode 100644 index 0000000..8c0e1aa --- /dev/null +++ b/WebKit/chromium/public/WebBlobData.h @@ -0,0 +1,102 @@ +/* + * 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: + * + * * 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 WebBlobData_h +#define WebBlobData_h + +#include "WebCString.h" +#include "WebString.h" +#include "WebURL.h" + +#if WEBKIT_IMPLEMENTATION +namespace WebCore { class BlobData; } +namespace WTF { template <typename T> class PassOwnPtr; } +#endif + +namespace WebKit { + +class WebBlobDataPrivate; + +class WebBlobData { +public: + struct Item { + enum { TypeData, TypeFile, TypeBlob } type; + WebCString data; + WebString filePath; + WebURL blobURL; + long long offset; + long long length; // -1 means go to the end of the file/blob. + double expectedModificationTime; // 0.0 means that the time is not set. + }; + + ~WebBlobData() { reset(); } + + WebBlobData() : m_private(0) { } + + WEBKIT_API void initialize(); + WEBKIT_API void reset(); + + bool isNull() const { return !m_private; } + + // Returns the number of items. + WEBKIT_API size_t itemCount() const; + + // Retrieves the values of the item at the given index. Returns false if + // index is out of bounds. + WEBKIT_API bool itemAt(size_t index, Item& result) const; + + // Appends to the list of items. + WEBKIT_API void appendData(const WebCString&); + WEBKIT_API void appendFile(const WebString& filePath); + WEBKIT_API void appendFile(const WebString& filePath, long long offset, long long length, double expectedModificationTime); + WEBKIT_API void appendBlob(const WebURL& blobURL, long long offset, long long length); + + WEBKIT_API WebString contentType() const; + WEBKIT_API void setContentType(const WebString&); + + WEBKIT_API WebString contentDisposition() const; + WEBKIT_API void setContentDisposition(const WebString&); + +#if WEBKIT_IMPLEMENTATION + WebBlobData(const WTF::PassOwnPtr<WebCore::BlobData>&); + WebBlobData& operator=(const WTF::PassOwnPtr<WebCore::BlobData>&); + operator WTF::PassOwnPtr<WebCore::BlobData>(); +#endif + +private: +#if WEBKIT_IMPLEMENTATION + void assign(const WTF::PassOwnPtr<WebCore::BlobData>&); +#endif + WebBlobDataPrivate* m_private; +}; + +} // namespace WebKit + +#endif // WebBlobData_h diff --git a/WebKit/chromium/public/WebBlobRegistry.h b/WebKit/chromium/public/WebBlobRegistry.h new file mode 100644 index 0000000..cbd9a99 --- /dev/null +++ b/WebKit/chromium/public/WebBlobRegistry.h @@ -0,0 +1,58 @@ +/* + * 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: + * + * * 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 WebBlobRegistry_h +#define WebBlobRegistry_h + +#include "WebBlobStorageData.h" + +namespace WebKit { + +class WebBlobData; +class WebURL; + +class WebBlobRegistry { +public: + WEBKIT_API static WebBlobRegistry* create(); + + virtual ~WebBlobRegistry() { } + + // Registers a blob URL referring to the specified blob data. + virtual void registerBlobURL(const WebURL&, WebBlobData&) = 0; + + // Registers a blob URL referring to the blob data identified by the specified srcURL. + virtual void registerBlobURL(const WebURL&, const WebURL& srcURL) = 0; + + virtual void unregisterBlobURL(const WebURL&) = 0; +}; + +} // namespace WebKit + +#endif // WebBlobRegistry_h diff --git a/WebKit/chromium/public/WebBlobStorageData.h b/WebKit/chromium/public/WebBlobStorageData.h new file mode 100644 index 0000000..a9c0c8b --- /dev/null +++ b/WebKit/chromium/public/WebBlobStorageData.h @@ -0,0 +1,83 @@ +/* + * 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: + * + * * 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 WebBlobStorageData_h +#define WebBlobStorageData_h + +#include "WebBlobData.h" +#include "WebData.h" +#include "WebFileInfo.h" +#include "WebString.h" + +#if WEBKIT_IMPLEMENTATION +namespace WebCore { class BlobStorageData; } +namespace WTF { template <typename T> class PassRefPtr; } +#endif + +namespace WebKit { + +class WebBlobStorageDataPrivate; + +class WebBlobStorageData { +public: + ~WebBlobStorageData() { reset(); } + + WebBlobStorageData() : m_private(0) { } + + WEBKIT_API void reset(); + + bool isNull() const { return !m_private; } + + // Returns the number of items. + WEBKIT_API size_t itemCount() const; + + // Retrieves the values of the item at the given index. Returns false if + // index is out of bounds. + WEBKIT_API bool itemAt(size_t index, WebBlobData::Item& result) const; + + WEBKIT_API WebString contentType() const; + WEBKIT_API WebString contentDisposition() const; + +#if WEBKIT_IMPLEMENTATION + WebBlobStorageData(const WTF::PassRefPtr<WebCore::BlobStorageData>&); + WebBlobStorageData& operator=(const WTF::PassRefPtr<WebCore::BlobStorageData>&); + operator WTF::PassRefPtr<WebCore::BlobStorageData>() const; +#endif + +private: +#if WEBKIT_IMPLEMENTATION + void assign(const WTF::PassRefPtr<WebCore::BlobStorageData>&); +#endif + WebBlobStorageDataPrivate* m_private; +}; + +} // namespace WebKit + +#endif // WebBlobStorageData_h diff --git a/WebKit/chromium/public/WebEvent.h b/WebKit/chromium/public/WebDOMEvent.h index b0964d1..d34c8d4 100644 --- a/WebKit/chromium/public/WebEvent.h +++ b/WebKit/chromium/public/WebDOMEvent.h @@ -28,8 +28,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WebEvent_h -#define WebEvent_h +#ifndef WebDOMEvent_h +#define WebDOMEvent_h #include "WebCommon.h" #include "WebNode.h" @@ -42,7 +42,7 @@ namespace WTF { template <typename T> class PassRefPtr; } namespace WebKit { -class WebEvent { +class WebDOMEvent { public: enum PhaseType { CapturingPhase = 1, @@ -50,16 +50,16 @@ public: BubblingPhase = 3 }; - WebEvent() : m_private(0) { } - WebEvent(const WebEvent& e) : m_private(0) { assign(e); } - WebEvent& operator=(const WebEvent& e) + WebDOMEvent() : m_private(0) { } + WebDOMEvent(const WebDOMEvent& e) : m_private(0) { assign(e); } + WebDOMEvent& operator=(const WebDOMEvent& e) { assign(e); return *this; } WEBKIT_API void reset(); - WEBKIT_API void assign(const WebEvent&); + WEBKIT_API void assign(const WebDOMEvent&); bool isNull() const { return !m_private; } @@ -92,13 +92,27 @@ public: WEBKIT_API bool isBeforeLoadEvent() const; #if WEBKIT_IMPLEMENTATION - WebEvent(const WTF::PassRefPtr<WebCore::Event>&); + WebDOMEvent(const WTF::PassRefPtr<WebCore::Event>&); #endif + template<typename T> T to() + { + T res; + res.WebDOMEvent::assign(*this); + return res; + } + + template<typename T> const T toConst() const + { + T res; + res.WebDOMEvent::assign(*this); + return res; + } + protected: - typedef WebCore::Event WebEventPrivate; - void assign(WebEventPrivate*); - WebEventPrivate* m_private; + typedef WebCore::Event WebDOMEventPrivate; + void assign(WebDOMEventPrivate*); + WebDOMEventPrivate* m_private; template<typename T> T* unwrap() { diff --git a/WebKit/chromium/public/WebEventListener.h b/WebKit/chromium/public/WebDOMEventListener.h index 62ca0de..4b32b93 100644 --- a/WebKit/chromium/public/WebEventListener.h +++ b/WebKit/chromium/public/WebDOMEventListener.h @@ -28,8 +28,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WebEventListener_h -#define WebEventListener_h +#ifndef WebDOMEventListener_h +#define WebDOMEventListener_h #include "WebCommon.h" @@ -40,18 +40,18 @@ namespace WebCore { class Node; } namespace WebKit { class EventListenerWrapper; -class WebEvent; -class WebEventListenerPrivate; +class WebDOMEvent; +class WebDOMEventListenerPrivate; class WebNode; class WebString; -class WebEventListener { +class WebDOMEventListener { public: - WEBKIT_API WebEventListener(); - WEBKIT_API virtual ~WebEventListener(); + WEBKIT_API WebDOMEventListener(); + WEBKIT_API virtual ~WebDOMEventListener(); // Called when an event is received. - virtual void handleEvent(const WebEvent&) = 0; + virtual void handleEvent(const WebDOMEvent&) = 0; #if WEBKIT_IMPLEMENTATION void notifyEventListenerDeleted(EventListenerWrapper*); @@ -60,7 +60,7 @@ public: #endif private: - WebEventListenerPrivate* m_private; + WebDOMEventListenerPrivate* m_private; }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebDOMMouseEvent.h b/WebKit/chromium/public/WebDOMMouseEvent.h new file mode 100644 index 0000000..4c38b56 --- /dev/null +++ b/WebKit/chromium/public/WebDOMMouseEvent.h @@ -0,0 +1,62 @@ +/* + * 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: + * + * * 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 WebDOMMouseEvent_h +#define WebDOMMouseEvent_h + +#include "WebDOMEvent.h" + +#if WEBKIT_IMPLEMENTATION +namespace WebCore { class Event; } +#endif + +namespace WebKit { + +class WebDOMMouseEvent : public WebDOMEvent { +public: + WEBKIT_API int screenX() const; + WEBKIT_API int screenY() const; + WEBKIT_API int clientX() const; + WEBKIT_API int clientY() const; + WEBKIT_API int layerX() const; + WEBKIT_API int layerY() const; + WEBKIT_API int offsetX() const; + WEBKIT_API int offsetY() const; + WEBKIT_API int pageX() const; + WEBKIT_API int pageY() const; + WEBKIT_API int x() const; + WEBKIT_API int y() const; + + WEBKIT_API int button() const; + WEBKIT_API bool buttonDown() const; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebMutationEvent.h b/WebKit/chromium/public/WebDOMMutationEvent.h index 75eb9c4..471331f 100644 --- a/WebKit/chromium/public/WebMutationEvent.h +++ b/WebKit/chromium/public/WebDOMMutationEvent.h @@ -27,10 +27,10 @@ * (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 WebMutationEvent_h -#define WebMutationEvent_h +#ifndef WebDOMMutationEvent_h +#define WebDOMMutationEvent_h -#include "WebEvent.h" +#include "WebDOMEvent.h" #if WEBKIT_IMPLEMENTATION namespace WebCore { class Event; } @@ -38,7 +38,7 @@ namespace WebCore { class Event; } namespace WebKit { -class WebMutationEvent : public WebEvent { +class WebDOMMutationEvent : public WebDOMEvent { public: enum AttrChangeType { Modification = 1, diff --git a/WebKit/chromium/public/WebDevToolsAgent.h b/WebKit/chromium/public/WebDevToolsAgent.h index a355a0f..6b4d237 100644 --- a/WebKit/chromium/public/WebDevToolsAgent.h +++ b/WebKit/chromium/public/WebDevToolsAgent.h @@ -59,7 +59,6 @@ public: virtual void inspectElementAt(const WebPoint&) = 0; - virtual void setRuntimeFeatureEnabled(const WebString& feature, bool enabled) = 0; virtual void setRuntimeProperty(const WebString& name, const WebString& value) = 0; // Exposed for LayoutTestController. diff --git a/WebKit/chromium/public/WebDevToolsAgentClient.h b/WebKit/chromium/public/WebDevToolsAgentClient.h index 386bd08..087ac0b 100644 --- a/WebKit/chromium/public/WebDevToolsAgentClient.h +++ b/WebKit/chromium/public/WebDevToolsAgentClient.h @@ -53,7 +53,6 @@ public: // Notifies host upon runtime feature being enabled/disabled. virtual void runtimePropertyChanged(const WebString& name, const WebString& value) { } - virtual WebCString injectedScriptSource() { return WebCString(); } virtual WebCString debuggerScriptSource() { return WebCString(); } class WebKitClientMessageLoop { diff --git a/WebKit/chromium/public/WebFileError.h b/WebKit/chromium/public/WebFileError.h new file mode 100644 index 0000000..cfe8882 --- /dev/null +++ b/WebKit/chromium/public/WebFileError.h @@ -0,0 +1,50 @@ +/* + * 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: + * + * * 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 WebFileError_h +#define WebFileError_h + +namespace WebKit { + +// File-related error code defined in HTML5 File API. +enum WebFileError { + WebFileErrorNoModificationAllowed = 7, + WebFileErrorNotFound = 8, + WebFileErrorInvalidState = 11, + WebFileErrorInvalidModification = 13, + WebFileErrorSecurity = 18, + WebFileErrorAbort = 20, + WebFileErrorQuotaExceeded = 22, + WebFileErrorNotReadable = 24, + WebFileErrorEncoding = 26, +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebFileSystem.h b/WebKit/chromium/public/WebFileSystem.h index a91106e..641c169 100644 --- a/WebKit/chromium/public/WebFileSystem.h +++ b/WebKit/chromium/public/WebFileSystem.h @@ -31,12 +31,77 @@ #ifndef WebFileSystem_h #define WebFileSystem_h -#include "WebFileUtilities.h" +#include "WebCommon.h" +#include "WebString.h" namespace WebKit { -// FIXME: Clean up this class once the renaming to WebFileUtilities is done. -class WebFileSystem : public WebFileUtilities { +class WebFileSystemCallbacks; + +class WebFileSystem { +public: + enum Type { + TypeTemporary, + TypePersistent, + }; + + // Moves a file or directory at |srcPath| to |destPath|. + // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully. + // WebFileSystemCallbacks::didFail() must be called otherwise. + virtual void move(const WebString& srcPath, const WebString& destPath, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + + // Copies a file or directory at |srcPath| to |destPath|. + // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully. + // WebFileSystemCallbacks::didFail() must be called otherwise. + virtual void copy(const WebString& srcPath, const WebString& destPath, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + + // Deletes a file or directory at a given |path|. + // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully. + // WebFileSystemCallbacks::didFail() must be called otherwise. + virtual void remove(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + + // Retrieves the metadata information of the file or directory at the given |path|. + // WebFileSystemCallbacks::didReadMetadata() must be called with a valid metadata when the retrieval is completed successfully. + // WebFileSystemCallbacks::didFail() must be called otherwise. + virtual void readMetadata(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + + // Creates a file at given |path|. + // If the |path| doesn't exist, it creates a new file at |path|. + // If |exclusive| is true, it fails if the |path| already exists. + // If |exclusive| is false, it succeeds if the |path| already exists or + // it has successfully created a new file at |path|. + // + // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully. + // WebFileSystemCallbacks::didFail() must be called otherwise. + virtual void createFile(const WebString& path, bool exclusive, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + + // Creates a directory at a given |path|. + // If the |path| doesn't exist, it creates a new directory at |path|. + // If |exclusive| is true, it fails if the |path| already exists. + // If |exclusive| is false, it succeeds if the |path| already exists or it has successfully created a new directory at |path|. + // + // WebFileSystemCallbacks::didSucceed() must be called when + // the operation is completed successfully. + // WebFileSystemCallbacks::didFail() must be called otherwise. + virtual void createDirectory(const WebString& path, bool exclusive, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + + // Checks if a file exists at a given |path|. + // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully. + // WebFileSystemCallbacks::didFail() must be called otherwise. + virtual void fileExists(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + + // Checks if a directory exists at a given |path|. + // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully. + // WebFileSystemCallbacks::didFail() must be called otherwise. + virtual void directoryExists(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + + // Reads directory entries of a given directory at |path|. + // WebFileSystemCallbacks::didReadDirectory() must be called when the operation is completed successfully. + // WebFileSystemCallbacks::didFail() must be called otherwise. + virtual void readDirectory(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + +protected: + virtual ~WebFileSystem() { } }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebFileSystemCallbacks.h b/WebKit/chromium/public/WebFileSystemCallbacks.h new file mode 100644 index 0000000..fa7ebbe --- /dev/null +++ b/WebKit/chromium/public/WebFileSystemCallbacks.h @@ -0,0 +1,73 @@ +/* + * 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: + * + * * 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 WebFileSystemCallbacks_h +#define WebFileSystemCallbacks_h + +#include "WebFileError.h" +#include "WebFileSystemEntry.h" +#include "WebVector.h" + +namespace WebKit { + +class WebString; +struct WebFileInfo; + +class WebFileSystemCallbacks { +public: + // Callback for WebFileSystem's various operations that don't require + // return values. + virtual void didSucceed() = 0; + + // Callback for WebFileSystem::readMetadata. Called with the file metadata + // for the requested path. + virtual void didReadMetadata(const WebFileInfo&) = 0; + + // Callback for WebFileSystem::readDirectory. Called with a vector of + // file entries in the requested directory. This callback might be called + // multiple times if the directory has many entries. |hasMore| must be + // true when there are more entries. + virtual void didReadDirectory(const WebVector<WebFileSystemEntry>&, bool hasMore) = 0; + + // Callback for WebFrameClient::openFileSystem. Called with a name and + // root path for the FileSystem when the request is accepted. + virtual void didOpenFileSystem(const WebString& name, const WebString& rootPath) = 0; + + // Called with an error code when a requested operation hasn't been + // completed. + virtual void didFail(WebFileError) = 0; + +protected: + virtual ~WebFileSystemCallbacks() {} +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebFileSystemEntry.h b/WebKit/chromium/public/WebFileSystemEntry.h new file mode 100644 index 0000000..00a5e38 --- /dev/null +++ b/WebKit/chromium/public/WebFileSystemEntry.h @@ -0,0 +1,50 @@ +/* + * 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: + * + * * 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 WebFileSystemEntry_h +#define WebFileSystemEntry_h + +#include "WebString.h" + +namespace WebKit { + +struct WebFileSystemEntry { + WebFileSystemEntry() : isDirectory(false) { } + + // The name of the entry. + WebString name; + + // This flag indicates if the entry is directory or not. + bool isDirectory; +}; + +} // namespace WebKit + +#endif // WebFileSystemEntry_h diff --git a/WebKit/chromium/public/WebFrameClient.h b/WebKit/chromium/public/WebFrameClient.h index 91f0e38..699325d 100644 --- a/WebKit/chromium/public/WebFrameClient.h +++ b/WebKit/chromium/public/WebFrameClient.h @@ -32,6 +32,7 @@ #define WebFrameClient_h #include "WebCommon.h" +#include "WebFileSystem.h" #include "WebNavigationPolicy.h" #include "WebNavigationType.h" #include "WebURLError.h" @@ -333,6 +334,19 @@ public: virtual void reportFindInPageSelection( int identifier, int activeMatchOrdinal, const WebRect& selection) { } + // FileSystem ---------------------------------------------------- + + // Requests to open a FileSystem. + // |size| indicates how much storage space (in bytes) the caller expects + // to need. + // WebFileSystemCallbacks::didOpenFileSystem() must be called with + // a name and root path for the requested FileSystem when the operation + // is completed successfully. WebFileSystemCallbacks::didFail() must be + // called otherwise. + virtual void openFileSystem( + WebFrame*, WebFileSystem::Type, long long size, + WebFileSystemCallbacks*) { } + protected: ~WebFrameClient() { } }; diff --git a/WebKit/chromium/public/WebGraphicsContext3D.h b/WebKit/chromium/public/WebGraphicsContext3D.h index 4c18076..44a0498 100644 --- a/WebKit/chromium/public/WebGraphicsContext3D.h +++ b/WebKit/chromium/public/WebGraphicsContext3D.h @@ -103,6 +103,11 @@ public: // Query whether it is built on top of compliant GLES2 implementation. virtual bool isGLES2Compliant() = 0; + // Query whether it is built on top of GLES2 NPOT strict implementation. + virtual bool isGLES2NPOTStrict() = 0; + // Query whether it is built on top of implementation that generates errors + // on out-of-bounds buffer accesses. + virtual bool isErrorGeneratedOnOutOfBoundsAccesses() = 0; // Helper for software compositing path. Reads back the frame buffer into // the memory region pointed to by "pixels" with size "bufferSize". It is diff --git a/WebKit/chromium/public/WebHTTPBody.h b/WebKit/chromium/public/WebHTTPBody.h index a7dc7c9..a2bb5cd 100644 --- a/WebKit/chromium/public/WebHTTPBody.h +++ b/WebKit/chromium/public/WebHTTPBody.h @@ -35,6 +35,7 @@ #include "WebFileInfo.h" #include "WebNonCopyable.h" #include "WebString.h" +#include "WebURL.h" #if WEBKIT_IMPLEMENTATION namespace WebCore { class FormData; } @@ -48,12 +49,13 @@ class WebHTTPBodyPrivate; class WebHTTPBody { public: struct Element { - enum { TypeData, TypeFile } type; + enum { TypeData, TypeFile, TypeBlob } type; WebData data; WebString filePath; long long fileStart; long long fileLength; // -1 means to the end of the file. WebFileInfo fileInfo; + WebURL blobURL; }; ~WebHTTPBody() { reset(); } @@ -84,6 +86,7 @@ public: WEBKIT_API void appendFile(const WebString&); // Passing -1 to fileLength means to the end of the file. WEBKIT_API void appendFileRange(const WebString&, long long fileStart, long long fileLength, const WebFileInfo&); + WEBKIT_API void appendBlob(const WebURL&); // Identifies a particular form submission instance. A value of 0 is // used to indicate an unspecified identifier. diff --git a/WebKit/chromium/public/WebIDBDatabase.h b/WebKit/chromium/public/WebIDBDatabase.h index b0d6086..6e494ce 100644 --- a/WebKit/chromium/public/WebIDBDatabase.h +++ b/WebKit/chromium/public/WebIDBDatabase.h @@ -34,6 +34,7 @@ namespace WebKit { class WebFrame; class WebIDBCallbacks; class WebIDBObjectStore; +class WebIDBTransaction; // See comment in WebIndexedDatabase for a high level overview of these classes. class WebIDBDatabase { @@ -74,6 +75,13 @@ public: { WEBKIT_ASSERT_NOT_REACHED(); } + // Transfers ownership of the WebIDBTransaction to the caller. + virtual WebIDBTransaction* transaction(const WebDOMStringList& names, unsigned short mode, unsigned long timeout) + { + WEBKIT_ASSERT_NOT_REACHED(); + return 0; + } + }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebIDBFactory.h b/WebKit/chromium/public/WebIDBFactory.h index 5eb6f58..7c070a2 100755 --- a/WebKit/chromium/public/WebIDBFactory.h +++ b/WebKit/chromium/public/WebIDBFactory.h @@ -34,12 +34,12 @@ #include "WebIDBCallbacks.h" #include "WebSecurityOrigin.h" #include "WebString.h" +#include "WebVector.h" namespace WebKit { class WebFrame; class WebIDBDatabase; -class WebString; class WebSecurityOrigin; // The entry point into the IndexedDatabase API. These classes match their Foo and @@ -63,6 +63,8 @@ public: { open(name, description, callbacks, origin, webFrame); } + + virtual void abortPendingTransactions(const WebVector<int>& pendingIDs) { WEBKIT_ASSERT_NOT_REACHED(); } }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebIDBKey.h b/WebKit/chromium/public/WebIDBKey.h index 32caa10..6aef332 100644 --- a/WebKit/chromium/public/WebIDBKey.h +++ b/WebKit/chromium/public/WebIDBKey.h @@ -39,6 +39,8 @@ class WebSerializedScriptValue; class WebIDBKey { public: + // Please use one of the factory methods. This is public only to allow WebVector. + WebIDBKey() { } ~WebIDBKey() { reset(); } WEBKIT_API static WebIDBKey createNull(); @@ -80,7 +82,6 @@ public: #endif private: - WebIDBKey() { } WebPrivatePtr<WebCore::IDBKey> m_private; }; diff --git a/WebKit/chromium/public/WebIDBKeyPath.h b/WebKit/chromium/public/WebIDBKeyPath.h index d08ec63..db6c363 100644 --- a/WebKit/chromium/public/WebIDBKeyPath.h +++ b/WebKit/chromium/public/WebIDBKeyPath.h @@ -40,7 +40,7 @@ class WebString; class WebIDBKeyPath { public: - static WebIDBKeyPath create(const WebString&); + WEBKIT_API static WebIDBKeyPath create(const WebString&); WebIDBKeyPath(const WebIDBKeyPath& keyPath) { assign(keyPath); } ~WebIDBKeyPath() { reset(); } diff --git a/WebKit/chromium/public/WebIDBTransaction.h b/WebKit/chromium/public/WebIDBTransaction.h new file mode 100644 index 0000000..0369b89 --- /dev/null +++ b/WebKit/chromium/public/WebIDBTransaction.h @@ -0,0 +1,62 @@ +/* + * 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 WebIDBTransaction_h +#define WebIDBTransaction_h + +#include "WebString.h" + +namespace WebKit { + +class WebIDBObjectStore; +class WebIDBTransactionCallbacks; + +// See comment in WebIndexedDatabase for a high level overview of these classes. +class WebIDBTransaction { +public: + virtual ~WebIDBTransaction() { } + + virtual int mode() const + { + WEBKIT_ASSERT_NOT_REACHED(); + return 0; + } + virtual WebIDBObjectStore* objectStore(const WebString& name) + { + WEBKIT_ASSERT_NOT_REACHED(); + return 0; + } + virtual void abort() { WEBKIT_ASSERT_NOT_REACHED(); } + virtual int id() const + { + WEBKIT_ASSERT_NOT_REACHED(); + return 0; + } + virtual void setCallbacks(WebIDBTransactionCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } +}; + +} // namespace WebKit + +#endif // WebIDBTransaction_h diff --git a/WebKit/chromium/public/WebIDBTransactionCallbacks.h b/WebKit/chromium/public/WebIDBTransactionCallbacks.h new file mode 100644 index 0000000..4b92217 --- /dev/null +++ b/WebKit/chromium/public/WebIDBTransactionCallbacks.h @@ -0,0 +1,46 @@ +/* + * 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 WebIDBTransactionCallbacks_h +#define WebIDBTransactionCallbacks_h + +#include "WebCommon.h" + +namespace WebKit { +class WebIDBTransactionCallbacks { +public: + virtual ~WebIDBTransactionCallbacks() { } + + virtual void onAbort() { WEBKIT_ASSERT_NOT_REACHED(); } + virtual int id() const + { + WEBKIT_ASSERT_NOT_REACHED(); + return 0; + } +}; + +} // namespace WebKit + +#endif // WebIDBTransactionCallbacks_h diff --git a/WebKit/chromium/public/WebKitClient.h b/WebKit/chromium/public/WebKitClient.h index 4104175..9c0b4c2 100644 --- a/WebKit/chromium/public/WebKitClient.h +++ b/WebKit/chromium/public/WebKitClient.h @@ -33,9 +33,9 @@ #include "WebCommon.h" #include "WebData.h" -#include "WebFileSystem.h" #include "WebLocalizedString.h" #include "WebString.h" +#include "WebVector.h" #include "WebURL.h" #include <time.h> @@ -48,16 +48,20 @@ namespace WebKit { class WebApplicationCacheHost; class WebApplicationCacheHostClient; +class WebBlobRegistry; class WebClipboard; class WebCookieJar; +class WebFileSystem; class WebFileUtilities; class WebGLES2Context; class WebGraphicsContext3D; class WebIDBFactory; +class WebIDBKey; class WebMessagePortChannel; class WebMimeRegistry; class WebPluginListBuilder; class WebSandboxSupport; +class WebSerializedScriptValue; class WebSharedWorkerRepository; class WebSocketStreamHandle; class WebStorageNamespace; @@ -73,12 +77,7 @@ public: virtual WebMimeRegistry* mimeRegistry() { return 0; } // Must return non-null. - // FIXME: Clean up this one once the renaming to WebFileUtilities is done. - virtual WebFileSystem* fileSystem() { return 0; } - - // Must return non-null. - // FIXME: Clean up this one once the renaming from WebFileSystem is done. - virtual WebFileUtilities* fileUtilities() { return fileSystem(); } + virtual WebFileUtilities* fileUtilities() { return 0; } // May return null if sandbox support is not necessary virtual WebSandboxSupport* sandboxSupport() { return 0; } @@ -89,6 +88,11 @@ public: // May return null. virtual WebCookieJar* cookieJar() { return 0; } + // Blob ---------------------------------------------------------------- + + // Must return non-null. + virtual WebBlobRegistry* blobRegistry() { return 0; } + // DOM Storage -------------------------------------------------- // Return a LocalStorage namespace that corresponds to the following path. @@ -138,6 +142,7 @@ public: // Indexed Database ---------------------------------------------------- virtual WebIDBFactory* idbFactory() { return 0; } + virtual void createIDBKeysFromSerializedValuesAndKeyPath(const WebVector<WebSerializedScriptValue>& values, const WebString& keyPath, WebVector<WebIDBKey>& keys) { } // Keygen -------------------------------------------------------------- @@ -268,6 +273,11 @@ public: // May return null if it fails to create the context. virtual WebGLES2Context* createGLES2Context() { return 0; } + // FileSystem ---------------------------------------------------------- + + // Must return non-null. + virtual WebFileSystem* fileSystem() { return 0; } + protected: ~WebKitClient() { } }; diff --git a/WebKit/chromium/public/WebMediaPlayer.h b/WebKit/chromium/public/WebMediaPlayer.h index 6f51345..6cec0f5 100644 --- a/WebKit/chromium/public/WebMediaPlayer.h +++ b/WebKit/chromium/public/WebMediaPlayer.h @@ -33,6 +33,7 @@ #include "WebCanvas.h" #include "WebVector.h" +#include "WebVideoFrame.h" namespace WebKit { @@ -127,6 +128,18 @@ public: virtual bool hasSingleSecurityOrigin() const = 0; virtual MovieLoadType movieLoadType() const = 0; + + // This function returns a pointer to a WebVideoFrame, which is + // a WebKit wrapper for a video frame in chromium. This places a lock + // on the frame in chromium, and calls to this method should always be + // followed with a call to putCurrentFrame(). The ownership of this object + // is not transferred to the caller, and the caller should not free the + // returned object. + virtual WebVideoFrame* getCurrentFrame() { return 0; } + // This function releases the lock on the current video frame in Chromium. + // It should always be called after getCurrentFrame(). Frame passed to this + // method should no longer be referenced after the call is made. + virtual void putCurrentFrame(WebVideoFrame*) { } }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebNode.h b/WebKit/chromium/public/WebNode.h index fb0a99e..f54ff04 100644 --- a/WebKit/chromium/public/WebNode.h +++ b/WebKit/chromium/public/WebNode.h @@ -38,9 +38,9 @@ namespace WebCore { class Node; } namespace WebKit { +class WebDOMEventListener; +class WebDOMEventListenerPrivate; class WebDocument; -class WebEventListener; -class WebEventListenerPrivate; class WebFrame; class WebNodeList; @@ -97,8 +97,8 @@ public: WEBKIT_API WebString createMarkup() const; WEBKIT_API bool isTextNode() const; WEBKIT_API bool isElementNode() const; - WEBKIT_API void addEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture); - WEBKIT_API void removeEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture); + WEBKIT_API void addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture); + WEBKIT_API void removeEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture); WEBKIT_API void simulateClick(); WEBKIT_API WebNodeList getElementsByTagName(const WebString&) const; diff --git a/WebKit/chromium/public/WebSettings.h b/WebKit/chromium/public/WebSettings.h index 90b8553..0bef045 100644 --- a/WebKit/chromium/public/WebSettings.h +++ b/WebKit/chromium/public/WebSettings.h @@ -92,7 +92,6 @@ public: virtual void setEditingBehavior(EditingBehavior) = 0; virtual void setAcceleratedCompositingEnabled(bool) = 0; virtual void setAccelerated2dCanvasEnabled(bool) = 0; - virtual void setHTML5ParserEnabled(bool) = 0; virtual void setMemoryInfoEnabled(bool) = 0; protected: diff --git a/WebKit/chromium/public/WebSpeechInputController.h b/WebKit/chromium/public/WebSpeechInputController.h index b85fde6..0315722 100644 --- a/WebKit/chromium/public/WebSpeechInputController.h +++ b/WebKit/chromium/public/WebSpeechInputController.h @@ -35,18 +35,20 @@ namespace WebKit { +struct WebRect; + // Provides an embedder API called by WebKit. class WebSpeechInputController { public: // Starts speech recognition. Speech will get recorded until the endpointer detects silence, // runs to the limit or stopRecording is called. Progress indications and the recognized // text are returned via the listener interface. - virtual bool startRecognition(int) + virtual bool startRecognition(int requestId, const WebRect&) { - return startRecognition(); + return startRecognition(requestId); } // FIXME: Remove this once chromium has picked up this change. - virtual bool startRecognition() + virtual bool startRecognition(int) { WEBKIT_ASSERT_NOT_REACHED(); return false; @@ -54,18 +56,14 @@ public: // Cancels an ongoing recognition and discards any audio recorded so far. No partial // recognition results are returned to the listener. - virtual void cancelRecognition(int) { cancelRecognition(); } - // FIXME: Remove this once chromium has picked up this change. - virtual void cancelRecognition() { WEBKIT_ASSERT_NOT_REACHED(); } + virtual void cancelRecognition(int) { WEBKIT_ASSERT_NOT_REACHED(); } // Stops audio recording and performs recognition with the audio recorded until now // (does not discard audio). This is an optional call and is typically invoked if the user // wants to stop recording audio as soon as they finished speaking. Otherwise, the speech // recording 'endpointer' should detect silence in the input and stop recording automatically. // Call startRecognition() to record audio and recognize speech again. - virtual void stopRecording(int) { stopRecording(); } - // FIXME: Remove this once chromium has picked up this change. - virtual void stopRecording() { WEBKIT_ASSERT_NOT_REACHED(); } + virtual void stopRecording(int) { WEBKIT_ASSERT_NOT_REACHED(); } protected: virtual ~WebSpeechInputController() { } diff --git a/WebKit/chromium/public/WebSpeechInputListener.h b/WebKit/chromium/public/WebSpeechInputListener.h index e779c3a..6dc3d49 100644 --- a/WebKit/chromium/public/WebSpeechInputListener.h +++ b/WebKit/chromium/public/WebSpeechInputListener.h @@ -48,33 +48,18 @@ public: // Typically after this call the listener would update the UI to reflect that recognition is // in progress. virtual void didCompleteRecording(int) = 0; - // FIXME: Remove this once chromium has picked up this change. - virtual void didCompleteRecording() - { - didCompleteRecording(1); - } // Gives results from speech recognition, either partial or the final results. // This method can potentially get called multiple times if there are partial results // available as the user keeps speaking. If the speech could not be recognized properly // or if there was any other errors in the process, this method may never be called. virtual void setRecognitionResult(int, const WebString&) = 0; - // FIXME: Remove this once chromium has picked up this change. - virtual void setRecognitionResult(const WebString& result) - { - setRecognitionResult(1, result); - } // Informs that speech recognition has completed. This gets invoked irrespective of whether // recognition was succesful or not, whether setRecognitionResult() was invoked or not. The // handler typically frees up any temporary resources allocated and waits for the next speech // recognition request. virtual void didCompleteRecognition(int) = 0; - // FIXME: Remove this once chromium has picked up this change. - virtual void didCompleteRecognition() - { - didCompleteRecognition(1); - } protected: ~WebSpeechInputListener() { } diff --git a/WebKit/chromium/public/WebVideoFrame.h b/WebKit/chromium/public/WebVideoFrame.h new file mode 100644 index 0000000..5e34f2a --- /dev/null +++ b/WebKit/chromium/public/WebVideoFrame.h @@ -0,0 +1,73 @@ +/* + * 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: + * + * * 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 WebVideoFrame_h +#define WebVideoFrame_h + +namespace WebKit { + +// A proxy video frame interface to communicate frame data between chromium +// and WebKit. +class WebVideoFrame { +public: + enum Format { + FormatInvalid, + FormatRGB555, + FormatRGB565, + FormatRGB24, + FormatRGB32, + FormatRGBA, + FormatYV12, + FormatYV16, + FormatNV12, + FormatEmpty, + FormatASCII, + }; + + enum SurfaceType { + SurfaceTypeSystemMemory, + SurfaceTypeOMXBufferHead, + SurfaceTypeEGLImage, + SurfaceTypeMFBuffer, + SurfaceTypeDirect3DSurface + }; + + virtual SurfaceType surfaceType() const = 0; + virtual Format format() const = 0; + virtual unsigned width() const = 0; + virtual unsigned height() const = 0; + virtual unsigned planes() const = 0; + virtual int stride(unsigned plane) const = 0; + virtual const void* data(unsigned plane) const = 0; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/src/AssertMatchingEnums.cpp b/WebKit/chromium/src/AssertMatchingEnums.cpp index b93d4bb..a117fc2 100644 --- a/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -48,6 +48,7 @@ #include "TextAffinity.h" #include "UserContentTypes.h" #include "UserScriptTypes.h" +#include "VideoFrameChromium.h" #include "WebAccessibilityObject.h" #include "WebApplicationCacheHost.h" #include "WebClipboard.h" @@ -62,6 +63,7 @@ #include "WebSettings.h" #include "WebTextAffinity.h" #include "WebTextCaseSensitivity.h" +#include "WebVideoFrame.h" #include "WebView.h" #include <wtf/Assertions.h> #include <wtf/text/StringImpl.h> @@ -327,6 +329,24 @@ COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::Unknown, MediaPlayer::Unknown); COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::Download, MediaPlayer::Download); COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::StoredStream, MediaPlayer::StoredStream); COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::LiveStream, MediaPlayer::LiveStream); + +COMPILE_ASSERT_MATCHING_ENUM(WebVideoFrame::FormatInvalid, VideoFrameChromium::Invalid); +COMPILE_ASSERT_MATCHING_ENUM(WebVideoFrame::FormatRGB555, VideoFrameChromium::RGB555); +COMPILE_ASSERT_MATCHING_ENUM(WebVideoFrame::FormatRGB565, VideoFrameChromium::RGB565); +COMPILE_ASSERT_MATCHING_ENUM(WebVideoFrame::FormatRGB24, VideoFrameChromium::RGB24); +COMPILE_ASSERT_MATCHING_ENUM(WebVideoFrame::FormatRGB32, VideoFrameChromium::RGB32); +COMPILE_ASSERT_MATCHING_ENUM(WebVideoFrame::FormatRGBA, VideoFrameChromium::RGBA); +COMPILE_ASSERT_MATCHING_ENUM(WebVideoFrame::FormatYV12, VideoFrameChromium::YV12); +COMPILE_ASSERT_MATCHING_ENUM(WebVideoFrame::FormatYV16, VideoFrameChromium::YV16); +COMPILE_ASSERT_MATCHING_ENUM(WebVideoFrame::FormatNV12, VideoFrameChromium::NV12); +COMPILE_ASSERT_MATCHING_ENUM(WebVideoFrame::FormatEmpty, VideoFrameChromium::Empty); +COMPILE_ASSERT_MATCHING_ENUM(WebVideoFrame::FormatASCII, VideoFrameChromium::ASCII); + +COMPILE_ASSERT_MATCHING_ENUM(WebVideoFrame::SurfaceTypeSystemMemory, VideoFrameChromium::TypeSystemMemory); +COMPILE_ASSERT_MATCHING_ENUM(WebVideoFrame::SurfaceTypeOMXBufferHead, VideoFrameChromium::TypeOMXBufferHead); +COMPILE_ASSERT_MATCHING_ENUM(WebVideoFrame::SurfaceTypeEGLImage, VideoFrameChromium::TypeEGLImage); +COMPILE_ASSERT_MATCHING_ENUM(WebVideoFrame::SurfaceTypeMFBuffer, VideoFrameChromium::TypeMFBuffer); +COMPILE_ASSERT_MATCHING_ENUM(WebVideoFrame::SurfaceTypeDirect3DSurface, VideoFrameChromium::TypeDirect3DSurface); #endif #if ENABLE(NOTIFICATIONS) @@ -360,5 +380,3 @@ COMPILE_ASSERT_MATCHING_ENUM(WebView::UserContentInjectInTopFrameOnly, InjectInT COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::NullType, IDBKey::NullType); COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::StringType, IDBKey::StringType); COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::NumberType, IDBKey::NumberType); - - diff --git a/WebKit/chromium/src/BlobRegistryProxy.cpp b/WebKit/chromium/src/BlobRegistryProxy.cpp new file mode 100644 index 0000000..84fcb4d --- /dev/null +++ b/WebKit/chromium/src/BlobRegistryProxy.cpp @@ -0,0 +1,87 @@ +/* + * 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: + * + * * 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" + +#if ENABLE(BLOB) + +#include "BlobRegistryProxy.h" + +#include "BlobData.h" +#include "KURL.h" +#include "ResourceHandle.h" +#include "WebBlobData.h" +#include "WebBlobRegistry.h" +#include "WebKit.h" +#include "WebKitClient.h" +#include "WebURL.h" +#include <wtf/MainThread.h> +#include <wtf/StdLibExtras.h> + +// We are part of the WebKit implementation. +using namespace WebKit; + +namespace WebCore { + +BlobRegistry& blobRegistry() +{ + ASSERT(isMainThread()); + DEFINE_STATIC_LOCAL(BlobRegistryProxy, instance, ()); + return instance; +} + +BlobRegistryProxy::BlobRegistryProxy() + : m_webBlobRegistry(WebKit::webKitClient()->blobRegistry()) +{ +} + +void BlobRegistryProxy::registerBlobURL(const KURL& url, PassOwnPtr<BlobData> blobData) +{ + if (m_webBlobRegistry) { + WebBlobData webBlobData(blobData); + m_webBlobRegistry->registerBlobURL(url, webBlobData); + } +} + +void BlobRegistryProxy::registerBlobURL(const KURL& url, const KURL& srcURL) +{ + if (m_webBlobRegistry) + m_webBlobRegistry->registerBlobURL(url, srcURL); +} + +void BlobRegistryProxy::unregisterBlobURL(const KURL& url) +{ + if (m_webBlobRegistry) + m_webBlobRegistry->unregisterBlobURL(url); +} + +} // namespace WebCore + +#endif diff --git a/WebKit/chromium/src/BlobRegistryProxy.h b/WebKit/chromium/src/BlobRegistryProxy.h new file mode 100644 index 0000000..6f2ebb2 --- /dev/null +++ b/WebKit/chromium/src/BlobRegistryProxy.h @@ -0,0 +1,63 @@ +/* + * 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: + * + * * 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 BlobRegistryProxy_h +#define BlobRegistryProxy_h + +#if ENABLE(BLOB) + +#include "BlobRegistry.h" + +namespace WebKit { class WebBlobRegistry; } + +namespace WebCore { + +class BlobRegistryProxy : public BlobRegistry { +public: + BlobRegistryProxy(); + + virtual void registerBlobURL(const KURL&, PassOwnPtr<BlobData>); + virtual void registerBlobURL(const KURL&, const KURL& srcURL); + virtual void unregisterBlobURL(const KURL&); + + virtual PassRefPtr<ResourceHandle> createResourceHandle(const ResourceRequest&, ResourceHandleClient*) { return 0; } + virtual bool loadResourceSynchronously(const ResourceRequest&, ResourceError&, ResourceResponse&, Vector<char>& data) { return false; } + +private: + virtual ~BlobRegistryProxy() { } + + WebKit::WebBlobRegistry* m_webBlobRegistry; +}; + +} // namespace WebCore + +#endif // ENABLE(BLOB) + +#endif // BlobRegistryProxy_h diff --git a/WebKit/chromium/src/ChromiumBridge.cpp b/WebKit/chromium/src/ChromiumBridge.cpp index 5b18e82..33f405d 100644 --- a/WebKit/chromium/src/ChromiumBridge.cpp +++ b/WebKit/chromium/src/ChromiumBridge.cpp @@ -44,6 +44,7 @@ #include "WebFileUtilities.h" #include "WebFrameClient.h" #include "WebFrameImpl.h" +#include "WebIDBKey.h" #include "WebImage.h" #include "WebKit.h" #include "WebKitClient.h" @@ -51,6 +52,7 @@ #include "WebPluginContainerImpl.h" #include "WebPluginListBuilderImpl.h" #include "WebSandboxSupport.h" +#include "WebSerializedScriptValue.h" #include "WebScreenInfo.h" #include "WebString.h" #include "WebURL.h" @@ -500,6 +502,18 @@ PassRefPtr<IDBFactoryBackendInterface> ChromiumBridge::idbFactory() return IDBFactoryBackendProxy::create(); } +void ChromiumBridge::createIDBKeysFromSerializedValuesAndKeyPath(const Vector<RefPtr<SerializedScriptValue> >& values, const String& keyPath, Vector<RefPtr<IDBKey> >& keys) +{ + WebVector<WebSerializedScriptValue> webValues = values; + WebVector<WebIDBKey> webKeys; + webKitClient()->createIDBKeysFromSerializedValuesAndKeyPath(webValues, WebString(keyPath), webKeys); + + size_t webKeysSize = webKeys.size(); + keys.reserveCapacity(webKeysSize); + for (size_t i = 0; i < webKeysSize; ++i) + keys.append(PassRefPtr<IDBKey>(webKeys[i])); +} + // Keygen --------------------------------------------------------------------- String ChromiumBridge::signedPublicKeyAndChallengeString( diff --git a/WebKit/chromium/src/EventListenerWrapper.cpp b/WebKit/chromium/src/EventListenerWrapper.cpp index f2d2979..706ba21 100644 --- a/WebKit/chromium/src/EventListenerWrapper.cpp +++ b/WebKit/chromium/src/EventListenerWrapper.cpp @@ -1,72 +1,72 @@ -/*
- * 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:
- *
- * * 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 "EventListenerWrapper.h"
-
-#include "Event.h"
-#include "EventListener.h"
-
-#include "WebEvent.h"
-#include "WebEventListener.h"
-
-namespace WebKit {
-
-EventListenerWrapper::EventListenerWrapper(WebEventListener* webEventListener)
- : EventListener(EventListener::JSEventListenerType)
- , m_webEventListener(webEventListener)
-{
-}
-
-EventListenerWrapper::~EventListenerWrapper()
-{
- if (m_webEventListener)
- m_webEventListener->notifyEventListenerDeleted(this);
-}
-
-bool EventListenerWrapper::operator==(const EventListener& listener)
-{
- return this == &listener;
-}
-
-void EventListenerWrapper::handleEvent(ScriptExecutionContext* context, Event* event)
-{
- if (!m_webEventListener)
- return;
- WebEvent webEvent(event);
- m_webEventListener->handleEvent(webEvent);
-}
-
-void EventListenerWrapper::webEventListenerDeleted()
-{
- m_webEventListener = 0;
-}
-
-} // namespace WebKit
+/* + * 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: + * + * * 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 "EventListenerWrapper.h" + +#include "Event.h" +#include "EventListener.h" + +#include "WebDOMEvent.h" +#include "WebDOMEventListener.h" + +namespace WebKit { + +EventListenerWrapper::EventListenerWrapper(WebDOMEventListener* webDOMEventListener) + : EventListener(EventListener::JSEventListenerType) + , m_webDOMEventListener(webDOMEventListener) +{ +} + +EventListenerWrapper::~EventListenerWrapper() +{ + if (m_webDOMEventListener) + m_webDOMEventListener->notifyEventListenerDeleted(this); +} + +bool EventListenerWrapper::operator==(const EventListener& listener) +{ + return this == &listener; +} + +void EventListenerWrapper::handleEvent(ScriptExecutionContext* context, Event* event) +{ + if (!m_webDOMEventListener) + return; + WebDOMEvent webDOMEvent(event); + m_webDOMEventListener->handleEvent(webDOMEvent); +} + +void EventListenerWrapper::webDOMEventListenerDeleted() +{ + m_webDOMEventListener = 0; +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/EventListenerWrapper.h b/WebKit/chromium/src/EventListenerWrapper.h index 2a0cbbb..75b6a95 100644 --- a/WebKit/chromium/src/EventListenerWrapper.h +++ b/WebKit/chromium/src/EventListenerWrapper.h @@ -1,62 +1,64 @@ -/*
- * 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:
- *
- * * 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 EventListenerWrapper_h
-#define EventListenerWrapper_h
-
-#include "EventListener.h"
-
-namespace WebCore {
-class ScriptExecutionContext;
-}
-
-using namespace WebCore;
-
-namespace WebKit {
-
-class WebEventListener;
-
-class EventListenerWrapper : public EventListener {
-public:
- EventListenerWrapper(WebEventListener*);
- ~EventListenerWrapper();
-
- virtual bool operator==(const EventListener&);
- virtual void handleEvent(ScriptExecutionContext*, Event*);
-
- void webEventListenerDeleted();
-
-private:
- WebEventListener* m_webEventListener;
-};
-
-} // namespace WebKit
-
-#endif
+/* + * 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: + * + * * 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 EventListenerWrapper_h +#define EventListenerWrapper_h + +#include "EventListener.h" + +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 { +public: + EventListenerWrapper(WebDOMEventListener*); + ~EventListenerWrapper(); + + virtual bool operator==(const EventListener&); + virtual void handleEvent(ScriptExecutionContext*, Event*); + + void webDOMEventListenerDeleted(); + +private: + WebDOMEventListener* m_webDOMEventListener; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/src/GraphicsContext3D.cpp b/WebKit/chromium/src/GraphicsContext3D.cpp index 0f672a3..6bc5ffe 100644 --- a/WebKit/chromium/src/GraphicsContext3D.cpp +++ b/WebKit/chromium/src/GraphicsContext3D.cpp @@ -39,14 +39,10 @@ #include "CanvasRenderingContext.h" #include "Chrome.h" #include "ChromeClientImpl.h" -#include "Float32Array.h" #include "HTMLCanvasElement.h" #include "HTMLImageElement.h" #include "ImageBuffer.h" #include "ImageData.h" -#include "Int32Array.h" -#include "Int8Array.h" -#include "Uint8Array.h" #include "WebGraphicsContext3D.h" #include "WebGraphicsContext3DDefaultImpl.h" #include "WebKit.h" @@ -110,6 +106,8 @@ public: CanvasLayerChromium* platformLayer() const; #endif bool isGLES2Compliant() const; + bool isGLES2NPOTStrict() const; + bool isErrorGeneratedOnOutOfBoundsAccesses() const; //---------------------------------------------------------------------- // Entry points for WebGL. @@ -128,10 +126,8 @@ public: void blendFuncSeparate(unsigned long srcRGB, unsigned long dstRGB, unsigned long srcAlpha, unsigned long dstAlpha); void bufferData(unsigned long target, int size, unsigned long usage); - void bufferData(unsigned long target, ArrayBuffer* data, unsigned long usage); - void bufferData(unsigned long target, ArrayBufferView* data, unsigned long usage); - void bufferSubData(unsigned long target, long offset, ArrayBuffer* data); - void bufferSubData(unsigned long target, long offset, ArrayBufferView* data); + void bufferData(unsigned long target, int size, const void* data, unsigned long usage); + void bufferSubData(unsigned long target, long offset, int size, const void* data); unsigned long checkFramebufferStatus(unsigned long target); void clear(unsigned long mask); @@ -587,6 +583,16 @@ bool GraphicsContext3DInternal::isGLES2Compliant() const return m_impl->isGLES2Compliant(); } +bool GraphicsContext3DInternal::isGLES2NPOTStrict() const +{ + return m_impl->isGLES2NPOTStrict(); +} + +bool GraphicsContext3DInternal::isErrorGeneratedOnOutOfBoundsAccesses() const +{ + return m_impl->isErrorGeneratedOnOutOfBoundsAccesses(); +} + DELEGATE_TO_IMPL_1(activeTexture, unsigned long) DELEGATE_TO_IMPL_2(attachShader, Platform3DObject, Platform3DObject) @@ -610,24 +616,14 @@ void GraphicsContext3DInternal::bufferData(unsigned long target, int size, unsig m_impl->bufferData(target, size, 0, usage); } -void GraphicsContext3DInternal::bufferData(unsigned long target, ArrayBuffer* array, unsigned long usage) -{ - m_impl->bufferData(target, array->byteLength(), array->data(), usage); -} - -void GraphicsContext3DInternal::bufferData(unsigned long target, ArrayBufferView* array, unsigned long usage) +void GraphicsContext3DInternal::bufferData(unsigned long target, int size, const void* data, unsigned long usage) { - m_impl->bufferData(target, array->byteLength(), array->baseAddress(), usage); + m_impl->bufferData(target, size, data, usage); } -void GraphicsContext3DInternal::bufferSubData(unsigned long target, long offset, ArrayBuffer* array) +void GraphicsContext3DInternal::bufferSubData(unsigned long target, long offset, int size, const void* data) { - m_impl->bufferSubData(target, offset, array->byteLength(), array->data()); -} - -void GraphicsContext3DInternal::bufferSubData(unsigned long target, long offset, ArrayBufferView* array) -{ - m_impl->bufferSubData(target, offset, array->byteLength(), array->baseAddress()); + m_impl->bufferSubData(target, offset, size, data); } DELEGATE_TO_IMPL_1R(checkFramebufferStatus, unsigned long, unsigned long) @@ -1068,10 +1064,8 @@ DELEGATE_TO_INTERNAL_2(blendFunc, unsigned long, unsigned long) DELEGATE_TO_INTERNAL_4(blendFuncSeparate, unsigned long, unsigned long, unsigned long, unsigned long) DELEGATE_TO_INTERNAL_3(bufferData, unsigned long, int, unsigned long) -DELEGATE_TO_INTERNAL_3(bufferData, unsigned long, ArrayBuffer*, unsigned long) -DELEGATE_TO_INTERNAL_3(bufferData, unsigned long, ArrayBufferView*, unsigned long) -DELEGATE_TO_INTERNAL_3(bufferSubData, unsigned long, long, ArrayBuffer*) -DELEGATE_TO_INTERNAL_3(bufferSubData, unsigned long, long, ArrayBufferView*) +DELEGATE_TO_INTERNAL_4(bufferData, unsigned long, int, const void*, unsigned long) +DELEGATE_TO_INTERNAL_4(bufferSubData, unsigned long, long, int, const void*) DELEGATE_TO_INTERNAL_1R(checkFramebufferStatus, unsigned long, unsigned long) DELEGATE_TO_INTERNAL_1(clear, unsigned long) @@ -1245,6 +1239,16 @@ bool GraphicsContext3D::isGLES2Compliant() const return m_internal->isGLES2Compliant(); } +bool GraphicsContext3D::isGLES2NPOTStrict() const +{ + return m_internal->isGLES2NPOTStrict(); +} + +bool GraphicsContext3D::isErrorGeneratedOnOutOfBoundsAccesses() const +{ + return m_internal->isErrorGeneratedOnOutOfBoundsAccesses(); +} + } // namespace WebCore #endif // ENABLE(3D_CANVAS) diff --git a/WebKit/chromium/src/IDBDatabaseProxy.cpp b/WebKit/chromium/src/IDBDatabaseProxy.cpp index d11d182..9aa2977 100644 --- a/WebKit/chromium/src/IDBDatabaseProxy.cpp +++ b/WebKit/chromium/src/IDBDatabaseProxy.cpp @@ -29,12 +29,14 @@ #include "DOMStringList.h" #include "IDBCallbacks.h" #include "IDBObjectStoreProxy.h" -#include "IDBTransactionBackendInterface.h" +#include "IDBTransactionBackendProxy.h" +#include "WebDOMStringList.h" #include "WebFrameImpl.h" #include "WebIDBCallbacksImpl.h" #include "WebIDBDatabase.h" #include "WebIDBDatabaseError.h" #include "WebIDBObjectStore.h" +#include "WebIDBTransaction.h" #if ENABLE(INDEXED_DATABASE) @@ -94,9 +96,9 @@ void IDBDatabaseProxy::removeObjectStore(const String& name, PassRefPtr<IDBCallb PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseProxy::transaction(DOMStringList* storeNames, unsigned short mode, unsigned long timeout) { - // FIXME: plumb to the browser process, etc etc. - ASSERT_NOT_REACHED(); - return 0; + WebKit::WebDOMStringList names(storeNames); + WebKit::WebIDBTransaction* transaction = m_webIDBDatabase->transaction(names, mode, timeout); + return IDBTransactionBackendProxy::create(transaction); } } // namespace WebCore diff --git a/WebKit/chromium/src/IDBFactoryBackendProxy.cpp b/WebKit/chromium/src/IDBFactoryBackendProxy.cpp index 44cbb40..114e7e1 100755 --- a/WebKit/chromium/src/IDBFactoryBackendProxy.cpp +++ b/WebKit/chromium/src/IDBFactoryBackendProxy.cpp @@ -39,6 +39,7 @@ #include "WebIDBFactory.h" #include "WebKit.h" #include "WebKitClient.h" +#include "WebVector.h" #if ENABLE(INDEXED_DATABASE) @@ -64,6 +65,14 @@ void IDBFactoryBackendProxy::open(const String& name, const String& description, m_webIDBFactory->open(name, description, new WebIDBCallbacksImpl(callbacks), origin, webFrame); } +void IDBFactoryBackendProxy::abortPendingTransactions(const Vector<int>& pendingIDs) +{ + ASSERT(pendingIDs.size()); + WebKit::WebVector<int> ids = pendingIDs; + + m_webIDBFactory->abortPendingTransactions(ids); +} + } // namespace WebCore #endif // ENABLE(INDEXED_DATABASE) diff --git a/WebKit/chromium/src/IDBFactoryBackendProxy.h b/WebKit/chromium/src/IDBFactoryBackendProxy.h index 969a9d7..9efc7af 100755 --- a/WebKit/chromium/src/IDBFactoryBackendProxy.h +++ b/WebKit/chromium/src/IDBFactoryBackendProxy.h @@ -46,6 +46,7 @@ public: PassRefPtr<DOMStringList> databases(void) const; virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*); + virtual void abortPendingTransactions(const Vector<int>& pendingIDs); private: IDBFactoryBackendProxy(); diff --git a/WebKit/chromium/src/IDBTransactionBackendProxy.cpp b/WebKit/chromium/src/IDBTransactionBackendProxy.cpp new file mode 100644 index 0000000..be6b058 --- /dev/null +++ b/WebKit/chromium/src/IDBTransactionBackendProxy.cpp @@ -0,0 +1,91 @@ +/* + * 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. + */ + +#include "config.h" +#include "IDBTransactionBackendProxy.h" + +#if ENABLE(INDEXED_DATABASE) + +#include "IDBObjectStoreProxy.h" +#include "IDBTransactionCallbacks.h" +#include "WebIDBDatabaseError.h" +#include "WebIDBObjectStore.h" +#include "WebIDBTransaction.h" +#include "WebIDBTransactionCallbacksImpl.h" + +namespace WebCore { + +PassRefPtr<IDBTransactionBackendInterface> IDBTransactionBackendProxy::create(PassOwnPtr<WebKit::WebIDBTransaction> transaction) +{ + return adoptRef(new IDBTransactionBackendProxy(transaction)); +} + +IDBTransactionBackendProxy::IDBTransactionBackendProxy(PassOwnPtr<WebKit::WebIDBTransaction> transaction) + : m_webIDBTransaction(transaction) +{ +} + +IDBTransactionBackendProxy::~IDBTransactionBackendProxy() +{ +} + +PassRefPtr<IDBObjectStoreBackendInterface> IDBTransactionBackendProxy::objectStore(const String& name) +{ + WebKit::WebIDBObjectStore* objectStore = m_webIDBTransaction->objectStore(name); + if (!objectStore) + return 0; + return IDBObjectStoreProxy::create(objectStore); +} + +unsigned short IDBTransactionBackendProxy::mode() const +{ + return m_webIDBTransaction->mode(); +} + +void IDBTransactionBackendProxy::abort() +{ + m_webIDBTransaction->abort(); +} + +void IDBTransactionBackendProxy::scheduleTask(PassOwnPtr<ScriptExecutionContext::Task>) +{ + // This should never be reached as it's the impl objects who get to + // execute tasks in the browser process. + ASSERT_NOT_REACHED(); +} + +int IDBTransactionBackendProxy::id() const +{ + return m_webIDBTransaction->id(); +} + +void IDBTransactionBackendProxy::setCallbacks(IDBTransactionCallbacks* callbacks) +{ + m_webIDBTransaction->setCallbacks(new WebIDBTransactionCallbacksImpl(callbacks)); +} + +} // namespace WebCore + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/WebKit/chromium/src/IDBTransactionBackendProxy.h b/WebKit/chromium/src/IDBTransactionBackendProxy.h new file mode 100644 index 0000000..d62b8ff --- /dev/null +++ b/WebKit/chromium/src/IDBTransactionBackendProxy.h @@ -0,0 +1,62 @@ +/* + * 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 IDBTransactionBackendProxy_h +#define IDBTransactionBackendProxy_h + +#include "IDBTransactionBackendInterface.h" + +#if ENABLE(INDEXED_DATABASE) + +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> + +namespace WebKit { class WebIDBTransaction; } + +namespace WebCore { + +class IDBTransactionBackendProxy : public IDBTransactionBackendInterface { +public: + static PassRefPtr<IDBTransactionBackendInterface> create(PassOwnPtr<WebKit::WebIDBTransaction>); + virtual ~IDBTransactionBackendProxy(); + + virtual PassRefPtr<IDBObjectStoreBackendInterface> objectStore(const String& name); + virtual unsigned short mode() const; + virtual void abort(); + virtual void scheduleTask(PassOwnPtr<ScriptExecutionContext::Task>); + virtual int id() const; + virtual void setCallbacks(IDBTransactionCallbacks*); + +private: + IDBTransactionBackendProxy(PassOwnPtr<WebKit::WebIDBTransaction>); + + OwnPtr<WebKit::WebIDBTransaction> m_webIDBTransaction; +}; + +} // namespace WebCore + +#endif + +#endif // IDBTransactionBackendProxy_h diff --git a/WebKit/chromium/src/IDBTransactionCallbacksProxy.cpp b/WebKit/chromium/src/IDBTransactionCallbacksProxy.cpp new file mode 100644 index 0000000..be7d44f --- /dev/null +++ b/WebKit/chromium/src/IDBTransactionCallbacksProxy.cpp @@ -0,0 +1,65 @@ +/* + * 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. + * 3. Neither the name of Apple Computer, Inc. ("Apple") 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 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. + */ + +#include "config.h" +#include "IDBTransactionCallbacksProxy.h" + +#include "WebIDBTransactionCallbacks.h" + +#if ENABLE(INDEXED_DATABASE) + +namespace WebCore { + +PassRefPtr<IDBTransactionCallbacksProxy> IDBTransactionCallbacksProxy::create(PassOwnPtr<WebKit::WebIDBTransactionCallbacks> callbacks) +{ + return adoptRef(new IDBTransactionCallbacksProxy(callbacks)); +} + +IDBTransactionCallbacksProxy::IDBTransactionCallbacksProxy(PassOwnPtr<WebKit::WebIDBTransactionCallbacks> callbacks) + : m_callbacks(callbacks) +{ +} + +IDBTransactionCallbacksProxy::~IDBTransactionCallbacksProxy() +{ +} + +void IDBTransactionCallbacksProxy::onAbort() +{ + m_callbacks->onAbort(); + m_callbacks.clear(); +} + +int IDBTransactionCallbacksProxy::id() const +{ + return m_callbacks->id(); +} + +} // namespace WebCore + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/WebKit/chromium/src/IDBTransactionCallbacksProxy.h b/WebKit/chromium/src/IDBTransactionCallbacksProxy.h new file mode 100644 index 0000000..821eff4 --- /dev/null +++ b/WebKit/chromium/src/IDBTransactionCallbacksProxy.h @@ -0,0 +1,63 @@ +/* + * 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. + * 3. Neither the name of Apple Computer, Inc. ("Apple") 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 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 IDBTransactionCallbacksProxy_h +#define IDBTransactionCallbacksProxy_h + +#include "IDBTransactionCallbacks.h" + +#if ENABLE(INDEXED_DATABASE) + +#include <wtf/PassOwnPtr.h> +#include <wtf/PassRefPtr.h> + +namespace WebKit { class WebIDBTransactionCallbacks; } + +namespace WebCore { + +class IDBTransactionCallbacksProxy : public IDBTransactionCallbacks { +public: + static PassRefPtr<IDBTransactionCallbacksProxy> create(PassOwnPtr<WebKit::WebIDBTransactionCallbacks>); + virtual ~IDBTransactionCallbacksProxy(); + + virtual void onAbort(); + virtual int id() const; + // FIXME: implement onComplete(). + +private: + IDBTransactionCallbacksProxy(PassOwnPtr<WebKit::WebIDBTransactionCallbacks>); + + OwnPtr<WebKit::WebIDBTransactionCallbacks> m_callbacks; +}; + + +} // namespace WebCore + +#endif + +#endif // IDBTransactionCallbacksProxy_h diff --git a/WebKit/chromium/src/SpeechInputClientImpl.cpp b/WebKit/chromium/src/SpeechInputClientImpl.cpp index 9c59bae..963d440 100644 --- a/WebKit/chromium/src/SpeechInputClientImpl.cpp +++ b/WebKit/chromium/src/SpeechInputClientImpl.cpp @@ -56,10 +56,10 @@ void SpeechInputClientImpl::setListener(WebCore::SpeechInputListener* listener) m_listener = listener; } -bool SpeechInputClientImpl::startRecognition(int requestId) +bool SpeechInputClientImpl::startRecognition(int requestId, const WebCore::IntRect& elementRect) { ASSERT(m_listener); - return m_controller->startRecognition(requestId); + return m_controller->startRecognition(requestId, elementRect); } void SpeechInputClientImpl::stopRecording(int requestId) diff --git a/WebKit/chromium/src/SpeechInputClientImpl.h b/WebKit/chromium/src/SpeechInputClientImpl.h index 0ab54c1..817b32b 100644 --- a/WebKit/chromium/src/SpeechInputClientImpl.h +++ b/WebKit/chromium/src/SpeechInputClientImpl.h @@ -54,7 +54,7 @@ public: // SpeechInputClient methods. void setListener(WebCore::SpeechInputListener*); - bool startRecognition(int); + bool startRecognition(int, const WebCore::IntRect&); void stopRecording(int); void cancelRecognition(int); diff --git a/WebKit/chromium/src/VideoFrameChromiumImpl.cpp b/WebKit/chromium/src/VideoFrameChromiumImpl.cpp new file mode 100644 index 0000000..2b98320 --- /dev/null +++ b/WebKit/chromium/src/VideoFrameChromiumImpl.cpp @@ -0,0 +1,111 @@ +/* + * 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: + * + * * 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 "VideoFrameChromiumImpl.h" + +#include "VideoFrameChromium.h" +#include "WebVideoFrame.h" + +using namespace WebCore; + +namespace WebKit { + +const unsigned cMaxPlanes = 3; +const unsigned cNumRGBPlanes = 1; +const unsigned cRGBPlane = 0; +const unsigned cNumYUVPlanes = 3; +const unsigned cYPlane = 0; +const unsigned cUPlane = 1; +const unsigned cVPlane = 2; + +WebVideoFrame* VideoFrameChromiumImpl::toWebVideoFrame(VideoFrameChromium* videoFrame) +{ + VideoFrameChromiumImpl* wrappedFrame = static_cast<VideoFrameChromiumImpl*>(videoFrame); + if (wrappedFrame) + return wrappedFrame->m_webVideoFrame; + return 0; +} + +VideoFrameChromiumImpl::VideoFrameChromiumImpl(WebVideoFrame* webVideoFrame) + : m_webVideoFrame(webVideoFrame) +{ +} + +VideoFrameChromium::SurfaceType VideoFrameChromiumImpl::surfaceType() const +{ + if (m_webVideoFrame) + return static_cast<VideoFrameChromium::SurfaceType>(m_webVideoFrame->surfaceType()); + return TypeSystemMemory; +} + +VideoFrameChromium::Format VideoFrameChromiumImpl::format() const +{ + if (m_webVideoFrame) + return static_cast<VideoFrameChromium::Format>(m_webVideoFrame->format()); + return Invalid; +} + +unsigned VideoFrameChromiumImpl::width() const +{ + if (m_webVideoFrame) + return m_webVideoFrame->width(); + return 0; +} + +unsigned VideoFrameChromiumImpl::height() const +{ + if (m_webVideoFrame) + return m_webVideoFrame->height(); + return 0; +} + +unsigned VideoFrameChromiumImpl::planes() const +{ + if (m_webVideoFrame) + return m_webVideoFrame->planes(); + return 0; +} + +int VideoFrameChromiumImpl::stride(unsigned plane) const +{ + if (m_webVideoFrame) + return m_webVideoFrame->stride(plane); + return 0; +} + +const void* VideoFrameChromiumImpl::data(unsigned plane) const +{ + if (m_webVideoFrame) + return m_webVideoFrame->data(plane); + return 0; +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/VideoFrameChromiumImpl.h b/WebKit/chromium/src/VideoFrameChromiumImpl.h new file mode 100644 index 0000000..3ad424c --- /dev/null +++ b/WebKit/chromium/src/VideoFrameChromiumImpl.h @@ -0,0 +1,66 @@ +/* + * 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: + * + * * 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 VideoFrameChromiumImpl_h +#define VideoFrameChromiumImpl_h + +#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 { +public: + // Converts a WebCore::VideoFrameChromium to a WebKit::WebVideoFrame. + static WebVideoFrame* toWebVideoFrame(VideoFrameChromium*); + + // Creates a VideoFrameChromiumImpl object to wrap the given WebVideoFrame. + // The VideoFrameChromiumImpl does not take ownership of the WebVideoFrame + // and should not free the frame's memory. + VideoFrameChromiumImpl(WebVideoFrame*); + virtual SurfaceType surfaceType() const; + virtual Format format() const; + virtual unsigned width() const; + virtual unsigned height() const; + virtual unsigned planes() const; + virtual int stride(unsigned plane) const; + virtual const void* data(unsigned plane) const; + +private: + WebVideoFrame* m_webVideoFrame; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/src/WebBlobData.cpp b/WebKit/chromium/src/WebBlobData.cpp new file mode 100644 index 0000000..4cd1d67 --- /dev/null +++ b/WebKit/chromium/src/WebBlobData.cpp @@ -0,0 +1,166 @@ +/* + * 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: + * + * * 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 "WebBlobData.h" + +#include "BlobData.h" + +using namespace WebCore; + +namespace WebKit { + +class WebBlobDataPrivate : public BlobData { +}; + +void WebBlobData::initialize() +{ + assign(BlobData::create()); +} + +void WebBlobData::reset() +{ + assign(0); +} + +size_t WebBlobData::itemCount() const +{ + ASSERT(!isNull()); + return m_private->items().size(); +} + +bool WebBlobData::itemAt(size_t index, Item& result) const +{ + ASSERT(!isNull()); + + if (index >= m_private->items().size()) + return false; + + const BlobDataItem& item = m_private->items()[index]; + result.data.reset(); + result.filePath.reset(); + result.blobURL = KURL(); + result.offset = item.offset; + result.length = item.length; + result.expectedModificationTime = item.expectedModificationTime; + + switch (item.type) { + case BlobDataItem::Data: + result.type = Item::TypeData; + result.data = item.data; + return true; + case BlobDataItem::File: + result.type = Item::TypeFile; + result.filePath = item.path; + return true; + case BlobDataItem::Blob: + result.type = Item::TypeBlob; + result.blobURL = item.url; + return true; + } + ASSERT_NOT_REACHED(); + return false; +} + +void WebBlobData::appendData(const WebCString& data) +{ + ASSERT(!isNull()); + m_private->appendData(data); +} + +void WebBlobData::appendFile(const WebString& filePath) +{ + ASSERT(!isNull()); + m_private->appendFile(filePath); +} + +void WebBlobData::appendFile(const WebString& filePath, long long offset, long long length, double expectedModificationTime) +{ + ASSERT(!isNull()); + m_private->appendFile(filePath, offset, length, expectedModificationTime); +} + +void WebBlobData::appendBlob(const WebURL& blobURL, long long offset, long long length) +{ + ASSERT(!isNull()); + m_private->appendBlob(blobURL, offset, length); +} + +WebString WebBlobData::contentType() const +{ + ASSERT(!isNull()); + return m_private->contentType(); +} + +void WebBlobData::setContentType(const WebString& contentType) +{ + ASSERT(!isNull()); + m_private->setContentType(contentType); +} + +WebString WebBlobData::contentDisposition() const +{ + ASSERT(!isNull()); + return m_private->contentDisposition(); +} + +void WebBlobData::setContentDisposition(const WebString& contentDisposition) +{ + ASSERT(!isNull()); + m_private->setContentDisposition(contentDisposition); +} + +WebBlobData::WebBlobData(const PassOwnPtr<BlobData>& data) + : m_private(0) +{ + assign(data); +} + +WebBlobData& WebBlobData::operator=(const PassOwnPtr<BlobData>& data) +{ + assign(data); + return *this; +} + +WebBlobData::operator PassOwnPtr<BlobData>() +{ + WebBlobDataPrivate* temp = m_private; + m_private = 0; + return adoptPtr(temp); +} + +void WebBlobData::assign(const PassOwnPtr<BlobData>& data) +{ + if (m_private) + delete m_private; + m_private = static_cast<WebBlobDataPrivate*>(data.leakPtr()); +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebBlobStorageData.cpp b/WebKit/chromium/src/WebBlobStorageData.cpp new file mode 100644 index 0000000..38a25fe --- /dev/null +++ b/WebKit/chromium/src/WebBlobStorageData.cpp @@ -0,0 +1,113 @@ +/* + * 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: + * + * * 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 "WebBlobStorageData.h" + +#include "BlobStorageData.h" + +using namespace WebCore; + +namespace WebKit { + +class WebBlobStorageDataPrivate : public BlobStorageData { +}; + +void WebBlobStorageData::reset() +{ + assign(0); +} + +size_t WebBlobStorageData::itemCount() const +{ + ASSERT(!isNull()); + return m_private->items().size(); +} + +bool WebBlobStorageData::itemAt(size_t index, WebBlobData::Item& result) const +{ + ASSERT(!isNull()); + + if (index >= m_private->items().size()) + return false; + + const BlobDataItem& item = m_private->items()[index]; + result.offset = item.offset; + result.length = item.length; + result.expectedModificationTime = item.expectedModificationTime; + if (item.type == BlobDataItem::Data) { + result.type = WebBlobData::Item::TypeData; + result.data.assign(item.data.data(), static_cast<size_t>(item.data.length())); + return true; + } else { + ASSERT(item.type == BlobDataItem::File); + result.type = WebBlobData::Item::TypeFile; + result.filePath = item.path; + return true; + } +} + +WebString WebBlobStorageData::contentType() const +{ + ASSERT(!isNull()); + return m_private->contentType(); +} + +WebString WebBlobStorageData::contentDisposition() const +{ + ASSERT(!isNull()); + return m_private->contentDisposition(); +} + +WebBlobStorageData::WebBlobStorageData(const PassRefPtr<BlobStorageData>& data) + : m_private(0) +{ + assign(data); +} + +WebBlobStorageData& WebBlobStorageData::operator=(const PassRefPtr<BlobStorageData>& data) +{ + assign(data); + return *this; +} + +WebBlobStorageData::operator PassRefPtr<BlobStorageData>() const +{ + return m_private; +} + +void WebBlobStorageData::assign(const PassRefPtr<BlobStorageData>& data) +{ + if (m_private) + m_private->deref(); + m_private = static_cast<WebBlobStorageDataPrivate*>(data.leakRef()); +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebEvent.cpp b/WebKit/chromium/src/WebDOMEvent.cpp index 8c68959..48e5268 100644 --- a/WebKit/chromium/src/WebEvent.cpp +++ b/WebKit/chromium/src/WebDOMEvent.cpp @@ -29,7 +29,7 @@ */ #include "config.h" -#include "WebEvent.h" +#include "WebDOMEvent.h" #include "Event.h" #include "Node.h" @@ -37,23 +37,23 @@ namespace WebKit { -class WebEventPrivate : public WebCore::Event { +class WebDOMEventPrivate : public WebCore::Event { }; -void WebEvent::reset() +void WebDOMEvent::reset() { assign(0); } -void WebEvent::assign(const WebEvent& other) +void WebDOMEvent::assign(const WebDOMEvent& other) { - WebEventPrivate* p = const_cast<WebEventPrivate*>(other.m_private); + WebDOMEventPrivate* p = const_cast<WebDOMEventPrivate*>(other.m_private); if (p) p->ref(); assign(p); } -void WebEvent::assign(WebEventPrivate* p) +void WebDOMEvent::assign(WebDOMEventPrivate* p) { // p is already ref'd for us by the caller if (m_private) @@ -61,156 +61,156 @@ void WebEvent::assign(WebEventPrivate* p) m_private = p; } -WebEvent::WebEvent(const WTF::PassRefPtr<WebCore::Event>& event) - : m_private(static_cast<WebEventPrivate*>(event.releaseRef())) +WebDOMEvent::WebDOMEvent(const WTF::PassRefPtr<WebCore::Event>& event) + : m_private(static_cast<WebDOMEventPrivate*>(event.releaseRef())) { } -WebString WebEvent::type() const +WebString WebDOMEvent::type() const { ASSERT(m_private); return m_private->type(); } -WebNode WebEvent::target() const +WebNode WebDOMEvent::target() const { ASSERT(m_private); return WebNode(m_private->target()->toNode()); } -WebNode WebEvent::currentTarget() const +WebNode WebDOMEvent::currentTarget() const { ASSERT(m_private); return WebNode(m_private->currentTarget()->toNode()); } -WebEvent::PhaseType WebEvent::eventPhase() const +WebDOMEvent::PhaseType WebDOMEvent::eventPhase() const { ASSERT(m_private); - return static_cast<WebEvent::PhaseType>(m_private->eventPhase()); + return static_cast<WebDOMEvent::PhaseType>(m_private->eventPhase()); } -bool WebEvent::bubbles() const +bool WebDOMEvent::bubbles() const { ASSERT(m_private); return m_private->bubbles(); } -bool WebEvent::cancelable() const +bool WebDOMEvent::cancelable() const { ASSERT(m_private); return m_private->cancelable(); } -bool WebEvent::isUIEvent() const +bool WebDOMEvent::isUIEvent() const { ASSERT(m_private); return m_private->isUIEvent(); } -bool WebEvent::isMouseEvent() const +bool WebDOMEvent::isMouseEvent() const { ASSERT(m_private); return m_private->isMouseEvent(); } -bool WebEvent::isMutationEvent() const +bool WebDOMEvent::isMutationEvent() const { ASSERT(m_private); return m_private->isMutationEvent(); } -bool WebEvent::isKeyboardEvent() const +bool WebDOMEvent::isKeyboardEvent() const { ASSERT(m_private); return m_private->isKeyboardEvent(); } -bool WebEvent::isTextEvent() const +bool WebDOMEvent::isTextEvent() const { ASSERT(m_private); return m_private->isTextEvent(); } -bool WebEvent::isCompositionEvent() const +bool WebDOMEvent::isCompositionEvent() const { ASSERT(m_private); return m_private->isCompositionEvent(); } -bool WebEvent::isDragEvent() const +bool WebDOMEvent::isDragEvent() const { ASSERT(m_private); return m_private->isDragEvent(); } -bool WebEvent::isClipboardEvent() const +bool WebDOMEvent::isClipboardEvent() const { ASSERT(m_private); return m_private->isClipboardEvent(); } -bool WebEvent::isMessageEvent() const +bool WebDOMEvent::isMessageEvent() const { ASSERT(m_private); return m_private->isMessageEvent(); } -bool WebEvent::isWheelEvent() const +bool WebDOMEvent::isWheelEvent() const { ASSERT(m_private); return m_private->isWheelEvent(); } -bool WebEvent::isBeforeTextInsertedEvent() const +bool WebDOMEvent::isBeforeTextInsertedEvent() const { ASSERT(m_private); return m_private->isBeforeTextInsertedEvent(); } -bool WebEvent::isOverflowEvent() const +bool WebDOMEvent::isOverflowEvent() const { ASSERT(m_private); return m_private->isOverflowEvent(); } -bool WebEvent::isPageTransitionEvent() const +bool WebDOMEvent::isPageTransitionEvent() const { ASSERT(m_private); return m_private->isPageTransitionEvent(); } -bool WebEvent::isPopStateEvent() const +bool WebDOMEvent::isPopStateEvent() const { ASSERT(m_private); return m_private->isPopStateEvent(); } -bool WebEvent::isProgressEvent() const +bool WebDOMEvent::isProgressEvent() const { ASSERT(m_private); return m_private->isProgressEvent(); } -bool WebEvent::isXMLHttpRequestProgressEvent() const +bool WebDOMEvent::isXMLHttpRequestProgressEvent() const { ASSERT(m_private); return m_private->isXMLHttpRequestProgressEvent(); } -bool WebEvent::isWebKitAnimationEvent() const +bool WebDOMEvent::isWebKitAnimationEvent() const { ASSERT(m_private); return m_private->isWebKitAnimationEvent(); } -bool WebEvent::isWebKitTransitionEvent() const +bool WebDOMEvent::isWebKitTransitionEvent() const { ASSERT(m_private); return m_private->isWebKitTransitionEvent(); } -bool WebEvent::isBeforeLoadEvent() const +bool WebDOMEvent::isBeforeLoadEvent() const { ASSERT(m_private); return m_private->isBeforeLoadEvent(); diff --git a/WebKit/chromium/src/WebEventListener.cpp b/WebKit/chromium/src/WebDOMEventListener.cpp index 8d9a887..93c1640 100644 --- a/WebKit/chromium/src/WebEventListener.cpp +++ b/WebKit/chromium/src/WebDOMEventListener.cpp @@ -1,64 +1,64 @@ -/*
- * 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:
- *
- * * 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 "WebEventListener.h"
-
-#include "WebEventListenerPrivate.h"
-
-namespace WebKit {
-
-WebEventListener::WebEventListener()
- : m_private(new WebEventListenerPrivate(this))
-{
-}
-
-WebEventListener::~WebEventListener()
-{
- m_private->webEventListenerDeleted();
- delete m_private;
-}
-
-void WebEventListener::notifyEventListenerDeleted(EventListenerWrapper* wrapper)
-{
- m_private->eventListenerDeleted(wrapper);
-}
-
-EventListenerWrapper* WebEventListener::createEventListenerWrapper(const WebString& eventType, bool useCapture, Node* node)
-{
- return m_private->createEventListenerWrapper(eventType, useCapture, node);
-}
-
-EventListenerWrapper* WebEventListener::getEventListenerWrapper(const WebString& eventType, bool useCapture, Node* node)
-{
- return m_private->getEventListenerWrapper(eventType, useCapture, node);
-}
-
-} // namespace WebKit
+/* + * 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: + * + * * 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 "WebDOMEventListener.h" + +#include "WebDOMEventListenerPrivate.h" + +namespace WebKit { + +WebDOMEventListener::WebDOMEventListener() + : m_private(new WebDOMEventListenerPrivate(this)) +{ +} + +WebDOMEventListener::~WebDOMEventListener() +{ + m_private->webDOMEventListenerDeleted(); + delete m_private; +} + +void WebDOMEventListener::notifyEventListenerDeleted(EventListenerWrapper* wrapper) +{ + m_private->eventListenerDeleted(wrapper); +} + +EventListenerWrapper* WebDOMEventListener::createEventListenerWrapper(const WebString& eventType, bool useCapture, Node* node) +{ + return m_private->createEventListenerWrapper(eventType, useCapture, node); +} + +EventListenerWrapper* WebDOMEventListener::getEventListenerWrapper(const WebString& eventType, bool useCapture, Node* node) +{ + return m_private->getEventListenerWrapper(eventType, useCapture, node); +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebEventListenerPrivate.cpp b/WebKit/chromium/src/WebDOMEventListenerPrivate.cpp index bd14baf..4edbeef 100644 --- a/WebKit/chromium/src/WebEventListenerPrivate.cpp +++ b/WebKit/chromium/src/WebDOMEventListenerPrivate.cpp @@ -1,87 +1,87 @@ -/*
- * 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:
- *
- * * 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 "WebEventListenerPrivate.h"
-
-#include "EventListenerWrapper.h"
-#include "WebEventListener.h"
-
-namespace WebKit {
-
-WebEventListenerPrivate::WebEventListenerPrivate(WebEventListener* webEventListener)
- : m_webEventListener(webEventListener)
-{
-}
-
-WebEventListenerPrivate::~WebEventListenerPrivate()
-{
-}
-
-EventListenerWrapper* WebEventListenerPrivate::createEventListenerWrapper(const WebString& eventType, bool useCapture, Node* node)
-{
- EventListenerWrapper* listenerWrapper = new EventListenerWrapper(m_webEventListener);
- WebEventListenerPrivate::ListenerInfo listenerInfo(eventType, useCapture, listenerWrapper, node);
- m_listenerWrappers.append(listenerInfo);
- return listenerWrapper;
-}
-
-EventListenerWrapper* WebEventListenerPrivate::getEventListenerWrapper(const WebString& eventType, bool useCapture, Node* node)
-{
- Vector<WebEventListenerPrivate::ListenerInfo>::const_iterator iter;
- for (iter = m_listenerWrappers.begin(); iter != m_listenerWrappers.end(); ++iter) {
- if (iter->node == node)
- return iter->eventListenerWrapper;
- }
- ASSERT_NOT_REACHED();
- return 0;
-}
-
-void WebEventListenerPrivate::webEventListenerDeleted()
-{
- // Notifies all WebEventListenerWrappers that we are going away so they can
- // invalidate their pointer to us.
- Vector<WebEventListenerPrivate::ListenerInfo>::const_iterator iter;
- for (iter = m_listenerWrappers.begin(); iter != m_listenerWrappers.end(); ++iter)
- iter->eventListenerWrapper->webEventListenerDeleted();
-}
-
-void WebEventListenerPrivate::eventListenerDeleted(EventListenerWrapper* eventListener)
-{
- for (size_t i = 0; i < m_listenerWrappers.size(); ++i) {
- if (m_listenerWrappers[i].eventListenerWrapper == eventListener) {
- m_listenerWrappers.remove(i);
- return;
- }
- }
- ASSERT_NOT_REACHED();
-}
-
-} // namespace WebKit
+/* + * 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: + * + * * 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 "WebDOMEventListenerPrivate.h" + +#include "EventListenerWrapper.h" +#include "WebDOMEventListener.h" + +namespace WebKit { + +WebDOMEventListenerPrivate::WebDOMEventListenerPrivate(WebDOMEventListener* webDOMEventListener) + : m_webDOMEventListener(webDOMEventListener) +{ +} + +WebDOMEventListenerPrivate::~WebDOMEventListenerPrivate() +{ +} + +EventListenerWrapper* WebDOMEventListenerPrivate::createEventListenerWrapper(const WebString& eventType, bool useCapture, Node* node) +{ + EventListenerWrapper* listenerWrapper = new EventListenerWrapper(m_webDOMEventListener); + WebDOMEventListenerPrivate::ListenerInfo listenerInfo(eventType, useCapture, listenerWrapper, node); + m_listenerWrappers.append(listenerInfo); + return listenerWrapper; +} + +EventListenerWrapper* WebDOMEventListenerPrivate::getEventListenerWrapper(const WebString& eventType, bool useCapture, Node* node) +{ + Vector<WebDOMEventListenerPrivate::ListenerInfo>::const_iterator iter; + for (iter = m_listenerWrappers.begin(); iter != m_listenerWrappers.end(); ++iter) { + if (iter->node == node) + return iter->eventListenerWrapper; + } + ASSERT_NOT_REACHED(); + return 0; +} + +void WebDOMEventListenerPrivate::webDOMEventListenerDeleted() +{ + // Notifies all WebDOMEventListenerWrappers that we are going away so they can + // invalidate their pointer to us. + Vector<WebDOMEventListenerPrivate::ListenerInfo>::const_iterator iter; + for (iter = m_listenerWrappers.begin(); iter != m_listenerWrappers.end(); ++iter) + iter->eventListenerWrapper->webDOMEventListenerDeleted(); +} + +void WebDOMEventListenerPrivate::eventListenerDeleted(EventListenerWrapper* eventListener) +{ + for (size_t i = 0; i < m_listenerWrappers.size(); ++i) { + if (m_listenerWrappers[i].eventListenerWrapper == eventListener) { + m_listenerWrappers.remove(i); + return; + } + } + ASSERT_NOT_REACHED(); +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebEventListenerPrivate.h b/WebKit/chromium/src/WebDOMEventListenerPrivate.h index 0ba2b5d..c86f427 100644 --- a/WebKit/chromium/src/WebEventListenerPrivate.h +++ b/WebKit/chromium/src/WebDOMEventListenerPrivate.h @@ -1,95 +1,95 @@ -/*
- * 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:
- *
- * * 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 WebEventListenerPrivate_h
-#define WebEventListenerPrivate_h
-
-#include "WebString.h"
-
-#include <wtf/Vector.h>
-
-namespace WebCore {
-class Node;
-}
-
-using namespace WebCore;
-
-namespace WebKit {
-
-class EventListenerWrapper;
-class WebEventListener;
-
-class WebEventListenerPrivate {
-public:
- WebEventListenerPrivate(WebEventListener* webEventListener);
- ~WebEventListenerPrivate();
-
- EventListenerWrapper* createEventListenerWrapper(
- const WebString& eventType, bool useCapture, Node* node);
-
- // Gets the ListenerEventWrapper for a specific node.
- // Used by WebNode::removeEventListener().
- EventListenerWrapper* getEventListenerWrapper(
- const WebString& eventType, bool useCapture, Node* node);
-
- // Called by the WebEventListener when it is about to be deleted.
- void webEventListenerDeleted();
-
- // Called by the EventListenerWrapper when it is about to be deleted.
- void eventListenerDeleted(EventListenerWrapper* eventListener);
-
- struct ListenerInfo {
- ListenerInfo(const WebString& eventType, bool useCapture,
- EventListenerWrapper* eventListenerWrapper,
- Node* node)
- : eventType(eventType)
- , useCapture(useCapture)
- , eventListenerWrapper(eventListenerWrapper)
- , node(node)
- {
- }
-
- WebString eventType;
- bool useCapture;
- EventListenerWrapper* eventListenerWrapper;
- Node* node;
- };
-
-private:
- WebEventListener* m_webEventListener;
-
- // We keep a list of the wrapper for the WebKit EventListener, it is needed
- // to implement WebNode::removeEventListener().
- Vector<ListenerInfo> m_listenerWrappers;
-};
-
-} // namespace WebKit
-
-#endif
+/* + * 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: + * + * * 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 WebDOMEventListenerPrivate_h +#define WebDOMEventListenerPrivate_h + +#include "WebString.h" + +#include <wtf/Vector.h> + +namespace WebCore { +class Node; +} + +using namespace WebCore; + +namespace WebKit { + +class EventListenerWrapper; +class WebDOMEventListener; + +class WebDOMEventListenerPrivate { +public: + WebDOMEventListenerPrivate(WebDOMEventListener* webDOMEventListener); + ~WebDOMEventListenerPrivate(); + + EventListenerWrapper* createEventListenerWrapper( + const WebString& eventType, bool useCapture, Node* node); + + // Gets the ListenerEventWrapper for a specific node. + // Used by WebNode::removeDOMEventListener(). + EventListenerWrapper* getEventListenerWrapper( + const WebString& eventType, bool useCapture, Node* node); + + // Called by the WebDOMEventListener when it is about to be deleted. + void webDOMEventListenerDeleted(); + + // Called by the EventListenerWrapper when it is about to be deleted. + void eventListenerDeleted(EventListenerWrapper* eventListener); + + struct ListenerInfo { + ListenerInfo(const WebString& eventType, bool useCapture, + EventListenerWrapper* eventListenerWrapper, + Node* node) + : eventType(eventType) + , useCapture(useCapture) + , eventListenerWrapper(eventListenerWrapper) + , node(node) + { + } + + WebString eventType; + bool useCapture; + EventListenerWrapper* eventListenerWrapper; + Node* node; + }; + +private: + WebDOMEventListener* m_webDOMEventListener; + + // We keep a list of the wrapper for the WebKit EventListener, it is needed + // to implement WebNode::removeEventListener(). + Vector<ListenerInfo> m_listenerWrappers; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/src/WebDOMMouseEvent.cpp b/WebKit/chromium/src/WebDOMMouseEvent.cpp new file mode 100644 index 0000000..bfeae37 --- /dev/null +++ b/WebKit/chromium/src/WebDOMMouseEvent.cpp @@ -0,0 +1,110 @@ +/* + * 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: + * + * * 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 "WebDOMMouseEvent.h" + +#include "MouseEvent.h" + +using namespace WebCore; + +namespace WebKit { + +int WebDOMMouseEvent::screenX() const +{ + return constUnwrap<MouseEvent>()->screenX(); +} + +int WebDOMMouseEvent::screenY() const +{ + return constUnwrap<MouseEvent>()->screenY(); +} + +int WebDOMMouseEvent::clientX() const +{ + return constUnwrap<MouseEvent>()->clientX(); +} + +int WebDOMMouseEvent::clientY() const +{ + return constUnwrap<MouseEvent>()->clientY(); +} + +int WebDOMMouseEvent::layerX() const +{ + return constUnwrap<MouseEvent>()->layerX(); +} + +int WebDOMMouseEvent::layerY() const +{ + return constUnwrap<MouseEvent>()->layerY(); +} + +int WebDOMMouseEvent::offsetX() const +{ + return constUnwrap<MouseEvent>()->offsetX(); +} + +int WebDOMMouseEvent::offsetY() const +{ + return constUnwrap<MouseEvent>()->offsetY(); +} + +int WebDOMMouseEvent::pageX() const +{ + return constUnwrap<MouseEvent>()->pageX(); +} + +int WebDOMMouseEvent::pageY() const +{ + return constUnwrap<MouseEvent>()->pageY(); +} + +int WebDOMMouseEvent::x() const +{ + return constUnwrap<MouseEvent>()->x(); +} + +int WebDOMMouseEvent::y() const +{ + return constUnwrap<MouseEvent>()->y(); +} + +int WebDOMMouseEvent::button() const +{ + return constUnwrap<MouseEvent>()->button(); +} + +bool WebDOMMouseEvent::buttonDown() const +{ + return constUnwrap<MouseEvent>()->buttonDown(); +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebDOMMutationEvent.cpp b/WebKit/chromium/src/WebDOMMutationEvent.cpp new file mode 100644 index 0000000..8a6e592 --- /dev/null +++ b/WebKit/chromium/src/WebDOMMutationEvent.cpp @@ -0,0 +1,65 @@ +/* + * 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: + * + * * 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 "WebDOMMutationEvent.h" + +#include "MutationEvent.h" + +using namespace WebCore; + +namespace WebKit { + +WebNode WebDOMMutationEvent::relatedNode() const +{ + return WebNode(constUnwrap<MutationEvent>()->relatedNode()); +} + +WebString WebDOMMutationEvent::prevValue() const +{ + return WebString(constUnwrap<MutationEvent>()->prevValue()); +} + +WebString WebDOMMutationEvent::newValue() const +{ + return WebString(constUnwrap<MutationEvent>()->newValue()); +} + +WebString WebDOMMutationEvent::attrName() const +{ + return WebString(constUnwrap<MutationEvent>()->attrName()); +} + +WebDOMMutationEvent::AttrChangeType WebDOMMutationEvent::attrChange() const +{ + return static_cast<AttrChangeType>(constUnwrap<MutationEvent>()->attrChange()); +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebDOMStringList.cpp b/WebKit/chromium/src/WebDOMStringList.cpp index 4be7fab..dc82331 100644 --- a/WebKit/chromium/src/WebDOMStringList.cpp +++ b/WebKit/chromium/src/WebDOMStringList.cpp @@ -60,6 +60,8 @@ void WebDOMStringList::append(const WebString& string) unsigned WebDOMStringList::length() const { + if (m_private.isNull()) + return 0; return m_private->length(); } diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp index f4b1a86..fbb06f8 100644 --- a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp +++ b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp @@ -206,19 +206,6 @@ void WebDevToolsAgentImpl::attach() WebCString debuggerScriptJs = m_client->debuggerScriptSource(); WebCore::ScriptDebugServer::shared().setDebuggerScriptSource( WTF::String(debuggerScriptJs.data(), debuggerScriptJs.length())); - - // TODO(yurys): the source should have already been pushed by the frontend. - WebCString injectedScriptJs = m_client->injectedScriptSource(); - String injectedScriptSource = String::fromUTF8(injectedScriptJs.data(), injectedScriptJs.length()); - const char* varDefinition = "var injectedScriptConstructor = "; - int pos = injectedScriptSource.find(varDefinition); - if (pos == -1) { - ASSERT_NOT_REACHED(); - return; - } - pos += String(varDefinition).length(); - injectedScriptSource = injectedScriptSource.substring(pos); - inspectorController()->injectedScriptHost()->setInjectedScriptSource(injectedScriptSource); m_attached = true; } @@ -237,7 +224,8 @@ void WebDevToolsAgentImpl::detach() void WebDevToolsAgentImpl::frontendLoaded() { inspectorController()->connectFrontend(); - m_client->runtimePropertyChanged(kFrontendConnectedFeatureName, "true"); + // We know that by this time injected script has already been pushed to the backend. + m_client->runtimePropertyChanged(kFrontendConnectedFeatureName, inspectorController()->injectedScriptHost()->injectedScriptSource()); } void WebDevToolsAgentImpl::didNavigate() @@ -266,11 +254,6 @@ void WebDevToolsAgentImpl::inspectElementAt(const WebPoint& point) m_webViewImpl->inspectElementAt(point); } -void WebDevToolsAgentImpl::setRuntimeFeatureEnabled(const WebString& feature, bool enabled) -{ - setRuntimeProperty(feature, enabled ? String("true") : String("false")); -} - void WebDevToolsAgentImpl::setRuntimeProperty(const WebString& name, const WebString& value) { if (name == kApuAgentFeatureName) @@ -283,8 +266,10 @@ void WebDevToolsAgentImpl::setRuntimeProperty(const WebString& name, const WebSt ic->enableResourceTracking(false /* not sticky */, false /* no reload */); else ic->disableResourceTracking(false /* not sticky */); - } else if (name == kFrontendConnectedFeatureName && value == "true" && !inspectorController()->hasFrontend()) + } else if (name == kFrontendConnectedFeatureName && !inspectorController()->hasFrontend()) { + inspectorController()->injectedScriptHost()->setInjectedScriptSource(value); frontendLoaded(); + } } void WebDevToolsAgentImpl::setApuAgentEnabled(bool enabled) diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.h b/WebKit/chromium/src/WebDevToolsAgentImpl.h index 73b8a1e..da584fb 100644 --- a/WebKit/chromium/src/WebDevToolsAgentImpl.h +++ b/WebKit/chromium/src/WebDevToolsAgentImpl.h @@ -76,7 +76,6 @@ public: virtual void dispatchOnInspectorBackend(const WebString& message); virtual void inspectElementAt(const WebPoint& point); virtual void evaluateInWebInspector(long callId, const WebString& script); - virtual void setRuntimeFeatureEnabled(const WebString& feature, bool enabled); virtual void setRuntimeProperty(const WebString& name, const WebString& value); virtual void setTimelineProfilingEnabled(bool enable); diff --git a/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp b/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp new file mode 100644 index 0000000..d29f86d --- /dev/null +++ b/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp @@ -0,0 +1,94 @@ +/* + * 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: + * + * * 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 "WebFileSystemCallbacksImpl.h" + +#if ENABLE(FILE_SYSTEM) + +#include "ExceptionCode.h" +#include "FileSystemCallbacks.h" +#include "WebFileSystemEntry.h" +#include "WebFileInfo.h" +#include "WebString.h" +#include <wtf/Vector.h> + +using namespace WebCore; + +namespace WebKit { + +WebFileSystemCallbacksImpl::WebFileSystemCallbacksImpl(PassOwnPtr<FileSystemCallbacksBase> callbacks) + : m_callbacks(callbacks) +{ +} + +WebFileSystemCallbacksImpl::~WebFileSystemCallbacksImpl() +{ +} + +void WebFileSystemCallbacksImpl::didSucceed() +{ + ASSERT(m_callbacks); + m_callbacks->didSucceed(); + delete this; +} + +void WebFileSystemCallbacksImpl::didReadMetadata(const WebFileInfo& info) +{ + ASSERT(m_callbacks); + m_callbacks->didReadMetadata(info.modificationTime); + delete this; +} + +void WebFileSystemCallbacksImpl::didReadDirectory(const WebVector<WebFileSystemEntry>& entries, bool hasMore) +{ + ASSERT(m_callbacks); + for (size_t i = 0; i < entries.size(); ++i) + m_callbacks->didReadDirectoryEntry(entries[i].name, entries[i].isDirectory); + m_callbacks->didReadDirectoryChunkDone(hasMore); + if (!hasMore) + delete this; +} + +void WebFileSystemCallbacksImpl::didOpenFileSystem(const WebString& name, const WebString& path) +{ + m_callbacks->didOpenFileSystem(name, path); + delete this; +} + +void WebFileSystemCallbacksImpl::didFail(WebFileError error) +{ + ASSERT(m_callbacks); + m_callbacks->didFail(error); + delete this; +} + +} // namespace WebKit + +#endif // ENABLE(FILE_SYSTEM) diff --git a/WebKit/chromium/src/WebFileSystemCallbacksImpl.h b/WebKit/chromium/src/WebFileSystemCallbacksImpl.h new file mode 100644 index 0000000..f3c6bc3 --- /dev/null +++ b/WebKit/chromium/src/WebFileSystemCallbacksImpl.h @@ -0,0 +1,66 @@ +/* + * 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: + * + * * 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 WebFileSystemCallbacksImpl_h +#define WebFileSystemCallbacksImpl_h + +#include "WebFileSystemCallbacks.h" +#include "WebVector.h" +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> + +namespace WebCore { +class FileSystemCallbacksBase; +} + +namespace WebKit { + +struct WebFileInfo; +class WebFileSystemEntry; +class WebString; + +class WebFileSystemCallbacksImpl : public WebFileSystemCallbacks { +public: + WebFileSystemCallbacksImpl(PassOwnPtr<WebCore::FileSystemCallbacksBase>); + virtual ~WebFileSystemCallbacksImpl(); + + virtual void didSucceed(); + virtual void didReadMetadata(const WebFileInfo& info); + virtual void didReadDirectory(const WebVector<WebFileSystemEntry>& entries, bool hasMore); + virtual void didOpenFileSystem(const WebString& name, const WebString& rootPath); + virtual void didFail(WebFileError error); + +private: + OwnPtr<WebCore::FileSystemCallbacksBase> m_callbacks; +}; + +} // namespace WebKit + +#endif // WebFileSystemCallbacksImpl_h diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp index f1c30e2..4375e73 100644 --- a/WebKit/chromium/src/WebFrameImpl.cpp +++ b/WebKit/chromium/src/WebFrameImpl.cpp @@ -234,6 +234,15 @@ static void frameContentAsPlainText(size_t maxChars, Frame* frame, // Recursively walk the children. FrameTree* frameTree = frame->tree(); for (Frame* curChild = frameTree->firstChild(); curChild; curChild = curChild->tree()->nextSibling()) { + // Ignore the text of non-visible frames. + RenderView* contentRenderer = curChild->contentRenderer(); + RenderPart* ownerRenderer = curChild->ownerRenderer(); + if (!contentRenderer || !contentRenderer->width() || !contentRenderer->height() + || (contentRenderer->x() + contentRenderer->width() <= 0) || (contentRenderer->y() + contentRenderer->height() <= 0) + || (ownerRenderer && ownerRenderer->style() && ownerRenderer->style()->visibility() != VISIBLE)) { + continue; + } + // Make sure the frame separator won't fill up the buffer, and give up if // it will. The danger is if the separator will make the buffer longer than // maxChars. This will cause the computation above: @@ -1429,7 +1438,7 @@ void WebFrameImpl::stopFinding(bool clearSelection) cancelPendingScopingEffort(); // Remove all markers for matches found and turn off the highlighting. - frame()->document()->removeMarkers(DocumentMarker::TextMatch); + frame()->document()->markers()->removeMarkers(DocumentMarker::TextMatch); frame()->setMarkedTextMatchesAreHighlighted(false); // Let the frame know that we don't want tickmarks or highlighting anymore. @@ -2060,14 +2069,14 @@ void WebFrameImpl::addMarker(Range* range, bool activeMatch) if (marker.endOffset > marker.startOffset) { // Find the node to add a marker to and add it. Node* node = textPiece->startContainer(exception); - frame()->document()->addMarker(node, marker); + frame()->document()->markers()->addMarker(node, marker); // Rendered rects for markers in WebKit are not populated until each time // the markers are painted. However, we need it to happen sooner, because // the whole purpose of tickmarks on the scrollbar is to show where // matches off-screen are (that haven't been painted yet). - Vector<DocumentMarker> markers = frame()->document()->markersForNode(node); - frame()->document()->setRenderedRectForMarker( + Vector<DocumentMarker> markers = frame()->document()->markers()->markersForNode(node); + frame()->document()->markers()->setRenderedRectForMarker( textPiece->startContainer(exception), markers[markers.size() - 1], range->boundingBox()); @@ -2081,7 +2090,7 @@ void WebFrameImpl::setMarkerActive(Range* range, bool active) if (!range || range->collapsed(ec)) return; - frame()->document()->setMarkersActive(range, active); + frame()->document()->markers()->setMarkersActive(range, active); } int WebFrameImpl::ordinalOfFirstMatchForFrame(WebFrameImpl* frame) const diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp index a863862..6e1adca 100644 --- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp +++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp @@ -182,6 +182,16 @@ bool WebGraphicsContext3DDefaultImpl::isGLES2Compliant() return false; } +bool WebGraphicsContext3DDefaultImpl::isGLES2NPOTStrict() +{ + return false; +} + +bool WebGraphicsContext3DDefaultImpl::isErrorGeneratedOnOutOfBoundsAccesses() +{ + return false; +} + unsigned int WebGraphicsContext3DDefaultImpl::getPlatformTextureId() { ASSERT_NOT_REACHED(); @@ -922,9 +932,10 @@ DELEGATE_TO_GL_3(getVertexAttribiv, GetVertexAttribiv, unsigned long, unsigned l long WebGraphicsContext3DDefaultImpl::getVertexAttribOffset(unsigned long index, unsigned long pname) { - // FIXME: implement. - notImplemented(); - return 0; + makeContextCurrent(); + void* pointer; + glGetVertexAttribPointerv(index, pname, &pointer); + return reinterpret_cast<long>(pointer); } DELEGATE_TO_GL_2(hint, Hint, unsigned long, unsigned long) diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h index cf5f5b4..a4c5b4b 100644 --- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h +++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h @@ -68,6 +68,8 @@ public: virtual int sizeInBytes(int type); virtual bool isGLES2Compliant(); + virtual bool isGLES2NPOTStrict(); + virtual bool isErrorGeneratedOnOutOfBoundsAccesses(); virtual void reshape(int width, int height); diff --git a/WebKit/chromium/src/WebHTTPBody.cpp b/WebKit/chromium/src/WebHTTPBody.cpp index fa75387..e54b4e5 100644 --- a/WebKit/chromium/src/WebHTTPBody.cpp +++ b/WebKit/chromium/src/WebHTTPBody.cpp @@ -74,31 +74,33 @@ bool WebHTTPBody::elementAt(size_t index, Element& result) const const FormDataElement& element = m_private->elements()[index]; + result.data.reset(); + result.filePath.reset(); + result.fileStart = 0; + result.fileLength = 0; + result.fileInfo.modificationTime = 0.0; + result.blobURL = KURL(); + switch (element.m_type) { case FormDataElement::data: result.type = Element::TypeData; result.data.assign(element.m_data.data(), element.m_data.size()); - result.filePath.reset(); -#if ENABLE(BLOB) - result.fileStart = 0; - result.fileLength = 0; - result.fileInfo.modificationTime = 0.0; -#endif break; case FormDataElement::encodedFile: result.type = Element::TypeFile; - result.data.reset(); result.filePath = element.m_filename; #if ENABLE(BLOB) result.fileStart = element.m_fileStart; result.fileLength = element.m_fileLength; result.fileInfo.modificationTime = element.m_expectedFileModificationTime; -#else - result.fileStart = 0; - result.fileLength = -1; - result.fileInfo.modificationTime = 0.0; #endif break; +#if ENABLE(BLOB) + case FormDataElement::encodedBlob: + result.type = Element::TypeBlob; + result.blobURL = element.m_blobURL; + break; +#endif default: ASSERT_NOT_REACHED(); return false; @@ -129,6 +131,14 @@ void WebHTTPBody::appendFileRange(const WebString& filePath, long long fileStart #endif } +void WebHTTPBody::appendBlob(const WebURL& blobURL) +{ +#if ENABLE(BLOB) + ensureMutable(); + m_private->appendBlob(blobURL); +#endif +} + long long WebHTTPBody::identifier() const { ASSERT(!isNull()); diff --git a/WebKit/chromium/src/WebIDBDatabaseImpl.cpp b/WebKit/chromium/src/WebIDBDatabaseImpl.cpp index 8c8e30a..bd3600f 100644 --- a/WebKit/chromium/src/WebIDBDatabaseImpl.cpp +++ b/WebKit/chromium/src/WebIDBDatabaseImpl.cpp @@ -29,8 +29,10 @@ #include "DOMStringList.h" #include "IDBCallbacksProxy.h" #include "IDBDatabaseBackendInterface.h" +#include "IDBTransactionBackendInterface.h" #include "WebIDBCallbacks.h" #include "WebIDBObjectStoreImpl.h" +#include "WebIDBTransactionImpl.h" #if ENABLE(INDEXED_DATABASE) @@ -85,6 +87,15 @@ void WebIDBDatabaseImpl::removeObjectStore(const WebString& name, WebIDBCallback m_databaseBackend->removeObjectStore(name, IDBCallbacksProxy::create(callbacks)); } +WebIDBTransaction* WebIDBDatabaseImpl::transaction(const WebDOMStringList& names, unsigned short mode, unsigned long timeout) +{ + RefPtr<DOMStringList> nameList = PassRefPtr<DOMStringList>(names); + RefPtr<IDBTransactionBackendInterface> transaction = m_databaseBackend->transaction(nameList.get(), mode, timeout); + if (!transaction) + return 0; + return new WebIDBTransactionImpl(transaction); +} + } // namespace WebCore #endif // ENABLE(INDEXED_DATABASE) diff --git a/WebKit/chromium/src/WebIDBDatabaseImpl.h b/WebKit/chromium/src/WebIDBDatabaseImpl.h index 46a6609..9ae74e0 100644 --- a/WebKit/chromium/src/WebIDBDatabaseImpl.h +++ b/WebKit/chromium/src/WebIDBDatabaseImpl.h @@ -36,6 +36,7 @@ namespace WebCore { class IDBDatabaseBackendInterface; } namespace WebKit { class WebIDBObjectStore; +class WebIDBTransaction; // See comment in WebIndexedDatabase for a high level overview these classes. class WebIDBDatabaseImpl : public WebIDBDatabase { @@ -51,6 +52,7 @@ public: virtual void createObjectStore(const WebString& name, const WebString& keyPath, bool autoIncrement, WebIDBCallbacks* callbacks); virtual WebIDBObjectStore* objectStore(const WebString& name, unsigned short mode); virtual void removeObjectStore(const WebString& name, WebIDBCallbacks* callbacks); + virtual WebIDBTransaction* transaction(const WebDOMStringList& names, unsigned short mode, unsigned long timeout); private: WTF::RefPtr<WebCore::IDBDatabaseBackendInterface> m_databaseBackend; diff --git a/WebKit/chromium/src/WebIDBFactoryImpl.cpp b/WebKit/chromium/src/WebIDBFactoryImpl.cpp index 5ac89f4..564be36 100755 --- a/WebKit/chromium/src/WebIDBFactoryImpl.cpp +++ b/WebKit/chromium/src/WebIDBFactoryImpl.cpp @@ -63,6 +63,15 @@ void WebIDBFactoryImpl::open(const WebString& name, const WebString& description m_idbFactoryBackend->open(name, description, IDBCallbacksProxy::create(callbacks), origin, 0); } +void WebIDBFactoryImpl::abortPendingTransactions(const WebVector<int>& pendingIDs) +{ + WTF::Vector<int> ids(pendingIDs.size()); + for (size_t i = 0; i < pendingIDs.size(); ++i) + ids[i] = pendingIDs[i]; + + m_idbFactoryBackend->abortPendingTransactions(ids); +} + } // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/WebKit/chromium/src/WebIDBFactoryImpl.h b/WebKit/chromium/src/WebIDBFactoryImpl.h index c9ec9a3..aeab478 100755 --- a/WebKit/chromium/src/WebIDBFactoryImpl.h +++ b/WebKit/chromium/src/WebIDBFactoryImpl.h @@ -43,6 +43,7 @@ public: virtual ~WebIDBFactoryImpl(); virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*); + virtual void abortPendingTransactions(const WebVector<int>& pendingIDs); private: WTF::RefPtr<WebCore::IDBFactoryBackendInterface> m_idbFactoryBackend; diff --git a/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.cpp b/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.cpp new file mode 100644 index 0000000..264ddc5 --- /dev/null +++ b/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.cpp @@ -0,0 +1,56 @@ +/* + * 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. + */ + +#include "config.h" +#include "WebIDBTransactionCallbacksImpl.h" + +#if ENABLE(INDEXED_DATABASE) + +#include "IDBTransactionCallbacks.h" + +namespace WebCore { + +WebIDBTransactionCallbacksImpl::WebIDBTransactionCallbacksImpl(PassRefPtr<IDBTransactionCallbacks> callbacks) + : m_callbacks(callbacks) +{ +} + +WebIDBTransactionCallbacksImpl::~WebIDBTransactionCallbacksImpl() +{ +} + +void WebIDBTransactionCallbacksImpl::onAbort() +{ + m_callbacks->onAbort(); +} + +int WebIDBTransactionCallbacksImpl::id() const +{ + return m_callbacks->id(); +} + +} // namespace WebCore + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.h b/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.h new file mode 100644 index 0000000..398a679a --- /dev/null +++ b/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.h @@ -0,0 +1,55 @@ +/* + * 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 WebIDBTransactionCallbacksImpl_h +#define WebIDBTransactionCallbacksImpl_h + +#if ENABLE(INDEXED_DATABASE) + +#include "WebIDBTransactionCallbacks.h" +#include <wtf/PassRefPtr.h> +#include <wtf/RefPtr.h> + +namespace WebCore { + +class IDBTransactionCallbacks; + +class WebIDBTransactionCallbacksImpl : public WebKit::WebIDBTransactionCallbacks { +public: + WebIDBTransactionCallbacksImpl(PassRefPtr<IDBTransactionCallbacks>); + virtual ~WebIDBTransactionCallbacksImpl(); + + virtual void onAbort(); + virtual int id() const; + +private: + RefPtr<IDBTransactionCallbacks> m_callbacks; +}; + +} // namespace WebCore + +#endif + +#endif // WebIDBTransactionCallbacksImpl_h diff --git a/WebKit/chromium/src/WebIDBTransactionImpl.cpp b/WebKit/chromium/src/WebIDBTransactionImpl.cpp new file mode 100644 index 0000000..0dc9702 --- /dev/null +++ b/WebKit/chromium/src/WebIDBTransactionImpl.cpp @@ -0,0 +1,80 @@ +/* + * 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. + */ + +#include "config.h" +#include "WebIDBTransactionImpl.h" + +#if ENABLE(INDEXED_DATABASE) + +#include "IDBTransaction.h" +#include "IDBTransactionCallbacksProxy.h" +#include "WebIDBObjectStoreImpl.h" +#include "WebIDBTransactionCallbacks.h" + +using namespace WebCore; + +namespace WebKit { + +WebIDBTransactionImpl::WebIDBTransactionImpl(PassRefPtr<IDBTransactionBackendInterface> backend) + : m_backend(backend) +{ +} + +WebIDBTransactionImpl::~WebIDBTransactionImpl() +{ +} + +int WebIDBTransactionImpl::mode() const +{ + return m_backend->mode(); +} + +WebIDBObjectStore* WebIDBTransactionImpl::objectStore(const WebString& name) +{ + RefPtr<IDBObjectStoreBackendInterface> objectStore = m_backend->objectStore(name); + if (!objectStore) + return 0; + return new WebIDBObjectStoreImpl(objectStore); +} + +void WebIDBTransactionImpl::abort() +{ + m_backend->abort(); +} + +int WebIDBTransactionImpl::id() const +{ + return m_backend->id(); +} + +void WebIDBTransactionImpl::setCallbacks(WebIDBTransactionCallbacks* callbacks) +{ + RefPtr<IDBTransactionCallbacks> idbCallbacks = IDBTransactionCallbacksProxy::create(callbacks); + m_backend->setCallbacks(idbCallbacks.get()); +} + +} // namespace WebKit + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/WebKit/chromium/src/WebIDBTransactionImpl.h b/WebKit/chromium/src/WebIDBTransactionImpl.h new file mode 100644 index 0000000..a9bde68 --- /dev/null +++ b/WebKit/chromium/src/WebIDBTransactionImpl.h @@ -0,0 +1,60 @@ +/* + * 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 WebIDBTransactionImpl_h +#define WebIDBTransactionImpl_h + +#if ENABLE(INDEXED_DATABASE) + +#include "WebCommon.h" +#include "WebIDBTransaction.h" +#include <wtf/PassRefPtr.h> +#include <wtf/RefPtr.h> + +namespace WebCore { class IDBTransactionBackendInterface; } + +namespace WebKit { + +// See comment in WebIndexedDatabase for a high level overview these classes. +class WebIDBTransactionImpl: public WebIDBTransaction { +public: + WebIDBTransactionImpl(WTF::PassRefPtr<WebCore::IDBTransactionBackendInterface>); + virtual ~WebIDBTransactionImpl(); + + virtual int mode() const; + virtual WebIDBObjectStore* objectStore(const WebString& name); + virtual void abort(); + virtual int id() const; + virtual void setCallbacks(WebIDBTransactionCallbacks*); + +private: + WTF::RefPtr<WebCore::IDBTransactionBackendInterface> m_backend; +}; + +} // namespace WebKit + +#endif // ENABLE(INDEXED_DATABASE) + +#endif // WebIDBTransactionImpl_h diff --git a/WebKit/chromium/src/WebImageDecoder.cpp b/WebKit/chromium/src/WebImageDecoder.cpp index 9e1d1f4..160deee 100644 --- a/WebKit/chromium/src/WebImageDecoder.cpp +++ b/WebKit/chromium/src/WebImageDecoder.cpp @@ -56,10 +56,10 @@ void WebImageDecoder::init(Type type) { switch (type) { case TypeBMP: - m_private = new BMPImageDecoder(); + m_private = new BMPImageDecoder(true); break; case TypeICO: - m_private = new ICOImageDecoder(); + m_private = new ICOImageDecoder(true); break; } } diff --git a/WebKit/chromium/src/WebInputEventConversion.cpp b/WebKit/chromium/src/WebInputEventConversion.cpp index f47a4e8..24eb372 100644 --- a/WebKit/chromium/src/WebInputEventConversion.cpp +++ b/WebKit/chromium/src/WebInputEventConversion.cpp @@ -332,6 +332,11 @@ WebKeyboardEventBuilder::WebKeyboardEventBuilder(const KeyboardEvent& event) modifiers = getWebInputModifiers(event); timeStampSeconds = event.timeStamp() * 1.0e-3; windowsKeyCode = event.keyCode(); + + // The platform keyevent does not exist if the event was created using + // initKeyboardEvent. + if (!event.keyEvent()) + return; nativeKeyCode = event.keyEvent()->nativeVirtualKeyCode(); unsigned int numChars = std::min(event.keyEvent()->text().length(), static_cast<unsigned int>(WebKeyboardEvent::textLengthCap)); diff --git a/WebKit/chromium/src/WebKit.cpp b/WebKit/chromium/src/WebKit.cpp index 786d573..cadcb6c 100644 --- a/WebKit/chromium/src/WebKit.cpp +++ b/WebKit/chromium/src/WebKit.cpp @@ -46,11 +46,18 @@ namespace WebKit { +// Make sure we are not re-initialized in the same address space. +// Doing so may cause hard to reproduce crashes. +static bool s_webKitInitialized = false; + static WebKitClient* s_webKitClient = 0; static bool s_layoutTestMode = false; void initialize(WebKitClient* webKitClient) { + ASSERT(!s_webKitInitialized); + s_webKitInitialized = true; + ASSERT(webKitClient); ASSERT(!s_webKitClient); s_webKitClient = webKitClient; diff --git a/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp b/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp index 8f210a0..f0ece0d 100644 --- a/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp +++ b/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp @@ -22,6 +22,8 @@ #include "RenderLayerCompositor.h" #endif +#include "VideoFrameChromium.h" +#include "VideoFrameChromiumImpl.h" #include "WebCanvas.h" #include "WebCString.h" #include "WebFrameClient.h" @@ -416,6 +418,28 @@ MediaPlayer::MovieLoadType WebMediaPlayerClientImpl::movieLoadType() const return MediaPlayer::Unknown; } +VideoFrameChromium* WebMediaPlayerClientImpl::getCurrentFrame() +{ + VideoFrameChromium* videoFrame = 0; + if (m_webMediaPlayer.get()) { + WebVideoFrame* webkitVideoFrame = m_webMediaPlayer->getCurrentFrame(); + if (webkitVideoFrame) + videoFrame = new VideoFrameChromiumImpl(webkitVideoFrame); + } + return videoFrame; +} + +void WebMediaPlayerClientImpl::putCurrentFrame(VideoFrameChromium* videoFrame) +{ + if (videoFrame) { + if (m_webMediaPlayer.get()) { + m_webMediaPlayer->putCurrentFrame( + VideoFrameChromiumImpl::toWebVideoFrame(videoFrame)); + } + delete videoFrame; + } +} + MediaPlayerPrivateInterface* WebMediaPlayerClientImpl::create(MediaPlayer* player) { WebMediaPlayerClientImpl* client = new WebMediaPlayerClientImpl(); @@ -433,7 +457,7 @@ MediaPlayerPrivateInterface* WebMediaPlayerClientImpl::create(MediaPlayer* playe frame->contentRenderer()->compositor()->hasAcceleratedCompositing(); if (client->m_supportsAcceleratedCompositing) - client->m_videoLayer = VideoLayerChromium::create(0); + client->m_videoLayer = VideoLayerChromium::create(0, client); #endif return client; diff --git a/WebKit/chromium/src/WebMediaPlayerClientImpl.h b/WebKit/chromium/src/WebMediaPlayerClientImpl.h index df179a8..e014871 100644 --- a/WebKit/chromium/src/WebMediaPlayerClientImpl.h +++ b/WebKit/chromium/src/WebMediaPlayerClientImpl.h @@ -34,6 +34,8 @@ #if ENABLE(VIDEO) #include "MediaPlayerPrivate.h" +#include "VideoFrameChromium.h" +#include "VideoFrameProvider.h" #include "WebMediaPlayerClient.h" #include <wtf/OwnPtr.h> @@ -44,8 +46,10 @@ class WebMediaPlayer; // This class serves as a bridge between WebCore::MediaPlayer and // WebKit::WebMediaPlayer. -class WebMediaPlayerClientImpl : public WebMediaPlayerClient - , public WebCore::MediaPlayerPrivateInterface { +class WebMediaPlayerClientImpl : public WebCore::MediaPlayerPrivateInterface + , public WebCore::VideoFrameProvider + , public WebMediaPlayerClient { + public: static bool isEnabled(); static void setIsEnabled(bool); @@ -110,6 +114,10 @@ public: virtual WebCore::MediaPlayer::MovieLoadType movieLoadType() const; + // VideoFrameProvider methods: + virtual WebCore::VideoFrameChromium* getCurrentFrame(); + virtual void putCurrentFrame(WebCore::VideoFrameChromium*); + private: WebMediaPlayerClientImpl(); diff --git a/WebKit/chromium/src/WebNode.cpp b/WebKit/chromium/src/WebNode.cpp index 69c35e7..caea589 100644 --- a/WebKit/chromium/src/WebNode.cpp +++ b/WebKit/chromium/src/WebNode.cpp @@ -38,9 +38,9 @@ #include "NodeList.h" #include "EventListenerWrapper.h" +#include "WebDOMEvent.h" +#include "WebDOMEventListener.h" #include "WebDocument.h" -#include "WebEvent.h" -#include "WebEventListener.h" #include "WebFrameImpl.h" #include "WebNodeList.h" #include "WebString.h" @@ -79,7 +79,7 @@ WebNode::NodeType WebNode::nodeType() const WebNode WebNode::parentNode() const { - return WebNode(const_cast<Node*>(m_private->parentNode())); + return WebNode(const_cast<ContainerNode*>(m_private->parentNode())); } WebString WebNode::nodeName() const @@ -149,7 +149,7 @@ bool WebNode::isElementNode() const return m_private->isElementNode(); } -void WebNode::addEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture) +void WebNode::addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture) { EventListenerWrapper* listenerWrapper = listener->createEventListenerWrapper(eventType, useCapture, m_private.get()); @@ -159,7 +159,7 @@ void WebNode::addEventListener(const WebString& eventType, WebEventListener* lis m_private->addEventListener(eventType, adoptRef(listenerWrapper), useCapture); } -void WebNode::removeEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture) +void WebNode::removeEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture) { EventListenerWrapper* listenerWrapper = listener->getEventListenerWrapper(eventType, useCapture, m_private.get()); diff --git a/WebKit/chromium/src/WebPageSerializerImpl.cpp b/WebKit/chromium/src/WebPageSerializerImpl.cpp index e65af85..885ee25 100644 --- a/WebKit/chromium/src/WebPageSerializerImpl.cpp +++ b/WebKit/chromium/src/WebPageSerializerImpl.cpp @@ -380,9 +380,8 @@ void WebPageSerializerImpl::endTagToString(const Element* element, // Check whether we have to write end tag for empty element. if (param->isHTMLDocument) { result += ">"; - const HTMLElement* htmlElement = - static_cast<const HTMLElement*>(element); - if (htmlElement->endTagRequirement() == TagStatusRequired) { + // FIXME: This code is horribly wrong. WebPageSerializerImpl must die. + if (!static_cast<const HTMLElement*>(element)->ieForbidsInsertHTML()) { // We need to write end tag when it is required. result += "</"; result += element->nodeName().lower(); diff --git a/WebKit/chromium/src/WebSettingsImpl.cpp b/WebKit/chromium/src/WebSettingsImpl.cpp index 6569e2e..329027c 100644 --- a/WebKit/chromium/src/WebSettingsImpl.cpp +++ b/WebKit/chromium/src/WebSettingsImpl.cpp @@ -284,11 +284,6 @@ void WebSettingsImpl::setAccelerated2dCanvasEnabled(bool enabled) m_settings->setAccelerated2dCanvasEnabled(enabled); } -void WebSettingsImpl::setHTML5ParserEnabled(bool enabled) -{ - m_settings->setHTML5ParserEnabled(enabled); -} - void WebSettingsImpl::setMemoryInfoEnabled(bool enabled) { m_settings->setMemoryInfoEnabled(enabled); diff --git a/WebKit/chromium/src/WebSettingsImpl.h b/WebKit/chromium/src/WebSettingsImpl.h index 9eedba8..0120dbc 100644 --- a/WebKit/chromium/src/WebSettingsImpl.h +++ b/WebKit/chromium/src/WebSettingsImpl.h @@ -88,7 +88,6 @@ public: virtual void setEditingBehavior(EditingBehavior); virtual void setAcceleratedCompositingEnabled(bool); virtual void setAccelerated2dCanvasEnabled(bool); - virtual void setHTML5ParserEnabled(bool); virtual void setMemoryInfoEnabled(bool); private: diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp index 57e3635..60c4fed 100644 --- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp +++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp @@ -33,6 +33,7 @@ #include "PlatformString.h" #include "SpeechInputClientMock.h" +#include "WebRect.h" namespace WebKit { @@ -74,9 +75,9 @@ void WebSpeechInputControllerMockImpl::setRecognitionResult(int requestId, const m_listener->setRecognitionResult(requestId, result); } -bool WebSpeechInputControllerMockImpl::startRecognition(int requestId) +bool WebSpeechInputControllerMockImpl::startRecognition(int requestId, const WebRect& elementRect) { - return m_webcoreMock->startRecognition(requestId); + return m_webcoreMock->startRecognition(requestId, elementRect); } void WebSpeechInputControllerMockImpl::cancelRecognition(int requestId) diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h index 38a15df..edbfca3 100644 --- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h +++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h @@ -43,6 +43,8 @@ class SpeechInputClientMock; namespace WebKit { +struct WebRect; + class WebSpeechInputControllerMockImpl : public WebCore::SpeechInputListener , public WebSpeechInputControllerMock { public: @@ -55,7 +57,7 @@ public: void setRecognitionResult(int requestId, const WTF::String& result); // WebSpeechInputController methods. - bool startRecognition(int requestId); + bool startRecognition(int requestId, const WebRect& elementRect); void cancelRecognition(int requestId); void stopRecording(int requestId); diff --git a/WebKit/chromium/src/WebURLRequest.cpp b/WebKit/chromium/src/WebURLRequest.cpp index 69dfac4..2950076 100644 --- a/WebKit/chromium/src/WebURLRequest.cpp +++ b/WebKit/chromium/src/WebURLRequest.cpp @@ -55,6 +55,8 @@ public: : m_resourceRequestAllocation(*p->m_resourceRequest) { m_resourceRequest = &m_resourceRequestAllocation; + m_allowStoredCredentials = p->m_allowStoredCredentials; + m_downloadToFile = p->m_downloadToFile; } virtual void dispose() { delete this; } diff --git a/WebKit/chromium/src/WebURLResponse.cpp b/WebKit/chromium/src/WebURLResponse.cpp index 0511f8d..aae413c 100644 --- a/WebKit/chromium/src/WebURLResponse.cpp +++ b/WebKit/chromium/src/WebURLResponse.cpp @@ -59,6 +59,7 @@ public: : m_resourceResponseAllocation(*p->m_resourceResponse) { m_resourceResponse = &m_resourceResponseAllocation; + m_downloadFilePath = p->m_downloadFilePath; } virtual void dispose() { delete this; } diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp index 62b20d5..383b716 100644 --- a/WebKit/chromium/src/WebViewImpl.cpp +++ b/WebKit/chromium/src/WebViewImpl.cpp @@ -88,6 +88,7 @@ #include "Settings.h" #include "Timer.h" #include "TypingCommand.h" +#include "UserGestureIndicator.h" #include "Vector.h" #include "WebAccessibilityObject.h" #include "WebDevToolsAgentPrivate.h" @@ -980,6 +981,8 @@ const WebInputEvent* WebViewImpl::m_currentInputEvent = 0; bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent) { + UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); + // If we've started a drag and drop operation, ignore input events until // we're done. if (m_doingDragAndDrop) diff --git a/WebKit/chromium/src/js/DebuggerScript.js b/WebKit/chromium/src/js/DebuggerScript.js index 51787f6..5a8a7bf 100644 --- a/WebKit/chromium/src/js/DebuggerScript.js +++ b/WebKit/chromium/src/js/DebuggerScript.js @@ -32,7 +32,6 @@ var DebuggerScript = {}; DebuggerScript._breakpoints = {}; -DebuggerScript._breakpointsActivated = true; DebuggerScript.PauseOnExceptionsState = { DontPauseOnExceptions : 0, @@ -95,7 +94,7 @@ DebuggerScript.setBreakpoint = function(execState, args) { args.lineNumber = DebuggerScript._webkitToV8LineNumber(args.lineNumber); var breakId = Debug.setScriptBreakPointById(args.scriptId, args.lineNumber, 0 /* column */, args.condition); - if (!args.enabled || !DebuggerScript._breakpointsActivated) + if (!args.enabled) Debug.disableScriptBreakPoint(breakId); var locations = Debug.findBreakPointActualLocations(breakId); @@ -198,14 +197,7 @@ DebuggerScript.clearBreakpoints = function(execState, args) DebuggerScript.setBreakpointsActivated = function(execState, args) { - for (var key in DebuggerScript._breakpoints) { - var breakId = DebuggerScript._breakpoints[key]; - if (args.enabled) - Debug.enableScriptBreakPoint(breakId); - else - Debug.disableScriptBreakPoint(breakId); - } - DebuggerScript._breakpointsActivated = args.enabled; + Debug.debuggerFlags().breakPointsActive.setValue(args.enabled); } DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame) diff --git a/WebKit/chromium/src/js/DevTools.js b/WebKit/chromium/src/js/DevTools.js index 0fd66c9..e3e0204 100644 --- a/WebKit/chromium/src/js/DevTools.js +++ b/WebKit/chromium/src/js/DevTools.js @@ -74,6 +74,7 @@ WebInspector.loaded = function() Preferences.profilerAlwaysEnabled = true; Preferences.canEditScriptSource = true; Preferences.onlineDetectionEnabled = false; + Preferences.domBreakpointsEnabled = true; oldLoaded.call(WebInspector); } diff --git a/WebKit/chromium/tests/RunAllTests.cpp b/WebKit/chromium/tests/RunAllTests.cpp index 0f3f82f..cfcfbee 100644 --- a/WebKit/chromium/tests/RunAllTests.cpp +++ b/WebKit/chromium/tests/RunAllTests.cpp @@ -33,18 +33,15 @@ #include "WebKit.h" #include "WebKitClient.h" - -// WebKitClient has a protected destructor, so we need to subclass. -class DummyWebKitClient : public WebKit::WebKitClient { -}; +#include <webkit/support/webkit_support.h> int main(int argc, char** argv) { - DummyWebKitClient dummyClient; - WebKit::initialize(&dummyClient); - - int result = TestSuite(argc, argv).Run(); - - WebKit::shutdown(); + TestSuite testSuite(argc, argv); + // TestSuite must be created before SetUpTestEnvironment so it performs + // initializations needed by WebKit support. + webkit_support::SetUpTestEnvironmentForUnitTests(); + int result = testSuite.Run(); + webkit_support::TearDownTestEnvironment(); return result; } diff --git a/WebKit/chromium/tests/TilingDataTest.cpp b/WebKit/chromium/tests/TilingDataTest.cpp index 463542b..ec18f01 100755 --- a/WebKit/chromium/tests/TilingDataTest.cpp +++ b/WebKit/chromium/tests/TilingDataTest.cpp @@ -30,7 +30,8 @@ #include "config.h" -#include "GLES2Texture.h" +#include "TilingData.h" + #include <gtest/gtest.h> using namespace WebCore; @@ -220,4 +221,114 @@ TEST(TilingDataTest, tileSizeY) EXPECT_EQ(3, TilingData(5, 12, 12, true).tileSizeY(2)); } +TEST(TilingDataTest, tileSizeX_and_tilePositionX) +{ + // Single tile cases: + EXPECT_EQ(1, TilingData(3, 1, 1, false).tileSizeX(0)); + EXPECT_EQ(0, TilingData(3, 1, 1, false).tilePositionX(0)); + EXPECT_EQ(1, TilingData(3, 1, 100, false).tileSizeX(0)); + EXPECT_EQ(0, TilingData(3, 1, 100, false).tilePositionX(0)); + EXPECT_EQ(3, TilingData(3, 3, 1, false).tileSizeX(0)); + EXPECT_EQ(0, TilingData(3, 3, 1, false).tilePositionX(0)); + EXPECT_EQ(3, TilingData(3, 3, 100, false).tileSizeX(0)); + EXPECT_EQ(0, TilingData(3, 3, 100, false).tilePositionX(0)); + EXPECT_EQ(1, TilingData(3, 1, 1, true).tileSizeX(0)); + EXPECT_EQ(0, TilingData(3, 1, 1, true).tilePositionX(0)); + EXPECT_EQ(1, TilingData(3, 1, 100, true).tileSizeX(0)); + EXPECT_EQ(0, TilingData(3, 1, 100, true).tilePositionX(0)); + EXPECT_EQ(3, TilingData(3, 3, 1, true).tileSizeX(0)); + EXPECT_EQ(0, TilingData(3, 3, 1, true).tilePositionX(0)); + EXPECT_EQ(3, TilingData(3, 3, 100, true).tileSizeX(0)); + EXPECT_EQ(0, TilingData(3, 3, 100, true).tilePositionX(0)); + + // Multiple tiles: + // no border + // positions 0, 3 + EXPECT_EQ(2, TilingData(3, 6, 1, false).numTiles()); + EXPECT_EQ(3, TilingData(3, 6, 1, false).tileSizeX(0)); + EXPECT_EQ(3, TilingData(3, 6, 1, false).tileSizeX(1)); + EXPECT_EQ(0, TilingData(3, 6, 1, false).tilePositionX(0)); + EXPECT_EQ(3, TilingData(3, 6, 1, false).tilePositionX(1)); + EXPECT_EQ(3, TilingData(3, 6, 100, false).tileSizeX(0)); + EXPECT_EQ(3, TilingData(3, 6, 100, false).tileSizeX(1)); + EXPECT_EQ(0, TilingData(3, 6, 100, false).tilePositionX(0)); + EXPECT_EQ(3, TilingData(3, 6, 100, false).tilePositionX(1)); + + // Multiple tiles: + // with border + // positions 0, 2, 3, 4 + EXPECT_EQ(4, TilingData(3, 6, 1, true).numTiles()); + EXPECT_EQ(2, TilingData(3, 6, 1, true).tileSizeX(0)); + EXPECT_EQ(1, TilingData(3, 6, 1, true).tileSizeX(1)); + EXPECT_EQ(1, TilingData(3, 6, 1, true).tileSizeX(2)); + EXPECT_EQ(2, TilingData(3, 6, 1, true).tileSizeX(3)); + EXPECT_EQ(0, TilingData(3, 6, 1, true).tilePositionX(0)); + EXPECT_EQ(2, TilingData(3, 6, 1, true).tilePositionX(1)); + EXPECT_EQ(3, TilingData(3, 6, 1, true).tilePositionX(2)); + EXPECT_EQ(4, TilingData(3, 6, 1, true).tilePositionX(3)); + EXPECT_EQ(2, TilingData(3, 6, 100, true).tileSizeX(0)); + EXPECT_EQ(1, TilingData(3, 6, 100, true).tileSizeX(1)); + EXPECT_EQ(1, TilingData(3, 6, 100, true).tileSizeX(2)); + EXPECT_EQ(2, TilingData(3, 6, 100, true).tileSizeX(3)); + EXPECT_EQ(0, TilingData(3, 6, 100, true).tilePositionX(0)); + EXPECT_EQ(2, TilingData(3, 6, 100, true).tilePositionX(1)); + EXPECT_EQ(3, TilingData(3, 6, 100, true).tilePositionX(2)); + EXPECT_EQ(4, TilingData(3, 6, 100, true).tilePositionX(3)); +} + +TEST(TilingDataTest, tileSizeY_and_tilePositionY) +{ + // Single tile cases: + EXPECT_EQ(1, TilingData(3, 1, 1, false).tileSizeY(0)); + EXPECT_EQ(0, TilingData(3, 1, 1, false).tilePositionY(0)); + EXPECT_EQ(1, TilingData(3, 100, 1, false).tileSizeY(0)); + EXPECT_EQ(0, TilingData(3, 100, 1, false).tilePositionY(0)); + EXPECT_EQ(3, TilingData(3, 1, 3, false).tileSizeY(0)); + EXPECT_EQ(0, TilingData(3, 1, 3, false).tilePositionY(0)); + EXPECT_EQ(3, TilingData(3, 100, 3, false).tileSizeY(0)); + EXPECT_EQ(0, TilingData(3, 100, 3, false).tilePositionY(0)); + EXPECT_EQ(1, TilingData(3, 1, 1, true).tileSizeY(0)); + EXPECT_EQ(0, TilingData(3, 1, 1, true).tilePositionY(0)); + EXPECT_EQ(1, TilingData(3, 100, 1, true).tileSizeY(0)); + EXPECT_EQ(0, TilingData(3, 100, 1, true).tilePositionY(0)); + EXPECT_EQ(3, TilingData(3, 1, 3, true).tileSizeY(0)); + EXPECT_EQ(0, TilingData(3, 1, 3, true).tilePositionY(0)); + EXPECT_EQ(3, TilingData(3, 100, 3, true).tileSizeY(0)); + EXPECT_EQ(0, TilingData(3, 100, 3, true).tilePositionY(0)); + + // Multiple tiles: + // no border + // positions 0, 3 + EXPECT_EQ(2, TilingData(3, 1, 6, false).numTiles()); + EXPECT_EQ(3, TilingData(3, 1, 6, false).tileSizeY(0)); + EXPECT_EQ(3, TilingData(3, 1, 6, false).tileSizeY(1)); + EXPECT_EQ(0, TilingData(3, 1, 6, false).tilePositionY(0)); + EXPECT_EQ(3, TilingData(3, 1, 6, false).tilePositionY(1)); + EXPECT_EQ(3, TilingData(3, 100, 6, false).tileSizeY(0)); + EXPECT_EQ(3, TilingData(3, 100, 6, false).tileSizeY(1)); + EXPECT_EQ(0, TilingData(3, 100, 6, false).tilePositionY(0)); + EXPECT_EQ(3, TilingData(3, 100, 6, false).tilePositionY(1)); + + // Multiple tiles: + // with border + // positions 0, 2, 3, 4 + EXPECT_EQ(4, TilingData(3, 1, 6, true).numTiles()); + EXPECT_EQ(2, TilingData(3, 1, 6, true).tileSizeY(0)); + EXPECT_EQ(1, TilingData(3, 1, 6, true).tileSizeY(1)); + EXPECT_EQ(1, TilingData(3, 1, 6, true).tileSizeY(2)); + EXPECT_EQ(2, TilingData(3, 1, 6, true).tileSizeY(3)); + EXPECT_EQ(0, TilingData(3, 1, 6, true).tilePositionY(0)); + EXPECT_EQ(2, TilingData(3, 1, 6, true).tilePositionY(1)); + EXPECT_EQ(3, TilingData(3, 1, 6, true).tilePositionY(2)); + EXPECT_EQ(4, TilingData(3, 1, 6, true).tilePositionY(3)); + EXPECT_EQ(2, TilingData(3, 100, 6, true).tileSizeY(0)); + EXPECT_EQ(1, TilingData(3, 100, 6, true).tileSizeY(1)); + EXPECT_EQ(1, TilingData(3, 100, 6, true).tileSizeY(2)); + EXPECT_EQ(2, TilingData(3, 100, 6, true).tileSizeY(3)); + EXPECT_EQ(0, TilingData(3, 100, 6, true).tilePositionY(0)); + EXPECT_EQ(2, TilingData(3, 100, 6, true).tilePositionY(1)); + EXPECT_EQ(3, TilingData(3, 100, 6, true).tilePositionY(2)); + EXPECT_EQ(4, TilingData(3, 100, 6, true).tilePositionY(3)); +} + } // namespace diff --git a/WebKit/chromium/tests/WebFrameTest.cpp b/WebKit/chromium/tests/WebFrameTest.cpp new file mode 100644 index 0000000..cf91cb4 --- /dev/null +++ b/WebKit/chromium/tests/WebFrameTest.cpp @@ -0,0 +1,112 @@ +/* + * 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: + * + * * 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 <googleurl/src/gurl.h> +#include <gtest/gtest.h> +#include <webkit/support/webkit_support.h> +#include "WebFrame.h" +#include "WebFrameClient.h" +#include "WebString.h" +#include "WebURL.h" +#include "WebURLRequest.h" +#include "WebURLResponse.h" +#include "WebView.h" + +using namespace WebKit; + +namespace { + +class WebFrameTest : public testing::Test { +public: + WebFrameTest() {} + + virtual void TearDown() + { + webkit_support::UnregisterAllMockedURLs(); + } + + void registerMockedURLLoad(const WebURL& url, const WebURLResponse& response, const WebString& fileName) + { + std::string filePath = webkit_support::GetWebKitRootDir().utf8(); + filePath.append("/WebKit/chromium/tests/data/"); + filePath.append(fileName.utf8()); + webkit_support::RegisterMockedURL(url, response, WebString::fromUTF8(filePath)); + } + + void serveRequests() + { + webkit_support::ServeAsynchronousMockedRequests(); + } +}; + +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])); + } + + // Create and initialize the WebView. + TestWebFrameClient webFrameClient; + WebView* webView = WebView::create(0, 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. + serveRequests(); + + // Now retrieve the frames text and test it only includes visible elements. + std::string content = webView->mainFrame()->contentAsText(1024).utf8(); + EXPECT_NE(std::string::npos, content.find(" visible paragraph")); + EXPECT_NE(std::string::npos, content.find(" visible iframe")); + EXPECT_EQ(std::string::npos, content.find(" invisible pararaph")); + EXPECT_EQ(std::string::npos, content.find(" invisible iframe")); + EXPECT_EQ(std::string::npos, content.find("iframe with zero size")); + + webView->close(); +} + +} diff --git a/WebKit/chromium/tests/data/iframes_test.html b/WebKit/chromium/tests/data/iframes_test.html new file mode 100644 index 0000000..425709b --- /dev/null +++ b/WebKit/chromium/tests/data/iframes_test.html @@ -0,0 +1,9 @@ +<html> + <body> + <iframe src="visible_iframe.html"></iframe> + <iframe width=0 height=0 src="zero_sized_iframe.html"></iframe> + <iframe style="visibility:hidden;" src="invisible_iframe.html"></iframe> + <p>This is a visible paragraph.</p> + <p style="visibility:hidden;">This is an invisible paragraph.</p> + </body> +</html> diff --git a/WebKit/chromium/tests/data/invisible_iframe.html b/WebKit/chromium/tests/data/invisible_iframe.html new file mode 100644 index 0000000..e5686c7 --- /dev/null +++ b/WebKit/chromium/tests/data/invisible_iframe.html @@ -0,0 +1,5 @@ +<html> + <body> + This is an invisible frame. + </body> +</html> diff --git a/WebKit/chromium/tests/data/visible_iframe.html b/WebKit/chromium/tests/data/visible_iframe.html new file mode 100644 index 0000000..291af3d --- /dev/null +++ b/WebKit/chromium/tests/data/visible_iframe.html @@ -0,0 +1,5 @@ +<html> + <body> + This is a visible iframe. + </body> +</html> diff --git a/WebKit/chromium/tests/data/zero_sized_iframe.html b/WebKit/chromium/tests/data/zero_sized_iframe.html new file mode 100644 index 0000000..6728cab --- /dev/null +++ b/WebKit/chromium/tests/data/zero_sized_iframe.html @@ -0,0 +1,5 @@ +<html> + <body> + This is an iframe with zero size. + </body> +</html> |