diff options
author | Steve Block <steveblock@google.com> | 2010-08-27 11:02:25 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-09-02 17:17:20 +0100 |
commit | e8b154fd68f9b33be40a3590e58347f353835f5c (patch) | |
tree | 0733ce26384183245aaa5656af26c653636fe6c1 /WebKit/chromium/public | |
parent | da56157816334089526a7a115a85fd85a6e9a1dc (diff) | |
download | external_webkit-e8b154fd68f9b33be40a3590e58347f353835f5c.zip external_webkit-e8b154fd68f9b33be40a3590e58347f353835f5c.tar.gz external_webkit-e8b154fd68f9b33be40a3590e58347f353835f5c.tar.bz2 |
Merge WebKit at r66079 : Initial merge by git
Change-Id: Ie2e1440fb9d487d24e52c247342c076fecaecac7
Diffstat (limited to 'WebKit/chromium/public')
29 files changed, 843 insertions, 69 deletions
diff --git a/WebKit/chromium/public/WebBlobData.h b/WebKit/chromium/public/WebBlobData.h new file mode 100644 index 0000000..8c0e1aa --- /dev/null +++ b/WebKit/chromium/public/WebBlobData.h @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebBlobData_h +#define WebBlobData_h + +#include "WebCString.h" +#include "WebString.h" +#include "WebURL.h" + +#if WEBKIT_IMPLEMENTATION +namespace WebCore { class BlobData; } +namespace WTF { template <typename T> class PassOwnPtr; } +#endif + +namespace WebKit { + +class WebBlobDataPrivate; + +class WebBlobData { +public: + struct Item { + enum { TypeData, TypeFile, TypeBlob } type; + WebCString data; + WebString filePath; + WebURL blobURL; + long long offset; + long long length; // -1 means go to the end of the file/blob. + double expectedModificationTime; // 0.0 means that the time is not set. + }; + + ~WebBlobData() { reset(); } + + WebBlobData() : m_private(0) { } + + WEBKIT_API void initialize(); + WEBKIT_API void reset(); + + bool isNull() const { return !m_private; } + + // Returns the number of items. + WEBKIT_API size_t itemCount() const; + + // Retrieves the values of the item at the given index. Returns false if + // index is out of bounds. + WEBKIT_API bool itemAt(size_t index, Item& result) const; + + // Appends to the list of items. + WEBKIT_API void appendData(const WebCString&); + WEBKIT_API void appendFile(const WebString& filePath); + WEBKIT_API void appendFile(const WebString& filePath, long long offset, long long length, double expectedModificationTime); + WEBKIT_API void appendBlob(const WebURL& blobURL, long long offset, long long length); + + WEBKIT_API WebString contentType() const; + WEBKIT_API void setContentType(const WebString&); + + WEBKIT_API WebString contentDisposition() const; + WEBKIT_API void setContentDisposition(const WebString&); + +#if WEBKIT_IMPLEMENTATION + WebBlobData(const WTF::PassOwnPtr<WebCore::BlobData>&); + WebBlobData& operator=(const WTF::PassOwnPtr<WebCore::BlobData>&); + operator WTF::PassOwnPtr<WebCore::BlobData>(); +#endif + +private: +#if WEBKIT_IMPLEMENTATION + void assign(const WTF::PassOwnPtr<WebCore::BlobData>&); +#endif + WebBlobDataPrivate* m_private; +}; + +} // namespace WebKit + +#endif // WebBlobData_h diff --git a/WebKit/chromium/public/WebBlobRegistry.h b/WebKit/chromium/public/WebBlobRegistry.h new file mode 100644 index 0000000..cbd9a99 --- /dev/null +++ b/WebKit/chromium/public/WebBlobRegistry.h @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebBlobRegistry_h +#define WebBlobRegistry_h + +#include "WebBlobStorageData.h" + +namespace WebKit { + +class WebBlobData; +class WebURL; + +class WebBlobRegistry { +public: + WEBKIT_API static WebBlobRegistry* create(); + + virtual ~WebBlobRegistry() { } + + // Registers a blob URL referring to the specified blob data. + virtual void registerBlobURL(const WebURL&, WebBlobData&) = 0; + + // Registers a blob URL referring to the blob data identified by the specified srcURL. + virtual void registerBlobURL(const WebURL&, const WebURL& srcURL) = 0; + + virtual void unregisterBlobURL(const WebURL&) = 0; +}; + +} // namespace WebKit + +#endif // WebBlobRegistry_h diff --git a/WebKit/chromium/public/WebBlobStorageData.h b/WebKit/chromium/public/WebBlobStorageData.h new file mode 100644 index 0000000..a9c0c8b --- /dev/null +++ b/WebKit/chromium/public/WebBlobStorageData.h @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebBlobStorageData_h +#define WebBlobStorageData_h + +#include "WebBlobData.h" +#include "WebData.h" +#include "WebFileInfo.h" +#include "WebString.h" + +#if WEBKIT_IMPLEMENTATION +namespace WebCore { class BlobStorageData; } +namespace WTF { template <typename T> class PassRefPtr; } +#endif + +namespace WebKit { + +class WebBlobStorageDataPrivate; + +class WebBlobStorageData { +public: + ~WebBlobStorageData() { reset(); } + + WebBlobStorageData() : m_private(0) { } + + WEBKIT_API void reset(); + + bool isNull() const { return !m_private; } + + // Returns the number of items. + WEBKIT_API size_t itemCount() const; + + // Retrieves the values of the item at the given index. Returns false if + // index is out of bounds. + WEBKIT_API bool itemAt(size_t index, WebBlobData::Item& result) const; + + WEBKIT_API WebString contentType() const; + WEBKIT_API WebString contentDisposition() const; + +#if WEBKIT_IMPLEMENTATION + WebBlobStorageData(const WTF::PassRefPtr<WebCore::BlobStorageData>&); + WebBlobStorageData& operator=(const WTF::PassRefPtr<WebCore::BlobStorageData>&); + operator WTF::PassRefPtr<WebCore::BlobStorageData>() const; +#endif + +private: +#if WEBKIT_IMPLEMENTATION + void assign(const WTF::PassRefPtr<WebCore::BlobStorageData>&); +#endif + WebBlobStorageDataPrivate* m_private; +}; + +} // namespace WebKit + +#endif // WebBlobStorageData_h diff --git a/WebKit/chromium/public/WebEvent.h b/WebKit/chromium/public/WebDOMEvent.h index b0964d1..d34c8d4 100644 --- a/WebKit/chromium/public/WebEvent.h +++ b/WebKit/chromium/public/WebDOMEvent.h @@ -28,8 +28,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WebEvent_h -#define WebEvent_h +#ifndef WebDOMEvent_h +#define WebDOMEvent_h #include "WebCommon.h" #include "WebNode.h" @@ -42,7 +42,7 @@ namespace WTF { template <typename T> class PassRefPtr; } namespace WebKit { -class WebEvent { +class WebDOMEvent { public: enum PhaseType { CapturingPhase = 1, @@ -50,16 +50,16 @@ public: BubblingPhase = 3 }; - WebEvent() : m_private(0) { } - WebEvent(const WebEvent& e) : m_private(0) { assign(e); } - WebEvent& operator=(const WebEvent& e) + WebDOMEvent() : m_private(0) { } + WebDOMEvent(const WebDOMEvent& e) : m_private(0) { assign(e); } + WebDOMEvent& operator=(const WebDOMEvent& e) { assign(e); return *this; } WEBKIT_API void reset(); - WEBKIT_API void assign(const WebEvent&); + WEBKIT_API void assign(const WebDOMEvent&); bool isNull() const { return !m_private; } @@ -92,13 +92,27 @@ public: WEBKIT_API bool isBeforeLoadEvent() const; #if WEBKIT_IMPLEMENTATION - WebEvent(const WTF::PassRefPtr<WebCore::Event>&); + WebDOMEvent(const WTF::PassRefPtr<WebCore::Event>&); #endif + template<typename T> T to() + { + T res; + res.WebDOMEvent::assign(*this); + return res; + } + + template<typename T> const T toConst() const + { + T res; + res.WebDOMEvent::assign(*this); + return res; + } + protected: - typedef WebCore::Event WebEventPrivate; - void assign(WebEventPrivate*); - WebEventPrivate* m_private; + typedef WebCore::Event WebDOMEventPrivate; + void assign(WebDOMEventPrivate*); + WebDOMEventPrivate* m_private; template<typename T> T* unwrap() { diff --git a/WebKit/chromium/public/WebEventListener.h b/WebKit/chromium/public/WebDOMEventListener.h index 62ca0de..4b32b93 100644 --- a/WebKit/chromium/public/WebEventListener.h +++ b/WebKit/chromium/public/WebDOMEventListener.h @@ -28,8 +28,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WebEventListener_h -#define WebEventListener_h +#ifndef WebDOMEventListener_h +#define WebDOMEventListener_h #include "WebCommon.h" @@ -40,18 +40,18 @@ namespace WebCore { class Node; } namespace WebKit { class EventListenerWrapper; -class WebEvent; -class WebEventListenerPrivate; +class WebDOMEvent; +class WebDOMEventListenerPrivate; class WebNode; class WebString; -class WebEventListener { +class WebDOMEventListener { public: - WEBKIT_API WebEventListener(); - WEBKIT_API virtual ~WebEventListener(); + WEBKIT_API WebDOMEventListener(); + WEBKIT_API virtual ~WebDOMEventListener(); // Called when an event is received. - virtual void handleEvent(const WebEvent&) = 0; + virtual void handleEvent(const WebDOMEvent&) = 0; #if WEBKIT_IMPLEMENTATION void notifyEventListenerDeleted(EventListenerWrapper*); @@ -60,7 +60,7 @@ public: #endif private: - WebEventListenerPrivate* m_private; + WebDOMEventListenerPrivate* m_private; }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebDOMMouseEvent.h b/WebKit/chromium/public/WebDOMMouseEvent.h new file mode 100644 index 0000000..4c38b56 --- /dev/null +++ b/WebKit/chromium/public/WebDOMMouseEvent.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef WebDOMMouseEvent_h +#define WebDOMMouseEvent_h + +#include "WebDOMEvent.h" + +#if WEBKIT_IMPLEMENTATION +namespace WebCore { class Event; } +#endif + +namespace WebKit { + +class WebDOMMouseEvent : public WebDOMEvent { +public: + WEBKIT_API int screenX() const; + WEBKIT_API int screenY() const; + WEBKIT_API int clientX() const; + WEBKIT_API int clientY() const; + WEBKIT_API int layerX() const; + WEBKIT_API int layerY() const; + WEBKIT_API int offsetX() const; + WEBKIT_API int offsetY() const; + WEBKIT_API int pageX() const; + WEBKIT_API int pageY() const; + WEBKIT_API int x() const; + WEBKIT_API int y() const; + + WEBKIT_API int button() const; + WEBKIT_API bool buttonDown() const; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebMutationEvent.h b/WebKit/chromium/public/WebDOMMutationEvent.h index 75eb9c4..471331f 100644 --- a/WebKit/chromium/public/WebMutationEvent.h +++ b/WebKit/chromium/public/WebDOMMutationEvent.h @@ -27,10 +27,10 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WebMutationEvent_h -#define WebMutationEvent_h +#ifndef WebDOMMutationEvent_h +#define WebDOMMutationEvent_h -#include "WebEvent.h" +#include "WebDOMEvent.h" #if WEBKIT_IMPLEMENTATION namespace WebCore { class Event; } @@ -38,7 +38,7 @@ namespace WebCore { class Event; } namespace WebKit { -class WebMutationEvent : public WebEvent { +class WebDOMMutationEvent : public WebDOMEvent { public: enum AttrChangeType { Modification = 1, diff --git a/WebKit/chromium/public/WebDevToolsAgent.h b/WebKit/chromium/public/WebDevToolsAgent.h index a355a0f..6b4d237 100644 --- a/WebKit/chromium/public/WebDevToolsAgent.h +++ b/WebKit/chromium/public/WebDevToolsAgent.h @@ -59,7 +59,6 @@ public: virtual void inspectElementAt(const WebPoint&) = 0; - virtual void setRuntimeFeatureEnabled(const WebString& feature, bool enabled) = 0; virtual void setRuntimeProperty(const WebString& name, const WebString& value) = 0; // Exposed for LayoutTestController. diff --git a/WebKit/chromium/public/WebDevToolsAgentClient.h b/WebKit/chromium/public/WebDevToolsAgentClient.h index 386bd08..087ac0b 100644 --- a/WebKit/chromium/public/WebDevToolsAgentClient.h +++ b/WebKit/chromium/public/WebDevToolsAgentClient.h @@ -53,7 +53,6 @@ public: // Notifies host upon runtime feature being enabled/disabled. virtual void runtimePropertyChanged(const WebString& name, const WebString& value) { } - virtual WebCString injectedScriptSource() { return WebCString(); } virtual WebCString debuggerScriptSource() { return WebCString(); } class WebKitClientMessageLoop { diff --git a/WebKit/chromium/public/WebFileError.h b/WebKit/chromium/public/WebFileError.h new file mode 100644 index 0000000..cfe8882 --- /dev/null +++ b/WebKit/chromium/public/WebFileError.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef WebFileError_h +#define WebFileError_h + +namespace WebKit { + +// File-related error code defined in HTML5 File API. +enum WebFileError { + WebFileErrorNoModificationAllowed = 7, + WebFileErrorNotFound = 8, + WebFileErrorInvalidState = 11, + WebFileErrorInvalidModification = 13, + WebFileErrorSecurity = 18, + WebFileErrorAbort = 20, + WebFileErrorQuotaExceeded = 22, + WebFileErrorNotReadable = 24, + WebFileErrorEncoding = 26, +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebFileSystem.h b/WebKit/chromium/public/WebFileSystem.h index a91106e..641c169 100644 --- a/WebKit/chromium/public/WebFileSystem.h +++ b/WebKit/chromium/public/WebFileSystem.h @@ -31,12 +31,77 @@ #ifndef WebFileSystem_h #define WebFileSystem_h -#include "WebFileUtilities.h" +#include "WebCommon.h" +#include "WebString.h" namespace WebKit { -// FIXME: Clean up this class once the renaming to WebFileUtilities is done. -class WebFileSystem : public WebFileUtilities { +class WebFileSystemCallbacks; + +class WebFileSystem { +public: + enum Type { + TypeTemporary, + TypePersistent, + }; + + // Moves a file or directory at |srcPath| to |destPath|. + // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully. + // WebFileSystemCallbacks::didFail() must be called otherwise. + virtual void move(const WebString& srcPath, const WebString& destPath, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + + // Copies a file or directory at |srcPath| to |destPath|. + // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully. + // WebFileSystemCallbacks::didFail() must be called otherwise. + virtual void copy(const WebString& srcPath, const WebString& destPath, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + + // Deletes a file or directory at a given |path|. + // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully. + // WebFileSystemCallbacks::didFail() must be called otherwise. + virtual void remove(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + + // Retrieves the metadata information of the file or directory at the given |path|. + // WebFileSystemCallbacks::didReadMetadata() must be called with a valid metadata when the retrieval is completed successfully. + // WebFileSystemCallbacks::didFail() must be called otherwise. + virtual void readMetadata(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + + // Creates a file at given |path|. + // If the |path| doesn't exist, it creates a new file at |path|. + // If |exclusive| is true, it fails if the |path| already exists. + // If |exclusive| is false, it succeeds if the |path| already exists or + // it has successfully created a new file at |path|. + // + // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully. + // WebFileSystemCallbacks::didFail() must be called otherwise. + virtual void createFile(const WebString& path, bool exclusive, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + + // Creates a directory at a given |path|. + // If the |path| doesn't exist, it creates a new directory at |path|. + // If |exclusive| is true, it fails if the |path| already exists. + // If |exclusive| is false, it succeeds if the |path| already exists or it has successfully created a new directory at |path|. + // + // WebFileSystemCallbacks::didSucceed() must be called when + // the operation is completed successfully. + // WebFileSystemCallbacks::didFail() must be called otherwise. + virtual void createDirectory(const WebString& path, bool exclusive, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + + // Checks if a file exists at a given |path|. + // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully. + // WebFileSystemCallbacks::didFail() must be called otherwise. + virtual void fileExists(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + + // Checks if a directory exists at a given |path|. + // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully. + // WebFileSystemCallbacks::didFail() must be called otherwise. + virtual void directoryExists(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + + // Reads directory entries of a given directory at |path|. + // WebFileSystemCallbacks::didReadDirectory() must be called when the operation is completed successfully. + // WebFileSystemCallbacks::didFail() must be called otherwise. + virtual void readDirectory(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + +protected: + virtual ~WebFileSystem() { } }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebFileSystemCallbacks.h b/WebKit/chromium/public/WebFileSystemCallbacks.h new file mode 100644 index 0000000..fa7ebbe --- /dev/null +++ b/WebKit/chromium/public/WebFileSystemCallbacks.h @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebFileSystemCallbacks_h +#define WebFileSystemCallbacks_h + +#include "WebFileError.h" +#include "WebFileSystemEntry.h" +#include "WebVector.h" + +namespace WebKit { + +class WebString; +struct WebFileInfo; + +class WebFileSystemCallbacks { +public: + // Callback for WebFileSystem's various operations that don't require + // return values. + virtual void didSucceed() = 0; + + // Callback for WebFileSystem::readMetadata. Called with the file metadata + // for the requested path. + virtual void didReadMetadata(const WebFileInfo&) = 0; + + // Callback for WebFileSystem::readDirectory. Called with a vector of + // file entries in the requested directory. This callback might be called + // multiple times if the directory has many entries. |hasMore| must be + // true when there are more entries. + virtual void didReadDirectory(const WebVector<WebFileSystemEntry>&, bool hasMore) = 0; + + // Callback for WebFrameClient::openFileSystem. Called with a name and + // root path for the FileSystem when the request is accepted. + virtual void didOpenFileSystem(const WebString& name, const WebString& rootPath) = 0; + + // Called with an error code when a requested operation hasn't been + // completed. + virtual void didFail(WebFileError) = 0; + +protected: + virtual ~WebFileSystemCallbacks() {} +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebFileSystemEntry.h b/WebKit/chromium/public/WebFileSystemEntry.h new file mode 100644 index 0000000..00a5e38 --- /dev/null +++ b/WebKit/chromium/public/WebFileSystemEntry.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebFileSystemEntry_h +#define WebFileSystemEntry_h + +#include "WebString.h" + +namespace WebKit { + +struct WebFileSystemEntry { + WebFileSystemEntry() : isDirectory(false) { } + + // The name of the entry. + WebString name; + + // This flag indicates if the entry is directory or not. + bool isDirectory; +}; + +} // namespace WebKit + +#endif // WebFileSystemEntry_h diff --git a/WebKit/chromium/public/WebFrameClient.h b/WebKit/chromium/public/WebFrameClient.h index 91f0e38..699325d 100644 --- a/WebKit/chromium/public/WebFrameClient.h +++ b/WebKit/chromium/public/WebFrameClient.h @@ -32,6 +32,7 @@ #define WebFrameClient_h #include "WebCommon.h" +#include "WebFileSystem.h" #include "WebNavigationPolicy.h" #include "WebNavigationType.h" #include "WebURLError.h" @@ -333,6 +334,19 @@ public: virtual void reportFindInPageSelection( int identifier, int activeMatchOrdinal, const WebRect& selection) { } + // FileSystem ---------------------------------------------------- + + // Requests to open a FileSystem. + // |size| indicates how much storage space (in bytes) the caller expects + // to need. + // WebFileSystemCallbacks::didOpenFileSystem() must be called with + // a name and root path for the requested FileSystem when the operation + // is completed successfully. WebFileSystemCallbacks::didFail() must be + // called otherwise. + virtual void openFileSystem( + WebFrame*, WebFileSystem::Type, long long size, + WebFileSystemCallbacks*) { } + protected: ~WebFrameClient() { } }; diff --git a/WebKit/chromium/public/WebGraphicsContext3D.h b/WebKit/chromium/public/WebGraphicsContext3D.h index 4c18076..44a0498 100644 --- a/WebKit/chromium/public/WebGraphicsContext3D.h +++ b/WebKit/chromium/public/WebGraphicsContext3D.h @@ -103,6 +103,11 @@ public: // Query whether it is built on top of compliant GLES2 implementation. virtual bool isGLES2Compliant() = 0; + // Query whether it is built on top of GLES2 NPOT strict implementation. + virtual bool isGLES2NPOTStrict() = 0; + // Query whether it is built on top of implementation that generates errors + // on out-of-bounds buffer accesses. + virtual bool isErrorGeneratedOnOutOfBoundsAccesses() = 0; // Helper for software compositing path. Reads back the frame buffer into // the memory region pointed to by "pixels" with size "bufferSize". It is diff --git a/WebKit/chromium/public/WebHTTPBody.h b/WebKit/chromium/public/WebHTTPBody.h index a7dc7c9..a2bb5cd 100644 --- a/WebKit/chromium/public/WebHTTPBody.h +++ b/WebKit/chromium/public/WebHTTPBody.h @@ -35,6 +35,7 @@ #include "WebFileInfo.h" #include "WebNonCopyable.h" #include "WebString.h" +#include "WebURL.h" #if WEBKIT_IMPLEMENTATION namespace WebCore { class FormData; } @@ -48,12 +49,13 @@ class WebHTTPBodyPrivate; class WebHTTPBody { public: struct Element { - enum { TypeData, TypeFile } type; + enum { TypeData, TypeFile, TypeBlob } type; WebData data; WebString filePath; long long fileStart; long long fileLength; // -1 means to the end of the file. WebFileInfo fileInfo; + WebURL blobURL; }; ~WebHTTPBody() { reset(); } @@ -84,6 +86,7 @@ public: WEBKIT_API void appendFile(const WebString&); // Passing -1 to fileLength means to the end of the file. WEBKIT_API void appendFileRange(const WebString&, long long fileStart, long long fileLength, const WebFileInfo&); + WEBKIT_API void appendBlob(const WebURL&); // Identifies a particular form submission instance. A value of 0 is // used to indicate an unspecified identifier. diff --git a/WebKit/chromium/public/WebIDBDatabase.h b/WebKit/chromium/public/WebIDBDatabase.h index b0d6086..6e494ce 100644 --- a/WebKit/chromium/public/WebIDBDatabase.h +++ b/WebKit/chromium/public/WebIDBDatabase.h @@ -34,6 +34,7 @@ namespace WebKit { class WebFrame; class WebIDBCallbacks; class WebIDBObjectStore; +class WebIDBTransaction; // See comment in WebIndexedDatabase for a high level overview of these classes. class WebIDBDatabase { @@ -74,6 +75,13 @@ public: { WEBKIT_ASSERT_NOT_REACHED(); } + // Transfers ownership of the WebIDBTransaction to the caller. + virtual WebIDBTransaction* transaction(const WebDOMStringList& names, unsigned short mode, unsigned long timeout) + { + WEBKIT_ASSERT_NOT_REACHED(); + return 0; + } + }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebIDBFactory.h b/WebKit/chromium/public/WebIDBFactory.h index 5eb6f58..7c070a2 100755 --- a/WebKit/chromium/public/WebIDBFactory.h +++ b/WebKit/chromium/public/WebIDBFactory.h @@ -34,12 +34,12 @@ #include "WebIDBCallbacks.h" #include "WebSecurityOrigin.h" #include "WebString.h" +#include "WebVector.h" namespace WebKit { class WebFrame; class WebIDBDatabase; -class WebString; class WebSecurityOrigin; // The entry point into the IndexedDatabase API. These classes match their Foo and @@ -63,6 +63,8 @@ public: { open(name, description, callbacks, origin, webFrame); } + + virtual void abortPendingTransactions(const WebVector<int>& pendingIDs) { WEBKIT_ASSERT_NOT_REACHED(); } }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebIDBKey.h b/WebKit/chromium/public/WebIDBKey.h index 32caa10..6aef332 100644 --- a/WebKit/chromium/public/WebIDBKey.h +++ b/WebKit/chromium/public/WebIDBKey.h @@ -39,6 +39,8 @@ class WebSerializedScriptValue; class WebIDBKey { public: + // Please use one of the factory methods. This is public only to allow WebVector. + WebIDBKey() { } ~WebIDBKey() { reset(); } WEBKIT_API static WebIDBKey createNull(); @@ -80,7 +82,6 @@ public: #endif private: - WebIDBKey() { } WebPrivatePtr<WebCore::IDBKey> m_private; }; diff --git a/WebKit/chromium/public/WebIDBKeyPath.h b/WebKit/chromium/public/WebIDBKeyPath.h index d08ec63..db6c363 100644 --- a/WebKit/chromium/public/WebIDBKeyPath.h +++ b/WebKit/chromium/public/WebIDBKeyPath.h @@ -40,7 +40,7 @@ class WebString; class WebIDBKeyPath { public: - static WebIDBKeyPath create(const WebString&); + WEBKIT_API static WebIDBKeyPath create(const WebString&); WebIDBKeyPath(const WebIDBKeyPath& keyPath) { assign(keyPath); } ~WebIDBKeyPath() { reset(); } diff --git a/WebKit/chromium/public/WebIDBTransaction.h b/WebKit/chromium/public/WebIDBTransaction.h new file mode 100644 index 0000000..0369b89 --- /dev/null +++ b/WebKit/chromium/public/WebIDBTransaction.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebIDBTransaction_h +#define WebIDBTransaction_h + +#include "WebString.h" + +namespace WebKit { + +class WebIDBObjectStore; +class WebIDBTransactionCallbacks; + +// See comment in WebIndexedDatabase for a high level overview of these classes. +class WebIDBTransaction { +public: + virtual ~WebIDBTransaction() { } + + virtual int mode() const + { + WEBKIT_ASSERT_NOT_REACHED(); + return 0; + } + virtual WebIDBObjectStore* objectStore(const WebString& name) + { + WEBKIT_ASSERT_NOT_REACHED(); + return 0; + } + virtual void abort() { WEBKIT_ASSERT_NOT_REACHED(); } + virtual int id() const + { + WEBKIT_ASSERT_NOT_REACHED(); + return 0; + } + virtual void setCallbacks(WebIDBTransactionCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } +}; + +} // namespace WebKit + +#endif // WebIDBTransaction_h diff --git a/WebKit/chromium/public/WebIDBTransactionCallbacks.h b/WebKit/chromium/public/WebIDBTransactionCallbacks.h new file mode 100644 index 0000000..4b92217 --- /dev/null +++ b/WebKit/chromium/public/WebIDBTransactionCallbacks.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebIDBTransactionCallbacks_h +#define WebIDBTransactionCallbacks_h + +#include "WebCommon.h" + +namespace WebKit { +class WebIDBTransactionCallbacks { +public: + virtual ~WebIDBTransactionCallbacks() { } + + virtual void onAbort() { WEBKIT_ASSERT_NOT_REACHED(); } + virtual int id() const + { + WEBKIT_ASSERT_NOT_REACHED(); + return 0; + } +}; + +} // namespace WebKit + +#endif // WebIDBTransactionCallbacks_h diff --git a/WebKit/chromium/public/WebKitClient.h b/WebKit/chromium/public/WebKitClient.h index 4104175..9c0b4c2 100644 --- a/WebKit/chromium/public/WebKitClient.h +++ b/WebKit/chromium/public/WebKitClient.h @@ -33,9 +33,9 @@ #include "WebCommon.h" #include "WebData.h" -#include "WebFileSystem.h" #include "WebLocalizedString.h" #include "WebString.h" +#include "WebVector.h" #include "WebURL.h" #include <time.h> @@ -48,16 +48,20 @@ namespace WebKit { class WebApplicationCacheHost; class WebApplicationCacheHostClient; +class WebBlobRegistry; class WebClipboard; class WebCookieJar; +class WebFileSystem; class WebFileUtilities; class WebGLES2Context; class WebGraphicsContext3D; class WebIDBFactory; +class WebIDBKey; class WebMessagePortChannel; class WebMimeRegistry; class WebPluginListBuilder; class WebSandboxSupport; +class WebSerializedScriptValue; class WebSharedWorkerRepository; class WebSocketStreamHandle; class WebStorageNamespace; @@ -73,12 +77,7 @@ public: virtual WebMimeRegistry* mimeRegistry() { return 0; } // Must return non-null. - // FIXME: Clean up this one once the renaming to WebFileUtilities is done. - virtual WebFileSystem* fileSystem() { return 0; } - - // Must return non-null. - // FIXME: Clean up this one once the renaming from WebFileSystem is done. - virtual WebFileUtilities* fileUtilities() { return fileSystem(); } + virtual WebFileUtilities* fileUtilities() { return 0; } // May return null if sandbox support is not necessary virtual WebSandboxSupport* sandboxSupport() { return 0; } @@ -89,6 +88,11 @@ public: // May return null. virtual WebCookieJar* cookieJar() { return 0; } + // Blob ---------------------------------------------------------------- + + // Must return non-null. + virtual WebBlobRegistry* blobRegistry() { return 0; } + // DOM Storage -------------------------------------------------- // Return a LocalStorage namespace that corresponds to the following path. @@ -138,6 +142,7 @@ public: // Indexed Database ---------------------------------------------------- virtual WebIDBFactory* idbFactory() { return 0; } + virtual void createIDBKeysFromSerializedValuesAndKeyPath(const WebVector<WebSerializedScriptValue>& values, const WebString& keyPath, WebVector<WebIDBKey>& keys) { } // Keygen -------------------------------------------------------------- @@ -268,6 +273,11 @@ public: // May return null if it fails to create the context. virtual WebGLES2Context* createGLES2Context() { return 0; } + // FileSystem ---------------------------------------------------------- + + // Must return non-null. + virtual WebFileSystem* fileSystem() { return 0; } + protected: ~WebKitClient() { } }; diff --git a/WebKit/chromium/public/WebMediaPlayer.h b/WebKit/chromium/public/WebMediaPlayer.h index 6f51345..6cec0f5 100644 --- a/WebKit/chromium/public/WebMediaPlayer.h +++ b/WebKit/chromium/public/WebMediaPlayer.h @@ -33,6 +33,7 @@ #include "WebCanvas.h" #include "WebVector.h" +#include "WebVideoFrame.h" namespace WebKit { @@ -127,6 +128,18 @@ public: virtual bool hasSingleSecurityOrigin() const = 0; virtual MovieLoadType movieLoadType() const = 0; + + // This function returns a pointer to a WebVideoFrame, which is + // a WebKit wrapper for a video frame in chromium. This places a lock + // on the frame in chromium, and calls to this method should always be + // followed with a call to putCurrentFrame(). The ownership of this object + // is not transferred to the caller, and the caller should not free the + // returned object. + virtual WebVideoFrame* getCurrentFrame() { return 0; } + // This function releases the lock on the current video frame in Chromium. + // It should always be called after getCurrentFrame(). Frame passed to this + // method should no longer be referenced after the call is made. + virtual void putCurrentFrame(WebVideoFrame*) { } }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebNode.h b/WebKit/chromium/public/WebNode.h index fb0a99e..f54ff04 100644 --- a/WebKit/chromium/public/WebNode.h +++ b/WebKit/chromium/public/WebNode.h @@ -38,9 +38,9 @@ namespace WebCore { class Node; } namespace WebKit { +class WebDOMEventListener; +class WebDOMEventListenerPrivate; class WebDocument; -class WebEventListener; -class WebEventListenerPrivate; class WebFrame; class WebNodeList; @@ -97,8 +97,8 @@ public: WEBKIT_API WebString createMarkup() const; WEBKIT_API bool isTextNode() const; WEBKIT_API bool isElementNode() const; - WEBKIT_API void addEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture); - WEBKIT_API void removeEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture); + WEBKIT_API void addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture); + WEBKIT_API void removeEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture); WEBKIT_API void simulateClick(); WEBKIT_API WebNodeList getElementsByTagName(const WebString&) const; diff --git a/WebKit/chromium/public/WebSettings.h b/WebKit/chromium/public/WebSettings.h index 90b8553..0bef045 100644 --- a/WebKit/chromium/public/WebSettings.h +++ b/WebKit/chromium/public/WebSettings.h @@ -92,7 +92,6 @@ public: virtual void setEditingBehavior(EditingBehavior) = 0; virtual void setAcceleratedCompositingEnabled(bool) = 0; virtual void setAccelerated2dCanvasEnabled(bool) = 0; - virtual void setHTML5ParserEnabled(bool) = 0; virtual void setMemoryInfoEnabled(bool) = 0; protected: diff --git a/WebKit/chromium/public/WebSpeechInputController.h b/WebKit/chromium/public/WebSpeechInputController.h index b85fde6..0315722 100644 --- a/WebKit/chromium/public/WebSpeechInputController.h +++ b/WebKit/chromium/public/WebSpeechInputController.h @@ -35,18 +35,20 @@ namespace WebKit { +struct WebRect; + // Provides an embedder API called by WebKit. class WebSpeechInputController { public: // Starts speech recognition. Speech will get recorded until the endpointer detects silence, // runs to the limit or stopRecording is called. Progress indications and the recognized // text are returned via the listener interface. - virtual bool startRecognition(int) + virtual bool startRecognition(int requestId, const WebRect&) { - return startRecognition(); + return startRecognition(requestId); } // FIXME: Remove this once chromium has picked up this change. - virtual bool startRecognition() + virtual bool startRecognition(int) { WEBKIT_ASSERT_NOT_REACHED(); return false; @@ -54,18 +56,14 @@ public: // Cancels an ongoing recognition and discards any audio recorded so far. No partial // recognition results are returned to the listener. - virtual void cancelRecognition(int) { cancelRecognition(); } - // FIXME: Remove this once chromium has picked up this change. - virtual void cancelRecognition() { WEBKIT_ASSERT_NOT_REACHED(); } + virtual void cancelRecognition(int) { WEBKIT_ASSERT_NOT_REACHED(); } // Stops audio recording and performs recognition with the audio recorded until now // (does not discard audio). This is an optional call and is typically invoked if the user // wants to stop recording audio as soon as they finished speaking. Otherwise, the speech // recording 'endpointer' should detect silence in the input and stop recording automatically. // Call startRecognition() to record audio and recognize speech again. - virtual void stopRecording(int) { stopRecording(); } - // FIXME: Remove this once chromium has picked up this change. - virtual void stopRecording() { WEBKIT_ASSERT_NOT_REACHED(); } + virtual void stopRecording(int) { WEBKIT_ASSERT_NOT_REACHED(); } protected: virtual ~WebSpeechInputController() { } diff --git a/WebKit/chromium/public/WebSpeechInputListener.h b/WebKit/chromium/public/WebSpeechInputListener.h index e779c3a..6dc3d49 100644 --- a/WebKit/chromium/public/WebSpeechInputListener.h +++ b/WebKit/chromium/public/WebSpeechInputListener.h @@ -48,33 +48,18 @@ public: // Typically after this call the listener would update the UI to reflect that recognition is // in progress. virtual void didCompleteRecording(int) = 0; - // FIXME: Remove this once chromium has picked up this change. - virtual void didCompleteRecording() - { - didCompleteRecording(1); - } // Gives results from speech recognition, either partial or the final results. // This method can potentially get called multiple times if there are partial results // available as the user keeps speaking. If the speech could not be recognized properly // or if there was any other errors in the process, this method may never be called. virtual void setRecognitionResult(int, const WebString&) = 0; - // FIXME: Remove this once chromium has picked up this change. - virtual void setRecognitionResult(const WebString& result) - { - setRecognitionResult(1, result); - } // Informs that speech recognition has completed. This gets invoked irrespective of whether // recognition was succesful or not, whether setRecognitionResult() was invoked or not. The // handler typically frees up any temporary resources allocated and waits for the next speech // recognition request. virtual void didCompleteRecognition(int) = 0; - // FIXME: Remove this once chromium has picked up this change. - virtual void didCompleteRecognition() - { - didCompleteRecognition(1); - } protected: ~WebSpeechInputListener() { } diff --git a/WebKit/chromium/public/WebVideoFrame.h b/WebKit/chromium/public/WebVideoFrame.h new file mode 100644 index 0000000..5e34f2a --- /dev/null +++ b/WebKit/chromium/public/WebVideoFrame.h @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebVideoFrame_h +#define WebVideoFrame_h + +namespace WebKit { + +// A proxy video frame interface to communicate frame data between chromium +// and WebKit. +class WebVideoFrame { +public: + enum Format { + FormatInvalid, + FormatRGB555, + FormatRGB565, + FormatRGB24, + FormatRGB32, + FormatRGBA, + FormatYV12, + FormatYV16, + FormatNV12, + FormatEmpty, + FormatASCII, + }; + + enum SurfaceType { + SurfaceTypeSystemMemory, + SurfaceTypeOMXBufferHead, + SurfaceTypeEGLImage, + SurfaceTypeMFBuffer, + SurfaceTypeDirect3DSurface + }; + + virtual SurfaceType surfaceType() const = 0; + virtual Format format() const = 0; + virtual unsigned width() const = 0; + virtual unsigned height() const = 0; + virtual unsigned planes() const = 0; + virtual int stride(unsigned plane) const = 0; + virtual const void* data(unsigned plane) const = 0; +}; + +} // namespace WebKit + +#endif |