diff options
author | skyostil <skyostil@chromium.org> | 2015-06-05 10:48:59 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-05 17:49:39 +0000 |
commit | d4104aab631ebbf2b13ad881b3ccc00a4c4b797c (patch) | |
tree | e7ae9d8767f554877496c3527ad833a5b8018b66 /content/browser/streams | |
parent | a73bdd5538ce40dd9e3a664ed5c42b2618f04d01 (diff) | |
download | chromium_src-d4104aab631ebbf2b13ad881b3ccc00a4c4b797c.zip chromium_src-d4104aab631ebbf2b13ad881b3ccc00a4c4b797c.tar.gz chromium_src-d4104aab631ebbf2b13ad881b3ccc00a4c4b797c.tar.bz2 |
Revert "content: Remove use of MessageLoopProxy and deprecated MessageLoop APIs"
This reverts commit 422456f9d53f0bf936a64f21a1463fd0abd3df84.
TBR=zea@chromium.org
BUG=465354
NOTRY=true
NOTREECHECKS=true
Review URL: https://codereview.chromium.org/1170623003
Cr-Commit-Position: refs/heads/master@{#333086}
Diffstat (limited to 'content/browser/streams')
-rw-r--r-- | content/browser/streams/stream.cc | 13 | ||||
-rw-r--r-- | content/browser/streams/stream_handle_impl.cc | 9 | ||||
-rw-r--r-- | content/browser/streams/stream_handle_impl.h | 4 | ||||
-rw-r--r-- | content/browser/streams/stream_url_request_job.cc | 5 |
4 files changed, 14 insertions, 17 deletions
diff --git a/content/browser/streams/stream.cc b/content/browser/streams/stream.cc index 3f4ae680..fb36ad9 100644 --- a/content/browser/streams/stream.cc +++ b/content/browser/streams/stream.cc @@ -6,8 +6,7 @@ #include "base/bind.h" #include "base/location.h" -#include "base/single_thread_task_runner.h" -#include "base/thread_task_runner_handle.h" +#include "base/message_loop/message_loop_proxy.h" #include "base/values.h" #include "content/browser/streams/stream_handle_impl.h" #include "content/browser/streams/stream_read_observer.h" @@ -36,9 +35,11 @@ Stream::Stream(StreamRegistry* registry, write_observer_(write_observer), stream_handle_(NULL), weak_ptr_factory_(this) { - CreateByteStream(base::ThreadTaskRunnerHandle::Get(), - base::ThreadTaskRunnerHandle::Get(), kDeferSizeThreshold, - &writer_, &reader_); + CreateByteStream(base::MessageLoopProxy::current(), + base::MessageLoopProxy::current(), + kDeferSizeThreshold, + &writer_, + &reader_); // Setup callback for writing. writer_->RegisterCallback(base::Bind(&Stream::OnSpaceAvailable, @@ -121,7 +122,7 @@ void Stream::Finalize() { writer_.reset(); // Continue asynchronously. - base::ThreadTaskRunnerHandle::Get()->PostTask( + base::MessageLoopProxy::current()->PostTask( FROM_HERE, base::Bind(&Stream::OnDataAvailable, weak_ptr_factory_.GetWeakPtr())); } diff --git a/content/browser/streams/stream_handle_impl.cc b/content/browser/streams/stream_handle_impl.cc index ba4dee2..5bc2acb 100644 --- a/content/browser/streams/stream_handle_impl.cc +++ b/content/browser/streams/stream_handle_impl.cc @@ -6,7 +6,7 @@ #include "base/bind.h" #include "base/location.h" -#include "base/thread_task_runner_handle.h" +#include "base/message_loop/message_loop_proxy.h" #include "content/browser/streams/stream.h" namespace content { @@ -23,12 +23,11 @@ void RunCloseListeners(const std::vector<base::Closure>& close_listeners) { StreamHandleImpl::StreamHandleImpl(const base::WeakPtr<Stream>& stream) : stream_(stream), url_(stream->url()), - stream_task_runner_(base::ThreadTaskRunnerHandle::Get().get()) { -} + stream_message_loop_(base::MessageLoopProxy::current().get()) {} StreamHandleImpl::~StreamHandleImpl() { - stream_task_runner_->PostTaskAndReply( - FROM_HERE, base::Bind(&Stream::CloseHandle, stream_), + stream_message_loop_->PostTaskAndReply(FROM_HERE, + base::Bind(&Stream::CloseHandle, stream_), base::Bind(&RunCloseListeners, close_listeners_)); } diff --git a/content/browser/streams/stream_handle_impl.h b/content/browser/streams/stream_handle_impl.h index 15e8e20..d2bd94d 100644 --- a/content/browser/streams/stream_handle_impl.h +++ b/content/browser/streams/stream_handle_impl.h @@ -11,7 +11,7 @@ #include "content/public/browser/stream_handle.h" namespace base { -class SingleThreadTaskRunner; +class MessageLoopProxy; } namespace content { @@ -30,7 +30,7 @@ class StreamHandleImpl : public StreamHandle { base::WeakPtr<Stream> stream_; GURL url_; - base::SingleThreadTaskRunner* stream_task_runner_; + base::MessageLoopProxy* stream_message_loop_; std::vector<base::Closure> close_listeners_; }; diff --git a/content/browser/streams/stream_url_request_job.cc b/content/browser/streams/stream_url_request_job.cc index d2bce89..3d4ac7f 100644 --- a/content/browser/streams/stream_url_request_job.cc +++ b/content/browser/streams/stream_url_request_job.cc @@ -4,10 +4,7 @@ #include "content/browser/streams/stream_url_request_job.h" -#include "base/location.h" -#include "base/single_thread_task_runner.h" #include "base/strings/string_number_conversions.h" -#include "base/thread_task_runner_handle.h" #include "content/browser/streams/stream.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" @@ -83,7 +80,7 @@ void StreamURLRequestJob::OnDataAvailable(Stream* stream) { // net::URLRequestJob methods. void StreamURLRequestJob::Start() { // Continue asynchronously. - base::ThreadTaskRunnerHandle::Get()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&StreamURLRequestJob::DidStart, weak_factory_.GetWeakPtr())); } |