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

Unified Diff: chrome_frame/urlmon_url_request.cc

Issue 388008: This CL fixes the following issues:-... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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
« no previous file with comments | « chrome_frame/chrome_frame_automation.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/urlmon_url_request.cc
===================================================================
--- chrome_frame/urlmon_url_request.cc (revision 31553)
+++ chrome_frame/urlmon_url_request.cc (working copy)
@@ -46,13 +46,14 @@
return false;
}
- worker_thread_->message_loop()->PostTask(
- FROM_HERE, NewRunnableMethod(this, &UrlmonUrlRequest::StartAsync));
-
// Take a self reference to maintain COM lifetime. This will be released
// in EndRequest
AddRef();
request_handler()->AddRequest(this);
+
+ worker_thread_->message_loop()->PostTask(
+ FROM_HERE, NewRunnableMethod(this, &UrlmonUrlRequest::StartAsync));
+
return true;
}
@@ -64,6 +65,11 @@
return;
}
+ // We can remove the request from the map safely here if it is still valid.
+ // There is an additional reference on the UrlmonUrlRequest instance which
+ // is released when the task scheduled by the EndRequest function executes.
+ request_handler()->RemoveRequest(this);
+
worker_thread_->message_loop()->PostTask(
FROM_HERE, NewRunnableMethod(this, &UrlmonUrlRequest::StopAsync));
}
@@ -205,6 +211,8 @@
status_.set_os_error(0);
}
+ DLOG(INFO) << "OnStopBinding received for request id: " << id();
+
// Release these variables after reporting EndRequest since we might need to
// access their state.
binding_ = NULL;
@@ -605,6 +613,9 @@
}
void UrlmonUrlRequest::EndRequestInternal() {
+ // The request object could have been removed from the map in the
+ // OnRequestEnd callback which executes on receiving the
+ // AutomationMsg_RequestEnd IPC from Chrome.
request_handler()->RemoveRequest(this);
// Release the outstanding reference in the context of the UI thread to
// ensure that our instance gets deleted in the same thread which created it.
« no previous file with comments | « chrome_frame/chrome_frame_automation.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698