| 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 // MediaStreamManager is used to open/enumerate media capture devices (video | 5 // MediaStreamManager is used to open/enumerate media capture devices (video |
| 6 // supported now). Call flow: | 6 // supported now). Call flow: |
| 7 // 1. GenerateStream is called when a render process wants to use a capture | 7 // 1. GenerateStream is called when a render process wants to use a capture |
| 8 // device. | 8 // device. |
| 9 // 2. MediaStreamManager will ask MediaStreamUIController for permission to | 9 // 2. MediaStreamManager will ask MediaStreamUIController for permission to |
| 10 // use devices and for which device to use. | 10 // use devices and for which device to use. |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 // This object gets deleted on the UI thread after the IO thread has been | 178 // This object gets deleted on the UI thread after the IO thread has been |
| 179 // destroyed. So we need to know when IO thread is being destroyed so that | 179 // destroyed. So we need to know when IO thread is being destroyed so that |
| 180 // we can delete VideoCaptureManager and AudioInputDeviceManager. Normally | 180 // we can delete VideoCaptureManager and AudioInputDeviceManager. Normally |
| 181 // this is handled by | 181 // this is handled by |
| 182 // base::MessageLoop::DestructionObserver::WillDestroyCurrentMessageLoop. | 182 // base::MessageLoop::DestructionObserver::WillDestroyCurrentMessageLoop. |
| 183 // But for some tests which use TestBrowserThreadBundle, we need to call | 183 // But for some tests which use TestBrowserThreadBundle, we need to call |
| 184 // WillDestroyCurrentMessageLoop explicitly because the notification happens | 184 // WillDestroyCurrentMessageLoop explicitly because the notification happens |
| 185 // too late. (see http://crbug.com/247525#c14). | 185 // too late. (see http://crbug.com/247525#c14). |
| 186 virtual void WillDestroyCurrentMessageLoop() OVERRIDE; | 186 virtual void WillDestroyCurrentMessageLoop() OVERRIDE; |
| 187 | 187 |
| 188 // Sends log messages to the render processes making device requests, to be |
| 189 // used by the webrtcLoggingPrivate API if requested. |
| 190 void AddLogMessageOnUIThread(const std::string& message); |
| 191 |
| 192 // Adds |message| to native logs for outstanding device requests, for use by |
| 193 // render processes requesting logging from webrtcLoggingPrivate API. Safe to |
| 194 // call from any thread. |
| 195 static void SendMessageToNativeLog(const std::string& message); |
| 196 |
| 188 protected: | 197 protected: |
| 189 // Used for testing. | 198 // Used for testing. |
| 190 MediaStreamManager(); | 199 MediaStreamManager(); |
| 191 | 200 |
| 192 private: | 201 private: |
| 193 // Contains all data needed to keep track of requests. | 202 // Contains all data needed to keep track of requests. |
| 194 class DeviceRequest; | 203 class DeviceRequest; |
| 195 | 204 |
| 196 // Cache enumerated device list. | 205 // Cache enumerated device list. |
| 197 struct EnumerationCache { | 206 struct EnumerationCache { |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 | 357 |
| 349 bool use_fake_ui_; | 358 bool use_fake_ui_; |
| 350 scoped_ptr<FakeMediaStreamUIProxy> fake_ui_; | 359 scoped_ptr<FakeMediaStreamUIProxy> fake_ui_; |
| 351 | 360 |
| 352 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); | 361 DISALLOW_COPY_AND_ASSIGN(MediaStreamManager); |
| 353 }; | 362 }; |
| 354 | 363 |
| 355 } // namespace content | 364 } // namespace content |
| 356 | 365 |
| 357 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ | 366 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_ |
| OLD | NEW |