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

Side by Side Diff: ipc/ipc_channel_win.h

Issue 588383003: IPC: Use ScopedHandle instead of a raw HANDLE for the private members. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | ipc/ipc_channel_win.cc » ('j') | ipc/ipc_channel_win.cc » ('J')
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 "ipc/ipc_channel_reader.h" 17 #include "ipc/ipc_channel_reader.h"
17 18
18 namespace base { 19 namespace base {
19 class ThreadChecker; 20 class ThreadChecker;
20 } 21 }
21 22
22 namespace IPC { 23 namespace IPC {
23 24
24 class ChannelWin : public Channel, 25 class ChannelWin : public Channel,
25 public internal::ChannelReader, 26 public internal::ChannelReader,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 struct State { 68 struct State {
68 explicit State(ChannelWin* channel); 69 explicit State(ChannelWin* channel);
69 ~State(); 70 ~State();
70 base::MessageLoopForIO::IOContext context; 71 base::MessageLoopForIO::IOContext context;
71 bool is_pending; 72 bool is_pending;
72 }; 73 };
73 74
74 State input_state_; 75 State input_state_;
75 State output_state_; 76 State output_state_;
76 77
77 HANDLE pipe_; 78 base::win::ScopedHandle pipe_;
78 79
79 base::ProcessId peer_pid_; 80 base::ProcessId peer_pid_;
80 81
81 // Messages to be sent are queued here. 82 // Messages to be sent are queued here.
82 std::queue<Message*> output_queue_; 83 std::queue<Message*> output_queue_;
83 84
84 // In server-mode, we have to wait for the client to connect before we 85 // In server-mode, we have to wait for the client to connect before we
85 // can begin reading. We make use of the input_state_ when performing 86 // can begin reading. We make use of the input_state_ when performing
86 // the connect operation in overlapped mode. 87 // the connect operation in overlapped mode.
87 bool waiting_connect_; 88 bool waiting_connect_;
(...skipping 29 matching lines...) Expand all
117 118
118 scoped_ptr<base::ThreadChecker> thread_check_; 119 scoped_ptr<base::ThreadChecker> thread_check_;
119 base::WeakPtrFactory<ChannelWin> weak_factory_; 120 base::WeakPtrFactory<ChannelWin> weak_factory_;
120 121
121 DISALLOW_COPY_AND_ASSIGN(ChannelWin); 122 DISALLOW_COPY_AND_ASSIGN(ChannelWin);
122 }; 123 };
123 124
124 } // namespace IPC 125 } // namespace IPC
125 126
126 #endif // IPC_IPC_CHANNEL_WIN_H_ 127 #endif // IPC_IPC_CHANNEL_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | ipc/ipc_channel_win.cc » ('j') | ipc/ipc_channel_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698