Commit bea5da03 authored by satish@chromium.org's avatar satish@chromium.org

Use QuitTask instead of Quit() to signal request completion.

This allows for cases where the request complete callback is invoked outside a message loop,
for e.g. in TestPostChunkedDataAfterStart(). Quit() can only be invoked inside a message
loop whereas posting a QuitTask to the message loop can be done from anywhere.

BUG=none
TEST=TestPostChunkedDataAfterStart passes through the tsan bots and net_unittests in general runs fine.

Review URL: http://codereview.chromium.org/6329019

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72493 0039d316-1c4b-4281-b951-d872f2087c98
parent a2fedb1e
......@@ -223,7 +223,7 @@ class TestDelegate : public net::URLRequest::Delegate {
received_redirect_count_++;
if (quit_on_redirect_) {
*defer_redirect = true;
MessageLoop::current()->Quit();
MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask());
} else if (cancel_in_rr_) {
request->Cancel();
}
......@@ -290,7 +290,7 @@ class TestDelegate : public net::URLRequest::Delegate {
virtual void OnResponseCompleted(net::URLRequest* request) {
if (quit_on_complete_)
MessageLoop::current()->Quit();
MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask());
}
void OnAuthRequired(net::URLRequest* request,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment