diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-12 22:03:11 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-12 22:03:11 +0000 |
commit | 83820d454c4ffe31faeb8a726a3ebb033f6ac71c (patch) | |
tree | 2a0a6fa84e6d477d755b304eb314fa0b8a3bbfc2 /content/renderer/v8_value_converter_impl.cc | |
parent | 31a7eef76caaaa50d57166c26ebe2f9625000642 (diff) | |
download | chromium_src-83820d454c4ffe31faeb8a726a3ebb033f6ac71c.zip chromium_src-83820d454c4ffe31faeb8a726a3ebb033f6ac71c.tar.gz chromium_src-83820d454c4ffe31faeb8a726a3ebb033f6ac71c.tar.bz2 |
Enable extension APIs for content scripts.
This only enables extension functions. I will do events in a
separate change.
BUG=81760,80308
Review URL: http://codereview.chromium.org/8540012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109812 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/v8_value_converter_impl.cc')
-rw-r--r-- | content/renderer/v8_value_converter_impl.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/content/renderer/v8_value_converter_impl.cc b/content/renderer/v8_value_converter_impl.cc index 218624a..b0762ef 100644 --- a/content/renderer/v8_value_converter_impl.cc +++ b/content/renderer/v8_value_converter_impl.cc @@ -26,7 +26,7 @@ V8ValueConverterImpl::V8ValueConverterImpl() } v8::Handle<v8::Value> V8ValueConverterImpl::ToV8Value( - Value* value, v8::Handle<v8::Context> context) const { + const Value* value, v8::Handle<v8::Context> context) const { v8::Context::Scope context_scope(context); v8::HandleScope handle_scope; return handle_scope.Close(ToV8ValueImpl(value)); @@ -40,7 +40,8 @@ Value* V8ValueConverterImpl::FromV8Value( return FromV8ValueImpl(val); } -v8::Handle<v8::Value> V8ValueConverterImpl::ToV8ValueImpl(Value* value) const { +v8::Handle<v8::Value> V8ValueConverterImpl::ToV8ValueImpl( + const Value* value) const { CHECK(value); switch (value->GetType()) { case Value::TYPE_NULL: @@ -71,10 +72,10 @@ v8::Handle<v8::Value> V8ValueConverterImpl::ToV8ValueImpl(Value* value) const { } case Value::TYPE_LIST: - return ToV8Array(static_cast<ListValue*>(value)); + return ToV8Array(static_cast<const ListValue*>(value)); case Value::TYPE_DICTIONARY: - return ToV8Object(static_cast<DictionaryValue*>(value)); + return ToV8Object(static_cast<const DictionaryValue*>(value)); default: LOG(ERROR) << "Unexpected value type: " << value->GetType(); @@ -82,7 +83,8 @@ v8::Handle<v8::Value> V8ValueConverterImpl::ToV8ValueImpl(Value* value) const { } } -v8::Handle<v8::Value> V8ValueConverterImpl::ToV8Array(ListValue* val) const { +v8::Handle<v8::Value> V8ValueConverterImpl::ToV8Array( + const ListValue* val) const { v8::Handle<v8::Array> result(v8::Array::New(val->GetSize())); for (size_t i = 0; i < val->GetSize(); ++i) { @@ -102,7 +104,7 @@ v8::Handle<v8::Value> V8ValueConverterImpl::ToV8Array(ListValue* val) const { } v8::Handle<v8::Value> V8ValueConverterImpl::ToV8Object( - DictionaryValue* val) const { + const DictionaryValue* val) const { v8::Handle<v8::Object> result(v8::Object::New()); for (DictionaryValue::key_iterator iter = val->begin_keys(); |