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

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

Issue 159542: Add a WebKit API that registers a V8 extension to be loaded into content (Closed)
Patch Set: final Created 11 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/renderer_extension_bindings.h" 5 #include "chrome/renderer/extensions/renderer_extension_bindings.h"
6 6
7 #include "app/resource_bundle.h" 7 #include "app/resource_bundle.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/common/render_messages.h" 10 #include "chrome/common/render_messages.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 return v8_values; 187 return v8_values;
188 } 188 }
189 189
190 } // namespace 190 } // namespace
191 191
192 const char* RendererExtensionBindings::kName = 192 const char* RendererExtensionBindings::kName =
193 "chrome/RendererExtensionBindings"; 193 "chrome/RendererExtensionBindings";
194 194
195 v8::Extension* RendererExtensionBindings::Get() { 195 v8::Extension* RendererExtensionBindings::Get() {
196 return new ExtensionImpl(); 196 static v8::Extension* extension = new ExtensionImpl();
197 return extension;
197 } 198 }
198 199
199 void RendererExtensionBindings::Invoke(const std::string& function_name, 200 void RendererExtensionBindings::Invoke(const std::string& function_name,
200 const ListValue& args, 201 const ListValue& args,
201 RenderView* renderview) { 202 RenderView* renderview) {
202 v8::HandleScope handle_scope; 203 v8::HandleScope handle_scope;
203 std::vector< v8::Handle<v8::Value> > argv = ListValueToV8(args); 204 std::vector< v8::Handle<v8::Value> > argv = ListValueToV8(args);
204 EventBindings::CallFunction(function_name, argv.size(), &argv[0], renderview); 205 EventBindings::CallFunction(function_name, argv.size(), &argv[0], renderview);
205 } 206 }
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/extension_process_bindings.cc ('k') | chrome/renderer/js_only_v8_extensions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698