| OLD | NEW | 
|    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 29 matching lines...) Expand all  Loading... | 
|   40   static void CreateBrokerIfNeeded(); |   40   static void CreateBrokerIfNeeded(); | 
|   41 #endif  // defined(OS_MACOSX) && !defined(OS_IOS) |   41 #endif  // defined(OS_MACOSX) && !defined(OS_IOS) | 
|   42  |   42  | 
|   43   // AttachmentBroker overrides. |   43   // AttachmentBroker overrides. | 
|   44   void RegisterCommunicationChannel(Endpoint* endpoint) override; |   44   void RegisterCommunicationChannel(Endpoint* endpoint) override; | 
|   45   void DeregisterCommunicationChannel(Endpoint* endpoint) override; |   45   void DeregisterCommunicationChannel(Endpoint* endpoint) override; | 
|   46  |   46  | 
|   47  protected: |   47  protected: | 
|   48   // Returns the sender whose peer's process id is |id|. |   48   // Returns the sender whose peer's process id is |id|. | 
|   49   // Returns nullptr if no sender is found. |   49   // Returns nullptr if no sender is found. | 
 |   50   // The lock returned by get_lock() must already be acquired before calling | 
 |   51   // this method. The return value is only guaranteed to be valid while the lock | 
 |   52   // is held. | 
|   50   Sender* GetSenderWithProcessId(base::ProcessId id); |   53   Sender* GetSenderWithProcessId(base::ProcessId id); | 
|   51  |   54  | 
|   52   // Errors that can be reported by subclasses. |   55   // Errors that can be reported by subclasses. | 
|   53   // These match tools/metrics/histograms.xml. |   56   // These match tools/metrics/histograms.xml. | 
|   54   // This enum is append-only. |   57   // This enum is append-only. | 
|   55   enum UMAError { |   58   enum UMAError { | 
|   56     // The brokerable attachment had a valid destination. This is the success |   59     // The brokerable attachment had a valid destination. This is the success | 
|   57     // case. |   60     // case. | 
|   58     DESTINATION_FOUND = 0, |   61     DESTINATION_FOUND = 0, | 
|   59     // The brokerable attachment had a destination, but the broker did not have |   62     // The brokerable attachment had a destination, but the broker did not have | 
| (...skipping 29 matching lines...) Expand all  Loading... | 
|   89   void LogError(UMAError error); |   92   void LogError(UMAError error); | 
|   90  |   93  | 
|   91  private: |   94  private: | 
|   92   std::vector<Endpoint*> endpoints_; |   95   std::vector<Endpoint*> endpoints_; | 
|   93   DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerPrivileged); |   96   DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerPrivileged); | 
|   94 }; |   97 }; | 
|   95  |   98  | 
|   96 }  // namespace IPC |   99 }  // namespace IPC | 
|   97  |  100  | 
|   98 #endif  // IPC_ATTACHMENT_BROKER_PRIVILEGED_H_ |  101 #endif  // IPC_ATTACHMENT_BROKER_PRIVILEGED_H_ | 
| OLD | NEW |