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

Side by Side Diff: ipc/ipc_channel_proxy.cc

Issue 307653003: Introduce IPC::Channel::Create*() to ensure it being heap-allocated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing windows build, landing again. Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « ipc/ipc_channel_posix_unittest.cc ('k') | ipc/ipc_channel_proxy_unittest.cc » ('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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_.reset(new Channel(handle, mode, this)); 55 channel_ = Channel::CreateByModeForProxy(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
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
OLDNEW
« no previous file with comments | « ipc/ipc_channel_posix_unittest.cc ('k') | ipc/ipc_channel_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698