diff options
Diffstat (limited to 'WebKit/chromium/src')
59 files changed, 2124 insertions, 521 deletions
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); } |