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

Side by Side Diff: content/browser/loader/buffered_resource_handler.cc

Issue 1170623003: Revert "content: Remove use of MessageLoopProxy and deprecated MessageLoop APIs" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
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 "content/browser/loader/buffered_resource_handler.h" 5 #include "content/browser/loader/buffered_resource_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h"
11 #include "base/logging.h" 10 #include "base/logging.h"
12 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
13 #include "base/single_thread_task_runner.h"
14 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
15 #include "base/thread_task_runner_handle.h"
16 #include "components/mime_util/mime_util.h" 13 #include "components/mime_util/mime_util.h"
17 #include "content/browser/download/download_resource_handler.h" 14 #include "content/browser/download/download_resource_handler.h"
18 #include "content/browser/download/download_stats.h" 15 #include "content/browser/download/download_stats.h"
19 #include "content/browser/loader/certificate_resource_handler.h" 16 #include "content/browser/loader/certificate_resource_handler.h"
20 #include "content/browser/loader/resource_dispatcher_host_impl.h" 17 #include "content/browser/loader/resource_dispatcher_host_impl.h"
21 #include "content/browser/loader/resource_request_info_impl.h" 18 #include "content/browser/loader/resource_request_info_impl.h"
22 #include "content/browser/loader/stream_resource_handler.h" 19 #include "content/browser/loader/stream_resource_handler.h"
23 #include "content/public/browser/content_browser_client.h" 20 #include "content/public/browser/content_browser_client.h"
24 #include "content/public/browser/download_item.h" 21 #include "content/public/browser/download_item.h"
25 #include "content/public/browser/download_save_info.h" 22 #include "content/public/browser/download_save_info.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 next_handler_->OnResponseCompleted(status, security_info, defer); 189 next_handler_->OnResponseCompleted(status, security_info, defer);
193 } 190 }
194 191
195 void BufferedResourceHandler::Resume() { 192 void BufferedResourceHandler::Resume() {
196 switch (state_) { 193 switch (state_) {
197 case STATE_BUFFERING: 194 case STATE_BUFFERING:
198 case STATE_PROCESSING: 195 case STATE_PROCESSING:
199 NOTREACHED(); 196 NOTREACHED();
200 break; 197 break;
201 case STATE_REPLAYING: 198 case STATE_REPLAYING:
202 base::ThreadTaskRunnerHandle::Get()->PostTask( 199 base::MessageLoop::current()->PostTask(
203 FROM_HERE, 200 FROM_HERE,
204 base::Bind(&BufferedResourceHandler::CallReplayReadCompleted, 201 base::Bind(&BufferedResourceHandler::CallReplayReadCompleted,
205 weak_ptr_factory_.GetWeakPtr())); 202 weak_ptr_factory_.GetWeakPtr()));
206 break; 203 break;
207 case STATE_STARTING: 204 case STATE_STARTING:
208 case STATE_STREAMING: 205 case STATE_STREAMING:
209 controller()->Resume(); 206 controller()->Resume();
210 break; 207 break;
211 } 208 }
212 } 209 }
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 request()->LogUnblocked(); 505 request()->LogUnblocked();
509 bool defer = false; 506 bool defer = false;
510 if (!ProcessResponse(&defer)) { 507 if (!ProcessResponse(&defer)) {
511 controller()->Cancel(); 508 controller()->Cancel();
512 } else if (!defer) { 509 } else if (!defer) {
513 controller()->Resume(); 510 controller()->Resume();
514 } 511 }
515 } 512 }
516 513
517 } // namespace content 514 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_transaction.cc ('k') | content/browser/loader/resource_dispatcher_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698