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

Side by Side Diff: ipc/ipc_channel_win.h

Issue 1262543003: ipc: Create an unforgeable mechanism to get the process id of the sender. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove dchecks. Created 5 years, 4 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_reader_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>
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 static bool IsNamedServerInitialized(const std::string& channel_id); 45 static bool IsNamedServerInitialized(const std::string& channel_id);
46 46
47 47
48 private: 48 private:
49 // ChannelReader implementation. 49 // ChannelReader implementation.
50 ReadState ReadData(char* buffer, int buffer_len, int* bytes_read) override; 50 ReadState ReadData(char* buffer, int buffer_len, int* bytes_read) override;
51 bool ShouldDispatchInputMessage(Message* msg) override; 51 bool ShouldDispatchInputMessage(Message* msg) override;
52 bool GetNonBrokeredAttachments(Message* msg) override; 52 bool GetNonBrokeredAttachments(Message* msg) override;
53 bool DidEmptyInputBuffers() override; 53 bool DidEmptyInputBuffers() override;
54 void HandleInternalMessage(const Message& msg) override; 54 void HandleInternalMessage(const Message& msg) override;
55 base::ProcessId GetSenderPID() override;
55 56
56 static const base::string16 PipeName(const std::string& channel_id, 57 static const base::string16 PipeName(const std::string& channel_id,
57 int32* secret); 58 int32* secret);
58 bool CreatePipe(const IPC::ChannelHandle &channel_handle, Mode mode); 59 bool CreatePipe(const IPC::ChannelHandle &channel_handle, Mode mode);
59 60
60 bool ProcessConnection(); 61 bool ProcessConnection();
61 bool ProcessOutgoingMessages(base::MessageLoopForIO::IOContext* context, 62 bool ProcessOutgoingMessages(base::MessageLoopForIO::IOContext* context,
62 DWORD bytes_written); 63 DWORD bytes_written);
63 64
64 // Returns |false| on channel error. 65 // Returns |false| on channel error.
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 // |broker_| must outlive this instance. 133 // |broker_| must outlive this instance.
133 AttachmentBroker* broker_; 134 AttachmentBroker* broker_;
134 135
135 base::WeakPtrFactory<ChannelWin> weak_factory_; 136 base::WeakPtrFactory<ChannelWin> weak_factory_;
136 DISALLOW_COPY_AND_ASSIGN(ChannelWin); 137 DISALLOW_COPY_AND_ASSIGN(ChannelWin);
137 }; 138 };
138 139
139 } // namespace IPC 140 } // namespace IPC
140 141
141 #endif // IPC_IPC_CHANNEL_WIN_H_ 142 #endif // IPC_IPC_CHANNEL_WIN_H_
OLDNEW
« no previous file with comments | « ipc/ipc_channel_reader_unittest.cc ('k') | ipc/ipc_channel_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698