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

Side by Side Diff: ipc/mojo/ipc_channel_mojo.cc

Issue 1246953003: Use thread-safe send when using Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ipc/mojo/ipc_channel_mojo.h" 5 #include "ipc/mojo/ipc_channel_mojo.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 pending_messages_.push_back(message); 440 pending_messages_.push_back(message);
441 // Counts as OK before the connection is established, but it's an 441 // Counts as OK before the connection is established, but it's an
442 // error otherwise. 442 // error otherwise.
443 return waiting_connect_; 443 return waiting_connect_;
444 } 444 }
445 445
446 return message_reader_->Send(make_scoped_ptr(message)); 446 return message_reader_->Send(make_scoped_ptr(message));
447 } 447 }
448 448
449 bool ChannelMojo::IsSendThreadSafe() const { 449 bool ChannelMojo::IsSendThreadSafe() const {
450 return false; 450 return true;
451 } 451 }
452 452
453 base::ProcessId ChannelMojo::GetPeerPID() const { 453 base::ProcessId ChannelMojo::GetPeerPID() const {
454 return peer_pid_; 454 return peer_pid_;
455 } 455 }
456 456
457 base::ProcessId ChannelMojo::GetSelfPID() const { 457 base::ProcessId ChannelMojo::GetSelfPID() const {
458 return bootstrap_->GetSelfPID(); 458 return bootstrap_->GetSelfPID();
459 } 459 }
460 460
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 if (!ok) { 551 if (!ok) {
552 LOG(ERROR) << "Failed to add new Mojo handle."; 552 LOG(ERROR) << "Failed to add new Mojo handle.";
553 return MOJO_RESULT_UNKNOWN; 553 return MOJO_RESULT_UNKNOWN;
554 } 554 }
555 } 555 }
556 556
557 return MOJO_RESULT_OK; 557 return MOJO_RESULT_OK;
558 } 558 }
559 559
560 } // namespace IPC 560 } // namespace IPC
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698