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

Side by Side Diff: android_webview/browser/net/android_stream_reader_url_request_job.cc

Issue 14314022: android_webview: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "android_webview/browser/net/android_stream_reader_url_request_job.h" 5 #include "android_webview/browser/net/android_stream_reader_url_request_job.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "android_webview/browser/input_stream.h" 9 #include "android_webview/browser/input_stream.h"
10 #include "android_webview/browser/net/input_stream_reader.h" 10 #include "android_webview/browser/net/input_stream_reader.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 // callbacks happen as they would for network requests. 128 // callbacks happen as they would for network requests.
129 SetStatus(net::URLRequestStatus(net::URLRequestStatus::IO_PENDING, 129 SetStatus(net::URLRequestStatus(net::URLRequestStatus::IO_PENDING,
130 net::ERR_IO_PENDING)); 130 net::ERR_IO_PENDING));
131 131
132 // This could be done in the InputStreamReader but would force more 132 // This could be done in the InputStreamReader but would force more
133 // complex synchronization in the delegate. 133 // complex synchronization in the delegate.
134 GetWorkerThreadRunner()->PostTask( 134 GetWorkerThreadRunner()->PostTask(
135 FROM_HERE, 135 FROM_HERE,
136 base::Bind( 136 base::Bind(
137 &OpenInputStreamOnWorkerThread, 137 &OpenInputStreamOnWorkerThread,
138 MessageLoop::current()->message_loop_proxy(), 138 base::MessageLoop::current()->message_loop_proxy(),
139 // This is intentional - the job could be deleted while the callback 139 // This is intentional - the job could be deleted while the callback
140 // is executing on the background thread. 140 // is executing on the background thread.
141 // The delegate will be "returned" to the job once the InputStream 141 // The delegate will be "returned" to the job once the InputStream
142 // open attempt is completed. 142 // open attempt is completed.
143 base::Passed(&delegate_), 143 base::Passed(&delegate_),
144 request()->url(), 144 request()->url(),
145 base::Bind(&AndroidStreamReaderURLRequestJob::OnInputStreamOpened, 145 base::Bind(&AndroidStreamReaderURLRequestJob::OnInputStreamOpened,
146 weak_factory_.GetWeakPtr()))); 146 weak_factory_.GetWeakPtr())));
147 } 147 }
148 148
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 } else { 353 } else {
354 // We don't support multiple range requests in one single URL request, 354 // We don't support multiple range requests in one single URL request,
355 // because we need to do multipart encoding here. 355 // because we need to do multipart encoding here.
356 NotifyDone(net::URLRequestStatus( 356 NotifyDone(net::URLRequestStatus(
357 net::URLRequestStatus::FAILED, 357 net::URLRequestStatus::FAILED,
358 net::ERR_REQUEST_RANGE_NOT_SATISFIABLE)); 358 net::ERR_REQUEST_RANGE_NOT_SATISFIABLE));
359 } 359 }
360 } 360 }
361 } 361 }
362 } 362 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698