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

Unified Diff: chrome/renderer/extensions/request_sender.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/request_sender.h
diff --git a/chrome/renderer/extensions/request_sender.h b/chrome/renderer/extensions/request_sender.h
index a7bbdb81142c556d70ed235a7708c2503ef4505c..b1463fd36b9250f0744d305931d2e91690df46d7 100644
--- a/chrome/renderer/extensions/request_sender.h
+++ b/chrome/renderer/extensions/request_sender.h
@@ -16,7 +16,7 @@ class ListValue;
}
namespace extensions {
-class ChromeV8ContextSet;
+class ChromeV8Context;
class Dispatcher;
struct PendingRequest;
@@ -25,15 +25,17 @@ struct PendingRequest;
// extension host and routing the responses back to the caller.
class RequestSender {
public:
- explicit RequestSender(Dispatcher* dispatcher,
- ChromeV8ContextSet* context_set);
+ explicit RequestSender(Dispatcher* dispatcher);
~RequestSender();
// Makes a call to the API function |name| that is to be handled by the
// extension host. The response to this request will be received in
// HandleResponse().
// TODO(koz): Remove |request_id| and generate that internally.
- void StartRequest(const std::string& name,
+ // There are multiple of these per render view though, so we'll
+ // need to vend the IDs centrally.
+ void StartRequest(ChromeV8Context* target_context,
+ const std::string& name,
int request_id,
bool has_callback,
bool for_io_thread,
@@ -45,6 +47,9 @@ class RequestSender {
const base::ListValue& response,
const std::string& error);
+ // Notifies this that a context is no longer valid.
+ // TODO(kalman): Do this in a generic/safe way.
+ void InvalidateContext(ChromeV8Context* context);
private:
typedef std::map<int, linked_ptr<PendingRequest> > PendingRequestMap;
@@ -54,7 +59,6 @@ class RequestSender {
Dispatcher* dispatcher_;
PendingRequestMap pending_requests_;
- ChromeV8ContextSet* context_set_;
DISALLOW_COPY_AND_ASSIGN(RequestSender);
};
« no previous file with comments | « chrome/renderer/extensions/page_capture_custom_bindings.cc ('k') | chrome/renderer/extensions/request_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698