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

Side by Side Diff: ipc/ipc_channel_win.h

Issue 1184523003: attachment broker wip (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor comments. 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_unittest.cc ('k') | ipc/ipc_channel_win.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 #ifndef IPC_IPC_CHANNEL_WIN_H_ 5 #ifndef IPC_IPC_CHANNEL_WIN_H_
6 #define IPC_IPC_CHANNEL_WIN_H_ 6 #define IPC_IPC_CHANNEL_WIN_H_
7 7
8 #include "ipc/ipc_channel.h" 8 #include "ipc/ipc_channel.h"
9 9
10 #include <queue> 10 #include <queue>
11 #include <string> 11 #include <string>
12 12
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/message_loop/message_loop.h" 15 #include "base/message_loop/message_loop.h"
16 #include "base/win/scoped_handle.h" 16 #include "base/win/scoped_handle.h"
17 #include "ipc/ipc_channel_reader.h" 17 #include "ipc/ipc_channel_reader.h"
18 18
19 namespace base { 19 namespace base {
20 class ThreadChecker; 20 class ThreadChecker;
21 } 21 }
22 22
23 namespace IPC { 23 namespace IPC {
24 24
25 class ChannelWin : public Channel, 25 class ChannelWin : public Channel,
26 public internal::ChannelReader, 26 public internal::ChannelReader,
27 public base::MessageLoopForIO::IOHandler { 27 public base::MessageLoopForIO::IOHandler {
28 public: 28 public:
29 // Mirror methods of Channel, see ipc_channel.h for description. 29 // Mirror methods of Channel, see ipc_channel.h for description.
30 ChannelWin(const IPC::ChannelHandle &channel_handle, Mode mode, 30 ChannelWin(const IPC::ChannelHandle& channel_handle,
31 Listener* listener); 31 Mode mode,
32 Listener* listener,
33 AttachmentBroker* broker);
32 ~ChannelWin() override; 34 ~ChannelWin() override;
33 35
34 // Channel implementation 36 // Channel implementation
35 bool Connect() override; 37 bool Connect() override;
36 void Close() override; 38 void Close() override;
37 bool Send(Message* message) override; 39 bool Send(Message* message) override;
40 AttachmentBroker* GetAttachmentBroker() override;
38 base::ProcessId GetPeerPID() const override; 41 base::ProcessId GetPeerPID() const override;
39 base::ProcessId GetSelfPID() const override; 42 base::ProcessId GetSelfPID() const override;
40 43
41 static bool IsNamedServerInitialized(const std::string& channel_id); 44 static bool IsNamedServerInitialized(const std::string& channel_id);
42 45
43 46
44 private: 47 private:
45 // ChannelReader implementation. 48 // ChannelReader implementation.
46 ReadState ReadData(char* buffer, int buffer_len, int* bytes_read) override; 49 ReadState ReadData(char* buffer, int buffer_len, int* bytes_read) override;
47 bool WillDispatchInputMessage(Message* msg) override; 50 bool WillDispatchInputMessage(Message* msg) override;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 100
98 // This is a unique per-channel value used to authenticate the client end of 101 // This is a unique per-channel value used to authenticate the client end of
99 // a connection. If the value is non-zero, the client passes it in the hello 102 // a connection. If the value is non-zero, the client passes it in the hello
100 // and the host validates. (We don't send the zero value fto preserve IPC 103 // and the host validates. (We don't send the zero value fto preserve IPC
101 // compatability with existing clients that don't validate the channel.) 104 // compatability with existing clients that don't validate the channel.)
102 int32 client_secret_; 105 int32 client_secret_;
103 106
104 scoped_ptr<base::ThreadChecker> thread_check_; 107 scoped_ptr<base::ThreadChecker> thread_check_;
105 base::WeakPtrFactory<ChannelWin> weak_factory_; 108 base::WeakPtrFactory<ChannelWin> weak_factory_;
106 109
110 AttachmentBroker* broker_;
111
107 DISALLOW_COPY_AND_ASSIGN(ChannelWin); 112 DISALLOW_COPY_AND_ASSIGN(ChannelWin);
108 }; 113 };
109 114
110 } // namespace IPC 115 } // namespace IPC
111 116
112 #endif // IPC_IPC_CHANNEL_WIN_H_ 117 #endif // IPC_IPC_CHANNEL_WIN_H_
OLDNEW
« no previous file with comments | « ipc/ipc_channel_unittest.cc ('k') | ipc/ipc_channel_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698