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

Side by Side Diff: ipc/ipc_channel_factory.cc

Issue 1185133006: IPC: Make ChannelReader inherit from SupportsAttachmentBrokering. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from tsepez. Created 5 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
« no previous file with comments | « ipc/ipc_channel_factory.h ('k') | ipc/ipc_channel_nacl.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 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/ipc_channel_factory.h" 5 #include "ipc/ipc_channel_factory.h"
6 6
7 namespace IPC { 7 namespace IPC {
8 8
9 namespace { 9 namespace {
10 10
11 class PlatformChannelFactory : public ChannelFactory { 11 class PlatformChannelFactory : public ChannelFactory {
12 public: 12 public:
13 PlatformChannelFactory(ChannelHandle handle, 13 PlatformChannelFactory(ChannelHandle handle,
14 Channel::Mode mode) 14 Channel::Mode mode,
15 : handle_(handle), mode_(mode) { 15 AttachmentBroker* broker)
16 } 16 : handle_(handle), mode_(mode), broker_(broker) {}
17 17
18 std::string GetName() const override { 18 std::string GetName() const override {
19 return handle_.name; 19 return handle_.name;
20 } 20 }
21 21
22 scoped_ptr<Channel> BuildChannel(Listener* listener) override { 22 scoped_ptr<Channel> BuildChannel(Listener* listener) override {
23 return Channel::Create(handle_, mode_, listener); 23 return Channel::Create(handle_, mode_, listener, broker_);
24 } 24 }
25 25
26 private: 26 private:
27 ChannelHandle handle_; 27 ChannelHandle handle_;
28 Channel::Mode mode_; 28 Channel::Mode mode_;
29 AttachmentBroker* broker_;
29 30
30 DISALLOW_COPY_AND_ASSIGN(PlatformChannelFactory); 31 DISALLOW_COPY_AND_ASSIGN(PlatformChannelFactory);
31 }; 32 };
32 33
33 } // namespace 34 } // namespace
34 35
35 // static 36 // static
36 scoped_ptr<ChannelFactory> ChannelFactory::Create( 37 scoped_ptr<ChannelFactory> ChannelFactory::Create(const ChannelHandle& handle,
37 const ChannelHandle& handle, Channel::Mode mode) { 38 Channel::Mode mode,
38 return scoped_ptr<ChannelFactory>(new PlatformChannelFactory(handle, mode)); 39 AttachmentBroker* broker) {
40 return scoped_ptr<ChannelFactory>(
41 new PlatformChannelFactory(handle, mode, broker));
39 } 42 }
40 43
41 } // namespace IPC 44 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_factory.h ('k') | ipc/ipc_channel_nacl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698