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

Unified Diff: chrome/renderer/extensions/chrome_v8_extension.h

Issue 11571014: Lazy load chrome.* APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android compilation Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/extensions/chrome_v8_extension.h
diff --git a/chrome/renderer/extensions/chrome_v8_extension.h b/chrome/renderer/extensions/chrome_v8_extension.h
index e12af644124408cd5daa716d60e3ab06822eca6c..42a9e6e05a6b10a3095fa334cac6c31318206f87 100644
--- a/chrome/renderer/extensions/chrome_v8_extension.h
+++ b/chrome/renderer/extensions/chrome_v8_extension.h
@@ -9,7 +9,7 @@
#include "base/memory/linked_ptr.h"
#include "base/string_piece.h"
#include "chrome/renderer/extensions/chrome_v8_extension_handler.h"
-#include "chrome/renderer/extensions/native_handler.h"
+#include "chrome/renderer/extensions/object_backed_native_handler.h"
#include "v8/include/v8.h"
#include <map>
@@ -26,19 +26,26 @@ class ChromeV8Context;
class Dispatcher;
class Extension;
+// DEPRECATED.
+//
// This is a base class for chrome extension bindings. Common features that
// are shared by different modules go here.
-// TODO(koz): Rename this to ExtensionNativeModule.
-class ChromeV8Extension : public NativeHandler {
+//
+// TODO(kalman): Delete this class entirely, it has no value anymore.
+// Custom bindings should extend ObjectBackedNativeHandler.
+class ChromeV8Extension : public ObjectBackedNativeHandler {
public:
- typedef std::set<ChromeV8Extension*> InstanceSet;
- static const InstanceSet& GetAll();
-
- explicit ChromeV8Extension(Dispatcher* dispatcher);
+ ChromeV8Extension(Dispatcher* dispatcher, v8::Handle<v8::Context> context);
virtual ~ChromeV8Extension();
Dispatcher* dispatcher() { return dispatcher_; }
+ ChromeV8Context* GetContext();
+
+ // Shortcuts through to the context's render view and extension.
+ content::RenderView* GetRenderView();
+ const Extension* GetExtensionForRenderView();
+
protected:
template<class T>
static T* GetFromArguments(const v8::Arguments& args) {
@@ -47,17 +54,6 @@ class ChromeV8Extension : public NativeHandler {
return result;
}
- // Gets the render view for the current v8 context.
- static content::RenderView* GetCurrentRenderView();
-
- // Note: do not call this function before or during the chromeHidden.onLoad
- // event dispatch. The URL might not have been committed yet and might not
- // be an extension URL.
- const Extension* GetExtensionForCurrentRenderView() const;
-
- // Returns the chromeHidden object for the current context.
- static v8::Handle<v8::Value> GetChromeHidden(const v8::Arguments& args);
-
Dispatcher* dispatcher_;
private:
« no previous file with comments | « chrome/renderer/extensions/chrome_v8_context_set.cc ('k') | chrome/renderer/extensions/chrome_v8_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698