summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-17 21:18:23 +0000
committerjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-17 21:18:23 +0000
commit6ec209c7941078ee08558fced68739417cdbd54f (patch)
tree014c0c111b3869cfdbe741ae322469a27db7a39b /webkit
parentc4e051d22338feb2ee5e3b276098904ae5f5208a (diff)
downloadchromium_src-6ec209c7941078ee08558fced68739417cdbd54f.zip
chromium_src-6ec209c7941078ee08558fced68739417cdbd54f.tar.gz
chromium_src-6ec209c7941078ee08558fced68739417cdbd54f.tar.bz2
TEST=none
BUG=14006 A first pass at the DOM Storage V8 bindings. Android needs these ASAP and Chromium will need them soon. I've created my own test suite which I will be converting into layout tests over time and used this to manually test on a slightly hacked up version of Chromium running with --single-process. Before these changes are compiled into Chrome by default, I will add tests. I've taken the GYP and webview_impl out of this patch since we don't want it to be compiled in by default yet. Review URL: http://codereview.chromium.org/125035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18655 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/port/bindings/scripts/CodeGeneratorV8.pm1
-rw-r--r--webkit/port/bindings/v8/DOMObjectsInclude.h5
-rw-r--r--webkit/port/bindings/v8/v8_index.cpp5
-rw-r--r--webkit/port/bindings/v8/v8_index.h11
-rw-r--r--webkit/port/bindings/v8/v8_proxy.cpp15
-rw-r--r--webkit/port/bindings/v8/v8_proxy.h5
6 files changed, 41 insertions, 1 deletions
diff --git a/webkit/port/bindings/scripts/CodeGeneratorV8.pm b/webkit/port/bindings/scripts/CodeGeneratorV8.pm
index ba747fd..8b2b18c 100644
--- a/webkit/port/bindings/scripts/CodeGeneratorV8.pm
+++ b/webkit/port/bindings/scripts/CodeGeneratorV8.pm
@@ -1728,6 +1728,7 @@ my %typeCanFailConversion = (
"NSResolver" => 0,
"Range" => 0,
"SQLResultSet" => 0,
+ "Storage" => 0,
"SVGAngle" => 0,
"SVGElement" => 0,
"SVGLength" => 1,
diff --git a/webkit/port/bindings/v8/DOMObjectsInclude.h b/webkit/port/bindings/v8/DOMObjectsInclude.h
index 671e982..8f6fec4 100644
--- a/webkit/port/bindings/v8/DOMObjectsInclude.h
+++ b/webkit/port/bindings/v8/DOMObjectsInclude.h
@@ -127,6 +127,11 @@
#include "XPathNSResolver.h"
#include "XPathResult.h"
+#if ENABLE(DOM_STORAGE)
+#include "Storage.h"
+#include "StorageEvent.h"
+#endif
+
#if ENABLE(SVG)
#include "SVGAngle.h"
#include "SVGAnimatedPoints.h"
diff --git a/webkit/port/bindings/v8/v8_index.cpp b/webkit/port/bindings/v8/v8_index.cpp
index 60757b6..7e057ad 100644
--- a/webkit/port/bindings/v8/v8_index.cpp
+++ b/webkit/port/bindings/v8/v8_index.cpp
@@ -202,6 +202,11 @@
#include "V8XSLTProcessor.h"
#include "V8RGBColor.h"
+#if ENABLE(DOM_STORAGE)
+#include "V8Storage.h"
+#include "V8StorageEvent.h"
+#endif
+
#if ENABLE(SVG_ANIMATION)
#include "V8SVGAnimateColorElement.h"
#include "V8SVGAnimateElement.h"
diff --git a/webkit/port/bindings/v8/v8_index.h b/webkit/port/bindings/v8/v8_index.h
index c347ceb..f80eb5e 100644
--- a/webkit/port/bindings/v8/v8_index.h
+++ b/webkit/port/bindings/v8/v8_index.h
@@ -349,10 +349,19 @@ typedef v8::Persistent<v8::FunctionTemplate> (*FunctionTemplateFactory)();
#define DOM_OBJECT_DATABASE_TYPES(V)
#endif
+#if ENABLE(DOM_STORAGE)
+#define DOM_OBJECT_STORAGE_TYPES(V) \
+ V(STORAGE, Storage) \
+ V(STORAGEEVENT, StorageEvent)
+#else
+#define DOM_OBJECT_STORAGE_TYPES(V)
+#endif
+
#define DOM_OBJECT_TYPES(V) \
DOM_OBJECT_TYPES_1(V) \
DOM_OBJECT_TYPES_2(V) \
- DOM_OBJECT_DATABASE_TYPES(V)
+ DOM_OBJECT_DATABASE_TYPES(V) \
+ DOM_OBJECT_STORAGE_TYPES(V)
#if ENABLE(SVG)
// SVG_OBJECT_TYPES are svg non-node, non-pod types.
diff --git a/webkit/port/bindings/v8/v8_proxy.cpp b/webkit/port/bindings/v8/v8_proxy.cpp
index 706a620..6cffe3a 100644
--- a/webkit/port/bindings/v8/v8_proxy.cpp
+++ b/webkit/port/bindings/v8/v8_proxy.cpp
@@ -1459,6 +1459,21 @@ v8::Persistent<v8::FunctionTemplate> V8Proxy::GetTemplate(
collectionIndexedPropertyEnumerator<NamedNodeMap>,
v8::Integer::New(V8ClassIndex::NODE));
break;
+#if ENABLE(DOM_STORAGE)
+ case V8ClassIndex::STORAGE:
+ desc->InstanceTemplate()->SetNamedPropertyHandler(
+ USE_NAMED_PROPERTY_GETTER(Storage),
+ USE_NAMED_PROPERTY_SETTER(Storage),
+ 0,
+ USE_NAMED_PROPERTY_DELETER(Storage),
+ V8Custom::v8StorageNamedPropertyEnumerator);
+ desc->InstanceTemplate()->SetIndexedPropertyHandler(
+ USE_INDEXED_PROPERTY_GETTER(Storage),
+ USE_INDEXED_PROPERTY_SETTER(Storage),
+ 0,
+ USE_INDEXED_PROPERTY_DELETER(Storage));
+ break;
+#endif
case V8ClassIndex::NODELIST:
setCollectionIndexedGetter<NodeList, Node>(desc, V8ClassIndex::NODE);
desc->InstanceTemplate()->SetNamedPropertyHandler(
diff --git a/webkit/port/bindings/v8/v8_proxy.h b/webkit/port/bindings/v8/v8_proxy.h
index b1059e9..6bfff64 100644
--- a/webkit/port/bindings/v8/v8_proxy.h
+++ b/webkit/port/bindings/v8/v8_proxy.h
@@ -72,6 +72,11 @@ class CSSValueList;
class NodeFilter;
class ScriptExecutionContext;
+#if ENABLE(DOM_STORAGE)
+class Storage;
+class StorageEvent;
+#endif
+
#if ENABLE(SVG)
class SVGElementInstance;
#endif