| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_DEVICE_MANAGER_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_DEVICE_MANAGER_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_DEVICE_MANAGER_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_DEVICE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 void OnDeviceOpenFailed(int request_id) override; | 74 void OnDeviceOpenFailed(int request_id) override; |
| 75 void OnDevicesChanged() override; | 75 void OnDevicesChanged() override; |
| 76 | 76 |
| 77 // Stream type conversion. | 77 // Stream type conversion. |
| 78 static MediaStreamType FromPepperDeviceType(PP_DeviceType_Dev type); | 78 static MediaStreamType FromPepperDeviceType(PP_DeviceType_Dev type); |
| 79 static PP_DeviceType_Dev FromMediaStreamType(MediaStreamType type); | 79 static PP_DeviceType_Dev FromMediaStreamType(MediaStreamType type); |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 explicit PepperMediaDeviceManager(RenderFrame* render_frame); | 82 explicit PepperMediaDeviceManager(RenderFrame* render_frame); |
| 83 | 83 |
| 84 // RenderFrameObserver implementation. |
| 85 void OnDestruct() override; |
| 86 |
| 84 // Called by StopEnumerateDevices() after returing to the event loop, to avoid | 87 // Called by StopEnumerateDevices() after returing to the event loop, to avoid |
| 85 // a reentrancy problem. | 88 // a reentrancy problem. |
| 86 void StopEnumerateDevicesDelayed(int request_id); | 89 void StopEnumerateDevicesDelayed(int request_id); |
| 87 | 90 |
| 88 void NotifyDeviceOpened(int request_id, | 91 void NotifyDeviceOpened(int request_id, |
| 89 bool succeeded, | 92 bool succeeded, |
| 90 const std::string& label); | 93 const std::string& label); |
| 91 | 94 |
| 92 | 95 |
| 93 MediaStreamDispatcher* GetMediaStreamDispatcher() const; | 96 MediaStreamDispatcher* GetMediaStreamDispatcher() const; |
| 94 | 97 |
| 95 int next_id_; | 98 int next_id_; |
| 96 | 99 |
| 97 typedef std::map<int, EnumerateDevicesCallback> EnumerateCallbackMap; | 100 typedef std::map<int, EnumerateDevicesCallback> EnumerateCallbackMap; |
| 98 EnumerateCallbackMap enumerate_callbacks_; | 101 EnumerateCallbackMap enumerate_callbacks_; |
| 99 | 102 |
| 100 typedef std::map<int, OpenDeviceCallback> OpenCallbackMap; | 103 typedef std::map<int, OpenDeviceCallback> OpenCallbackMap; |
| 101 OpenCallbackMap open_callbacks_; | 104 OpenCallbackMap open_callbacks_; |
| 102 | 105 |
| 103 DISALLOW_COPY_AND_ASSIGN(PepperMediaDeviceManager); | 106 DISALLOW_COPY_AND_ASSIGN(PepperMediaDeviceManager); |
| 104 }; | 107 }; |
| 105 | 108 |
| 106 } // namespace content | 109 } // namespace content |
| 107 | 110 |
| 108 #endif // CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_DEVICE_MANAGER_H_ | 111 #endif // CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_DEVICE_MANAGER_H_ |
| OLD | NEW |