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

Unified Diff: net/url_request/url_request_simple_job.cc

Issue 10696135: Offload disk accesses to WorkerPool in ExtensionProtocolHandler (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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: net/url_request/url_request_simple_job.cc
===================================================================
--- net/url_request/url_request_simple_job.cc (revision 145483)
+++ net/url_request/url_request_simple_job.cc (working copy)
@@ -57,11 +57,19 @@
if (!request_)
return;
- if (GetData(&mime_type_, &charset_, &data_)) {
+ int result = GetData(&mime_type_, &charset_, &data_,
+ base::Bind(&URLRequestSimpleJob::OnGetDataCompleted,
+ weak_factory_.GetWeakPtr()));
+ if (result != ERR_IO_PENDING)
+ OnGetDataCompleted(result);
+}
+
+void URLRequestSimpleJob::OnGetDataCompleted(int result) {
+ if (result == OK) {
// Notify that the headers are complete
NotifyHeadersComplete();
} else {
- // what should the error code be?
+ DCHECK_EQ(result, ERR_FAILED);
NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED,
ERR_INVALID_URL));
}

Powered by Google App Engine
This is Rietveld 408576698