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

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

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