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

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

Issue 10024055: Remove unneeded extension_messages_browsertest.cc + cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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_context.h
diff --git a/chrome/renderer/extensions/chrome_v8_context.h b/chrome/renderer/extensions/chrome_v8_context.h
index e2c89111dd459bad633e153f860e0b99010fe6a6..9ba0e86c37ba1ccf981b267f1a3e54dd93d39a3f 100644
--- a/chrome/renderer/extensions/chrome_v8_context.h
+++ b/chrome/renderer/extensions/chrome_v8_context.h
@@ -30,7 +30,7 @@ class ChromeV8Context {
public:
ChromeV8Context(v8::Handle<v8::Context> context,
WebKit::WebFrame* frame,
- const std::string& extension_id,
+ const Extension* extension,
extensions::Feature::Context context_type);
~ChromeV8Context();
@@ -38,8 +38,8 @@ class ChromeV8Context {
return v8_context_;
}
- const std::string& extension_id() const {
- return extension_id_;
+ const Extension* extension() const {
+ return extension_;
}
WebKit::WebFrame* web_frame() const {
@@ -57,6 +57,8 @@ class ChromeV8Context {
module_system_ = module_system.Pass();
}
+ std::string GetExtensionID();
+
// Returns a special Chrome-specific hidden object that is associated with a
// context, but not reachable from the JavaScript in that context. This is
// used by our v8::Extension implementations as a way to share code and as a
@@ -77,8 +79,8 @@ class ChromeV8Context {
// TODO(aa): Move this to EventBindings.
void DispatchOnLoadEvent(bool is_extension_process,
bool is_incognito_process,
- int manifest_version) const;
- void DispatchOnUnloadEvent() const;
+ int manifest_version);
+ void DispatchOnUnloadEvent();
// Call the named method of the chromeHidden object in this context.
// The function can be a sub-property like "Port.dispatchOnMessage". Returns
@@ -90,6 +92,8 @@ class ChromeV8Context {
v8::Handle<v8::Value>* argv,
v8::Handle<v8::Value>* result) const;
+ std::set<std::string>* GetAvailableExtensionAPIs();
+
private:
// The v8 context the bindings are accessible to. We keep a strong reference
// to it for simplicity. In the case of content scripts, this is necessary
@@ -104,8 +108,7 @@ class ChromeV8Context {
// object can outlive is destroyed asynchronously.
WebKit::WebFrame* web_frame_;
- // The extension ID this context is associated with.
- std::string extension_id_;
+ const Extension* extension_;
// The type of context.
extensions::Feature::Context context_type_;
@@ -113,6 +116,8 @@ class ChromeV8Context {
// Owns and structures the JS that is injected to set up extension bindings.
scoped_ptr<ModuleSystem> module_system_;
+ scoped_ptr<std::set<std::string> > available_extension_apis_;
+
DISALLOW_COPY_AND_ASSIGN(ChromeV8Context);
};

Powered by Google App Engine
This is Rietveld 408576698