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

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: Rebase 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') | 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 "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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 struct State { 67 struct State {
67 explicit State(ChannelWin* channel); 68 explicit State(ChannelWin* channel);
68 ~State(); 69 ~State();
69 base::MessageLoopForIO::IOContext context; 70 base::MessageLoopForIO::IOContext context;
70 bool is_pending; 71 bool is_pending;
71 }; 72 };
72 73
73 State input_state_; 74 State input_state_;
74 State output_state_; 75 State output_state_;
75 76
76 HANDLE pipe_; 77 base::win::ScopedHandle pipe_;
77 78
78 base::ProcessId peer_pid_; 79 base::ProcessId peer_pid_;
79 80
80 // Messages to be sent are queued here. 81 // Messages to be sent are queued here.
81 std::queue<Message*> output_queue_; 82 std::queue<Message*> output_queue_;
82 83
83 // In server-mode, we have to wait for the client to connect before we 84 // In server-mode, we have to wait for the client to connect before we
84 // can begin reading. We make use of the input_state_ when performing 85 // can begin reading. We make use of the input_state_ when performing
85 // the connect operation in overlapped mode. 86 // the connect operation in overlapped mode.
86 bool waiting_connect_; 87 bool waiting_connect_;
(...skipping 29 matching lines...) Expand all
116 117
117 scoped_ptr<base::ThreadChecker> thread_check_; 118 scoped_ptr<base::ThreadChecker> thread_check_;
118 base::WeakPtrFactory<ChannelWin> weak_factory_; 119 base::WeakPtrFactory<ChannelWin> weak_factory_;
119 120
120 DISALLOW_COPY_AND_ASSIGN(ChannelWin); 121 DISALLOW_COPY_AND_ASSIGN(ChannelWin);
121 }; 122 };
122 123
123 } // namespace IPC 124 } // namespace IPC
124 125
125 #endif // IPC_IPC_CHANNEL_WIN_H_ 126 #endif // IPC_IPC_CHANNEL_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | ipc/ipc_channel_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698