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

Side by Side Diff: ipc/attachment_broker.h

Issue 1256993003: ipc: Create AttachmentBrokerPrivileged and AttachmentBrokerUnprivileged. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add_ipc_message_feature
Patch Set: Rebase. 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
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 #ifndef IPC_ATTACHMENT_BROKER_H_ 5 #ifndef IPC_ATTACHMENT_BROKER_H_
6 #define IPC_ATTACHMENT_BROKER_H_ 6 #define IPC_ATTACHMENT_BROKER_H_
7 7
8 #include "base/gtest_prod_util.h" 8 #include "base/gtest_prod_util.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/process/process_handle.h" 10 #include "base/process/process_handle.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 const scoped_refptr<BrokerableAttachment>& attachment); 77 const scoped_refptr<BrokerableAttachment>& attachment);
78 78
79 // Informs the observers that a new BrokerableAttachment has been received. 79 // Informs the observers that a new BrokerableAttachment has been received.
80 void NotifyObservers(const BrokerableAttachment::AttachmentId& id); 80 void NotifyObservers(const BrokerableAttachment::AttachmentId& id);
81 81
82 // This method is exposed for testing only. 82 // This method is exposed for testing only.
83 AttachmentVector* get_attachments() { return &attachments_; } 83 AttachmentVector* get_attachments() { return &attachments_; }
84 84
85 private: 85 private:
86 #if defined(OS_WIN) 86 #if defined(OS_WIN)
87 FRIEND_TEST_ALL_PREFIXES(AttachmentBrokerWinTest, ReceiveValidMessage); 87 FRIEND_TEST_ALL_PREFIXES(AttachmentBrokerUnprivilegedWinTest,
88 FRIEND_TEST_ALL_PREFIXES(AttachmentBrokerWinTest, ReceiveInvalidMessage); 88 ReceiveValidMessage);
89 FRIEND_TEST_ALL_PREFIXES(AttachmentBrokerUnprivilegedWinTest,
90 ReceiveInvalidMessage);
89 #endif // defined(OS_WIN) 91 #endif // defined(OS_WIN)
90 92
91 // A vector of BrokerableAttachments that have been received, but not yet 93 // A vector of BrokerableAttachments that have been received, but not yet
92 // consumed. 94 // consumed.
93 // A std::vector is used instead of a std::map because this container is 95 // A std::vector is used instead of a std::map because this container is
94 // expected to have few elements, for which a std::vector is expected to have 96 // expected to have few elements, for which a std::vector is expected to have
95 // better performance. 97 // better performance.
96 AttachmentVector attachments_; 98 AttachmentVector attachments_;
97 99
98 std::vector<Observer*> observers_; 100 std::vector<Observer*> observers_;
99 DISALLOW_COPY_AND_ASSIGN(AttachmentBroker); 101 DISALLOW_COPY_AND_ASSIGN(AttachmentBroker);
100 }; 102 };
101 103
102 } // namespace IPC 104 } // namespace IPC
103 105
104 #endif // IPC_ATTACHMENT_BROKER_H_ 106 #endif // IPC_ATTACHMENT_BROKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698