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

Side by Side Diff: content/child/child_thread_impl.cc

Issue 2123653003: Remove calls to MessageLoop::current() in content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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/child/child_thread_impl.h" 5 #include "content/child/child_thread_impl.h"
6 6
7 #include <signal.h> 7 #include <signal.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 void ChildThreadImpl::OnChannelConnected(int32_t peer_pid) { 558 void ChildThreadImpl::OnChannelConnected(int32_t peer_pid) {
559 channel_connected_factory_.InvalidateWeakPtrs(); 559 channel_connected_factory_.InvalidateWeakPtrs();
560 } 560 }
561 561
562 void ChildThreadImpl::OnChannelError() { 562 void ChildThreadImpl::OnChannelError() {
563 on_channel_error_called_ = true; 563 on_channel_error_called_ = true;
564 base::MessageLoop::current()->QuitWhenIdle(); 564 base::MessageLoop::current()->QuitWhenIdle();
565 } 565 }
566 566
567 bool ChildThreadImpl::Send(IPC::Message* msg) { 567 bool ChildThreadImpl::Send(IPC::Message* msg) {
568 DCHECK(base::MessageLoop::current() == message_loop()); 568 DCHECK(message_loop_->task_runner()->BelongsToCurrentThread());
569 if (!channel_) { 569 if (!channel_) {
570 delete msg; 570 delete msg;
571 return false; 571 return false;
572 } 572 }
573 573
574 return channel_->Send(msg); 574 return channel_->Send(msg);
575 } 575 }
576 576
577 #if defined(OS_WIN) 577 #if defined(OS_WIN)
578 void ChildThreadImpl::PreCacheFont(const LOGFONT& log_font) { 578 void ChildThreadImpl::PreCacheFont(const LOGFONT& log_font) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 610
611 shell::InterfaceRegistry* ChildThreadImpl::GetInterfaceRegistryForConnection() { 611 shell::InterfaceRegistry* ChildThreadImpl::GetInterfaceRegistryForConnection() {
612 return GetInterfaceRegistry(); 612 return GetInterfaceRegistry();
613 } 613 }
614 614
615 shell::InterfaceProvider* ChildThreadImpl::GetInterfaceProviderForConnection() { 615 shell::InterfaceProvider* ChildThreadImpl::GetInterfaceProviderForConnection() {
616 return GetRemoteInterfaces(); 616 return GetRemoteInterfaces();
617 } 617 }
618 618
619 IPC::MessageRouter* ChildThreadImpl::GetRouter() { 619 IPC::MessageRouter* ChildThreadImpl::GetRouter() {
620 DCHECK(base::MessageLoop::current() == message_loop()); 620 DCHECK(message_loop_->task_runner()->BelongsToCurrentThread());
621 return &router_; 621 return &router_;
622 } 622 }
623 623
624 std::unique_ptr<base::SharedMemory> ChildThreadImpl::AllocateSharedMemory( 624 std::unique_ptr<base::SharedMemory> ChildThreadImpl::AllocateSharedMemory(
625 size_t buf_size) { 625 size_t buf_size) {
626 DCHECK(base::MessageLoop::current() == message_loop()); 626 DCHECK(message_loop_->task_runner()->BelongsToCurrentThread());
627 return AllocateSharedMemory(buf_size, this, nullptr); 627 return AllocateSharedMemory(buf_size, this, nullptr);
628 } 628 }
629 629
630 // static 630 // static
631 std::unique_ptr<base::SharedMemory> ChildThreadImpl::AllocateSharedMemory( 631 std::unique_ptr<base::SharedMemory> ChildThreadImpl::AllocateSharedMemory(
632 size_t buf_size, 632 size_t buf_size,
633 IPC::Sender* sender, 633 IPC::Sender* sender,
634 bool* out_of_memory) { 634 bool* out_of_memory) {
635 std::unique_ptr<base::SharedMemory> shared_buf; 635 std::unique_ptr<base::SharedMemory> shared_buf;
636 // Ask the browser to create the shared memory, since this is blocked by the 636 // Ask the browser to create the shared memory, since this is blocked by the
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 void ChildThreadImpl::EnsureConnected() { 766 void ChildThreadImpl::EnsureConnected() {
767 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; 767 VLOG(0) << "ChildThreadImpl::EnsureConnected()";
768 base::Process::Current().Terminate(0, false); 768 base::Process::Current().Terminate(0, false);
769 } 769 }
770 770
771 bool ChildThreadImpl::IsInBrowserProcess() const { 771 bool ChildThreadImpl::IsInBrowserProcess() const {
772 return static_cast<bool>(browser_process_io_runner_); 772 return static_cast<bool>(browser_process_io_runner_);
773 } 773 }
774 774
775 } // namespace content 775 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698