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

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

Issue 10879107: Move ModuleSystem and NativeHandler to extensions/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/extensions/native_handler.h ('k') | chrome/renderer/module_system.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/native_handler.h" 5 #include "chrome/renderer/extensions/native_handler.h"
6 6
7 #include "base/memory/linked_ptr.h" 7 #include "base/memory/linked_ptr.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/renderer/module_system.h" 9 #include "chrome/renderer/extensions/module_system.h"
10 #include "v8/include/v8.h" 10 #include "v8/include/v8.h"
11 11
12 namespace extensions {
13
12 NativeHandler::NativeHandler() 14 NativeHandler::NativeHandler()
13 : object_template_( 15 : object_template_(
14 v8::Persistent<v8::ObjectTemplate>::New(v8::ObjectTemplate::New())) { 16 v8::Persistent<v8::ObjectTemplate>::New(v8::ObjectTemplate::New())) {
15 } 17 }
16 18
17 NativeHandler::~NativeHandler() { 19 NativeHandler::~NativeHandler() {
18 object_template_.Dispose(); 20 object_template_.Dispose();
19 } 21 }
20 22
21 v8::Handle<v8::Object> NativeHandler::NewInstance() { 23 v8::Handle<v8::Object> NativeHandler::NewInstance() {
(...skipping 25 matching lines...) Expand all
47 v8::External::New(function.get())); 49 v8::External::New(function.get()));
48 object_template_->Set(name.c_str(), function_template); 50 object_template_->Set(name.c_str(), function_template);
49 } 51 }
50 52
51 void NativeHandler::RouteStaticFunction(const std::string& name, 53 void NativeHandler::RouteStaticFunction(const std::string& name,
52 const HandlerFunc handler_func) { 54 const HandlerFunc handler_func) {
53 v8::Handle<v8::FunctionTemplate> function_template = 55 v8::Handle<v8::FunctionTemplate> function_template =
54 v8::FunctionTemplate::New(handler_func, v8::External::New(this)); 56 v8::FunctionTemplate::New(handler_func, v8::External::New(this));
55 object_template_->Set(name.c_str(), function_template); 57 object_template_->Set(name.c_str(), function_template);
56 } 58 }
59
60 } // extensions
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/native_handler.h ('k') | chrome/renderer/module_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698