summaryrefslogtreecommitdiffstats
path: root/o3d/plugin/cross/np_v8_bridge.cc
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-08 21:18:06 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-08 21:18:06 +0000
commit782ce0676a7ab49b411d44a953637ad4805bc4ea (patch)
tree8e9c2b6734753d4a9886f3ce78dc94381e5c88bc /o3d/plugin/cross/np_v8_bridge.cc
parent397189ee96ffd74d8edd01c2dcfa5708981948cd (diff)
downloadchromium_src-782ce0676a7ab49b411d44a953637ad4805bc4ea.zip
chromium_src-782ce0676a7ab49b411d44a953637ad4805bc4ea.tar.gz
chromium_src-782ce0676a7ab49b411d44a953637ad4805bc4ea.tar.bz2
Rolled forward O3D's Chromium DEPS to match the Skia roll-forward in
the last CL, which broke the Linux build due to version mismatches. Thanks to tschmelcher for help with the Linux changes. Built and tested O3D on Windows, Linux and Mac OS X. BUG=none TEST=none Review URL: http://codereview.chromium.org/2952001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51895 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/plugin/cross/np_v8_bridge.cc')
-rw-r--r--o3d/plugin/cross/np_v8_bridge.cc62
1 files changed, 38 insertions, 24 deletions
diff --git a/o3d/plugin/cross/np_v8_bridge.cc b/o3d/plugin/cross/np_v8_bridge.cc
index 9e8c752..ced02d2 100644
--- a/o3d/plugin/cross/np_v8_bridge.cc
+++ b/o3d/plugin/cross/np_v8_bridge.cc
@@ -1264,27 +1264,6 @@ v8::Handle<Value> NPV8Bridge::V8PropertySetter(
return v8_result;
}
-v8::Handle<v8::Boolean> NPV8Bridge::V8PropertyQuery(Local<Value> v8_name,
- const AccessorInfo& info) {
- Local<Object> holder = info.Holder();
- NPV8Bridge* bridge = static_cast<NPV8Bridge*>(
- Local<External>::Cast(
- holder->GetInternalField(V8_NP_OBJECT_BRIDGE))->Value());
- Context::Scope scope(bridge->script_context());
-
- NPObjectPtr<NPObject> np_object = bridge->V8ToNPObject(holder);
- if (np_object.IsNull())
- return v8::Handle<v8::Boolean>();
-
- NPIdentifier np_name = V8ToNPIdentifier(v8_name);
- if (np_name == NULL)
- return v8::Handle<v8::Boolean>();
-
- bool has = NPN_HasProperty(bridge->npp_, np_object.Get(), np_name) ||
- NPN_HasMethod(bridge->npp_, np_object.Get(), np_name);
- return v8::Boolean::New(has);
-}
-
v8::Handle<v8::Boolean> NPV8Bridge::V8PropertyDeleter(
Local<Value> v8_name,
const AccessorInfo& info) {
@@ -1322,10 +1301,28 @@ v8::Handle<Value> NPV8Bridge::V8NamedPropertySetter(Local<v8::String> v8_name,
return V8PropertySetter(v8_name, v8_value, info);
}
-v8::Handle<v8::Boolean> NPV8Bridge::V8NamedPropertyQuery(
+v8::Handle<v8::Integer> NPV8Bridge::V8NamedPropertyQuery(
Local<v8::String> v8_name,
const AccessorInfo& info) {
- return V8PropertyQuery(v8_name, info);
+ Local<Object> holder = info.Holder();
+ NPV8Bridge* bridge = static_cast<NPV8Bridge*>(
+ Local<External>::Cast(
+ holder->GetInternalField(V8_NP_OBJECT_BRIDGE))->Value());
+ Context::Scope scope(bridge->script_context());
+
+ NPObjectPtr<NPObject> np_object = bridge->V8ToNPObject(holder);
+ if (np_object.IsNull())
+ return v8::Handle<v8::Integer>();
+
+ NPIdentifier np_name = V8ToNPIdentifier(v8_name);
+ if (np_name == NULL)
+ return v8::Handle<v8::Integer>();
+
+ bool has = NPN_HasProperty(bridge->npp_, np_object.Get(), np_name) ||
+ NPN_HasMethod(bridge->npp_, np_object.Get(), np_name);
+ if (!has)
+ return v8::Handle<v8::Integer>();
+ return v8::Integer::New(0);
}
v8::Handle<v8::Boolean> NPV8Bridge::V8NamedPropertyDeleter(
@@ -1365,7 +1362,24 @@ v8::Handle<Value> NPV8Bridge::V8IndexedPropertySetter(
v8::Handle<v8::Boolean> NPV8Bridge::V8IndexedPropertyQuery(
uint32_t index,
const AccessorInfo& info) {
- return V8PropertyQuery(Integer::New(index), info);
+ Local<Object> holder = info.Holder();
+ NPV8Bridge* bridge = static_cast<NPV8Bridge*>(
+ Local<External>::Cast(
+ holder->GetInternalField(V8_NP_OBJECT_BRIDGE))->Value());
+ Context::Scope scope(bridge->script_context());
+
+ NPObjectPtr<NPObject> np_object = bridge->V8ToNPObject(holder);
+ if (np_object.IsNull())
+ return v8::Handle<v8::Boolean>();
+
+ Local<Value> v8_name = Integer::New(index);
+ NPIdentifier np_name = V8ToNPIdentifier(v8_name);
+ if (np_name == NULL)
+ return v8::Handle<v8::Boolean>();
+
+ bool has = NPN_HasProperty(bridge->npp_, np_object.Get(), np_name) ||
+ NPN_HasMethod(bridge->npp_, np_object.Get(), np_name);
+ return v8::Boolean::New(has);
}
v8::Handle<v8::Boolean> NPV8Bridge::V8IndexedPropertyDeleter(