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

Side by Side Diff: ipc/ipc_channel_factory.cc

Issue 2494373002: Remove IPC channel IDs. (Closed)
Patch Set: rebase Created 4 years, 1 month 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_factory.h ('k') | ipc/ipc_channel_mojo.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 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 "base/macros.h" 5 #include "base/macros.h"
6 #include "base/memory/ptr_util.h" 6 #include "base/memory/ptr_util.h"
7 #include "ipc/ipc_channel_factory.h" 7 #include "ipc/ipc_channel_factory.h"
8 #include "ipc/ipc_channel_mojo.h" 8 #include "ipc/ipc_channel_mojo.h"
9 9
10 namespace IPC { 10 namespace IPC {
11 11
12 namespace { 12 namespace {
13 13
14 class PlatformChannelFactory : public ChannelFactory { 14 class PlatformChannelFactory : public ChannelFactory {
15 public: 15 public:
16 PlatformChannelFactory( 16 PlatformChannelFactory(
17 ChannelHandle handle, 17 ChannelHandle handle,
18 Channel::Mode mode, 18 Channel::Mode mode,
19 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) 19 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner)
20 : handle_(handle), mode_(mode), ipc_task_runner_(ipc_task_runner) {} 20 : handle_(handle), mode_(mode), ipc_task_runner_(ipc_task_runner) {}
21 21
22 std::string GetName() const override { return ""; }
23
24 std::unique_ptr<Channel> BuildChannel(Listener* listener) override { 22 std::unique_ptr<Channel> BuildChannel(Listener* listener) override {
25 #if defined(OS_NACL_SFI) 23 #if defined(OS_NACL_SFI)
26 return Channel::Create(handle_, mode_, listener); 24 return Channel::Create(handle_, mode_, listener);
27 #else 25 #else
28 DCHECK(handle_.is_mojo_channel_handle()); 26 DCHECK(handle_.is_mojo_channel_handle());
29 return ChannelMojo::Create( 27 return ChannelMojo::Create(
30 mojo::ScopedMessagePipeHandle(handle_.mojo_handle), mode_, listener, 28 mojo::ScopedMessagePipeHandle(handle_.mojo_handle), mode_, listener,
31 ipc_task_runner_); 29 ipc_task_runner_);
32 #endif 30 #endif
33 } 31 }
(...skipping 15 matching lines...) Expand all
49 // static 47 // static
50 std::unique_ptr<ChannelFactory> ChannelFactory::Create( 48 std::unique_ptr<ChannelFactory> ChannelFactory::Create(
51 const ChannelHandle& handle, 49 const ChannelHandle& handle,
52 Channel::Mode mode, 50 Channel::Mode mode,
53 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) { 51 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) {
54 return base::MakeUnique<PlatformChannelFactory>(handle, mode, 52 return base::MakeUnique<PlatformChannelFactory>(handle, mode,
55 ipc_task_runner); 53 ipc_task_runner);
56 } 54 }
57 55
58 } // namespace IPC 56 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_factory.h ('k') | ipc/ipc_channel_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698