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

Side by Side Diff: ipc/ipc_channel_proxy.cc

Issue 1262253004: Let IPC::SyncMessageFilter take advantage of thread-safe Send. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minus some code Created 5 years, 4 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 | « ipc/ipc_channel_proxy.h ('k') | ipc/ipc_sync_channel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ipc/ipc_channel_proxy.h" 5 #include "ipc/ipc_channel_proxy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 if (channel_send_thread_safe_) { 334 if (channel_send_thread_safe_) {
335 SendFromThisThread(message); 335 SendFromThisThread(message);
336 return; 336 return;
337 } 337 }
338 338
339 ipc_task_runner()->PostTask( 339 ipc_task_runner()->PostTask(
340 FROM_HERE, base::Bind(&ChannelProxy::Context::OnSendMessage, this, 340 FROM_HERE, base::Bind(&ChannelProxy::Context::OnSendMessage, this,
341 base::Passed(scoped_ptr<Message>(message)))); 341 base::Passed(scoped_ptr<Message>(message))));
342 } 342 }
343 343
344 bool ChannelProxy::Context::IsChannelSendThreadSafe() const {
345 return channel_send_thread_safe_;
346 }
347
344 //----------------------------------------------------------------------------- 348 //-----------------------------------------------------------------------------
345 349
346 // static 350 // static
347 scoped_ptr<ChannelProxy> ChannelProxy::Create( 351 scoped_ptr<ChannelProxy> ChannelProxy::Create(
348 const IPC::ChannelHandle& channel_handle, 352 const IPC::ChannelHandle& channel_handle,
349 Channel::Mode mode, 353 Channel::Mode mode,
350 Listener* listener, 354 Listener* listener,
351 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner, 355 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
352 AttachmentBroker* broker) { 356 AttachmentBroker* broker) {
353 scoped_ptr<ChannelProxy> channel(new ChannelProxy(listener, ipc_task_runner)); 357 scoped_ptr<ChannelProxy> channel(new ChannelProxy(listener, ipc_task_runner));
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 } 510 }
507 #endif 511 #endif
508 512
509 void ChannelProxy::SetAttachmentBrokerEndpoint(bool is_endpoint) { 513 void ChannelProxy::SetAttachmentBrokerEndpoint(bool is_endpoint) {
510 context()->set_attachment_broker_endpoint(is_endpoint); 514 context()->set_attachment_broker_endpoint(is_endpoint);
511 } 515 }
512 516
513 //----------------------------------------------------------------------------- 517 //-----------------------------------------------------------------------------
514 518
515 } // namespace IPC 519 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_proxy.h ('k') | ipc/ipc_sync_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698