diff options
| author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-08-01 12:59:39 +0200 |
|---|---|---|
| committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-08-04 12:40:43 +0000 |
| commit | 28b1110370900897ab652cb420c371fab8857ad4 (patch) | |
| tree | 41b32127d23b0df4f2add2a27e12dc87bddb260e /chromium/jingle | |
| parent | 399c965b6064c440ddcf4015f5f8e9d131c7a0a6 (diff) | |
| download | qtwebengine-chromium-28b1110370900897ab652cb420c371fab8857ad4.tar.gz | |
BASELINE: Update Chromium to 53.0.2785.41
Also adds a few extra files for extensions.
Change-Id: Iccdd55d98660903331cf8b7b29188da781830af4
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/jingle')
| -rw-r--r-- | chromium/jingle/glue/DEPS | 1 | ||||
| -rw-r--r-- | chromium/jingle/glue/chrome_async_socket.cc | 34 | ||||
| -rw-r--r-- | chromium/jingle/glue/proxy_resolving_client_socket.cc | 20 | ||||
| -rw-r--r-- | chromium/jingle/glue/proxy_resolving_client_socket_unittest.cc | 3 | ||||
| -rw-r--r-- | chromium/jingle/glue/task_pump.cc | 6 | ||||
| -rw-r--r-- | chromium/jingle/glue/task_pump_unittest.cc | 5 | ||||
| -rw-r--r-- | chromium/jingle/glue/thread_wrapper.cc | 45 | ||||
| -rw-r--r-- | chromium/jingle/glue/thread_wrapper.h | 17 | ||||
| -rw-r--r-- | chromium/jingle/glue/thread_wrapper_unittest.cc | 88 | ||||
| -rw-r--r-- | chromium/jingle/glue/xmpp_client_socket_factory.cc | 17 | ||||
| -rw-r--r-- | chromium/jingle/notifier/base/xmpp_connection.cc | 7 | ||||
| -rw-r--r-- | chromium/jingle/notifier/communicator/single_login_attempt_unittest.cc | 5 | ||||
| -rw-r--r-- | chromium/jingle/notifier/listener/non_blocking_push_client_unittest.cc | 21 | ||||
| -rw-r--r-- | chromium/jingle/notifier/listener/push_client_unittest.cc | 8 |
14 files changed, 149 insertions, 128 deletions
diff --git a/chromium/jingle/glue/DEPS b/chromium/jingle/glue/DEPS index 44fa57328e9..a1e605be833 100644 --- a/chromium/jingle/glue/DEPS +++ b/chromium/jingle/glue/DEPS @@ -1,6 +1,5 @@ # Needed by logging_unittest.cc since it tests the overrides. include_rules = [ - "+third_party/libjingle/overrides", "+third_party/webrtc", '+third_party/webrtc_overrides', ] diff --git a/chromium/jingle/glue/chrome_async_socket.cc b/chromium/jingle/glue/chrome_async_socket.cc index ca03a0fa722..cd95cdc4c85 100644 --- a/chromium/jingle/glue/chrome_async_socket.cc +++ b/chromium/jingle/glue/chrome_async_socket.cc @@ -13,7 +13,7 @@ #include "base/bind.h" #include "base/compiler_specific.h" #include "base/logging.h" -#include "base/message_loop/message_loop.h" +#include "base/threading/thread_task_runner_handle.h" #include "jingle/glue/resolving_client_socket_factory.h" #include "net/base/address_list.h" #include "net/base/host_port_pair.h" @@ -117,12 +117,9 @@ bool ChromeAsyncSocket::Connect(const rtc::SocketAddress& address) { // directly here as the caller may not expect an error/close to // happen here. This is okay, as from the caller's point of view, // the connect always happens asynchronously. - base::MessageLoop* message_loop = base::MessageLoop::current(); - CHECK(message_loop); - message_loop->PostTask( - FROM_HERE, - base::Bind(&ChromeAsyncSocket::ProcessConnectDone, - weak_ptr_factory_.GetWeakPtr(), status)); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::Bind(&ChromeAsyncSocket::ProcessConnectDone, + weak_ptr_factory_.GetWeakPtr(), status)); } return true; } @@ -154,12 +151,9 @@ void ChromeAsyncSocket::PostDoRead() { DCHECK_EQ(read_state_, IDLE); DCHECK_EQ(read_start_, 0U); DCHECK_EQ(read_end_, 0U); - base::MessageLoop* message_loop = base::MessageLoop::current(); - CHECK(message_loop); - message_loop->PostTask( + base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(&ChromeAsyncSocket::DoRead, - weak_ptr_factory_.GetWeakPtr())); + base::Bind(&ChromeAsyncSocket::DoRead, weak_ptr_factory_.GetWeakPtr())); read_state_ = POSTED; } @@ -288,12 +282,9 @@ void ChromeAsyncSocket::PostDoWrite() { DCHECK(IsOpen()); DCHECK_EQ(write_state_, IDLE); DCHECK_GT(write_end_, 0U); - base::MessageLoop* message_loop = base::MessageLoop::current(); - CHECK(message_loop); - message_loop->PostTask( + base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(&ChromeAsyncSocket::DoWrite, - weak_ptr_factory_.GetWeakPtr())); + base::Bind(&ChromeAsyncSocket::DoWrite, weak_ptr_factory_.GetWeakPtr())); write_state_ = POSTED; } @@ -411,12 +402,9 @@ bool ChromeAsyncSocket::StartTls(const std::string& domain_name) { base::Bind(&ChromeAsyncSocket::ProcessSSLConnectDone, weak_ptr_factory_.GetWeakPtr())); if (status != net::ERR_IO_PENDING) { - base::MessageLoop* message_loop = base::MessageLoop::current(); - CHECK(message_loop); - message_loop->PostTask( - FROM_HERE, - base::Bind(&ChromeAsyncSocket::ProcessSSLConnectDone, - weak_ptr_factory_.GetWeakPtr(), status)); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::Bind(&ChromeAsyncSocket::ProcessSSLConnectDone, + weak_ptr_factory_.GetWeakPtr(), status)); } return true; } diff --git a/chromium/jingle/glue/proxy_resolving_client_socket.cc b/chromium/jingle/glue/proxy_resolving_client_socket.cc index c546cf97a20..91adcb2cce4 100644 --- a/chromium/jingle/glue/proxy_resolving_client_socket.cc +++ b/chromium/jingle/glue/proxy_resolving_client_socket.cc @@ -11,6 +11,7 @@ #include "base/bind_helpers.h" #include "base/compiler_specific.h" #include "base/logging.h" +#include "base/threading/thread_task_runner_handle.h" #include "net/base/io_buffer.h" #include "net/base/ip_address.h" #include "net/base/load_flags.h" @@ -62,6 +63,9 @@ ProxyResolvingClientSocket::ProxyResolvingClientSocket( session_params.cert_verifier = request_context->cert_verifier(); session_params.transport_security_state = request_context->transport_security_state(); + session_params.cert_transparency_verifier = + request_context->cert_transparency_verifier(); + session_params.ct_policy_enforcer = request_context->ct_policy_enforcer(); // TODO(rkn): This is NULL because ChannelIDService is not thread safe. session_params.channel_id_service = NULL; session_params.proxy_service = request_context->proxy_service(); @@ -86,10 +90,10 @@ ProxyResolvingClientSocket::ProxyResolvingClientSocket( reference_params->testing_fixed_https_port; session_params.enable_spdy31 = reference_params->enable_spdy31; session_params.enable_http2 = reference_params->enable_http2; - session_params.parse_alternative_services = - reference_params->parse_alternative_services; - session_params.enable_alternative_service_with_different_host = - reference_params->enable_alternative_service_with_different_host; + session_params.enable_http2_alternative_service_with_different_host = + reference_params->enable_http2_alternative_service_with_different_host; + session_params.enable_quic_alternative_service_with_different_host = + reference_params->enable_quic_alternative_service_with_different_host; } network_session_.reset(new net::HttpNetworkSession(session_params)); @@ -151,9 +155,7 @@ int ProxyResolvingClientSocket::Connect( // We defer execution of ProcessProxyResolveDone instead of calling it // directly here for simplicity. From the caller's point of view, // the connect always happens asynchronously. - base::MessageLoop* message_loop = base::MessageLoop::current(); - CHECK(message_loop); - message_loop->PostTask( + base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(&ProxyResolvingClientSocket::ProcessProxyResolveDone, weak_factory_.GetWeakPtr(), status)); @@ -307,9 +309,7 @@ int ProxyResolvingClientSocket::ReconsiderProxyAfterError(int error) { // In both cases we want to post ProcessProxyResolveDone (in the error case // we might still want to fall back a direct connection). if (rv != net::ERR_IO_PENDING) { - base::MessageLoop* message_loop = base::MessageLoop::current(); - CHECK(message_loop); - message_loop->PostTask( + base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(&ProxyResolvingClientSocket::ProcessProxyResolveDone, weak_factory_.GetWeakPtr(), rv)); diff --git a/chromium/jingle/glue/proxy_resolving_client_socket_unittest.cc b/chromium/jingle/glue/proxy_resolving_client_socket_unittest.cc index 866b37d87ff..d784cf3c426 100644 --- a/chromium/jingle/glue/proxy_resolving_client_socket_unittest.cc +++ b/chromium/jingle/glue/proxy_resolving_client_socket_unittest.cc @@ -7,6 +7,7 @@ #include "base/compiler_specific.h" #include "base/macros.h" #include "base/message_loop/message_loop.h" +#include "base/run_loop.h" #include "base/threading/thread_task_runner_handle.h" #include "net/base/test_completion_callback.h" #include "net/dns/mock_host_resolver.h" @@ -46,7 +47,7 @@ class ProxyResolvingClientSocketTest : public testing::Test { void TearDown() override { // Clear out any messages posted by ProxyResolvingClientSocket's // destructor. - message_loop_.RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } base::MessageLoop message_loop_; diff --git a/chromium/jingle/glue/task_pump.cc b/chromium/jingle/glue/task_pump.cc index f2c769d34b5..58399a2d93d 100644 --- a/chromium/jingle/glue/task_pump.cc +++ b/chromium/jingle/glue/task_pump.cc @@ -5,7 +5,7 @@ #include <stdint.h> #include "base/bind.h" -#include "base/message_loop/message_loop.h" +#include "base/threading/thread_task_runner_handle.h" #include "jingle/glue/task_pump.h" namespace jingle_glue { @@ -23,10 +23,8 @@ TaskPump::~TaskPump() { void TaskPump::WakeTasks() { DCHECK(CalledOnValidThread()); if (!stopped_ && !posted_wake_) { - base::MessageLoop* current_message_loop = base::MessageLoop::current(); - CHECK(current_message_loop); // Do the requested wake up. - current_message_loop->PostTask( + base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(&TaskPump::CheckAndRunTasks, weak_factory_.GetWeakPtr())); posted_wake_ = true; diff --git a/chromium/jingle/glue/task_pump_unittest.cc b/chromium/jingle/glue/task_pump_unittest.cc index 0782f8fdaee..fa40017a774 100644 --- a/chromium/jingle/glue/task_pump_unittest.cc +++ b/chromium/jingle/glue/task_pump_unittest.cc @@ -5,6 +5,7 @@ #include "jingle/glue/task_pump.h" #include "base/message_loop/message_loop.h" +#include "base/run_loop.h" #include "jingle/glue/mock_task.h" #include "testing/gtest/include/gtest/gtest.h" @@ -28,7 +29,7 @@ TEST_F(TaskPumpTest, Basic) { EXPECT_CALL(*task, ProcessStart()).WillOnce(Return(TASK_STATE_DONE)); task->Start(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } TEST_F(TaskPumpTest, Stop) { @@ -42,7 +43,7 @@ TEST_F(TaskPumpTest, Stop) { task->Start(); task_pump.Stop(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } } // namespace diff --git a/chromium/jingle/glue/thread_wrapper.cc b/chromium/jingle/glue/thread_wrapper.cc index 38db614af56..f49c6e9cd74 100644 --- a/chromium/jingle/glue/thread_wrapper.cc +++ b/chromium/jingle/glue/thread_wrapper.cc @@ -12,6 +12,7 @@ #include "base/lazy_instance.h" #include "base/macros.h" #include "base/threading/thread_local.h" +#include "base/trace_event/trace_event.h" #include "third_party/webrtc/base/nullsocketserver.h" namespace jingle_glue { @@ -20,7 +21,8 @@ struct JingleThreadWrapper::PendingSend { PendingSend(const rtc::Message& message_value) : sending_thread(JingleThreadWrapper::current()), message(message_value), - done_event(true, false) { + done_event(base::WaitableEvent::ResetPolicy::MANUAL, + base::WaitableEvent::InitialState::NOT_SIGNALED) { DCHECK(sending_thread); } @@ -65,7 +67,8 @@ JingleThreadWrapper::JingleThreadWrapper( : task_runner_(task_runner), send_allowed_(false), last_task_id_(0), - pending_send_event_(true, false), + pending_send_event_(base::WaitableEvent::ResetPolicy::MANUAL, + base::WaitableEvent::InitialState::NOT_SIGNALED), weak_ptr_factory_(this) { DCHECK(task_runner->BelongsToCurrentThread()); DCHECK(!rtc::Thread::Current()); @@ -90,18 +93,20 @@ void JingleThreadWrapper::WillDestroyCurrentMessageLoop() { delete this; } -void JingleThreadWrapper::Post(rtc::MessageHandler* handler, +void JingleThreadWrapper::Post(const rtc::Location& posted_from, + rtc::MessageHandler* handler, uint32_t message_id, rtc::MessageData* data, bool time_sensitive) { - PostTaskInternal(0, handler, message_id, data); + PostTaskInternal(posted_from, 0, handler, message_id, data); } -void JingleThreadWrapper::PostDelayed(int delay_ms, +void JingleThreadWrapper::PostDelayed(const rtc::Location& posted_from, + int delay_ms, rtc::MessageHandler* handler, uint32_t message_id, rtc::MessageData* data) { - PostTaskInternal(delay_ms, handler, message_id, data); + PostTaskInternal(posted_from, delay_ms, handler, message_id, data); } void JingleThreadWrapper::Clear(rtc::MessageHandler* handler, @@ -145,7 +150,15 @@ void JingleThreadWrapper::Clear(rtc::MessageHandler* handler, } } -void JingleThreadWrapper::Send(rtc::MessageHandler* handler, +void JingleThreadWrapper::Dispatch(rtc::Message* message) { + TRACE_EVENT2("webrtc", "JingleThreadWrapper::Dispatch", "src_file_and_line", + message->posted_from.file_and_line(), "src_func", + message->posted_from.function_name()); + message->phandler->OnMessage(message); +} + +void JingleThreadWrapper::Send(const rtc::Location& posted_from, + rtc::MessageHandler* handler, uint32_t id, rtc::MessageData* data) { if (fStop_) @@ -156,12 +169,13 @@ void JingleThreadWrapper::Send(rtc::MessageHandler* handler, "thread that has JingleThreadWrapper."; rtc::Message message; + message.posted_from = posted_from; message.phandler = handler; message.message_id = id; message.pdata = data; if (current_thread == this) { - handler->OnMessage(&message); + Dispatch(&message); return; } @@ -212,18 +226,20 @@ void JingleThreadWrapper::ProcessPendingSends() { } } if (pending_send) { - pending_send->message.phandler->OnMessage(&pending_send->message); + Dispatch(&pending_send->message); pending_send->done_event.Signal(); } } } -void JingleThreadWrapper::PostTaskInternal(int delay_ms, +void JingleThreadWrapper::PostTaskInternal(const rtc::Location& posted_from, + int delay_ms, rtc::MessageHandler* handler, uint32_t message_id, rtc::MessageData* data) { int task_id; rtc::Message message; + message.posted_from = posted_from; message.phandler = handler; message.message_id = message_id; message.pdata = data; @@ -263,7 +279,7 @@ void JingleThreadWrapper::RunTask(int task_id) { DCHECK(message.phandler == nullptr); delete message.pdata; } else { - message.phandler->OnMessage(&message); + Dispatch(&message); } } } @@ -293,17 +309,14 @@ bool JingleThreadWrapper::Peek(rtc::Message*, int) { return false; } -void JingleThreadWrapper::PostAt(uint32_t, +void JingleThreadWrapper::PostAt(const rtc::Location& posted_from, + uint32_t, rtc::MessageHandler*, uint32_t, rtc::MessageData*) { NOTREACHED(); } -void JingleThreadWrapper::Dispatch(rtc::Message* message) { - NOTREACHED(); -} - void JingleThreadWrapper::ReceiveSends() { NOTREACHED(); } diff --git a/chromium/jingle/glue/thread_wrapper.h b/chromium/jingle/glue/thread_wrapper.h index 6b215fbc4c5..69620eed910 100644 --- a/chromium/jingle/glue/thread_wrapper.h +++ b/chromium/jingle/glue/thread_wrapper.h @@ -61,18 +61,22 @@ class JingleThreadWrapper : public base::MessageLoop::DestructionObserver, void WillDestroyCurrentMessageLoop() override; // rtc::MessageQueue overrides. - void Post(rtc::MessageHandler* phandler, + void Post(const rtc::Location& posted_from, + rtc::MessageHandler* phandler, uint32_t id, rtc::MessageData* pdata, bool time_sensitive) override; - void PostDelayed(int delay_ms, + void PostDelayed(const rtc::Location& posted_from, + int delay_ms, rtc::MessageHandler* handler, uint32_t id, rtc::MessageData* data) override; void Clear(rtc::MessageHandler* handler, uint32_t id, rtc::MessageList* removed) override; - void Send(rtc::MessageHandler* handler, + void Dispatch(rtc::Message* message) override; + void Send(const rtc::Location& posted_from, + rtc::MessageHandler* handler, uint32_t id, rtc::MessageData* data) override; @@ -85,11 +89,11 @@ class JingleThreadWrapper : public base::MessageLoop::DestructionObserver, void Restart() override; bool Get(rtc::Message* message, int delay_ms, bool process_io) override; bool Peek(rtc::Message* message, int delay_ms) override; - void PostAt(uint32_t timestamp, + void PostAt(const rtc::Location& posted_from, + uint32_t timestamp, rtc::MessageHandler* handler, uint32_t id, rtc::MessageData* data) override; - void Dispatch(rtc::Message* message) override; void ReceiveSends() override; int GetDelay() override; @@ -104,7 +108,8 @@ class JingleThreadWrapper : public base::MessageLoop::DestructionObserver, explicit JingleThreadWrapper( scoped_refptr<base::SingleThreadTaskRunner> task_runner); - void PostTaskInternal(int delay_ms, + void PostTaskInternal(const rtc::Location& posted_from, + int delay_ms, rtc::MessageHandler* handler, uint32_t message_id, rtc::MessageData* data); diff --git a/chromium/jingle/glue/thread_wrapper_unittest.cc b/chromium/jingle/glue/thread_wrapper_unittest.cc index db590ef3a58..bc1e8c2477c 100644 --- a/chromium/jingle/glue/thread_wrapper_unittest.cc +++ b/chromium/jingle/glue/thread_wrapper_unittest.cc @@ -7,6 +7,8 @@ #include "base/bind.h" #include "base/compiler_specific.h" #include "base/message_loop/message_loop.h" +#include "base/run_loop.h" +#include "base/single_thread_task_runner.h" #include "base/threading/thread.h" #include "jingle/glue/thread_wrapper.h" #include "testing/gmock/include/gmock/gmock.h" @@ -74,7 +76,7 @@ class ThreadWrapperTest : public testing::Test { EXPECT_CALL(handler, OnMessage( MatchMessage(&handler, kTestMessage2, data))) .WillOnce(DeleteMessageData()); - thread_->Send(&handler, kTestMessage2, data); + thread_->Send(RTC_FROM_HERE, &handler, kTestMessage2, data); } protected: @@ -100,10 +102,10 @@ TEST_F(ThreadWrapperTest, Post) { rtc::MessageData* data3 = new rtc::MessageData(); rtc::MessageData* data4 = new rtc::MessageData(); - thread_->Post(&handler1_, kTestMessage1, data1); - thread_->Post(&handler1_, kTestMessage2, data2); - thread_->Post(&handler2_, kTestMessage1, data3); - thread_->Post(&handler2_, kTestMessage1, data4); + thread_->Post(RTC_FROM_HERE, &handler1_, kTestMessage1, data1); + thread_->Post(RTC_FROM_HERE, &handler1_, kTestMessage2, data2); + thread_->Post(RTC_FROM_HERE, &handler2_, kTestMessage1, data3); + thread_->Post(RTC_FROM_HERE, &handler2_, kTestMessage1, data4); InSequence in_seq; @@ -120,7 +122,7 @@ TEST_F(ThreadWrapperTest, Post) { MatchMessage(&handler2_, kTestMessage1, data4))) .WillOnce(DeleteMessageData()); - message_loop_.RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } TEST_F(ThreadWrapperTest, PostDelayed) { @@ -129,10 +131,14 @@ TEST_F(ThreadWrapperTest, PostDelayed) { rtc::MessageData* data3 = new rtc::MessageData(); rtc::MessageData* data4 = new rtc::MessageData(); - thread_->PostDelayed(kTestDelayMs1, &handler1_, kTestMessage1, data1); - thread_->PostDelayed(kTestDelayMs2, &handler1_, kTestMessage2, data2); - thread_->PostDelayed(kTestDelayMs3, &handler2_, kTestMessage1, data3); - thread_->PostDelayed(kTestDelayMs4, &handler2_, kTestMessage1, data4); + thread_->PostDelayed(RTC_FROM_HERE, kTestDelayMs1, &handler1_, kTestMessage1, + data1); + thread_->PostDelayed(RTC_FROM_HERE, kTestDelayMs2, &handler1_, kTestMessage2, + data2); + thread_->PostDelayed(RTC_FROM_HERE, kTestDelayMs3, &handler2_, kTestMessage1, + data3); + thread_->PostDelayed(RTC_FROM_HERE, kTestDelayMs4, &handler2_, kTestMessage1, + data4); InSequence in_seq; @@ -149,17 +155,17 @@ TEST_F(ThreadWrapperTest, PostDelayed) { MatchMessage(&handler2_, kTestMessage1, data4))) .WillOnce(DeleteMessageData()); - message_loop_.PostDelayedTask( + message_loop_.task_runner()->PostDelayedTask( FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), base::TimeDelta::FromMilliseconds(kMaxTestDelay)); - message_loop_.Run(); + base::RunLoop().Run(); } TEST_F(ThreadWrapperTest, Clear) { - thread_->Post(&handler1_, kTestMessage1, NULL); - thread_->Post(&handler1_, kTestMessage2, NULL); - thread_->Post(&handler2_, kTestMessage1, NULL); - thread_->Post(&handler2_, kTestMessage2, NULL); + thread_->Post(RTC_FROM_HERE, &handler1_, kTestMessage1, NULL); + thread_->Post(RTC_FROM_HERE, &handler1_, kTestMessage2, NULL); + thread_->Post(RTC_FROM_HERE, &handler2_, kTestMessage1, NULL); + thread_->Post(RTC_FROM_HERE, &handler2_, kTestMessage2, NULL); thread_->Clear(&handler1_, kTestMessage2); @@ -176,14 +182,18 @@ TEST_F(ThreadWrapperTest, Clear) { MatchMessage(&handler2_, kTestMessage2, null_data))) .WillOnce(DeleteMessageData()); - message_loop_.RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } TEST_F(ThreadWrapperTest, ClearDelayed) { - thread_->PostDelayed(kTestDelayMs1, &handler1_, kTestMessage1, NULL); - thread_->PostDelayed(kTestDelayMs2, &handler1_, kTestMessage2, NULL); - thread_->PostDelayed(kTestDelayMs3, &handler2_, kTestMessage1, NULL); - thread_->PostDelayed(kTestDelayMs4, &handler2_, kTestMessage1, NULL); + thread_->PostDelayed(RTC_FROM_HERE, kTestDelayMs1, &handler1_, kTestMessage1, + NULL); + thread_->PostDelayed(RTC_FROM_HERE, kTestDelayMs2, &handler1_, kTestMessage2, + NULL); + thread_->PostDelayed(RTC_FROM_HERE, kTestDelayMs3, &handler2_, kTestMessage1, + NULL); + thread_->PostDelayed(RTC_FROM_HERE, kTestDelayMs4, &handler2_, kTestMessage1, + NULL); thread_->Clear(&handler1_, kTestMessage2); @@ -200,19 +210,19 @@ TEST_F(ThreadWrapperTest, ClearDelayed) { MatchMessage(&handler2_, kTestMessage1, null_data))) .WillOnce(DeleteMessageData()); - message_loop_.PostDelayedTask( + message_loop_.task_runner()->PostDelayedTask( FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), base::TimeDelta::FromMilliseconds(kMaxTestDelay)); - message_loop_.Run(); + base::RunLoop().Run(); } // Verify that the queue is cleared when a handler is destroyed. -TEST_F(ThreadWrapperTest, ClearDestoroyed) { +TEST_F(ThreadWrapperTest, ClearDestroyed) { MockMessageHandler* handler_ptr; { MockMessageHandler handler; handler_ptr = &handler; - thread_->Post(&handler, kTestMessage1, NULL); + thread_->Post(RTC_FROM_HERE, &handler, kTestMessage1, NULL); } rtc::MessageList removed; thread_->Clear(handler_ptr, rtc::MQID_ANY, &removed); @@ -227,7 +237,7 @@ TEST_F(ThreadWrapperTest, SendSameThread) { EXPECT_CALL(handler1_, OnMessage( MatchMessage(&handler1_, kTestMessage1, data))) .WillOnce(DeleteMessageData()); - thread_->Send(&handler1_, kTestMessage1, data); + thread_->Send(RTC_FROM_HERE, &handler1_, kTestMessage1, data); } void InitializeWrapperForNewThread(rtc::Thread** thread, @@ -246,11 +256,13 @@ TEST_F(ThreadWrapperTest, SendToOtherThread) { base::Thread second_thread("JingleThreadWrapperTest"); second_thread.Start(); - base::WaitableEvent initialized_event(true, false); + base::WaitableEvent initialized_event( + base::WaitableEvent::ResetPolicy::MANUAL, + base::WaitableEvent::InitialState::NOT_SIGNALED); rtc::Thread* target; - second_thread.message_loop()->PostTask( - FROM_HERE, base::Bind(&InitializeWrapperForNewThread, - &target, &initialized_event)); + second_thread.task_runner()->PostTask( + FROM_HERE, + base::Bind(&InitializeWrapperForNewThread, &target, &initialized_event)); initialized_event.Wait(); ASSERT_TRUE(target != NULL); @@ -260,7 +272,7 @@ TEST_F(ThreadWrapperTest, SendToOtherThread) { EXPECT_CALL(handler1_, OnMessage( MatchMessage(&handler1_, kTestMessage1, data))) .WillOnce(DeleteMessageData()); - target->Send(&handler1_, kTestMessage1, data); + target->Send(RTC_FROM_HERE, &handler1_, kTestMessage1, data); Mock::VerifyAndClearExpectations(&handler1_); } @@ -275,11 +287,13 @@ TEST_F(ThreadWrapperTest, SendDuringSend) { base::Thread second_thread("JingleThreadWrapperTest"); second_thread.Start(); - base::WaitableEvent initialized_event(true, false); + base::WaitableEvent initialized_event( + base::WaitableEvent::ResetPolicy::MANUAL, + base::WaitableEvent::InitialState::NOT_SIGNALED); rtc::Thread* target; - second_thread.message_loop()->PostTask( - FROM_HERE, base::Bind(&InitializeWrapperForNewThread, - &target, &initialized_event)); + second_thread.task_runner()->PostTask( + FROM_HERE, + base::Bind(&InitializeWrapperForNewThread, &target, &initialized_event)); initialized_event.Wait(); ASSERT_TRUE(target != NULL); @@ -292,7 +306,7 @@ TEST_F(ThreadWrapperTest, SendDuringSend) { InvokeWithoutArgs( this, &ThreadWrapperTest::PingMainThread), DeleteMessageData())); - target->Send(&handler1_, kTestMessage1, data); + target->Send(RTC_FROM_HERE, &handler1_, kTestMessage1, data); Mock::VerifyAndClearExpectations(&handler1_); } @@ -301,7 +315,7 @@ TEST_F(ThreadWrapperTest, Dispose) { bool deleted_ = false; thread_->Dispose(new DeletableObject(&deleted_)); EXPECT_FALSE(deleted_); - message_loop_.RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(deleted_); } diff --git a/chromium/jingle/glue/xmpp_client_socket_factory.cc b/chromium/jingle/glue/xmpp_client_socket_factory.cc index 7277ab44b7f..3ed455f0c1c 100644 --- a/chromium/jingle/glue/xmpp_client_socket_factory.cc +++ b/chromium/jingle/glue/xmpp_client_socket_factory.cc @@ -48,14 +48,15 @@ std::unique_ptr<net::SSLClientSocket> XmppClientSocketFactory::CreateSSLClientSocket( std::unique_ptr<net::ClientSocketHandle> transport_socket, const net::HostPortPair& host_and_port) { - net::SSLClientSocketContext context; - context.cert_verifier = - request_context_getter_->GetURLRequestContext()->cert_verifier(); - context.transport_security_state = request_context_getter_-> - GetURLRequestContext()->transport_security_state(); - DCHECK(context.transport_security_state); - // TODO(rkn): context.channel_id_service is NULL because the - // ChannelIDService class is not thread safe. + const net::URLRequestContext* url_context = + request_context_getter_->GetURLRequestContext(); + net::SSLClientSocketContext context( + url_context->cert_verifier(), + nullptr, /* TODO(rkn): ChannelIDService is not thread safe. */ + url_context->transport_security_state(), + url_context->cert_transparency_verifier(), + url_context->ct_policy_enforcer(), + std::string() /* TODO(rsleevi): Ensure a proper unique shard. */); return client_socket_factory_->CreateSSLClientSocket( std::move(transport_socket), host_and_port, ssl_config_, context); } diff --git a/chromium/jingle/notifier/base/xmpp_connection.cc b/chromium/jingle/notifier/base/xmpp_connection.cc index d50adb02745..efa62bca796 100644 --- a/chromium/jingle/notifier/base/xmpp_connection.cc +++ b/chromium/jingle/notifier/base/xmpp_connection.cc @@ -8,8 +8,8 @@ #include "base/compiler_specific.h" #include "base/logging.h" -#include "base/message_loop/message_loop.h" #include "base/strings/string_piece.h" +#include "base/threading/thread_task_runner_handle.h" #include "jingle/glue/chrome_async_socket.h" #include "jingle/glue/task_pump.h" #include "jingle/glue/xmpp_client_socket_factory.h" @@ -82,13 +82,12 @@ XmppConnection::~XmppConnection() { DCHECK(CalledOnValidThread()); ClearClient(); task_pump_->Stop(); - base::MessageLoop* current_message_loop = base::MessageLoop::current(); - CHECK(current_message_loop); // We do this because XmppConnection may get destroyed as a result // of a signal from XmppClient. If we delete |task_pump_| here, bad // things happen when the stack pops back up to the XmppClient's // (which is deleted by |task_pump_|) function. - current_message_loop->DeleteSoon(FROM_HERE, task_pump_.release()); + base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, + task_pump_.release()); } void XmppConnection::OnStateChange(buzz::XmppEngine::State state) { diff --git a/chromium/jingle/notifier/communicator/single_login_attempt_unittest.cc b/chromium/jingle/notifier/communicator/single_login_attempt_unittest.cc index efb09916473..298907cf903 100644 --- a/chromium/jingle/notifier/communicator/single_login_attempt_unittest.cc +++ b/chromium/jingle/notifier/communicator/single_login_attempt_unittest.cc @@ -9,6 +9,7 @@ #include "base/compiler_specific.h" #include "base/message_loop/message_loop.h" +#include "base/run_loop.h" #include "base/threading/thread_task_runner_handle.h" #include "jingle/notifier/base/const_communicator.h" #include "jingle/notifier/base/fake_base_task.h" @@ -93,7 +94,7 @@ class SingleLoginAttemptTest : public ::testing::Test { "auth_mechanism"), attempt_(new SingleLoginAttempt(login_settings_, &fake_delegate_)) {} - void TearDown() override { message_loop_.RunUntilIdle(); } + void TearDown() override { base::RunLoop().RunUntilIdle(); } void FireRedirect(buzz::XmlElement* redirect_error) { attempt_->OnError(buzz::XmppEngine::ERROR_STREAM, 0, redirect_error); @@ -101,7 +102,7 @@ class SingleLoginAttemptTest : public ::testing::Test { ~SingleLoginAttemptTest() override { attempt_.reset(); - message_loop_.RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } private: diff --git a/chromium/jingle/notifier/listener/non_blocking_push_client_unittest.cc b/chromium/jingle/notifier/listener/non_blocking_push_client_unittest.cc index 8d12d75c4e6..f7826d3b5f8 100644 --- a/chromium/jingle/notifier/listener/non_blocking_push_client_unittest.cc +++ b/chromium/jingle/notifier/listener/non_blocking_push_client_unittest.cc @@ -9,6 +9,7 @@ #include "base/compiler_specific.h" #include "base/message_loop/message_loop.h" +#include "base/run_loop.h" #include "base/threading/thread_task_runner_handle.h" #include "jingle/notifier/base/fake_base_task.h" #include "jingle/notifier/listener/fake_push_client.h" @@ -35,17 +36,17 @@ class NonBlockingPushClientTest : public testing::Test { base::Unretained(this)))); push_client_->AddObserver(&fake_observer_); // Pump message loop to run CreateFakePushClient. - message_loop_.RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } void TearDown() override { // Clear out any pending notifications before removing observers. - message_loop_.RunUntilIdle(); + base::RunLoop().RunUntilIdle(); push_client_->RemoveObserver(&fake_observer_); push_client_.reset(); // Then pump message loop to run // NonBlockingPushClient::DestroyOnDelegateThread(). - message_loop_.RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } std::unique_ptr<PushClient> CreateFakePushClient() { @@ -72,7 +73,7 @@ TEST_F(NonBlockingPushClientTest, UpdateSubscriptions) { push_client_->UpdateSubscriptions(subscriptions); EXPECT_TRUE(fake_push_client_->subscriptions().empty()); - message_loop_.RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE( SubscriptionListsEqual( fake_push_client_->subscriptions(), subscriptions)); @@ -86,7 +87,7 @@ TEST_F(NonBlockingPushClientTest, UpdateCredentials) { push_client_->UpdateCredentials(kEmail, kToken); EXPECT_TRUE(fake_push_client_->email().empty()); EXPECT_TRUE(fake_push_client_->token().empty()); - message_loop_.RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kEmail, fake_push_client_->email()); EXPECT_EQ(kToken, fake_push_client_->token()); } @@ -107,7 +108,7 @@ TEST_F(NonBlockingPushClientTest, SendNotification) { push_client_->SendNotification(notification); EXPECT_TRUE(fake_push_client_->sent_notifications().empty()); - message_loop_.RunUntilIdle(); + base::RunLoop().RunUntilIdle(); ASSERT_EQ(1u, fake_push_client_->sent_notifications().size()); EXPECT_TRUE( fake_push_client_->sent_notifications()[0].Equals(notification)); @@ -117,7 +118,7 @@ TEST_F(NonBlockingPushClientTest, SendNotification) { TEST_F(NonBlockingPushClientTest, SendPing) { push_client_->SendPing(); EXPECT_EQ(0, fake_push_client_->sent_pings()); - message_loop_.RunUntilIdle(); + base::RunLoop().RunUntilIdle(); ASSERT_EQ(1, fake_push_client_->sent_pings()); } @@ -127,12 +128,12 @@ TEST_F(NonBlockingPushClientTest, NotificationStateChange) { EXPECT_EQ(DEFAULT_NOTIFICATION_ERROR, fake_observer_.last_notifications_disabled_reason()); fake_push_client_->EnableNotifications(); - message_loop_.RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(NO_NOTIFICATION_ERROR, fake_observer_.last_notifications_disabled_reason()); fake_push_client_->DisableNotifications( NOTIFICATION_CREDENTIALS_REJECTED); - message_loop_.RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(NOTIFICATION_CREDENTIALS_REJECTED, fake_observer_.last_notifications_disabled_reason()); } @@ -142,7 +143,7 @@ TEST_F(NonBlockingPushClientTest, OnIncomingNotification) { const Notification notification = MakeTestNotification(); fake_push_client_->SimulateIncomingNotification(notification); - message_loop_.RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE( fake_observer_.last_incoming_notification().Equals(notification)); } diff --git a/chromium/jingle/notifier/listener/push_client_unittest.cc b/chromium/jingle/notifier/listener/push_client_unittest.cc index a2302f66980..0273618701d 100644 --- a/chromium/jingle/notifier/listener/push_client_unittest.cc +++ b/chromium/jingle/notifier/listener/push_client_unittest.cc @@ -10,6 +10,7 @@ #include "base/compiler_specific.h" #include "base/location.h" #include "base/message_loop/message_loop.h" +#include "base/single_thread_task_runner.h" #include "base/threading/thread.h" #include "jingle/notifier/base/notifier_options.h" #include "net/url_request/url_request_test_util.h" @@ -44,10 +45,9 @@ TEST_F(PushClientTest, CreateDefaultOnIOThread) { TEST_F(PushClientTest, CreateDefaultOffIOThread) { base::Thread thread("Non-IO thread"); EXPECT_TRUE(thread.Start()); - thread.message_loop()->PostTask( - FROM_HERE, - base::Bind(base::IgnoreResult(&PushClient::CreateDefault), - notifier_options_)); + thread.task_runner()->PostTask( + FROM_HERE, base::Bind(base::IgnoreResult(&PushClient::CreateDefault), + notifier_options_)); thread.Stop(); } |
