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

Side by Side Diff: content/browser/streams/stream_url_request_job.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/streams/stream_url_request_job.h" 5 #include "content/browser/streams/stream_url_request_job.h"
6 6
7 #include "base/location.h"
8 #include "base/single_thread_task_runner.h"
7 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/thread_task_runner_handle.h"
8 #include "content/browser/streams/stream.h" 11 #include "content/browser/streams/stream.h"
9 #include "net/base/io_buffer.h" 12 #include "net/base/io_buffer.h"
10 #include "net/base/net_errors.h" 13 #include "net/base/net_errors.h"
11 #include "net/http/http_byte_range.h" 14 #include "net/http/http_byte_range.h"
12 #include "net/http/http_response_headers.h" 15 #include "net/http/http_response_headers.h"
13 #include "net/http/http_response_info.h" 16 #include "net/http/http_response_info.h"
14 #include "net/http/http_util.h" 17 #include "net/http/http_util.h"
15 #include "net/url_request/url_request.h" 18 #include "net/url_request/url_request.h"
16 19
17 namespace content { 20 namespace content {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 pending_buffer_ = NULL; 76 pending_buffer_ = NULL;
74 pending_buffer_size_ = 0; 77 pending_buffer_size_ = 0;
75 78
76 total_bytes_read_ += bytes_read; 79 total_bytes_read_ += bytes_read;
77 NotifyReadComplete(bytes_read); 80 NotifyReadComplete(bytes_read);
78 } 81 }
79 82
80 // net::URLRequestJob methods. 83 // net::URLRequestJob methods.
81 void StreamURLRequestJob::Start() { 84 void StreamURLRequestJob::Start() {
82 // Continue asynchronously. 85 // Continue asynchronously.
83 base::MessageLoop::current()->PostTask( 86 base::ThreadTaskRunnerHandle::Get()->PostTask(
84 FROM_HERE, 87 FROM_HERE,
85 base::Bind(&StreamURLRequestJob::DidStart, weak_factory_.GetWeakPtr())); 88 base::Bind(&StreamURLRequestJob::DidStart, weak_factory_.GetWeakPtr()));
86 } 89 }
87 90
88 void StreamURLRequestJob::Kill() { 91 void StreamURLRequestJob::Kill() {
89 net::URLRequestJob::Kill(); 92 net::URLRequestJob::Kill();
90 weak_factory_.InvalidateWeakPtrs(); 93 weak_factory_.InvalidateWeakPtrs();
91 ClearStream(); 94 ClearStream();
92 } 95 }
93 96
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 } 242 }
240 243
241 void StreamURLRequestJob::ClearStream() { 244 void StreamURLRequestJob::ClearStream() {
242 if (stream_.get()) { 245 if (stream_.get()) {
243 stream_->RemoveReadObserver(this); 246 stream_->RemoveReadObserver(this);
244 stream_ = NULL; 247 stream_ = NULL;
245 } 248 }
246 } 249 }
247 250
248 } // namespace content 251 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/streams/stream_handle_impl.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698