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

Side by Side Diff: ipc/ipc_channel_reader_unittest.cc

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.cc ('k') | ipc/ipc_channel_win.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "ipc/attachment_broker.h" 9 #include "ipc/attachment_broker.h"
10 #include "ipc/brokerable_attachment.h" 10 #include "ipc/brokerable_attachment.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 bool ShouldDispatchInputMessage(Message* msg) override { return true; } 72 bool ShouldDispatchInputMessage(Message* msg) override { return true; }
73 73
74 bool GetNonBrokeredAttachments(Message* msg) override { return true; } 74 bool GetNonBrokeredAttachments(Message* msg) override { return true; }
75 75
76 bool DidEmptyInputBuffers() override { return true; } 76 bool DidEmptyInputBuffers() override { return true; }
77 77
78 void HandleInternalMessage(const Message& msg) override {} 78 void HandleInternalMessage(const Message& msg) override {}
79 79
80 void DispatchMessage(Message* m) override { last_dispatched_message_ = m; } 80 void DispatchMessage(Message* m) override { last_dispatched_message_ = m; }
81 81
82 base::ProcessId GetSenderPID() override { return base::kNullProcessId; }
83
82 AttachmentBroker* GetAttachmentBroker() override { return broker_; } 84 AttachmentBroker* GetAttachmentBroker() override { return broker_; }
83 85
84 // This instance takes ownership of |m|. 86 // This instance takes ownership of |m|.
85 void AddMessageForDispatch(Message* m) { 87 void AddMessageForDispatch(Message* m) {
86 get_queued_messages()->push_back(m); 88 get_queued_messages()->push_back(m);
87 } 89 }
88 90
89 Message* get_last_dispatched_message() { return last_dispatched_message_; } 91 Message* get_last_dispatched_message() { return last_dispatched_message_; }
90 92
91 void set_broker(AttachmentBroker* broker) { broker_ = broker; } 93 void set_broker(AttachmentBroker* broker) { broker_ = broker; }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 reader.DispatchMessages()); 130 reader.DispatchMessages());
129 EXPECT_EQ(nullptr, reader.get_last_dispatched_message()); 131 EXPECT_EQ(nullptr, reader.get_last_dispatched_message());
130 132
131 broker.AddAttachment(attachment); 133 broker.AddAttachment(attachment);
132 EXPECT_EQ(m, reader.get_last_dispatched_message()); 134 EXPECT_EQ(m, reader.get_last_dispatched_message());
133 } 135 }
134 136
135 } // namespace internal 137 } // namespace internal
136 } // namespace IPC 138 } // namespace IPC
137 #endif // USE_ATTACHMENT_BROKER 139 #endif // USE_ATTACHMENT_BROKER
OLDNEW
« no previous file with comments | « ipc/ipc_channel_reader.cc ('k') | ipc/ipc_channel_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698