[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Wed Apr 7 23:27:39 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit ca262b42a95755d6eba8d89f7beb7d7c7790dd7f
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 9 21:55:01 2009 +0000

    2009-11-09  Yaar Schnitman  <yaar at chromium.org>
    
            Reviewed by Eric Seidel.
    
            Upstreaming the Chromium WebKit API: WebSockets and WebStorage.
    
            https://bugs.webkit.org/show_bug.cgi?id=28394
    
            * public/WebSocketStreamError.h: Added.
            * public/WebSocketStreamHandle.h: Added.
            (WebKit::WebSocketStreamHandle::~WebSocketStreamHandle):
            * public/WebSocketStreamHandleClient.h: Added.
            * public/WebStorageArea.h: Added.
            (WebKit::WebStorageArea::~WebStorageArea):
            * public/WebStorageEventDispatcher.h: Added.
            (WebKit::WebStorageEventDispatcher::~WebStorageEventDispatcher):
            * public/WebStorageNamespace.h: Added.
            (WebKit::WebStorageNamespace::~WebStorageNamespace):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50688 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 43958a6..60ee5b8 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,5 +1,24 @@
 2009-11-09  Yaar Schnitman  <yaar at chromium.org>
 
+        Reviewed by Eric Seidel.
+
+        Upstreaming the Chromium WebKit API: WebSockets and WebStorage.
+
+        https://bugs.webkit.org/show_bug.cgi?id=28394
+
+        * public/WebSocketStreamError.h: Added.
+        * public/WebSocketStreamHandle.h: Added.
+        (WebKit::WebSocketStreamHandle::~WebSocketStreamHandle):
+        * public/WebSocketStreamHandleClient.h: Added.
+        * public/WebStorageArea.h: Added.
+        (WebKit::WebStorageArea::~WebStorageArea):
+        * public/WebStorageEventDispatcher.h: Added.
+        (WebKit::WebStorageEventDispatcher::~WebStorageEventDispatcher):
+        * public/WebStorageNamespace.h: Added.
+        (WebKit::WebStorageNamespace::~WebStorageNamespace):
+
+2009-11-09  Yaar Schnitman  <yaar at chromium.org>
+
         Reviewed by Dimitri Glazkov.
 
         Upstreaming the Chromium WebKit API: WebString and other basic objects.
diff --git a/WebKit/chromium/public/WebSocketStreamError.h b/WebKit/chromium/public/WebSocketStreamError.h
new file mode 100644
index 0000000..f52869b
--- /dev/null
+++ b/WebKit/chromium/public/WebSocketStreamError.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2009 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 WebSocketStreamError_h
+#define WebSocketStreamError_h
+
+#include "WebCommon.h"
+
+namespace WebKit {
+
+class WebSocketStreamError {
+public:
+    // FIXME: Define SocketStream Error codes and accessor methods.
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebSocketStreamHandle.h b/WebKit/chromium/public/WebSocketStreamHandle.h
new file mode 100644
index 0000000..ededa0e
--- /dev/null
+++ b/WebKit/chromium/public/WebSocketStreamHandle.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2009 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 WebSocketStreamHandle_h
+#define WebSocketStreamHandle_h
+
+#include "WebCommon.h"
+
+namespace WebKit {
+
+class WebData;
+class WebSocketStreamHandleClient;
+class WebURL;
+
+class WebSocketStreamHandle {
+public:
+    virtual ~WebSocketStreamHandle() { }
+
+    // Connect new socket stream asynchronously.
+    virtual void connect(const WebURL&, WebSocketStreamHandleClient*) = 0;
+
+    // Send web socket frame data on the socket stream.
+    virtual bool send(const WebData&) = 0;
+
+    // Close the socket stream.
+    virtual void close() = 0;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebSocketStreamHandleClient.h b/WebKit/chromium/public/WebSocketStreamHandleClient.h
new file mode 100644
index 0000000..7dcf9a5
--- /dev/null
+++ b/WebKit/chromium/public/WebSocketStreamHandleClient.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2009 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 WebSocketStreamHandleClient_h
+#define WebSocketStreamHandleClient_h
+
+#include "WebCommon.h"
+
+namespace WebKit {
+
+class WebData;
+class WebSocketStreamError;
+class WebSocketStreamHandle;
+class WebURL;
+
+class WebSocketStreamHandleClient {
+public:
+
+    // Called when WebSocketStreamHandle is going to open the URL.
+    virtual void willOpenStream(WebSocketStreamHandle*, const WebURL&) = 0;
+
+    // Called when Socket Stream is opened.
+    virtual void didOpenStream(WebSocketStreamHandle*, int /* maxPendingSendAllowed */) = 0;
+
+    // Called when |amountSent| bytes are sent.
+    virtual void didSendData(WebSocketStreamHandle*, int /* amountSent */) = 0;
+
+    // Called when data are received.
+    virtual void didReceiveData(WebSocketStreamHandle*, const WebData&) = 0;
+
+    // Called when Socket Stream is closed.
+    virtual void didClose(WebSocketStreamHandle*) = 0;
+
+    // Called when Socket Stream has an error.
+    virtual void didFail(WebSocketStreamHandle*, const WebSocketStreamError&) = 0;
+
+    // FIXME: auth challenge for proxy
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebStorageArea.h b/WebKit/chromium/public/WebStorageArea.h
new file mode 100644
index 0000000..71dc7a5
--- /dev/null
+++ b/WebKit/chromium/public/WebStorageArea.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2009 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 WebStorageArea_h
+#define WebStorageArea_h
+
+#include "WebCommon.h"
+
+namespace WebKit {
+
+class WebString;
+class WebURL;
+
+// In WebCore, there's one distinct StorageArea per origin per StorageNamespace. This
+// class wraps a StorageArea.  All the methods have obvious connections to the spec:
+// http://dev.w3.org/html5/webstorage/
+class WebStorageArea {
+public:
+    virtual ~WebStorageArea() { }
+
+    // The number of key/value pairs in the storage area.
+    virtual unsigned length() = 0;
+
+    // Get a value for a specific key. Valid key indices are 0 through length() - 1.
+    // Indexes may change on any set/removeItem call. Will return null if the index
+    // provided is out of range.
+    virtual WebString key(unsigned index) = 0;
+
+    // Get the value that corresponds to a specific key. This returns null if there is
+    // no entry for that key.
+    virtual WebString getItem(const WebString& key) = 0;
+
+    // Set the value that corresponds to a specific key. QuotaException is set if we've
+    // the StorageArea would have exceeded its quota. The value is NOT set when there's
+    // an exception.  url is the url that should be used if a storage event fires.
+    virtual void setItem(const WebString& key, const WebString& value, const WebURL& url, bool& quotaException) = 0;
+
+    // Remove the value associated with a particular key.  url is the url that should be used
+    // if a storage event fires.
+    virtual void removeItem(const WebString& key, const WebURL& url) = 0;
+
+    // Clear all key/value pairs.  url is the url that should be used if a storage event fires.
+    virtual void clear(const WebURL& url) = 0;
+};
+
+} // namespace WebKit
+
+#endif // WebStorageArea_h
diff --git a/WebKit/chromium/public/WebStorageEventDispatcher.h b/WebKit/chromium/public/WebStorageEventDispatcher.h
new file mode 100644
index 0000000..57750e8
--- /dev/null
+++ b/WebKit/chromium/public/WebStorageEventDispatcher.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2009 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 WebStorageEventDispatcher_h
+#define WebStorageEventDispatcher_h
+
+#include "WebString.h"
+
+namespace WebKit {
+
+class WebURL;
+
+// This is used to dispatch storage events to all pages.
+// FIXME: Make this (or something) work for SessionStorage!
+class WebStorageEventDispatcher {
+public:
+    static WebStorageEventDispatcher* create();
+
+    virtual ~WebStorageEventDispatcher() { }
+
+    // Dispatch the actual event.  Doesn't yet work for SessionStorage.
+    virtual void dispatchStorageEvent(const WebString& key, const WebString& oldValue,
+                                      const WebString& newValue, const WebString& origin,
+                                      const WebURL& url, bool isLocalStorage) = 0;
+};
+
+} // namespace WebKit
+
+#endif // WebStorageEventDispatcher_h
diff --git a/WebKit/chromium/public/WebStorageNamespace.h b/WebKit/chromium/public/WebStorageNamespace.h
new file mode 100644
index 0000000..da92a77
--- /dev/null
+++ b/WebKit/chromium/public/WebStorageNamespace.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2009 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 WebStorageNamespace_h
+#define WebStorageNamespace_h
+
+#include "WebCommon.h"
+
+namespace WebKit {
+
+class WebStorageArea;
+class WebString;
+
+// WebStorageNamespace represents a collection of StorageAreas. Typically, you'll have
+// multiple StorageNamespaces to represent the SessionStorage for each tab and a single
+// StorageNamespace to represent LocalStorage for the entire browser.
+class WebStorageNamespace {
+public:
+    // Create a new WebStorageNamespace. LocalStorageNamespaces require a path to specify
+    // where the SQLite databases that make LocalStorage data persistent are located.
+    // If path is empty, data will not persist. You should call delete on the returned
+    // object when you're finished.
+    WEBKIT_API static WebStorageNamespace* createLocalStorageNamespace(const WebString& backingDirectoryPath, unsigned quota);
+    WEBKIT_API static WebStorageNamespace* createSessionStorageNamespace();
+
+    static const unsigned noQuota = UINT_MAX;
+
+    virtual ~WebStorageNamespace() { }
+
+    // Create a new WebStorageArea object. Two subsequent calls with the same origin
+    // will return two different WebStorageArea objects that share the same backing store.
+    // You should call delete on the returned object when you're finished.
+    virtual WebStorageArea* createStorageArea(const WebString& origin) = 0;
+
+    // Copy a StorageNamespace. This only makes sense in the case of SessionStorage.
+    virtual WebStorageNamespace* copy() = 0;
+
+    // Shutdown the StorageNamespace. Write all StorageArea's to disk and disallow new
+    // write activity.
+    virtual void close() = 0;
+};
+
+} // namespace WebKit
+
+#endif // WebStorageNamespace_h

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list