summaryrefslogtreecommitdiffstats
path: root/extensions/renderer/v8_helpers.h
diff options
context:
space:
mode:
authorbashi <bashi@chromium.org>2015-06-29 22:44:20 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-30 05:45:07 +0000
commitfacd48b87e81813aabcb7bccd7ae98d6db089cd6 (patch)
tree66becb105cf71f4ea01a129932ea197479e35ae5 /extensions/renderer/v8_helpers.h
parent309e0545fa27c4469a673d4057a8d4e280bbdda1 (diff)
downloadchromium_src-facd48b87e81813aabcb7bccd7ae98d6db089cd6.zip
chromium_src-facd48b87e81813aabcb7bccd7ae98d6db089cd6.tar.gz
chromium_src-facd48b87e81813aabcb7bccd7ae98d6db089cd6.tar.bz2
extensions: Use V8 Maybe version of GetFunction()
Also use As<v8::Object>() for return value of gin::CreateHandle() because it should always be an object. BUG=479065 Review URL: https://codereview.chromium.org/1208333002 Cr-Commit-Position: refs/heads/master@{#336731}
Diffstat (limited to 'extensions/renderer/v8_helpers.h')
-rw-r--r--extensions/renderer/v8_helpers.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/extensions/renderer/v8_helpers.h b/extensions/renderer/v8_helpers.h
index 77e2eb8..012cff8 100644
--- a/extensions/renderer/v8_helpers.h
+++ b/extensions/renderer/v8_helpers.h
@@ -39,6 +39,13 @@ inline v8::Local<v8::String> ToV8StringUnsafe(
.ToLocalChecked();
}
+inline v8::Local<v8::String> ToV8StringUnsafe(
+ v8::Isolate* isolate,
+ const std::string& str,
+ v8::NewStringType string_type = v8::NewStringType::kNormal) {
+ return ToV8StringUnsafe(isolate, str.c_str(), string_type);
+}
+
// Returns true if |maybe| is both a value, and that value is true.
inline bool IsTrue(v8::Maybe<bool> maybe) {
return maybe.IsJust() && maybe.FromJust();