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

Side by Side Diff: chrome/renderer/extensions/runtime_custom_bindings.cc

Issue 107083006: More v8-API-related cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/extensions/runtime_custom_bindings.h" 5 #include "chrome/renderer/extensions/runtime_custom_bindings.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/common/extensions/extension_messages.h" 10 #include "chrome/common/extensions/extension_messages.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 std::vector<content::RenderView*> views = ExtensionHelper::GetExtensionViews( 160 std::vector<content::RenderView*> views = ExtensionHelper::GetExtensionViews(
161 extension_id, browser_window_id, view_type); 161 extension_id, browser_window_id, view_type);
162 v8::Local<v8::Array> v8_views = v8::Array::New(args.GetIsolate()); 162 v8::Local<v8::Array> v8_views = v8::Array::New(args.GetIsolate());
163 int v8_index = 0; 163 int v8_index = 0;
164 for (size_t i = 0; i < views.size(); ++i) { 164 for (size_t i = 0; i < views.size(); ++i) {
165 v8::Local<v8::Context> context = 165 v8::Local<v8::Context> context =
166 views[i]->GetWebView()->mainFrame()->mainWorldScriptContext(); 166 views[i]->GetWebView()->mainFrame()->mainWorldScriptContext();
167 if (!context.IsEmpty()) { 167 if (!context.IsEmpty()) {
168 v8::Local<v8::Value> window = context->Global(); 168 v8::Local<v8::Value> window = context->Global();
169 DCHECK(!window.IsEmpty()); 169 DCHECK(!window.IsEmpty());
170 v8_views->Set(v8::Integer::New(v8_index++), window); 170 v8_views->Set(v8::Integer::New(args.GetIsolate(), v8_index++), window);
171 } 171 }
172 } 172 }
173 173
174 args.GetReturnValue().Set(v8_views); 174 args.GetReturnValue().Set(v8_views);
175 } 175 }
176 176
177 } // namespace extensions 177 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/pepper_request_proxy.cc ('k') | chrome/renderer/extensions/set_icon_natives.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698