Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(765)

Unified Diff: extensions/renderer/v8_schema_registry.cc

Issue 1167423002: Use V8 Maybe APIs in extensions/renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/renderer/v8_maybe_helpers.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/v8_schema_registry.cc
diff --git a/extensions/renderer/v8_schema_registry.cc b/extensions/renderer/v8_schema_registry.cc
index 65b1bed5d404877b611c529d19d837ca34f78eeb..3be5ac10a5c1138ba80cb383dc13016d034293b7 100644
--- a/extensions/renderer/v8_schema_registry.cc
+++ b/extensions/renderer/v8_schema_registry.cc
@@ -10,6 +10,7 @@
#include "extensions/common/extension_api.h"
#include "extensions/renderer/object_backed_native_handler.h"
#include "extensions/renderer/script_context.h"
+#include "extensions/renderer/v8_maybe_helpers.h"
using content::V8ValueConverter;
@@ -65,14 +66,15 @@ v8::Local<v8::Array> V8SchemaRegistry::GetSchemas(
const std::vector<std::string>& apis) {
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::EscapableHandleScope handle_scope(isolate);
- v8::Context::Scope context_scope(GetOrCreateContext(isolate));
+ v8::Local<v8::Context> context = GetOrCreateContext(isolate);
+ v8::Context::Scope context_scope(context);
v8::Local<v8::Array> v8_apis(v8::Array::New(isolate, apis.size()));
size_t api_index = 0;
for (std::vector<std::string>::const_iterator i = apis.begin();
i != apis.end();
++i) {
- v8_apis->Set(api_index++, GetSchema(*i));
+ SetProperty(context, v8_apis, api_index++, GetSchema(*i));
}
return handle_scope.Escape(v8_apis);
}
« no previous file with comments | « extensions/renderer/v8_maybe_helpers.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698