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

Side by Side Diff: ipc/attachment_broker_privileged.h

Issue 1420763002: ipc: Move methods into AttachmentBroker interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 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 | « ipc/attachment_broker_mac_unittest.cc ('k') | ipc/attachment_broker_privileged_mac.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 #ifndef IPC_ATTACHMENT_BROKER_PRIVILEGED_H_ 5 #ifndef IPC_ATTACHMENT_BROKER_PRIVILEGED_H_
6 #define IPC_ATTACHMENT_BROKER_PRIVILEGED_H_ 6 #define IPC_ATTACHMENT_BROKER_PRIVILEGED_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 15 matching lines...) Expand all
26 ~AttachmentBrokerPrivileged() override; 26 ~AttachmentBrokerPrivileged() override;
27 27
28 // On platforms that support attachment brokering, returns a new instance of 28 // On platforms that support attachment brokering, returns a new instance of
29 // a platform-specific attachment broker. Otherwise returns |nullptr|. 29 // a platform-specific attachment broker. Otherwise returns |nullptr|.
30 // The caller takes ownership of the newly created instance, and is 30 // The caller takes ownership of the newly created instance, and is
31 // responsible for ensuring that the attachment broker lives longer than 31 // responsible for ensuring that the attachment broker lives longer than
32 // every IPC::Channel. The new instance automatically registers itself as the 32 // every IPC::Channel. The new instance automatically registers itself as the
33 // global attachment broker. 33 // global attachment broker.
34 static scoped_ptr<AttachmentBrokerPrivileged> CreateBroker(); 34 static scoped_ptr<AttachmentBrokerPrivileged> CreateBroker();
35 35
36 // Each unprivileged process should have one IPC channel on which it 36 // AttachmentBroker overrides.
37 // communicates attachment information with the broker process. In the broker 37 void RegisterCommunicationChannel(Endpoint* endpoint) override;
38 // process, these channels must be registered and deregistered with the 38 void DeregisterCommunicationChannel(Endpoint* endpoint) override;
39 // Attachment Broker as they are created and destroyed.
40 void RegisterCommunicationChannel(Endpoint* endpoint);
41 void DeregisterCommunicationChannel(Endpoint* endpoint);
42 39
43 protected: 40 protected:
44 // Returns the sender whose peer's process id is |id|. 41 // Returns the sender whose peer's process id is |id|.
45 // Returns nullptr if no sender is found. 42 // Returns nullptr if no sender is found.
46 Sender* GetSenderWithProcessId(base::ProcessId id); 43 Sender* GetSenderWithProcessId(base::ProcessId id);
47 44
48 // Errors that can be reported by subclasses. 45 // Errors that can be reported by subclasses.
49 // These match tools/metrics/histograms.xml. 46 // These match tools/metrics/histograms.xml.
50 // This enum is append-only. 47 // This enum is append-only.
51 enum UMAError { 48 enum UMAError {
(...skipping 12 matching lines...) Expand all
64 void LogError(UMAError error); 61 void LogError(UMAError error);
65 62
66 private: 63 private:
67 std::vector<Endpoint*> endpoints_; 64 std::vector<Endpoint*> endpoints_;
68 DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerPrivileged); 65 DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerPrivileged);
69 }; 66 };
70 67
71 } // namespace IPC 68 } // namespace IPC
72 69
73 #endif // IPC_ATTACHMENT_BROKER_PRIVILEGED_H_ 70 #endif // IPC_ATTACHMENT_BROKER_PRIVILEGED_H_
OLDNEW
« no previous file with comments | « ipc/attachment_broker_mac_unittest.cc ('k') | ipc/attachment_broker_privileged_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698