Diff
Modified: trunk/Source/WebKit/chromium/ChangeLog (120752 => 120753)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-06-19 21:12:46 UTC (rev 120752)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-06-19 21:19:37 UTC (rev 120753)
@@ -1,3 +1,31 @@
+2012-06-19 Joshua Bell <[email protected]>
+
+ IndexedDB: Add new type (and chromium webkit API) for metadata snapshot
+ https://bugs.webkit.org/show_bug.cgi?id=88678
+
+ Reviewed by Darin Fisher.
+
+ * WebKit.gyp:
+ * public/WebIDBDatabase.h:
+ (WebKit::WebIDBDatabase::metadata):
+ * public/WebIDBKeyPath.h:
+ (WebIDBKeyPath):
+ (WebKit::WebIDBKeyPath::WebIDBKeyPath):
+ (WebKit::WebIDBKeyPath::~WebIDBKeyPath):
+ (WebKit::WebIDBKeyPath::operator=): Used by Chromium backend.
+ * public/WebIDBMetadata.h: Added new type.
+ (WebKit):
+ (WebIDBMetadata):
+ (WebKit::WebIDBMetadata::WebIDBMetadata):
+ (ObjectStore):
+ (WebKit::WebIDBMetadata::ObjectStore::ObjectStore):
+ (Index):
+ (WebKit::WebIDBMetadata::Index::Index):
+ * src/WebIDBKeyPath.cpp: Conform to normal WebXXX patern.
+ (WebKit::WebIDBKeyPath::assign):
+ (WebKit):
+ (WebKit::WebIDBKeyPath::reset):
+
2012-06-19 Amy Ousterhout <[email protected]>
[Chromium] Style Fix in WebDeviceOrientationController
Modified: trunk/Source/WebKit/chromium/WebKit.gyp (120752 => 120753)
--- trunk/Source/WebKit/chromium/WebKit.gyp 2012-06-19 21:12:46 UTC (rev 120752)
+++ trunk/Source/WebKit/chromium/WebKit.gyp 2012-06-19 21:19:37 UTC (rev 120753)
@@ -181,6 +181,7 @@
'public/WebIDBKey.h',
'public/WebIDBKeyPath.h',
'public/WebIDBKeyRange.h',
+ 'public/WebIDBMetadata.h',
'public/WebIDBObjectStore.h',
'public/WebIDBTransaction.h',
'public/WebIDBTransactionCallbacks.h',
Modified: trunk/Source/WebKit/chromium/public/WebIDBDatabase.h (120752 => 120753)
--- trunk/Source/WebKit/chromium/public/WebIDBDatabase.h 2012-06-19 21:12:46 UTC (rev 120752)
+++ trunk/Source/WebKit/chromium/public/WebIDBDatabase.h 2012-06-19 21:19:37 UTC (rev 120753)
@@ -28,6 +28,7 @@
#include "WebDOMStringList.h"
#include "WebExceptionCode.h"
+#include "WebIDBMetadata.h"
#include "platform/WebCommon.h"
namespace WebKit {
@@ -44,6 +45,11 @@
public:
virtual ~WebIDBDatabase() { }
+ virtual WebIDBMetadata metadata() const
+ {
+ WEBKIT_ASSERT_NOT_REACHED();
+ return WebIDBMetadata();
+ }
virtual WebString name() const
{
WEBKIT_ASSERT_NOT_REACHED();
Modified: trunk/Source/WebKit/chromium/public/WebIDBKeyPath.h (120752 => 120753)
--- trunk/Source/WebKit/chromium/public/WebIDBKeyPath.h 2012-06-19 21:12:46 UTC (rev 120752)
+++ trunk/Source/WebKit/chromium/public/WebIDBKeyPath.h 2012-06-19 21:19:37 UTC (rev 120753)
@@ -31,11 +31,6 @@
#include "platform/WebString.h"
#include "platform/WebVector.h"
-namespace WTF {
-template<typename T, size_t inlineCapacity> class Vector;
-class String;
-}
-
namespace WebCore { class IDBKeyPath; }
namespace WebKit {
@@ -45,9 +40,18 @@
WEBKIT_EXPORT static WebIDBKeyPath create(const WebString&);
WEBKIT_EXPORT static WebIDBKeyPath create(const WebVector<WebString>&);
WEBKIT_EXPORT static WebIDBKeyPath createNull();
- WEBKIT_EXPORT WebIDBKeyPath(const WebIDBKeyPath&);
- WEBKIT_EXPORT ~WebIDBKeyPath();
+ WebIDBKeyPath(const WebIDBKeyPath& keyPath) { assign(keyPath); }
+ virtual ~WebIDBKeyPath() { reset(); }
+ WebIDBKeyPath& operator=(const WebIDBKeyPath& keyPath)
+ {
+ assign(keyPath);
+ return *this;
+ }
+
+ WEBKIT_EXPORT void reset();
+ WEBKIT_EXPORT void assign(const WebIDBKeyPath&);
+
enum Type {
NullType = 0,
StringType,
Copied: trunk/Source/WebKit/chromium/public/WebIDBMetadata.h (from rev 120752, trunk/Source/WebKit/chromium/public/WebIDBKeyPath.h) (0 => 120753)
--- trunk/Source/WebKit/chromium/public/WebIDBMetadata.h (rev 0)
+++ trunk/Source/WebKit/chromium/public/WebIDBMetadata.h 2012-06-19 21:19:37 UTC (rev 120753)
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2012 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 WebIDBMetadata_h
+#define WebIDBMetadata_h
+
+#include "WebIDBKeyPath.h"
+#include "platform/WebCommon.h"
+#include "platform/WebString.h"
+#include "platform/WebVector.h"
+
+namespace WebKit {
+
+struct WebIDBMetadata {
+ struct Index;
+ struct ObjectStore;
+
+ WebString name;
+ WebString version;
+ WebVector<ObjectStore> objectStores;
+ WebIDBMetadata() { }
+
+ struct ObjectStore {
+ WebString name;
+ WebIDBKeyPath keyPath;
+ bool autoIncrement;
+ WebVector<Index> indexes;
+ ObjectStore()
+ : keyPath(WebIDBKeyPath::createNull())
+ , autoIncrement(false) { }
+ };
+
+ struct Index {
+ WebString name;
+ WebIDBKeyPath keyPath;
+ bool unique;
+ bool multiEntry;
+ Index()
+ : keyPath(WebIDBKeyPath::createNull())
+ , unique(false)
+ , multiEntry(false) { }
+ };
+};
+
+
+} // namespace WebKit
+
+#endif // WebIDBMetadata_h
Modified: trunk/Source/WebKit/chromium/src/WebIDBKeyPath.cpp (120752 => 120753)
--- trunk/Source/WebKit/chromium/src/WebIDBKeyPath.cpp 2012-06-19 21:12:46 UTC (rev 120752)
+++ trunk/Source/WebKit/chromium/src/WebIDBKeyPath.cpp 2012-06-19 21:19:37 UTC (rev 120753)
@@ -37,11 +37,6 @@
namespace WebKit {
-WebIDBKeyPath::~WebIDBKeyPath()
-{
- m_private.reset(0);
-}
-
WebIDBKeyPath WebIDBKeyPath::create(const WebString& keyPath)
{
return WebIDBKeyPath(IDBKeyPath(keyPath));
@@ -60,6 +55,17 @@
return WebIDBKeyPath(IDBKeyPath());
}
+void WebIDBKeyPath::assign(const WebIDBKeyPath& keyPath)
+{
+ ASSERT(keyPath.m_private.get());
+ m_private.reset(new IDBKeyPath(keyPath));
+}
+
+void WebIDBKeyPath::reset()
+{
+ m_private.reset(0);
+}
+
bool WebIDBKeyPath::isValid() const
{
ASSERT(m_private.get());
@@ -87,12 +93,6 @@
return m_private->string();
}
-WebIDBKeyPath::WebIDBKeyPath(const WebIDBKeyPath& keyPath)
- : m_private(new IDBKeyPath(keyPath))
-{
- ASSERT(m_private.get());
-}
-
WebIDBKeyPath::WebIDBKeyPath(const WebCore::IDBKeyPath& value)
: m_private(new IDBKeyPath(value))
{