Index: extensions/renderer/runtime_custom_bindings.cc |
diff --git a/extensions/renderer/runtime_custom_bindings.cc b/extensions/renderer/runtime_custom_bindings.cc |
index 915abf8be4fb0d4a89b6beb8fd4c2e060bc80ea9..8c6f2705e7e927e4bc18f563f72836a6fca3d2a0 100644 |
--- a/extensions/renderer/runtime_custom_bindings.cc |
+++ b/extensions/renderer/runtime_custom_bindings.cc |
@@ -156,6 +156,7 @@ void RuntimeCustomBindings::GetExtensionViews( |
std::vector<content::RenderFrame*> frames = |
ExtensionFrameHelper::GetExtensionFrames(extension_id, browser_window_id, |
view_type); |
+ v8::Local<v8::Context> v8_context = args.GetIsolate()->GetCurrentContext(); |
v8::Local<v8::Array> v8_views = v8::Array::New(args.GetIsolate()); |
int v8_index = 0; |
for (content::RenderFrame* frame : frames) { |
@@ -171,7 +172,9 @@ void RuntimeCustomBindings::GetExtensionViews( |
if (!context.IsEmpty()) { |
v8::Local<v8::Value> window = context->Global(); |
DCHECK(!window.IsEmpty()); |
- v8_views->Set(v8::Integer::New(args.GetIsolate(), v8_index++), window); |
+ v8::Maybe<bool> maybe = |
+ v8_views->CreateDataProperty(v8_context, v8_index++, window); |
+ DCHECK(maybe.IsJust() && maybe.FromJust()); |
} |
} |