OLD | NEW |
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 } | 45 } |
46 | 46 |
47 void ChannelProxy::Context::ClearIPCTaskRunner() { | 47 void ChannelProxy::Context::ClearIPCTaskRunner() { |
48 ipc_task_runner_ = NULL; | 48 ipc_task_runner_ = NULL; |
49 } | 49 } |
50 | 50 |
51 void ChannelProxy::Context::CreateChannel(const IPC::ChannelHandle& handle, | 51 void ChannelProxy::Context::CreateChannel(const IPC::ChannelHandle& handle, |
52 const Channel::Mode& mode) { | 52 const Channel::Mode& mode) { |
53 DCHECK(!channel_); | 53 DCHECK(!channel_); |
54 channel_id_ = handle.name; | 54 channel_id_ = handle.name; |
55 channel_ = Channel::CreateByModeForProxy(handle, mode, this); | 55 channel_.reset(new Channel(handle, mode, this)); |
56 } | 56 } |
57 | 57 |
58 bool ChannelProxy::Context::TryFilters(const Message& message) { | 58 bool ChannelProxy::Context::TryFilters(const Message& message) { |
59 DCHECK(message_filter_router_); | 59 DCHECK(message_filter_router_); |
60 #ifdef IPC_MESSAGE_LOG_ENABLED | 60 #ifdef IPC_MESSAGE_LOG_ENABLED |
61 Logging* logger = Logging::GetInstance(); | 61 Logging* logger = Logging::GetInstance(); |
62 if (logger->Enabled()) | 62 if (logger->Enabled()) |
63 logger->OnPreDispatchMessage(message); | 63 logger->OnPreDispatchMessage(message); |
64 #endif | 64 #endif |
65 | 65 |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 Channel* channel = context_.get()->channel_.get(); | 436 Channel* channel = context_.get()->channel_.get(); |
437 // Channel must have been created first. | 437 // Channel must have been created first. |
438 DCHECK(channel) << context_.get()->channel_id_; | 438 DCHECK(channel) << context_.get()->channel_id_; |
439 return channel->GetPeerEuid(peer_euid); | 439 return channel->GetPeerEuid(peer_euid); |
440 } | 440 } |
441 #endif | 441 #endif |
442 | 442 |
443 //----------------------------------------------------------------------------- | 443 //----------------------------------------------------------------------------- |
444 | 444 |
445 } // namespace IPC | 445 } // namespace IPC |
OLD | NEW |