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

Side by Side Diff: content/browser/renderer_host/media/media_stream_requester.h

Issue 180633008: Add different error codes for getUserMedia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed comments Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
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_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_REQUESTER_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_REQUESTER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_REQUESTER_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_REQUESTER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 #include "content/common/media/media_stream_options.h" 11 #include "content/common/media/media_stream_options.h"
12 12
13 namespace content { 13 namespace content {
14 14
15 // MediaStreamRequester must be implemented by the class requesting a new media 15 // MediaStreamRequester must be implemented by the class requesting a new media
16 // stream to be opened. MediaStreamManager will use this interface to signal 16 // stream to be opened. MediaStreamManager will use this interface to signal
17 // success and error for a request. 17 // success and error for a request.
18 class CONTENT_EXPORT MediaStreamRequester { 18 class CONTENT_EXPORT MediaStreamRequester {
19 public: 19 public:
20 // Called as a reply of a successful call to GenerateStream. 20 // Called as a reply of a successful call to GenerateStream.
21 virtual void StreamGenerated(int render_view_id, 21 virtual void StreamGenerated(int render_view_id,
22 int page_request_id, 22 int page_request_id,
23 const std::string& label, 23 const std::string& label,
24 const StreamDeviceInfoArray& audio_devices, 24 const StreamDeviceInfoArray& audio_devices,
25 const StreamDeviceInfoArray& video_devices) = 0; 25 const StreamDeviceInfoArray& video_devices) = 0;
26 // Called if GenerateStream failed. 26 // Called if GenerateStream failed.
27 virtual void StreamGenerationFailed(int render_view_id, 27 virtual void StreamGenerationFailed(
28 int page_request_id) = 0; 28 int render_view_id,
29 int page_request_id,
30 content::MediaStreamRequestResult result) = 0;
29 // Called if a device has been stopped by a user from UI or the device 31 // Called if a device has been stopped by a user from UI or the device
30 // has become unavailable. |render_view_id| is the render view that requested 32 // has become unavailable. |render_view_id| is the render view that requested
31 // the device and |label| is the label of the request|. 33 // the device and |label| is the label of the request|.
32 virtual void DeviceStopped(int render_view_id, 34 virtual void DeviceStopped(int render_view_id,
33 const std::string& label, 35 const std::string& label,
34 const StreamDeviceInfo& device) = 0; 36 const StreamDeviceInfo& device) = 0;
35 // Called as a reply of a successful call to EnumerateDevices. 37 // Called as a reply of a successful call to EnumerateDevices.
36 virtual void DevicesEnumerated(int render_view_id, 38 virtual void DevicesEnumerated(int render_view_id,
37 int page_request_id, 39 int page_request_id,
38 const std::string& label, 40 const std::string& label,
39 const StreamDeviceInfoArray& devices) = 0; 41 const StreamDeviceInfoArray& devices) = 0;
40 // Called as a reply of a successful call to OpenDevice. 42 // Called as a reply of a successful call to OpenDevice.
41 virtual void DeviceOpened(int render_view_id, 43 virtual void DeviceOpened(int render_view_id,
42 int page_request_id, 44 int page_request_id,
43 const std::string& label, 45 const std::string& label,
44 const StreamDeviceInfo& device_info) = 0; 46 const StreamDeviceInfo& device_info) = 0;
45 47
46 protected: 48 protected:
47 virtual ~MediaStreamRequester() { 49 virtual ~MediaStreamRequester() {
48 } 50 }
49 }; 51 };
50 52
51 } // namespace content 53 } // namespace content
52 54
53 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_REQUESTER_H_ 55 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_REQUESTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698