diff options
author | rdevlin.cronin <rdevlin.cronin@chromium.org> | 2016-03-11 09:02:17 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-11 17:03:41 +0000 |
commit | 2bda7ad3889d539b27e514226d696b6b024e2ac5 (patch) | |
tree | 79e10098acf9dacbe1fc0b142d3b30838a7f58aa /extensions/renderer/v8_helpers.h | |
parent | db433eabe1d4854125e00885fbba073ada75ad94 (diff) | |
download | chromium_src-2bda7ad3889d539b27e514226d696b6b024e2ac5.zip chromium_src-2bda7ad3889d539b27e514226d696b6b024e2ac5.tar.gz chromium_src-2bda7ad3889d539b27e514226d696b6b024e2ac5.tar.bz2 |
[Extensions] Use V8ValueConverter in i18n custom bindings
Instead of manually constructing a v8 object for i18n results, use the
V8 value converter to convert a base::Value. This helps us
a) Have fewer places that rely on v8_helpers::SetProperty, which should be
phased out for SetPrivateProperty.
b) Simplify the conversion so that if v8 apis change, we have to update fewer
places.
BUG=591164
Review URL: https://codereview.chromium.org/1782673006
Cr-Commit-Position: refs/heads/master@{#380655}
Diffstat (limited to 'extensions/renderer/v8_helpers.h')
-rw-r--r-- | extensions/renderer/v8_helpers.h | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/extensions/renderer/v8_helpers.h b/extensions/renderer/v8_helpers.h index 560beee..b0dd17a 100644 --- a/extensions/renderer/v8_helpers.h +++ b/extensions/renderer/v8_helpers.h @@ -71,23 +71,6 @@ inline bool SetProperty(v8::Local<v8::Context> context, return IsTrue(object->DefineOwnProperty(context, key, value)); } -inline bool SetProperty(v8::Local<v8::Context> context, - v8::Local<v8::Object> object, - const char* key, - v8::Local<v8::Value> value) { - v8::Local<v8::String> v8_key; - if (!ToV8String(context->GetIsolate(), key, &v8_key)) - return false; - return SetProperty(context, object, v8_key, value); -} - -inline bool SetProperty(v8::Local<v8::Context> context, - v8::Local<v8::Object> object, - uint32_t index, - v8::Local<v8::Value> value) { - return SetProperty(context, object, base::UintToString(index).c_str(), value); -} - // Wraps v8::Object::SetPrivate(). When possible, prefer this to SetProperty(). inline bool SetPrivateProperty(v8::Local<v8::Context> context, v8::Local<v8::Object> object, |