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

Side by Side Diff: ipc/ipc_channel_reader_unittest.cc

Issue 1258323004: Reland #1: Clean up interface of attachment broker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
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; } 82 base::ProcessId GetSenderPID() override { return base::kNullProcessId; }
83 83
84 bool IsAttachmentBrokerEndpoint() override { return false; }
85
84 AttachmentBroker* GetAttachmentBroker() override { return broker_; } 86 AttachmentBroker* GetAttachmentBroker() override { return broker_; }
85 87
86 // This instance takes ownership of |m|. 88 // This instance takes ownership of |m|.
87 void AddMessageForDispatch(Message* m) { 89 void AddMessageForDispatch(Message* m) {
88 get_queued_messages()->push_back(m); 90 get_queued_messages()->push_back(m);
89 } 91 }
90 92
91 Message* get_last_dispatched_message() { return last_dispatched_message_; } 93 Message* get_last_dispatched_message() { return last_dispatched_message_; }
92 94
93 void set_broker(AttachmentBroker* broker) { broker_ = broker; } 95 void set_broker(AttachmentBroker* broker) { broker_ = broker; }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 reader.DispatchMessages()); 132 reader.DispatchMessages());
131 EXPECT_EQ(nullptr, reader.get_last_dispatched_message()); 133 EXPECT_EQ(nullptr, reader.get_last_dispatched_message());
132 134
133 broker.AddAttachment(attachment); 135 broker.AddAttachment(attachment);
134 EXPECT_EQ(m, reader.get_last_dispatched_message()); 136 EXPECT_EQ(m, reader.get_last_dispatched_message());
135 } 137 }
136 138
137 } // namespace internal 139 } // namespace internal
138 } // namespace IPC 140 } // namespace IPC
139 #endif // USE_ATTACHMENT_BROKER 141 #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