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

Side by Side Diff: ipc/attachment_broker_privileged.h

Issue 1281103002: Add UMA metrics to log attachment broker errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from isherman. Created 5 years, 3 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 | « no previous file | ipc/attachment_broker_privileged.cc » ('j') | ipc/attachment_broker_privileged.cc » ('J')
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 "ipc/attachment_broker.h" 10 #include "ipc/attachment_broker.h"
(...skipping 18 matching lines...) Expand all
29 // process, these channels must be registered and deregistered with the 29 // process, these channels must be registered and deregistered with the
30 // Attachment Broker as they are created and destroyed. 30 // Attachment Broker as they are created and destroyed.
31 void RegisterCommunicationChannel(Endpoint* endpoint); 31 void RegisterCommunicationChannel(Endpoint* endpoint);
32 void DeregisterCommunicationChannel(Endpoint* endpoint); 32 void DeregisterCommunicationChannel(Endpoint* endpoint);
33 33
34 protected: 34 protected:
35 // Returns the sender whose peer's process id is |id|. 35 // Returns the sender whose peer's process id is |id|.
36 // Returns nullptr if no sender is found. 36 // Returns nullptr if no sender is found.
37 Sender* GetSenderWithProcessId(base::ProcessId id); 37 Sender* GetSenderWithProcessId(base::ProcessId id);
38 38
39 // Errors that can be reported by subclasses.
40 // These match tools/metrics/histograms.xml.
41 // This enum is append-only.
42 enum UMAError {
43 // The brokerable attachment did not have a destination process.
44 NO_DESTINATION = 0,
45 // The brokerable attachment had a destination, but the broker did not have
46 // a channel of communication with that process.
47 DESTINATION_NOT_FOUND = 1,
48 // The brokerable attachment had a valid destination. This is the success
49 // case.
50 DESTINATION_FOUND = 2,
51 ERROR_MAX
52 };
53
54 // Emits an UMA metric.
55 void LogError(UMAError error);
56
39 private: 57 private:
40 std::vector<Endpoint*> endpoints_; 58 std::vector<Endpoint*> endpoints_;
41 DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerPrivileged); 59 DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerPrivileged);
42 }; 60 };
43 61
44 } // namespace IPC 62 } // namespace IPC
45 63
46 #endif // IPC_ATTACHMENT_BROKER_PRIVILEGED_H_ 64 #endif // IPC_ATTACHMENT_BROKER_PRIVILEGED_H_
OLDNEW
« no previous file with comments | « no previous file | ipc/attachment_broker_privileged.cc » ('j') | ipc/attachment_broker_privileged.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698