From d1372e40d31a83071a54208536043e0fbd6df048 Mon Sep 17 00:00:00 2001 From: "jianli@chromium.org" Date: Wed, 1 Sep 2010 04:43:44 +0000 Subject: Make BlobURLRequestJob::Start to continue asynchronously no matter what. This solves the problem when testing error cases in test shell. BUG=none TEST=none Review URL: http://codereview.chromium.org/3218013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58127 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/blob/blob_url_request_job.cc | 10 +++++++--- webkit/blob/blob_url_request_job.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'webkit/blob') diff --git a/webkit/blob/blob_url_request_job.cc b/webkit/blob/blob_url_request_job.cc index 5103458..62712d5 100644 --- a/webkit/blob/blob_url_request_job.cc +++ b/webkit/blob/blob_url_request_job.cc @@ -65,6 +65,12 @@ BlobURLRequestJob::~BlobURLRequestJob() { } void BlobURLRequestJob::Start() { + // Continue asynchronously. + MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( + this, &BlobURLRequestJob::DidStart)); +} + +void BlobURLRequestJob::DidStart() { // We only support GET request per the spec. if (request()->method() != "GET") { NotifyFailure(net::ERR_METHOD_NOT_SUPPORTED); @@ -77,9 +83,7 @@ void BlobURLRequestJob::Start() { return; } - // Continue asynchronously. - MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( - this, &BlobURLRequestJob::CountSize)); + CountSize(); } void BlobURLRequestJob::Kill() { diff --git a/webkit/blob/blob_url_request_job.h b/webkit/blob/blob_url_request_job.h index 5445774..780a642 100644 --- a/webkit/blob/blob_url_request_job.h +++ b/webkit/blob/blob_url_request_job.h @@ -57,6 +57,7 @@ class BlobURLRequestJob : public URLRequestJob { void NotifySuccess(); void NotifyFailure(int); + void DidStart(); void DidResolve(base::PlatformFileError rv, const file_util::FileInfo& file_info); void DidRead(int result); -- cgit v1.1