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

Unified Diff: chrome/renderer/extensions/request_sender.cc

Issue 12378077: Attempting to fix problems in 11571014. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops 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/request_sender.cc
diff --git a/chrome/renderer/extensions/request_sender.cc b/chrome/renderer/extensions/request_sender.cc
index a9269aefe09089ca88eab33ea671b2a38f5ba01c..7ad4a243a59e48415371616f93896745b21b062e 100644
--- a/chrome/renderer/extensions/request_sender.cc
+++ b/chrome/renderer/extensions/request_sender.cc
@@ -21,15 +21,12 @@ namespace extensions {
// Contains info relevant to a pending API request.
struct PendingRequest {
public :
- PendingRequest(ChromeV8Context* context,
- ChromeV8Context* caller_context,
- const std::string& name)
- : name(name), context(context), caller_context(caller_context) {
+ PendingRequest(const std::string& name, ChromeV8Context* context)
+ : name(name), context(context) {
}
std::string name;
ChromeV8Context* context;
- ChromeV8Context* caller_context;
};
RequestSender::RequestSender(Dispatcher* dispatcher) : dispatcher_(dispatcher) {
@@ -84,19 +81,12 @@ void RequestSender::StartRequest(ChromeV8Context* context,
source_origin = webframe->document().securityOrigin();
}
- std::string extension_id = context->GetExtensionID();
- // Insert the current context into the PendingRequest because that's the
- // context that we call back on.
- InsertRequest(
- request_id,
- new PendingRequest(context,
- dispatcher_->v8_context_set().GetCurrent(),
- name));
+ InsertRequest(request_id, new PendingRequest(name, context));
ExtensionHostMsg_Request_Params params;
params.name = name;
params.arguments.Swap(value_args);
- params.extension_id = extension_id;
+ params.extension_id = context->GetExtensionID();
params.source_url = source_url;
params.source_origin = source_origin.toString();
params.request_id = request_id;
@@ -136,9 +126,9 @@ void RequestSender::HandleResponse(int request_id,
v8::Handle<v8::Value> retval;
CHECK(request->context->CallChromeHiddenMethod("handleResponse",
- arraysize(argv),
- argv,
- &retval));
+ arraysize(argv),
+ argv,
+ &retval));
// In debug, the js will validate the callback parameters and return a
// string if a validation error has occured.
if (DCHECK_IS_ON()) {
« no previous file with comments | « chrome/renderer/extensions/object_backed_native_handler.cc ('k') | chrome/renderer/extensions/send_request_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698