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

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

Issue 11571014: Lazy load chrome.* APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 #ifndef CHROME_RENDERER_EXTENSIONS_NATIVE_HANDLER_H_ 5 #ifndef CHROME_RENDERER_EXTENSIONS_NATIVE_HANDLER_H_
6 #define CHROME_RENDERER_EXTENSIONS_NATIVE_HANDLER_H_ 6 #define CHROME_RENDERER_EXTENSIONS_NATIVE_HANDLER_H_
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/memory/linked_ptr.h" 9 #include "base/memory/linked_ptr.h"
10 #include "v8/include/v8.h" 10 #include "v8/include/v8.h"
(...skipping 28 matching lines...) Expand all
39 39
40 // Installs a new 'route' from |name| to |handler_function|. This means that 40 // Installs a new 'route' from |name| to |handler_function|. This means that
41 // NewInstance()s of this NativeHandler will have a property |name| which 41 // NewInstance()s of this NativeHandler will have a property |name| which
42 // will be handled by |handler_function|. 42 // will be handled by |handler_function|.
43 void RouteFunction(const std::string& name, 43 void RouteFunction(const std::string& name,
44 const HandlerFunction& handler_function); 44 const HandlerFunction& handler_function);
45 45
46 void RouteStaticFunction(const std::string& name, 46 void RouteStaticFunction(const std::string& name,
47 const HandlerFunc handler_func); 47 const HandlerFunc handler_func);
48 48
49 v8::Persistent<v8::ObjectTemplate> object_template_;
50
49 private: 51 private:
50 static v8::Handle<v8::Value> Router(const v8::Arguments& args); 52 static v8::Handle<v8::Value> Router(const v8::Arguments& args);
51 53
52 std::vector<linked_ptr<HandlerFunction> > handler_functions_; 54 std::vector<linked_ptr<HandlerFunction> > handler_functions_;
53 v8::Persistent<v8::ObjectTemplate> object_template_;
54 55
55 DISALLOW_COPY_AND_ASSIGN(NativeHandler); 56 DISALLOW_COPY_AND_ASSIGN(NativeHandler);
56 }; 57 };
57 58
58 } // extensions 59 } // extensions
59 60
60 #endif // CHROME_RENDERER_EXTENSIONS_NATIVE_HANDLER_H_ 61 #endif // CHROME_RENDERER_EXTENSIONS_NATIVE_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698