diff options
author | Shimeng (Simon) Wang <swang@google.com> | 2010-12-07 17:22:45 -0800 |
---|---|---|
committer | Shimeng (Simon) Wang <swang@google.com> | 2010-12-22 14:15:40 -0800 |
commit | 4576aa36e9a9671459299c7963ac95aa94beaea9 (patch) | |
tree | 3863574e050f168c0126ecb47c83319fab0972d8 /WebKit/chromium/src | |
parent | 55323ac613cc31553107b68603cb627264d22bb0 (diff) | |
download | external_webkit-4576aa36e9a9671459299c7963ac95aa94beaea9.zip external_webkit-4576aa36e9a9671459299c7963ac95aa94beaea9.tar.gz external_webkit-4576aa36e9a9671459299c7963ac95aa94beaea9.tar.bz2 |
Merge WebKit at r73109: Initial merge by git.
Change-Id: I61f1a66d9642e3d8405d3ac6ccab2a53421c75d8
Diffstat (limited to 'WebKit/chromium/src')
54 files changed, 777 insertions, 133 deletions
diff --git a/WebKit/chromium/src/AssertMatchingEnums.cpp b/WebKit/chromium/src/AssertMatchingEnums.cpp index 3fffd60..ceeed8d 100644 --- a/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -41,6 +41,8 @@ #include "FileMetadata.h" #include "FontDescription.h" #include "FontSmoothingMode.h" +#include "GeolocationError.h" +#include "GeolocationPosition.h" #include "HTMLInputElement.h" #include "IDBKey.h" #include "MediaPlayer.h" @@ -62,6 +64,8 @@ #include "WebFileInfo.h" #include "WebFileSystem.h" #include "WebFontDescription.h" +#include "WebGeolocationError.h" +#include "WebGeolocationPosition.h" #include "WebIDBKey.h" #include "WebInputElement.h" #include "WebMediaPlayer.h" @@ -383,3 +387,8 @@ COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorInvalidModification, FileError::INVALID COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorQuotaExceeded, FileError::QUOTA_EXCEEDED_ERR); COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorTypeMismatch, FileError::TYPE_MISMATCH_ERR); COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorPathExists, FileError::PATH_EXISTS_ERR); + +#if ENABLE(CLIENT_BASED_GEOLOCATION) +COMPILE_ASSERT_MATCHING_ENUM(WebGeolocationError::ErrorPermissionDenied, GeolocationError::PermissionDenied); +COMPILE_ASSERT_MATCHING_ENUM(WebGeolocationError::ErrorPositionUnavailable, GeolocationError::PositionUnavailable); +#endif diff --git a/WebKit/chromium/src/AssociatedURLLoader.cpp b/WebKit/chromium/src/AssociatedURLLoader.cpp new file mode 100644 index 0000000..f494a0e --- /dev/null +++ b/WebKit/chromium/src/AssociatedURLLoader.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" +#include "AssociatedURLLoader.h" + +#include "WebApplicationCacheHost.h" +#include "WebDataSource.h" +#include "WebFrameImpl.h" +#include "WebKit.h" +#include "WebKitClient.h" +#include "WebURLRequest.h" + +namespace WebKit { + +AssociatedURLLoader::AssociatedURLLoader(PassRefPtr<WebFrameImpl> frameImpl) + : m_frameImpl(frameImpl), + m_realLoader(webKitClient()->createURLLoader()) +{ +} + +AssociatedURLLoader::~AssociatedURLLoader() +{ +} + +void AssociatedURLLoader::loadSynchronously(const WebURLRequest& request, WebURLResponse& response, WebURLError& error, WebData& data) +{ + WebURLRequest requestCopy(request); + prepareRequest(requestCopy); + + m_realLoader->loadSynchronously(requestCopy, response, error, data); +} + +void AssociatedURLLoader::loadAsynchronously(const WebURLRequest& request, WebURLLoaderClient* client) +{ + WebURLRequest requestCopy(request); + prepareRequest(requestCopy); + + m_realLoader->loadAsynchronously(requestCopy, client); +} + +void AssociatedURLLoader::cancel() +{ + m_realLoader->cancel(); +} + +void AssociatedURLLoader::setDefersLoading(bool defersLoading) +{ + m_realLoader->setDefersLoading(defersLoading); +} + +void AssociatedURLLoader::prepareRequest(WebURLRequest& request) +{ + WebApplicationCacheHost* applicationCacheHost = m_frameImpl->dataSource()->applicationCacheHost(); + if (applicationCacheHost) + applicationCacheHost->willStartSubResourceRequest(request); + m_frameImpl->dispatchWillSendRequest(request); +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebIDBFactory.cpp b/WebKit/chromium/src/AssociatedURLLoader.h index 40eff97..4c9f54e 100755..100644 --- a/WebKit/chromium/src/WebIDBFactory.cpp +++ b/WebKit/chromium/src/AssociatedURLLoader.h @@ -28,26 +28,37 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "config.h" -#include "WebIDBFactory.h" +#ifndef AssociatedURLLoader_h +#define AssociatedURLLoader_h -#include "IDBFactoryBackendImpl.h" -#include "WebSecurityOrigin.h" -#include <wtf/UnusedParam.h> - -using namespace WebCore; +#include "WebURLLoader.h" +#include <wtf/OwnPtr.h> +#include <wtf/RefPtr.h> namespace WebKit { -WebString WebIDBFactory::databaseFileName(const WebSecurityOrigin& origin) -{ - return IDBFactoryBackendImpl::databaseFileName(origin.get()); -} +class WebFrameImpl; + +// This class is used to implement WebFrame::createAssociatedURLLoader. +// FIXME: Implement in terms of WebCore::SubresourceLoader. +class AssociatedURLLoader : public WebURLLoader { +public: + AssociatedURLLoader(PassRefPtr<WebFrameImpl>); + ~AssociatedURLLoader(); + + // WebURLLoader methods: + virtual void loadSynchronously(const WebURLRequest&, WebURLResponse&, WebURLError&, WebData&); + virtual void loadAsynchronously(const WebURLRequest&, WebURLLoaderClient*); + virtual void cancel(); + virtual void setDefersLoading(bool); + +private: + void prepareRequest(WebURLRequest&); + + RefPtr<WebFrameImpl> m_frameImpl; + OwnPtr<WebURLLoader> m_realLoader; +}; -WebString WebIDBFactory::databaseFileName(const WebString& name, const WebSecurityOrigin& origin) -{ - UNUSED_PARAM(name); - return databaseFileName(origin); -} +} // namespace WebKit -} +#endif diff --git a/WebKit/chromium/src/ChromeClientImpl.cpp b/WebKit/chromium/src/ChromeClientImpl.cpp index c43a0b0..7b67ede 100644 --- a/WebKit/chromium/src/ChromeClientImpl.cpp +++ b/WebKit/chromium/src/ChromeClientImpl.cpp @@ -61,6 +61,7 @@ #include "ScriptController.h" #include "SearchPopupMenuChromium.h" #include "SecurityOrigin.h" +#include "Settings.h" #if USE(V8) #include "V8Proxy.h" #endif @@ -807,9 +808,25 @@ void ChromeClientImpl::scheduleCompositingLayerSync() m_webView->setRootLayerNeedsDisplay(); } -bool ChromeClientImpl::allowsAcceleratedCompositing() const +ChromeClient::CompositingTriggerFlags ChromeClientImpl::allowedCompositingTriggers() const { - return m_webView->allowsAcceleratedCompositing(); + if (!m_webView->allowsAcceleratedCompositing()) + return 0; + + CompositingTriggerFlags flags = 0; + Settings* settings = m_webView->page()->settings(); + if (settings->acceleratedCompositingFor3DTransformsEnabled()) + flags |= ThreeDTransformTrigger; + if (settings->acceleratedCompositingForVideoEnabled()) + flags |= VideoTrigger; + if (settings->acceleratedCompositingForPluginsEnabled()) + flags |= PluginTrigger; + if (settings->acceleratedCompositingForAnimationEnabled()) + flags |= AnimationTrigger; + if (settings->acceleratedCompositingForCanvasEnabled()) + flags |= CanvasTrigger; + + return flags; } #endif diff --git a/WebKit/chromium/src/ChromeClientImpl.h b/WebKit/chromium/src/ChromeClientImpl.h index 87c1653..b024bc0 100644 --- a/WebKit/chromium/src/ChromeClientImpl.h +++ b/WebKit/chromium/src/ChromeClientImpl.h @@ -152,8 +152,7 @@ public: // to do an eager layout before the drawing. virtual void scheduleCompositingLayerSync(); - // Returns true if accelerated compositing is supported. - virtual bool allowsAcceleratedCompositing() const; + virtual CompositingTriggerFlags allowedCompositingTriggers() const; #endif virtual bool supportsFullscreenForNode(const WebCore::Node*); diff --git a/WebKit/chromium/src/ChromiumBridge.cpp b/WebKit/chromium/src/ChromiumBridge.cpp index 074c982..e7a1305 100644 --- a/WebKit/chromium/src/ChromiumBridge.cpp +++ b/WebKit/chromium/src/ChromiumBridge.cpp @@ -35,6 +35,7 @@ #include "Chrome.h" #include "ChromeClientImpl.h" +#include "WebAudioBus.h" #include "WebClipboard.h" #include "WebCookie.h" #include "WebCookieJar.h" @@ -133,7 +134,7 @@ static WebCookieJar* getCookieJar(const Document* document) WebFrameImpl* frameImpl = WebFrameImpl::fromFrame(document->frame()); if (!frameImpl || !frameImpl->client()) return 0; - WebCookieJar* cookieJar = frameImpl->client()->cookieJar(); + WebCookieJar* cookieJar = frameImpl->client()->cookieJar(frameImpl); if (!cookieJar) cookieJar = webKitClient()->cookieJar(); return cookieJar; @@ -621,6 +622,27 @@ PassRefPtr<Image> ChromiumBridge::loadPlatformImageResource(const char* name) return image; } +#if ENABLE(WEB_AUDIO) + +PassOwnPtr<AudioBus> ChromiumBridge::loadPlatformAudioResource(const char* name, double sampleRate) +{ + const WebData& resource = webKitClient()->loadResource(name); + if (resource.isEmpty()) + return 0; + + return decodeAudioFileData(resource.data(), resource.size(), sampleRate); +} + +PassOwnPtr<AudioBus> ChromiumBridge::decodeAudioFileData(const char* data, size_t size, double sampleRate) +{ + WebAudioBus webAudioBus; + if (webKitClient()->decodeAudioFileData(&webAudioBus, data, size, sampleRate)) + return webAudioBus.release(); + return 0; +} + +#endif // ENABLE(WEB_AUDIO) + // Sandbox -------------------------------------------------------------------- bool ChromiumBridge::sandboxEnabled() diff --git a/WebKit/chromium/src/EditorClientImpl.cpp b/WebKit/chromium/src/EditorClientImpl.cpp index bc1d206..6f1739f 100644 --- a/WebKit/chromium/src/EditorClientImpl.cpp +++ b/WebKit/chromium/src/EditorClientImpl.cpp @@ -929,7 +929,8 @@ bool EditorClientImpl::spellingUIIsShowing() return false; } -void EditorClientImpl::getGuessesForWord(const String&, +void EditorClientImpl::getGuessesForWord(const String& word, + const String& context, WTF::Vector<String>& guesses) { notImplemented(); diff --git a/WebKit/chromium/src/EditorClientImpl.h b/WebKit/chromium/src/EditorClientImpl.h index b05a592..a194399 100644 --- a/WebKit/chromium/src/EditorClientImpl.h +++ b/WebKit/chromium/src/EditorClientImpl.h @@ -107,6 +107,7 @@ public: virtual void showSpellingUI(bool show); virtual bool spellingUIIsShowing(); virtual void getGuessesForWord(const WTF::String& word, + const WTF::String& context, WTF::Vector<WTF::String>& guesses); virtual void willSetInputMethodState(); virtual void setInputMethodState(bool enabled); diff --git a/WebKit/chromium/src/Extensions3DChromium.cpp b/WebKit/chromium/src/Extensions3DChromium.cpp index c36040b..fe04986 100644 --- a/WebKit/chromium/src/Extensions3DChromium.cpp +++ b/WebKit/chromium/src/Extensions3DChromium.cpp @@ -50,8 +50,7 @@ bool Extensions3DChromium::supports(const String& name) int Extensions3DChromium::getGraphicsResetStatusARB() { - // FIXME: implement this in GraphicsContext3DInternal / WebGraphicsContext3DInternal. - return GraphicsContext3D::NO_ERROR; + return m_internal->isContextLost() ? static_cast<int>(Extensions3D::UNKNOWN_CONTEXT_RESET_ARB) : static_cast<int>(GraphicsContext3D::NO_ERROR); } void* Extensions3DChromium::mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access) diff --git a/WebKit/chromium/src/ExternalPopupMenu.cpp b/WebKit/chromium/src/ExternalPopupMenu.cpp index 0f208fb..f7f9862 100644 --- a/WebKit/chromium/src/ExternalPopupMenu.cpp +++ b/WebKit/chromium/src/ExternalPopupMenu.cpp @@ -65,6 +65,8 @@ void ExternalPopupMenu::show(const IntRect& rect, FrameView* v, int index) WebPopupMenuInfo info; getPopupMenuInfo(&info); + if (info.items.isEmpty()) + return; m_webExternalPopupMenu = m_webViewClient->createExternalPopupMenu(info, this); m_webExternalPopupMenu->show(v->contentsToWindow(rect)); diff --git a/WebKit/chromium/src/GraphicsContext3DChromium.cpp b/WebKit/chromium/src/GraphicsContext3DChromium.cpp index 8cfe8c0..cc0c5bc 100644 --- a/WebKit/chromium/src/GraphicsContext3DChromium.cpp +++ b/WebKit/chromium/src/GraphicsContext3DChromium.cpp @@ -246,6 +246,11 @@ void GraphicsContext3DInternal::reshape(int width, int height) #endif // PLATFORM(CG) } +bool GraphicsContext3DInternal::isContextLost() +{ + return m_impl->isContextLost(); +} + // Macros to assist in delegating from GraphicsContext3DInternal to // WebGraphicsContext3D. diff --git a/WebKit/chromium/src/GraphicsContext3DInternal.h b/WebKit/chromium/src/GraphicsContext3DInternal.h index 4453d28..220cbb8 100644 --- a/WebKit/chromium/src/GraphicsContext3DInternal.h +++ b/WebKit/chromium/src/GraphicsContext3DInternal.h @@ -140,6 +140,8 @@ public: unsigned long getError(); + bool isContextLost(); + void getFloatv(unsigned long pname, float* value); void getFramebufferAttachmentParameteriv(unsigned long target, unsigned long attachment, unsigned long pname, int* value); diff --git a/WebKit/chromium/src/IDBDatabaseProxy.cpp b/WebKit/chromium/src/IDBDatabaseProxy.cpp index 4fecf1b..685f53c 100644 --- a/WebKit/chromium/src/IDBDatabaseProxy.cpp +++ b/WebKit/chromium/src/IDBDatabaseProxy.cpp @@ -71,9 +71,9 @@ String IDBDatabaseProxy::version() const return m_webIDBDatabase->version(); } -PassRefPtr<DOMStringList> IDBDatabaseProxy::objectStores() const +PassRefPtr<DOMStringList> IDBDatabaseProxy::objectStoreNames() const { - return m_webIDBDatabase->objectStores(); + return m_webIDBDatabase->objectStoreNames(); } PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseProxy::createObjectStore(const String& name, const String& keyPath, bool autoIncrement, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) @@ -87,12 +87,12 @@ PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseProxy::createObjectStore(c return IDBObjectStoreProxy::create(objectStore); } -void IDBDatabaseProxy::removeObjectStore(const String& name, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBDatabaseProxy::deleteObjectStore(const String& name, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction); - m_webIDBDatabase->removeObjectStore(name, *transactionProxy->getWebIDBTransaction(), ec); + m_webIDBDatabase->deleteObjectStore(name, *transactionProxy->getWebIDBTransaction(), ec); } void IDBDatabaseProxy::setVersion(const String& version, PassRefPtr<IDBCallbacks> callbacks, ExceptionCode& ec) @@ -104,6 +104,10 @@ PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseProxy::transaction(DOMStri { WebKit::WebDOMStringList names(storeNames); WebKit::WebIDBTransaction* transaction = m_webIDBDatabase->transaction(names, mode, timeout, ec); + if (!transaction) { + ASSERT(ec); + return 0; + } return IDBTransactionBackendProxy::create(transaction); } diff --git a/WebKit/chromium/src/IDBDatabaseProxy.h b/WebKit/chromium/src/IDBDatabaseProxy.h index 5d20073..84693f2 100644 --- a/WebKit/chromium/src/IDBDatabaseProxy.h +++ b/WebKit/chromium/src/IDBDatabaseProxy.h @@ -45,10 +45,10 @@ public: virtual String name() const; virtual String description() const; virtual String version() const; - virtual PassRefPtr<DOMStringList> objectStores() const; + virtual PassRefPtr<DOMStringList> objectStoreNames() const; virtual PassRefPtr<IDBObjectStoreBackendInterface> createObjectStore(const String& name, const String& keyPath, bool autoIncrement, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void removeObjectStore(const String& name, IDBTransactionBackendInterface*, ExceptionCode&); + virtual void deleteObjectStore(const String& name, IDBTransactionBackendInterface*, ExceptionCode&); virtual void setVersion(const String& version, PassRefPtr<IDBCallbacks>, ExceptionCode&); virtual PassRefPtr<IDBTransactionBackendInterface> transaction(DOMStringList* storeNames, unsigned short mode, unsigned long timeout, ExceptionCode&); virtual void close(); diff --git a/WebKit/chromium/src/IDBFactoryBackendProxy.cpp b/WebKit/chromium/src/IDBFactoryBackendProxy.cpp index 2e65246..67504a3 100755 --- a/WebKit/chromium/src/IDBFactoryBackendProxy.cpp +++ b/WebKit/chromium/src/IDBFactoryBackendProxy.cpp @@ -59,10 +59,10 @@ IDBFactoryBackendProxy::~IDBFactoryBackendProxy() { } -void IDBFactoryBackendProxy::open(const String& name, const String& description, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame, const String& dataDir, int64_t maximumSize) +void IDBFactoryBackendProxy::open(const String& name, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame, const String& dataDir, int64_t maximumSize) { WebKit::WebFrame* webFrame = WebKit::WebFrameImpl::fromFrame(frame); - m_webIDBFactory->open(name, description, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir, maximumSize); + m_webIDBFactory->open(name, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir, maximumSize); } } // namespace WebCore diff --git a/WebKit/chromium/src/IDBFactoryBackendProxy.h b/WebKit/chromium/src/IDBFactoryBackendProxy.h index 0a55b59..5950a68 100755 --- a/WebKit/chromium/src/IDBFactoryBackendProxy.h +++ b/WebKit/chromium/src/IDBFactoryBackendProxy.h @@ -45,7 +45,7 @@ public: virtual ~IDBFactoryBackendProxy(); PassRefPtr<DOMStringList> databases(void) const; - virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir, int64_t maximumSize); + virtual void open(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir, int64_t maximumSize); private: IDBFactoryBackendProxy(); diff --git a/WebKit/chromium/src/IDBObjectStoreProxy.cpp b/WebKit/chromium/src/IDBObjectStoreProxy.cpp index e537718..e03cdc8 100755 --- a/WebKit/chromium/src/IDBObjectStoreProxy.cpp +++ b/WebKit/chromium/src/IDBObjectStoreProxy.cpp @@ -88,12 +88,12 @@ void IDBObjectStoreProxy::put(PassRefPtr<SerializedScriptValue> value, PassRefPt m_webIDBObjectStore->put(value, key, addOnly, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } -void IDBObjectStoreProxy::remove(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBObjectStoreProxy::deleteFunction(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction); - m_webIDBObjectStore->remove(key, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); + m_webIDBObjectStore->deleteFunction(key, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreProxy::createIndex(const String& name, const String& keyPath, bool unique, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) @@ -115,12 +115,12 @@ PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreProxy::index(const String& na return IDBIndexBackendProxy::create(index); } -void IDBObjectStoreProxy::removeIndex(const String& name, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBObjectStoreProxy::deleteIndex(const String& name, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction); - m_webIDBObjectStore->removeIndex(name, *transactionProxy->getWebIDBTransaction(), ec); + m_webIDBObjectStore->deleteIndex(name, *transactionProxy->getWebIDBTransaction(), ec); } void IDBObjectStoreProxy::openCursor(PassRefPtr<IDBKeyRange> range, unsigned short direction, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) diff --git a/WebKit/chromium/src/IDBObjectStoreProxy.h b/WebKit/chromium/src/IDBObjectStoreProxy.h index 1e19279..348c794 100755 --- a/WebKit/chromium/src/IDBObjectStoreProxy.h +++ b/WebKit/chromium/src/IDBObjectStoreProxy.h @@ -48,11 +48,11 @@ public: virtual void get(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); virtual void put(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, bool addOnly, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void remove(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); + virtual void deleteFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); PassRefPtr<IDBIndexBackendInterface> createIndex(const String& name, const String& keyPath, bool unique, IDBTransactionBackendInterface*, ExceptionCode&); PassRefPtr<IDBIndexBackendInterface> index(const String& name, ExceptionCode&); - void removeIndex(const String& name, IDBTransactionBackendInterface*, ExceptionCode&); + void deleteIndex(const String& name, IDBTransactionBackendInterface*, ExceptionCode&); virtual void openCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); diff --git a/WebKit/chromium/src/IDBTransactionBackendProxy.cpp b/WebKit/chromium/src/IDBTransactionBackendProxy.cpp index 7a88b13..95c90d5 100644 --- a/WebKit/chromium/src/IDBTransactionBackendProxy.cpp +++ b/WebKit/chromium/src/IDBTransactionBackendProxy.cpp @@ -45,17 +45,16 @@ PassRefPtr<IDBTransactionBackendInterface> IDBTransactionBackendProxy::create(Pa IDBTransactionBackendProxy::IDBTransactionBackendProxy(PassOwnPtr<WebKit::WebIDBTransaction> transaction) : m_webIDBTransaction(transaction) { - if (!m_webIDBTransaction) - m_webIDBTransaction = adoptPtr(new WebKit::WebIDBTransaction()); + ASSERT(m_webIDBTransaction); } IDBTransactionBackendProxy::~IDBTransactionBackendProxy() { } -PassRefPtr<IDBObjectStoreBackendInterface> IDBTransactionBackendProxy::objectStore(const String& name) +PassRefPtr<IDBObjectStoreBackendInterface> IDBTransactionBackendProxy::objectStore(const String& name, ExceptionCode& ec) { - WebKit::WebIDBObjectStore* objectStore = m_webIDBTransaction->objectStore(name); + WebKit::WebIDBObjectStore* objectStore = m_webIDBTransaction->objectStore(name, ec); if (!objectStore) return 0; return IDBObjectStoreProxy::create(objectStore); diff --git a/WebKit/chromium/src/IDBTransactionBackendProxy.h b/WebKit/chromium/src/IDBTransactionBackendProxy.h index 0bf84da..96d7293 100644 --- a/WebKit/chromium/src/IDBTransactionBackendProxy.h +++ b/WebKit/chromium/src/IDBTransactionBackendProxy.h @@ -42,7 +42,7 @@ public: static PassRefPtr<IDBTransactionBackendInterface> create(PassOwnPtr<WebKit::WebIDBTransaction>); virtual ~IDBTransactionBackendProxy(); - virtual PassRefPtr<IDBObjectStoreBackendInterface> objectStore(const String& name); + virtual PassRefPtr<IDBObjectStoreBackendInterface> objectStore(const String& name, ExceptionCode&); virtual unsigned short mode() const; virtual void abort(); virtual bool scheduleTask(PassOwnPtr<ScriptExecutionContext::Task>, PassOwnPtr<ScriptExecutionContext::Task>); diff --git a/WebKit/chromium/src/LocalizedStrings.cpp b/WebKit/chromium/src/LocalizedStrings.cpp index 947e732..ab14009 100644 --- a/WebKit/chromium/src/LocalizedStrings.cpp +++ b/WebKit/chromium/src/LocalizedStrings.cpp @@ -43,6 +43,7 @@ #include <wtf/text/WTFString.h> using WebKit::WebLocalizedString; +using WebKit::WebString; namespace WebCore { @@ -51,9 +52,14 @@ static String query(WebLocalizedString::Name name) return WebKit::webKitClient()->queryLocalizedString(name); } -static String query(WebLocalizedString::Name name, int numericValue) +static String query(WebLocalizedString::Name name, const WebString& parameter) { - return WebKit::webKitClient()->queryLocalizedString(name, numericValue); + return WebKit::webKitClient()->queryLocalizedString(name, parameter); +} + +static String query(WebLocalizedString::Name name, const WebString& parameter1, const WebString& parameter2) +{ + return WebKit::webKitClient()->queryLocalizedString(name, parameter1, parameter2); } String searchableIndexIntroduction() @@ -94,6 +100,7 @@ String searchMenuRecentSearchesText() { return query(WebLocalizedString::SearchMenuRecentSearchesText); } + String searchMenuClearRecentSearchesText() { return query(WebLocalizedString::SearchMenuClearRecentSearchesText); @@ -190,7 +197,7 @@ String crashedPluginText() String multipleFileUploadText(unsigned numberOfFiles) { - return query(WebLocalizedString::MultipleFileUploadText, numberOfFiles); + return query(WebLocalizedString::MultipleFileUploadText, String::number(numberOfFiles)); } // Used in FTPDirectoryDocument.cpp @@ -299,6 +306,31 @@ String validationMessageValueMissingText() return query(WebLocalizedString::ValidationValueMissing); } +String validationMessageValueMissingForCheckboxText() +{ + return query(WebLocalizedString::ValidationValueMissingForCheckbox); +} + +String validationMessageValueMissingForFileText() +{ + return query(WebLocalizedString::ValidationValueMissingForFile); +} + +String validationMessageValueMissingForMultipleFileText() +{ + return query(WebLocalizedString::ValidationValueMissingForMultipleFile); +} + +String validationMessageValueMissingForRadioText() +{ + return query(WebLocalizedString::ValidationValueMissingForRadio); +} + +String validationMessageValueMissingForSelectText() +{ + return query(WebLocalizedString::ValidationValueMissingForSelect); +} + String validationMessageTypeMismatchText() { return query(WebLocalizedString::ValidationTypeMismatch); @@ -324,28 +356,24 @@ String validationMessagePatternMismatchText() return query(WebLocalizedString::ValidationPatternMismatch); } -String validationMessageTooLongText(int, int) +String validationMessageTooLongText(int valueLength, int maxLength) { - // FIXME: pass the arguments. - return query(WebLocalizedString::ValidationTooLong); + return query(WebLocalizedString::ValidationTooLong, String::number(valueLength), String::number(maxLength)); } -String validationMessageRangeUnderflowText(const String&) +String validationMessageRangeUnderflowText(const String& minimum) { - // FIXME: pass the arguments. - return query(WebLocalizedString::ValidationRangeUnderflow); + return query(WebLocalizedString::ValidationRangeUnderflow, minimum); } -String validationMessageRangeOverflowText(const String&) +String validationMessageRangeOverflowText(const String& maximum) { - // FIXME: pass the arguments. - return query(WebLocalizedString::ValidationRangeOverflow); + return query(WebLocalizedString::ValidationRangeOverflow, maximum); } -String validationMessageStepMismatchText(const String&, const String&) +String validationMessageStepMismatchText(const String& base, const String& step) { - // FIXME: pass the arguments. - return query(WebLocalizedString::ValidationStepMismatch); + return query(WebLocalizedString::ValidationStepMismatch, base, step); } } // namespace WebCore diff --git a/WebKit/chromium/src/WebAudioBus.cpp b/WebKit/chromium/src/WebAudioBus.cpp new file mode 100644 index 0000000..ceccafc --- /dev/null +++ b/WebKit/chromium/src/WebAudioBus.cpp @@ -0,0 +1,130 @@ +/* + * 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 INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebAudioBus.h" + +#if ENABLE(WEB_AUDIO) +#include "AudioBus.h" +#else +namespace WebCore { +class AudioBus { +}; +} // namespace WebCore +#endif + +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> + +using namespace WebCore; + +namespace WebKit { + +class WebAudioBusPrivate : public AudioBus { +}; + +WebAudioBus::~WebAudioBus() +{ +#if ENABLE(WEB_AUDIO) + delete m_private; + m_private = 0; +#endif +} + +void WebAudioBus::initialize(unsigned numberOfChannels, size_t length, double sampleRate) +{ +#if ENABLE(WEB_AUDIO) + AudioBus* audioBus = new AudioBus(numberOfChannels, length); + audioBus->setSampleRate(sampleRate); + + if (m_private) + delete m_private; + m_private = static_cast<WebAudioBusPrivate*>(audioBus); +#else + ASSERT_NOT_REACHED(); +#endif +} + +unsigned WebAudioBus::numberOfChannels() const +{ +#if ENABLE(WEB_AUDIO) + if (!m_private) + return 0; + return m_private->numberOfChannels(); +#else + ASSERT_NOT_REACHED(); + return 0; +#endif +} + +size_t WebAudioBus::length() const +{ +#if ENABLE(WEB_AUDIO) + if (!m_private) + return 0; + return m_private->length(); +#else + ASSERT_NOT_REACHED(); + return 0; +#endif +} + +double WebAudioBus::sampleRate() const +{ +#if ENABLE(WEB_AUDIO) + if (!m_private) + return 0; + return m_private->sampleRate(); +#else + ASSERT_NOT_REACHED(); + return 0; +#endif +} + +float* WebAudioBus::channelData(unsigned channelIndex) +{ +#if ENABLE(WEB_AUDIO) + if (!m_private) + return 0; + ASSERT(channelIndex < numberOfChannels()); + return m_private->channel(channelIndex)->data(); +#else + ASSERT_NOT_REACHED(); + return 0; +#endif +} + +PassOwnPtr<AudioBus> WebAudioBus::release() +{ +#if ENABLE(WEB_AUDIO) + OwnPtr<AudioBus> audioBus(adoptPtr(static_cast<AudioBus*>(m_private))); + m_private = 0; + return audioBus.release(); +#else + ASSERT_NOT_REACHED(); + return 0; +#endif +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebBindings.cpp b/WebKit/chromium/src/WebBindings.cpp index d0a20d3..0882e38 100644 --- a/WebKit/chromium/src/WebBindings.cpp +++ b/WebKit/chromium/src/WebBindings.cpp @@ -328,7 +328,7 @@ static NPObject* makeStringArrayImpl(const WebVector<WebString>& data) v8::HandleScope handleScope; v8::Handle<v8::Array> result = v8::Array::New(data.size()); for (size_t i = 0; i < data.size(); ++i) - result->Set(i, data[i].data() ? v8::String::New(reinterpret_cast<const uint16_t*>((data[i].data()))) : v8::String::New("")); + result->Set(i, data[i].data() ? v8::String::New(reinterpret_cast<const uint16_t*>((data[i].data())), data[i].length()) : v8::String::New("")); WebCore::DOMWindow* window = WebCore::V8Proxy::retrieveWindow(WebCore::V8Proxy::currentContext()); return npCreateV8ScriptObject(0, result, window); diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp index 880adb4..9f4ce87 100644 --- a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp +++ b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp @@ -33,6 +33,7 @@ #include "DebuggerAgentImpl.h" #include "DebuggerAgentManager.h" +#include "ExceptionCode.h" #include "InjectedScriptHost.h" #include "InspectorBackendDispatcher.h" #include "InspectorController.h" @@ -44,6 +45,7 @@ #include "ResourceResponse.h" #include "ScriptDebugServer.h" #include "V8Binding.h" +#include "V8Node.h" #include "V8Proxy.h" #include "V8Utilities.h" #include "WebDataSource.h" @@ -74,6 +76,7 @@ using WebCore::ResourceRequest; using WebCore::ResourceResponse; using WTF::String; using WebCore::V8DOMWrapper; +using WebCore::V8Node; using WebCore::V8Proxy; namespace WebKit { @@ -243,6 +246,14 @@ void WebDevToolsAgentImpl::inspectElementAt(const WebPoint& point) m_webViewImpl->inspectElementAt(point); } +void WebDevToolsAgentImpl::inspectNode(v8::Handle<v8::Value> node) +{ + if (!V8Node::HasInstance(node)) + V8Proxy::setDOMException(WebCore::TYPE_MISMATCH_ERR); + else + inspectorController()->inspect(V8Node::toNative(v8::Handle<v8::Object>::Cast(node))); +} + void WebDevToolsAgentImpl::setRuntimeProperty(const WebString& name, const WebString& value) { if (name == kApuAgentFeatureName) diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.h b/WebKit/chromium/src/WebDevToolsAgentImpl.h index feb4bdd..487cf0c 100644 --- a/WebKit/chromium/src/WebDevToolsAgentImpl.h +++ b/WebKit/chromium/src/WebDevToolsAgentImpl.h @@ -75,6 +75,7 @@ public: virtual void didNavigate(); virtual void dispatchOnInspectorBackend(const WebString& message); virtual void inspectElementAt(const WebPoint& point); + virtual void inspectNode(v8::Handle<v8::Value> node); virtual void evaluateInWebInspector(long callId, const WebString& script); virtual void setRuntimeProperty(const WebString& name, const WebString& value); virtual void setTimelineProfilingEnabled(bool enable); diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp index adaab61..4422e1b 100644 --- a/WebKit/chromium/src/WebFrameImpl.cpp +++ b/WebKit/chromium/src/WebFrameImpl.cpp @@ -71,6 +71,7 @@ #include "config.h" #include "WebFrameImpl.h" +#include "AssociatedURLLoader.h" #include "Chrome.h" #include "ChromiumBridge.h" #include "ClipboardUtilitiesChromium.h" @@ -1037,6 +1038,11 @@ void WebFrameImpl::dispatchWillSendRequest(WebURLRequest& request) 0, 0, request.toMutableResourceRequest(), response); } +WebURLLoader* WebFrameImpl::createAssociatedURLLoader() +{ + return new AssociatedURLLoader(this); +} + void WebFrameImpl::commitDocumentData(const char* data, size_t length) { m_frame->loader()->documentLoader()->commitData(data, length); diff --git a/WebKit/chromium/src/WebFrameImpl.h b/WebKit/chromium/src/WebFrameImpl.h index 35158a1..52d9db4 100644 --- a/WebKit/chromium/src/WebFrameImpl.h +++ b/WebKit/chromium/src/WebFrameImpl.h @@ -128,6 +128,7 @@ public: virtual bool isViewSourceModeEnabled() const; virtual void setReferrerForRequest(WebURLRequest&, const WebURL& referrer); virtual void dispatchWillSendRequest(WebURLRequest&); + virtual WebURLLoader* createAssociatedURLLoader(); virtual void commitDocumentData(const char* data, size_t length); virtual unsigned unloadListenerCount() const; virtual bool isProcessingUserGesture() const; diff --git a/WebKit/chromium/src/WebGeolocationError.cpp b/WebKit/chromium/src/WebGeolocationError.cpp new file mode 100644 index 0000000..9acb676 --- /dev/null +++ b/WebKit/chromium/src/WebGeolocationError.cpp @@ -0,0 +1,67 @@ +/* + * 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 "WebGeolocationError.h" + +#include "GeolocationError.h" +#include "WebString.h" + +using namespace WebCore; + +namespace WebKit { + +void WebGeolocationError::assign(Error code, const WebString& message) +{ + m_private = GeolocationError::create(static_cast<GeolocationError::ErrorCode>(code), message); +} + +void WebGeolocationError::assign(const WebGeolocationError& other) +{ + m_private = other.m_private; +} + +void WebGeolocationError::reset() +{ + m_private.reset(); +} + +WebGeolocationError::WebGeolocationError(PassRefPtr<GeolocationError> error) +{ + m_private = error; +} + +WebGeolocationError& WebGeolocationError::operator=(PassRefPtr<GeolocationError> error) +{ + m_private = error; + return *this; +} + +WebGeolocationError::operator PassRefPtr<GeolocationError>() const +{ + return m_private.get(); +} + +} diff --git a/WebKit/chromium/src/WebGeolocationPosition.cpp b/WebKit/chromium/src/WebGeolocationPosition.cpp new file mode 100644 index 0000000..75b3306 --- /dev/null +++ b/WebKit/chromium/src/WebGeolocationPosition.cpp @@ -0,0 +1,61 @@ +/* + * 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 "WebGeolocationPosition.h" + +#include "GeolocationPosition.h" + +using namespace WebCore; + +namespace WebKit { + +void WebGeolocationPosition::assign(double timestamp, double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed) +{ + m_private = GeolocationPosition::create(timestamp, latitude, longitude, accuracy, providesAltitude, altitude, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed); +} + +void WebGeolocationPosition::assign(const WebGeolocationPosition& other) +{ + m_private = other.m_private; +} + +void WebGeolocationPosition::reset() +{ + m_private.reset(); +} + +WebGeolocationPosition& WebGeolocationPosition::operator=(PassRefPtr<GeolocationPosition> position) +{ + m_private = position; + return *this; +} + +WebGeolocationPosition::operator PassRefPtr<GeolocationPosition>() const +{ + return m_private.get(); +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp index bd070c6..9a74601 100644 --- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp +++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp @@ -439,20 +439,29 @@ void WebGraphicsContext3DDefaultImpl::reshape(int width, int height) } // Initialize renderbuffers to 0. - GLboolean colorMask[] = {GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE}, depthMask = GL_TRUE, stencilMask = GL_TRUE; + GLfloat clearColor[] = {0, 0, 0, 0}, clearDepth = 0; + GLint clearStencil = 0; + GLboolean colorMask[] = {GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE}, depthMask = GL_TRUE; + GLuint stencilMask = 0xffffffff; GLboolean isScissorEnabled = GL_FALSE; GLboolean isDitherEnabled = GL_FALSE; GLbitfield clearMask = GL_COLOR_BUFFER_BIT; + glGetFloatv(GL_COLOR_CLEAR_VALUE, clearColor); + glClearColor(0, 0, 0, 0); glGetBooleanv(GL_COLOR_WRITEMASK, colorMask); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); if (m_attributes.depth) { + glGetFloatv(GL_DEPTH_CLEAR_VALUE, &clearDepth); + glClearDepth(1); glGetBooleanv(GL_DEPTH_WRITEMASK, &depthMask); glDepthMask(GL_TRUE); clearMask |= GL_DEPTH_BUFFER_BIT; } if (m_attributes.stencil) { - glGetBooleanv(GL_STENCIL_WRITEMASK, &stencilMask); - glStencilMask(GL_TRUE); + glGetIntegerv(GL_STENCIL_CLEAR_VALUE, &clearStencil); + glClearStencil(0); + glGetIntegerv(GL_STENCIL_WRITEMASK, reinterpret_cast<GLint*>(&stencilMask)); + glStencilMaskSeparate(GL_FRONT, 0xffffffff); clearMask |= GL_STENCIL_BUFFER_BIT; } isScissorEnabled = glIsEnabled(GL_SCISSOR_TEST); @@ -462,11 +471,16 @@ void WebGraphicsContext3DDefaultImpl::reshape(int width, int height) glClear(clearMask); + glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]); glColorMask(colorMask[0], colorMask[1], colorMask[2], colorMask[3]); - if (m_attributes.depth) + if (m_attributes.depth) { + glClearDepth(clearDepth); glDepthMask(depthMask); - if (m_attributes.stencil) - glStencilMask(stencilMask); + } + if (m_attributes.stencil) { + glClearStencil(clearStencil); + glStencilMaskSeparate(GL_FRONT, stencilMask); + } if (isScissorEnabled) glEnable(GL_SCISSOR_TEST); else @@ -973,6 +987,11 @@ unsigned long WebGraphicsContext3DDefaultImpl::getError() return glGetError(); } +bool WebGraphicsContext3DDefaultImpl::isContextLost() +{ + return false; +} + DELEGATE_TO_GL_2(getFloatv, GetFloatv, unsigned long, float*) void WebGraphicsContext3DDefaultImpl::getFramebufferAttachmentParameteriv(unsigned long target, unsigned long attachment, diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h index e865710..32e3671 100644 --- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h +++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h @@ -145,6 +145,8 @@ public: virtual unsigned long getError(); + virtual bool isContextLost(); + virtual void getFloatv(unsigned long pname, float* value); virtual void getFramebufferAttachmentParameteriv(unsigned long target, unsigned long attachment, unsigned long pname, int* value); diff --git a/WebKit/chromium/src/WebResourceRawHeaders.cpp b/WebKit/chromium/src/WebHTTPLoadInfo.cpp index 259365e..876a489 100644 --- a/WebKit/chromium/src/WebResourceRawHeaders.cpp +++ b/WebKit/chromium/src/WebHTTPLoadInfo.cpp @@ -29,9 +29,9 @@ */ #include "config.h" -#include "WebResourceRawHeaders.h" +#include "WebHTTPLoadInfo.h" -#include "ResourceRawHeaders.h" +#include "ResourceLoadInfo.h" #include "ResourceResponse.h" #include "WebHTTPHeaderVisitor.h" #include "WebString.h" @@ -40,31 +40,55 @@ using namespace WebCore; namespace WebKit { -void WebResourceRawHeaders::initialize() +void WebHTTPLoadInfo::initialize() { - m_private = adoptRef(new ResourceRawHeaders()); + m_private = adoptRef(new ResourceLoadInfo()); } -void WebResourceRawHeaders::reset() +void WebHTTPLoadInfo::reset() { m_private.reset(); } -void WebResourceRawHeaders::assign(const WebResourceRawHeaders& r) +void WebHTTPLoadInfo::assign(const WebHTTPLoadInfo& r) { m_private = r.m_private; } -WebResourceRawHeaders::WebResourceRawHeaders(WTF::PassRefPtr<WebCore::ResourceRawHeaders> value) +WebHTTPLoadInfo::WebHTTPLoadInfo(WTF::PassRefPtr<WebCore::ResourceLoadInfo> value) { m_private = value; } -WebResourceRawHeaders::operator WTF::PassRefPtr<WebCore::ResourceRawHeaders>() const +WebHTTPLoadInfo::operator WTF::PassRefPtr<WebCore::ResourceLoadInfo>() const { return m_private.get(); } +int WebHTTPLoadInfo::httpStatusCode() const +{ + ASSERT(!m_private.isNull()); + return m_private->httpStatusCode; +} + +void WebHTTPLoadInfo::setHTTPStatusCode(int statusCode) +{ + ASSERT(!m_private.isNull()); + m_private->httpStatusCode = statusCode; +} + +WebString WebHTTPLoadInfo::httpStatusText() const +{ + ASSERT(!m_private.isNull()); + return m_private->httpStatusText; +} + +void WebHTTPLoadInfo::setHTTPStatusText(const WebString& statusText) +{ + ASSERT(!m_private.isNull()); + m_private->httpStatusText = statusText; +} + static void addHeader(HTTPHeaderMap* map, const WebString& name, const WebString& value) { pair<HTTPHeaderMap::iterator, bool> result = map->add(name, value); @@ -72,13 +96,13 @@ static void addHeader(HTTPHeaderMap* map, const WebString& name, const WebString result.first->second += String("\n") + value; } -void WebResourceRawHeaders::addRequestHeader(const WebString& name, const WebString& value) +void WebHTTPLoadInfo::addRequestHeader(const WebString& name, const WebString& value) { ASSERT(!m_private.isNull()); addHeader(&m_private->requestHeaders, name, value); } -void WebResourceRawHeaders::addResponseHeader(const WebString& name, const WebString& value) +void WebHTTPLoadInfo::addResponseHeader(const WebString& name, const WebString& value) { ASSERT(!m_private.isNull()); addHeader(&m_private->responseHeaders, name, value); diff --git a/WebKit/chromium/src/WebIDBDatabaseImpl.cpp b/WebKit/chromium/src/WebIDBDatabaseImpl.cpp index 2d95e21..fa7a200 100644 --- a/WebKit/chromium/src/WebIDBDatabaseImpl.cpp +++ b/WebKit/chromium/src/WebIDBDatabaseImpl.cpp @@ -54,32 +54,29 @@ WebString WebIDBDatabaseImpl::name() const return m_databaseBackend->name(); } -WebString WebIDBDatabaseImpl::description() const -{ - return m_databaseBackend->description(); -} - WebString WebIDBDatabaseImpl::version() const { return m_databaseBackend->version(); } -WebDOMStringList WebIDBDatabaseImpl::objectStores() const +WebDOMStringList WebIDBDatabaseImpl::objectStoreNames() const { - return m_databaseBackend->objectStores(); + return m_databaseBackend->objectStoreNames(); } WebIDBObjectStore* WebIDBDatabaseImpl::createObjectStore(const WebString& name, const WebString& keyPath, bool autoIncrement, const WebIDBTransaction& transaction, WebExceptionCode& ec) { RefPtr<IDBObjectStoreBackendInterface> objectStore = m_databaseBackend->createObjectStore(name, keyPath, autoIncrement, transaction.getIDBTransactionBackendInterface(), ec); - if (!objectStore) + if (!objectStore) { + ASSERT(ec); return 0; + } return new WebIDBObjectStoreImpl(objectStore); } -void WebIDBDatabaseImpl::removeObjectStore(const WebString& name, const WebIDBTransaction& transaction, WebExceptionCode& ec) +void WebIDBDatabaseImpl::deleteObjectStore(const WebString& name, const WebIDBTransaction& transaction, WebExceptionCode& ec) { - m_databaseBackend->removeObjectStore(name, transaction.getIDBTransactionBackendInterface(), ec); + m_databaseBackend->deleteObjectStore(name, transaction.getIDBTransactionBackendInterface(), ec); } void WebIDBDatabaseImpl::setVersion(const WebString& version, WebIDBCallbacks* callbacks, WebExceptionCode& ec) @@ -91,8 +88,10 @@ WebIDBTransaction* WebIDBDatabaseImpl::transaction(const WebDOMStringList& names { RefPtr<DOMStringList> nameList = PassRefPtr<DOMStringList>(names); RefPtr<IDBTransactionBackendInterface> transaction = m_databaseBackend->transaction(nameList.get(), mode, timeout, ec); - if (!transaction) + if (!transaction) { + ASSERT(ec); return 0; + } return new WebIDBTransactionImpl(transaction); } diff --git a/WebKit/chromium/src/WebIDBDatabaseImpl.h b/WebKit/chromium/src/WebIDBDatabaseImpl.h index 94f1101..64e0b2e 100644 --- a/WebKit/chromium/src/WebIDBDatabaseImpl.h +++ b/WebKit/chromium/src/WebIDBDatabaseImpl.h @@ -46,12 +46,11 @@ public: virtual ~WebIDBDatabaseImpl(); virtual WebString name() const; - virtual WebString description() const; virtual WebString version() const; - virtual WebDOMStringList objectStores() const; + virtual WebDOMStringList objectStoreNames() const; virtual WebIDBObjectStore* createObjectStore(const WebString& name, const WebString& keyPath, bool autoIncrement, const WebIDBTransaction&, WebExceptionCode&); - virtual void removeObjectStore(const WebString& name, const WebIDBTransaction&, WebExceptionCode&); + virtual void deleteObjectStore(const WebString& name, const WebIDBTransaction&, WebExceptionCode&); virtual void setVersion(const WebString& version, WebIDBCallbacks* callbacks, WebExceptionCode&); virtual WebIDBTransaction* transaction(const WebDOMStringList& names, unsigned short mode, unsigned long timeout, WebExceptionCode&); virtual void close(); diff --git a/WebKit/chromium/src/WebIDBFactoryImpl.cpp b/WebKit/chromium/src/WebIDBFactoryImpl.cpp index 5d0ab85..a509076 100755 --- a/WebKit/chromium/src/WebIDBFactoryImpl.cpp +++ b/WebKit/chromium/src/WebIDBFactoryImpl.cpp @@ -58,9 +58,9 @@ WebIDBFactoryImpl::~WebIDBFactoryImpl() { } -void WebIDBFactoryImpl::open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir, unsigned long long maximumSize) +void WebIDBFactoryImpl::open(const WebString& name, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir, unsigned long long maximumSize) { - m_idbFactoryBackend->open(name, description, IDBCallbacksProxy::create(callbacks), origin, 0, dataDir, maximumSize); + m_idbFactoryBackend->open(name, IDBCallbacksProxy::create(callbacks), origin, 0, dataDir, maximumSize); } } // namespace WebKit diff --git a/WebKit/chromium/src/WebIDBFactoryImpl.h b/WebKit/chromium/src/WebIDBFactoryImpl.h index 4bc9426..9ed6e3f 100755 --- a/WebKit/chromium/src/WebIDBFactoryImpl.h +++ b/WebKit/chromium/src/WebIDBFactoryImpl.h @@ -42,7 +42,7 @@ public: WebIDBFactoryImpl(); virtual ~WebIDBFactoryImpl(); - virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir, unsigned long long maximumSize); + virtual void open(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir, unsigned long long maximumSize); private: WTF::RefPtr<WebCore::IDBFactoryBackendInterface> m_idbFactoryBackend; diff --git a/WebKit/chromium/src/WebIDBKeyRange.cpp b/WebKit/chromium/src/WebIDBKeyRange.cpp index 720af5f..ec5b7c2 100644 --- a/WebKit/chromium/src/WebIDBKeyRange.cpp +++ b/WebKit/chromium/src/WebIDBKeyRange.cpp @@ -39,12 +39,24 @@ void WebIDBKeyRange::assign(const WebIDBKeyRange& other) m_private = other.m_private; } -void WebIDBKeyRange::assign(const WebIDBKey& left, const WebIDBKey& right, unsigned short flags) +void WebIDBKeyRange::assign(const WebIDBKey& lower, const WebIDBKey& upper, bool lowerOpen, bool upperOpen) { - if (left.type() == WebIDBKey::InvalidType && right.type() == WebIDBKey::InvalidType) + if (lower.type() == WebIDBKey::InvalidType && upper.type() == WebIDBKey::InvalidType) m_private = 0; else - m_private = IDBKeyRange::create(left, right, flags); + m_private = IDBKeyRange::create(lower, upper, lowerOpen, upperOpen); +} + +// FIXME: Remove this after next roll. +void WebIDBKeyRange::assign(const WebIDBKey& lower, const WebIDBKey& upper, unsigned short flags) +{ + bool lowerOpen = !!(flags & 1); + bool upperOpen = !!(flags & 2); + + if (lower.type() == WebIDBKey::InvalidType && upper.type() == WebIDBKey::InvalidType) + m_private = 0; + else + m_private = IDBKeyRange::create(lower, upper, lowerOpen, upperOpen); } void WebIDBKeyRange::reset() @@ -54,23 +66,50 @@ void WebIDBKeyRange::reset() WebIDBKey WebIDBKeyRange::left() const { + return lower(); +} + +WebIDBKey WebIDBKeyRange::right() const +{ + return upper(); +} + +WebIDBKey WebIDBKeyRange::lower() const +{ if (!m_private.get()) return WebIDBKey::createInvalid(); - return m_private->left(); + return m_private->lower(); } -WebIDBKey WebIDBKeyRange::right() const +WebIDBKey WebIDBKeyRange::upper() const { if (!m_private.get()) return WebIDBKey::createInvalid(); - return m_private->right(); + return m_private->upper(); +} + +bool WebIDBKeyRange::lowerOpen() const +{ + return m_private.get() && m_private->lowerOpen(); } +bool WebIDBKeyRange::upperOpen() const +{ + return m_private.get() && m_private->upperOpen(); +} + +// FIXME: Remove this after next roll. unsigned short WebIDBKeyRange::flags() const { if (!m_private.get()) return 0; - return m_private->flags(); + + unsigned short flags = 0; + if (m_private->lowerOpen()) + flags |= 1; + if (m_private->upperOpen()) + flags |= 2; + return flags; } WebIDBKeyRange::WebIDBKeyRange(const PassRefPtr<IDBKeyRange>& value) diff --git a/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp b/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp index 5dd2652..0503ede 100755 --- a/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp +++ b/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp @@ -76,9 +76,9 @@ void WebIDBObjectStoreImpl::put(const WebSerializedScriptValue& value, const Web m_objectStore->put(value, key, addOnly, IDBCallbacksProxy::create(callbacks), transaction.getIDBTransactionBackendInterface(), ec); } -void WebIDBObjectStoreImpl::remove(const WebIDBKey& key, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec) +void WebIDBObjectStoreImpl::deleteFunction(const WebIDBKey& key, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec) { - m_objectStore->remove(key, IDBCallbacksProxy::create(callbacks), transaction.getIDBTransactionBackendInterface(), ec); + m_objectStore->deleteFunction(key, IDBCallbacksProxy::create(callbacks), transaction.getIDBTransactionBackendInterface(), ec); } WebIDBIndex* WebIDBObjectStoreImpl::createIndex(const WebString& name, const WebString& keyPath, bool unique, const WebIDBTransaction& transaction, WebExceptionCode& ec) @@ -97,9 +97,9 @@ WebIDBIndex* WebIDBObjectStoreImpl::index(const WebString& name, WebExceptionCod return new WebIDBIndexImpl(index); } -void WebIDBObjectStoreImpl::removeIndex(const WebString& name, const WebIDBTransaction& transaction, WebExceptionCode& ec) +void WebIDBObjectStoreImpl::deleteIndex(const WebString& name, const WebIDBTransaction& transaction, WebExceptionCode& ec) { - m_objectStore->removeIndex(name, transaction.getIDBTransactionBackendInterface(), ec); + m_objectStore->deleteIndex(name, transaction.getIDBTransactionBackendInterface(), ec); } void WebIDBObjectStoreImpl::openCursor(const WebIDBKeyRange& keyRange, unsigned short direction, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec) diff --git a/WebKit/chromium/src/WebIDBObjectStoreImpl.h b/WebKit/chromium/src/WebIDBObjectStoreImpl.h index 9148118..f9cd776 100755 --- a/WebKit/chromium/src/WebIDBObjectStoreImpl.h +++ b/WebKit/chromium/src/WebIDBObjectStoreImpl.h @@ -49,11 +49,11 @@ public: void get(const WebIDBKey& key, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&); void put(const WebSerializedScriptValue&, const WebIDBKey& key, bool addOnly, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&); - void remove(const WebIDBKey& key, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&); + void deleteFunction(const WebIDBKey& key, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&); WebIDBIndex* createIndex(const WebString& name, const WebString& keyPath, bool unique, const WebIDBTransaction&, WebExceptionCode&); WebIDBIndex* index(const WebString& name, WebExceptionCode&); - void removeIndex(const WebString& name, const WebIDBTransaction&, WebExceptionCode&); + void deleteIndex(const WebString& name, const WebIDBTransaction&, WebExceptionCode&); void openCursor(const WebIDBKeyRange&, unsigned short direction, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&); diff --git a/WebKit/chromium/src/WebIDBTransactionImpl.cpp b/WebKit/chromium/src/WebIDBTransactionImpl.cpp index 4307cb5..1ed6f4b 100644 --- a/WebKit/chromium/src/WebIDBTransactionImpl.cpp +++ b/WebKit/chromium/src/WebIDBTransactionImpl.cpp @@ -51,9 +51,9 @@ int WebIDBTransactionImpl::mode() const return m_backend->mode(); } -WebIDBObjectStore* WebIDBTransactionImpl::objectStore(const WebString& name) +WebIDBObjectStore* WebIDBTransactionImpl::objectStore(const WebString& name, ExceptionCode& ec) { - RefPtr<IDBObjectStoreBackendInterface> objectStore = m_backend->objectStore(name); + RefPtr<IDBObjectStoreBackendInterface> objectStore = m_backend->objectStore(name, ec); if (!objectStore) return 0; return new WebIDBObjectStoreImpl(objectStore); diff --git a/WebKit/chromium/src/WebIDBTransactionImpl.h b/WebKit/chromium/src/WebIDBTransactionImpl.h index b26b3ac..d26fc37 100644 --- a/WebKit/chromium/src/WebIDBTransactionImpl.h +++ b/WebKit/chromium/src/WebIDBTransactionImpl.h @@ -42,7 +42,7 @@ public: virtual ~WebIDBTransactionImpl(); virtual int mode() const; - virtual WebIDBObjectStore* objectStore(const WebString& name); + virtual WebIDBObjectStore* objectStore(const WebString& name, WebExceptionCode&); virtual void abort(); virtual void didCompleteTaskEvents(); virtual void setCallbacks(WebIDBTransactionCallbacks*); diff --git a/WebKit/chromium/src/WebInputElement.cpp b/WebKit/chromium/src/WebInputElement.cpp index d032ef8..8d89c60 100644 --- a/WebKit/chromium/src/WebInputElement.cpp +++ b/WebKit/chromium/src/WebInputElement.cpp @@ -160,6 +160,8 @@ bool WebInputElement::isValidValue(const WebString& value) const return constUnwrap<HTMLInputElement>()->isValidValue(value); } +const int WebInputElement::defaultMaxLength = HTMLInputElement::s_maximumLength; + WebInputElement::WebInputElement(const PassRefPtr<HTMLInputElement>& elem) : WebFormControlElement(elem) { diff --git a/WebKit/chromium/src/WebSettingsImpl.cpp b/WebKit/chromium/src/WebSettingsImpl.cpp index 1bea259..e60562c 100644 --- a/WebKit/chromium/src/WebSettingsImpl.cpp +++ b/WebKit/chromium/src/WebSettingsImpl.cpp @@ -284,6 +284,31 @@ void WebSettingsImpl::setAcceleratedCompositingEnabled(bool enabled) m_settings->setAcceleratedCompositingEnabled(enabled); } +void WebSettingsImpl::setAcceleratedCompositingFor3DTransformsEnabled(bool enabled) +{ + m_settings->setAcceleratedCompositingFor3DTransformsEnabled(enabled); +} + +void WebSettingsImpl::setAcceleratedCompositingForVideoEnabled(bool enabled) +{ + m_settings->setAcceleratedCompositingForVideoEnabled(enabled); +} + +void WebSettingsImpl::setAcceleratedCompositingForPluginsEnabled(bool enabled) +{ + m_settings->setAcceleratedCompositingForPluginsEnabled(enabled); +} + +void WebSettingsImpl::setAcceleratedCompositingForCanvasEnabled(bool enabled) +{ + m_settings->setAcceleratedCompositingForCanvasEnabled(enabled); +} + +void WebSettingsImpl::setAcceleratedCompositingForAnimationEnabled(bool enabled) +{ + m_settings->setAcceleratedCompositingForAnimationEnabled(enabled); +} + void WebSettingsImpl::setAccelerated2dCanvasEnabled(bool enabled) { m_settings->setAccelerated2dCanvasEnabled(enabled); diff --git a/WebKit/chromium/src/WebSettingsImpl.h b/WebKit/chromium/src/WebSettingsImpl.h index 081188f..ffdc8d3 100644 --- a/WebKit/chromium/src/WebSettingsImpl.h +++ b/WebKit/chromium/src/WebSettingsImpl.h @@ -88,6 +88,11 @@ public: virtual void setShowDebugBorders(bool); virtual void setEditingBehavior(EditingBehavior); virtual void setAcceleratedCompositingEnabled(bool); + virtual void setAcceleratedCompositingFor3DTransformsEnabled(bool); + virtual void setAcceleratedCompositingForVideoEnabled(bool); + virtual void setAcceleratedCompositingForPluginsEnabled(bool); + virtual void setAcceleratedCompositingForCanvasEnabled(bool); + virtual void setAcceleratedCompositingForAnimationEnabled(bool); virtual void setAccelerated2dCanvasEnabled(bool); virtual void setMemoryInfoEnabled(bool); virtual void setHyperlinkAuditingEnabled(bool); diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp index 8cf7848..48f8b50 100644 --- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp +++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp @@ -55,9 +55,9 @@ WebSpeechInputControllerMockImpl::~WebSpeechInputControllerMockImpl() m_webcoreMock->setListener(0); } -void WebSpeechInputControllerMockImpl::setMockRecognitionResult(const WebString& result, const WebString &language) +void WebSpeechInputControllerMockImpl::addMockRecognitionResult(const WebString& result, double confidence, const WebString &language) { - m_webcoreMock->setRecognitionResult(result, language); + m_webcoreMock->addRecognitionResult(result, confidence, language); } void WebSpeechInputControllerMockImpl::clearResults() diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h index 7680873..bf00ed0 100644 --- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h +++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h @@ -62,7 +62,7 @@ public: void stopRecording(int requestId); // WebSpeechInputControllerMock methods. - void setMockRecognitionResult(const WebString& result, const WebString& language); + void addMockRecognitionResult(const WebString& result, double confidence, const WebString& language); void clearResults(); private: diff --git a/WebKit/chromium/src/WebURLResponse.cpp b/WebKit/chromium/src/WebURLResponse.cpp index 5343921..bf3c521 100644 --- a/WebKit/chromium/src/WebURLResponse.cpp +++ b/WebKit/chromium/src/WebURLResponse.cpp @@ -35,6 +35,7 @@ #include "ResourceLoadTiming.h" #include "WebHTTPHeaderVisitor.h" +#include "WebHTTPLoadInfo.h" #include "WebString.h" #include "WebURL.h" #include "WebURLLoadTiming.h" @@ -129,14 +130,14 @@ void WebURLResponse::setLoadTiming(const WebURLLoadTiming& timing) m_private->m_resourceResponse->setResourceLoadTiming(loadTiming.release()); } -WebResourceRawHeaders WebURLResponse::resourceRawHeaders() +WebHTTPLoadInfo WebURLResponse::httpLoadInfo() { - return WebResourceRawHeaders(m_private->m_resourceResponse->resourceRawHeaders()); + return WebHTTPLoadInfo(m_private->m_resourceResponse->resourceLoadInfo()); } -void WebURLResponse::setResourceRawHeaders(const WebResourceRawHeaders& value) +void WebURLResponse::setHTTPLoadInfo(const WebHTTPLoadInfo& value) { - m_private->m_resourceResponse->setResourceRawHeaders(value); + m_private->m_resourceResponse->setResourceLoadInfo(value); } double WebURLResponse::responseTime() const diff --git a/WebKit/chromium/src/WebURLResponsePrivate.h b/WebKit/chromium/src/WebURLResponsePrivate.h index 4181e4c..dc5ce22 100644 --- a/WebKit/chromium/src/WebURLResponsePrivate.h +++ b/WebKit/chromium/src/WebURLResponsePrivate.h @@ -31,7 +31,6 @@ #ifndef WebURLResponsePrivate_h #define WebURLResponsePrivate_h -#include "WebResourceRawHeaders.h" #include "WebString.h" namespace WebCore { class ResourceResponse; } diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp index 6625949..e44c374 100644 --- a/WebKit/chromium/src/WebViewImpl.cpp +++ b/WebKit/chromium/src/WebViewImpl.cpp @@ -139,6 +139,27 @@ using namespace WebCore; +namespace { + +GraphicsContext3D::Attributes getCompositorContextAttributes() +{ + // Explicitly disable antialiasing for the compositor. As of the time of + // this writing, the only platform that supported antialiasing for the + // compositor was Mac OS X, because the on-screen OpenGL context creation + // code paths on Windows and Linux didn't yet have multisampling support. + // Mac OS X essentially always behaves as though it's rendering offscreen. + // Multisampling has a heavy cost especially on devices with relatively low + // fill rate like most notebooks, and the Mac implementation would need to + // be optimized to resolve directly into the IOSurface shared between the + // GPU and browser processes. For these reasons and to avoid platform + // disparities we explicitly disable antialiasing. + GraphicsContext3D::Attributes attributes; + attributes.antialias = false; + return attributes; +} + +} // anonymous namespace + namespace WebKit { // Change the text zoom level by kTextSizeMultiplierRatio each time the user @@ -937,7 +958,7 @@ void WebViewImpl::resize(const WebSize& newSize) } #if USE(ACCELERATED_COMPOSITING) - if (m_layerRenderer) { + if (m_layerRenderer && isAcceleratedCompositingActive()) { m_layerRenderer->resizeOnscreenContent(IntSize(std::max(1, m_size.width), std::max(1, m_size.height))); } @@ -2251,17 +2272,15 @@ bool WebViewImpl::allowsAcceleratedCompositing() void WebViewImpl::setRootGraphicsLayer(WebCore::PlatformLayer* layer) { - bool wasActive = m_isAcceleratedCompositingActive; setIsAcceleratedCompositingActive(layer ? true : false); if (m_layerRenderer) m_layerRenderer->setRootLayer(layer); - if (wasActive != m_isAcceleratedCompositingActive) { - IntRect damagedRect(0, 0, m_size.width, m_size.height); - if (m_isAcceleratedCompositingActive) - invalidateRootLayerRect(damagedRect); - else - m_client->didInvalidateRect(damagedRect); - } + + IntRect damagedRect(0, 0, m_size.width, m_size.height); + if (m_isAcceleratedCompositingActive) + invalidateRootLayerRect(damagedRect); + else + m_client->didInvalidateRect(damagedRect); } void WebViewImpl::setRootLayerNeedsDisplay() @@ -2318,6 +2337,9 @@ void WebViewImpl::scrollRootLayerRect(const IntSize& scrollDelta, const IntRect& } } + // Move the previous damage + m_rootLayerScrollDamage.move(scrollDelta.width(), scrollDelta.height()); + // Union with the new damage rect. m_rootLayerScrollDamage.unite(damagedContentsRect); // Scroll any existing damage that intersects with clip rect @@ -2357,7 +2379,8 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) if (!active) { m_isAcceleratedCompositingActive = false; - m_layerRenderer->finish(); // finish all GL rendering before we hide the window? + if (m_layerRenderer) + m_layerRenderer->finish(); // finish all GL rendering before we hide the window? m_client->didActivateAcceleratedCompositing(false); return; } @@ -2373,13 +2396,13 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) RefPtr<GraphicsContext3D> context = m_temporaryOnscreenGraphicsContext3D.release(); if (!context) { - m_client->didActivateAcceleratedCompositing(true); - context = GraphicsContext3D::create(GraphicsContext3D::Attributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); + context = GraphicsContext3D::create(getCompositorContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); if (context) context->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); } m_layerRenderer = LayerRendererChromium::create(context.release()); if (m_layerRenderer) { + m_client->didActivateAcceleratedCompositing(true); m_isAcceleratedCompositingActive = true; m_compositorCreationFailed = false; } else { @@ -2509,8 +2532,7 @@ WebGraphicsContext3D* WebViewImpl::graphicsContext3D() else if (m_temporaryOnscreenGraphicsContext3D) context = m_temporaryOnscreenGraphicsContext3D.get(); else { - GraphicsContext3D::Attributes attributes; - m_temporaryOnscreenGraphicsContext3D = GraphicsContext3D::create(GraphicsContext3D::Attributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); + m_temporaryOnscreenGraphicsContext3D = GraphicsContext3D::create(getCompositorContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); if (m_temporaryOnscreenGraphicsContext3D) m_temporaryOnscreenGraphicsContext3D->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); context = m_temporaryOnscreenGraphicsContext3D.get(); diff --git a/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp b/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp index 8d8e469..0d0ac8b 100644 --- a/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp +++ b/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp @@ -64,6 +64,11 @@ WorkerAsyncFileWriterChromium::~WorkerAsyncFileWriterChromium() m_bridge->postShutdownToMainThread(m_bridge); } +bool WorkerAsyncFileWriterChromium::waitForOperationToComplete() +{ + return m_bridge->waitForOperationToComplete(); +} + void WorkerAsyncFileWriterChromium::write(long long position, Blob* data) { m_bridge->postWriteToMainThread(position, data->url()); diff --git a/WebKit/chromium/src/WorkerAsyncFileWriterChromium.h b/WebKit/chromium/src/WorkerAsyncFileWriterChromium.h index 55d8d24..01058c3 100644 --- a/WebKit/chromium/src/WorkerAsyncFileWriterChromium.h +++ b/WebKit/chromium/src/WorkerAsyncFileWriterChromium.h @@ -67,6 +67,8 @@ public: } ~WorkerAsyncFileWriterChromium(); + bool waitForOperationToComplete(); + // FileWriter virtual void write(long long position, Blob* data); virtual void truncate(long long length); diff --git a/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.cpp b/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.cpp index 827c011..179aea5 100644 --- a/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.cpp +++ b/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.cpp @@ -59,16 +59,21 @@ void WorkerFileWriterCallbacksBridge::notifyStop() void WorkerFileWriterCallbacksBridge::postWriteToMainThread(long long position, const KURL& data) { + ASSERT(!m_operationInProgress); + m_operationInProgress = true; dispatchTaskToMainThread(createCallbackTask(&writeOnMainThread, this, position, data)); } void WorkerFileWriterCallbacksBridge::postTruncateToMainThread(long long length) { + ASSERT(!m_operationInProgress); + m_operationInProgress = true; dispatchTaskToMainThread(createCallbackTask(&truncateOnMainThread, this, length)); } void WorkerFileWriterCallbacksBridge::postAbortToMainThread() { + ASSERT(m_operationInProgress); dispatchTaskToMainThread(createCallbackTask(&abortOnMainThread, this)); } @@ -121,14 +126,19 @@ void WorkerFileWriterCallbacksBridge::didTruncate() dispatchTaskToWorkerThread(createCallbackTask(&didTruncateOnWorkerThread, this)); } +static const char fileWriterOperationsMode[] = "fileWriterOperationsMode"; + WorkerFileWriterCallbacksBridge::WorkerFileWriterCallbacksBridge(const String& path, WorkerLoaderProxy* proxy, ScriptExecutionContext* scriptExecutionContext, AsyncFileWriterClient* client) : WorkerContext::Observer(static_cast<WorkerContext*>(scriptExecutionContext)) , m_proxy(proxy) , m_workerContext(scriptExecutionContext) , m_clientOnWorkerThread(client) , m_writerDeleted(false) + , m_operationInProgress(false) { ASSERT(m_workerContext->isContextThread()); + m_mode = fileWriterOperationsMode; + m_mode.append(String::number(static_cast<WorkerContext*>(scriptExecutionContext)->thread()->runLoop().createUniqueId())); postInitToMainThread(path); } @@ -147,18 +157,25 @@ WorkerFileWriterCallbacksBridge::~WorkerFileWriterCallbacksBridge() void WorkerFileWriterCallbacksBridge::didWriteOnWorkerThread(ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge> bridge, long long length, bool complete) { ASSERT(bridge->m_workerContext->isContextThread()); + ASSERT(bridge->m_operationInProgress); + if (complete) + bridge->m_operationInProgress = false; bridge->m_clientOnWorkerThread->didWrite(length, complete); } void WorkerFileWriterCallbacksBridge::didFailOnWorkerThread(ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge> bridge, WebFileError error) { ASSERT(bridge->m_workerContext->isContextThread()); + ASSERT(bridge->m_operationInProgress); + bridge->m_operationInProgress = false; bridge->m_clientOnWorkerThread->didFail(static_cast<FileError::ErrorCode>(error)); } void WorkerFileWriterCallbacksBridge::didTruncateOnWorkerThread(ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge> bridge) { ASSERT(bridge->m_workerContext->isContextThread()); + ASSERT(bridge->m_operationInProgress); + bridge->m_operationInProgress = false; bridge->m_clientOnWorkerThread->didTruncate(); } @@ -185,9 +202,19 @@ void WorkerFileWriterCallbacksBridge::dispatchTaskToMainThread(PassOwnPtr<Script void WorkerFileWriterCallbacksBridge::dispatchTaskToWorkerThread(PassOwnPtr<ScriptExecutionContext::Task> task) { ASSERT(isMainThread()); - m_proxy->postTaskForModeToWorkerContext(createCallbackTask(&runTaskOnWorkerThread, this, task), WorkerRunLoop::defaultMode()); + m_proxy->postTaskForModeToWorkerContext(createCallbackTask(&runTaskOnWorkerThread, this, task), m_mode); } +bool WorkerFileWriterCallbacksBridge::waitForOperationToComplete() +{ + while (m_operationInProgress) { + WorkerContext* context = static_cast<WorkerContext*>(m_workerContext); + if (context->thread()->runLoop().runInMode(context, m_mode) == MessageQueueTerminated) + return false; + } + return true; } +} // namespace WebKit + #endif // ENABLE(FILE_SYSTEM) diff --git a/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.h b/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.h index d2e416e..62e333c 100644 --- a/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.h +++ b/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.h @@ -106,6 +106,9 @@ public: void didFail(WebFileError); void didTruncate(); + // Call this on the context thread to wait for the current operation to complete. + bool waitForOperationToComplete(); + private: WorkerFileWriterCallbacksBridge(const String& path, WebCore::WorkerLoaderProxy*, WebCore::ScriptExecutionContext*, WebCore::AsyncFileWriterClient*); @@ -147,6 +150,12 @@ private: // Used to indicate that shutdown has started on the main thread, and hence the writer has been deleted. bool m_writerDeleted; + + // Used by waitForOperationToComplete. + bool m_operationInProgress; + + // Used by postTaskForModeToWorkerContext and runInMode. + String m_mode; }; } // namespace WebCore diff --git a/WebKit/chromium/src/js/DevTools.js b/WebKit/chromium/src/js/DevTools.js index 8b3aea0..5bb150c 100644 --- a/WebKit/chromium/src/js/DevTools.js +++ b/WebKit/chromium/src/js/DevTools.js @@ -47,6 +47,8 @@ var context = {}; // Used by WebCore's inspector routines. Preferences.onlineDetectionEnabled = false; Preferences.nativeInstrumentationEnabled = true; Preferences.fileSystemEnabled = false; + Preferences.showTimingTab = true; + Preferences.showCookiesTab = true; })(); var devtools = devtools || {}; |