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

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

Issue 12313142: Revert 184837 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 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
===================================================================
--- chrome/renderer/extensions/chrome_v8_extension.h (revision 184858)
+++ chrome/renderer/extensions/chrome_v8_extension.h (working copy)
@@ -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/object_backed_native_handler.h"
+#include "chrome/renderer/extensions/native_handler.h"
#include "v8/include/v8.h"
#include <map>
@@ -26,30 +26,19 @@
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(kalman): Delete this class entirely, it has no value anymore.
-// Custom bindings should extend ObjectBackedNativeHandler.
-class ChromeV8Extension : public ObjectBackedNativeHandler {
+// TODO(koz): Rename this to ExtensionNativeModule.
+class ChromeV8Extension : public NativeHandler {
public:
- // EXTRA DEPRECATED. DO NOT USE THIS CONSTRUCTOR. It doesn't work in subtle
- // cases.
+ 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) {
@@ -58,6 +47,17 @@
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