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

Side by Side Diff: public/platform/WebMediaStreamTrackSourcesRequest.h

Issue 16778002: MediaStream API: Changing the device enumeration to be async (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review comment fixed Created 7 years, 6 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
« no previous file with comments | « public/platform/WebMediaStreamCenter.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution. 11 * documentation and/or other materials provided with the distribution.
12 * 12 *
13 * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY 13 * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC. OR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef WebSourceInfo_h 26 #ifndef WebMediaStreamTrackSourcesRequest_h
27 #define WebSourceInfo_h 27 #define WebMediaStreamTrackSourcesRequest_h
28 28
29 #include "WebCommon.h" 29 #include "WebCommon.h"
30 #include "WebNonCopyable.h" 30 #include "WebNonCopyable.h"
31 #include "WebPrivatePtr.h" 31 #include "WebPrivatePtr.h"
32 #include "WebString.h" 32 #include "WebString.h"
33 #include "WebVector.h"
34
35 namespace WebCore {
36 class MediaStreamTrackSourcesRequest;
37 }
33 38
34 namespace WebKit { 39 namespace WebKit {
40 class WebSourceInfo;
35 41
36 class WebSourceInfoPrivate; 42 class WebMediaStreamTrackSourcesRequest {
37
38 class WebSourceInfo {
39 public: 43 public:
40 enum SourceKind { 44 class ExtraData {
41 SourceKindNone, 45 public:
42 SourceKindAudio, 46 virtual ~ExtraData() { }
43 SourceKindVideo
44 }; 47 };
45 48
46 enum VideoFacingMode { 49 WebMediaStreamTrackSourcesRequest() { }
47 VideoFacingModeNone, 50 WebMediaStreamTrackSourcesRequest(const WebMediaStreamTrackSourcesRequest& o ther) { assign(other); }
48 VideoFacingModeUser, 51 ~WebMediaStreamTrackSourcesRequest() { reset(); }
49 VideoFacingModeEnvironment
50 };
51 52
52 WebSourceInfo() { } 53 WebMediaStreamTrackSourcesRequest& operator=(const WebMediaStreamTrackSource sRequest& other)
53 WebSourceInfo(const WebSourceInfo& other) { assign(other); }
54 ~WebSourceInfo() { reset(); }
55
56 WebSourceInfo& operator=(const WebSourceInfo& other)
57 { 54 {
58 assign(other); 55 assign(other);
59 return *this; 56 return *this;
60 } 57 }
61 58
62 WEBKIT_EXPORT void assign(const WebSourceInfo&); 59 WEBKIT_EXPORT void assign(const WebMediaStreamTrackSourcesRequest&);
63 60
64 WEBKIT_EXPORT void initialize(const WebString& id, SourceKind, const WebStri ng& label, VideoFacingMode);
65 WEBKIT_EXPORT void reset(); 61 WEBKIT_EXPORT void reset();
66 bool isNull() const { return m_private.isNull(); } 62 bool isNull() const { return m_private.isNull(); }
67 63
68 WEBKIT_EXPORT WebString id() const; 64 WEBKIT_EXPORT WebString origin() const;
69 WEBKIT_EXPORT SourceKind kind() const; 65 WEBKIT_EXPORT void requestSucceeded(const WebVector<WebSourceInfo>&) const;
70 WEBKIT_EXPORT WebString label() const; 66
71 WEBKIT_EXPORT VideoFacingMode facing() const; 67 // Extra data associated with this object.
68 // If non-null, the extra data pointer will be deleted when the object is de stroyed.
69 // Setting the extra data pointer will cause any existing non-null
70 // extra data pointer to be deleted.
71 WEBKIT_EXPORT ExtraData* extraData() const;
72 WEBKIT_EXPORT void setExtraData(ExtraData*);
73
74 #if WEBKIT_IMPLEMENTATION
75 WebMediaStreamTrackSourcesRequest(const WTF::PassRefPtr<WebCore::MediaStream TrackSourcesRequest>&);
76 #endif
72 77
73 private: 78 private:
74 WebPrivatePtr<WebSourceInfoPrivate> m_private; 79 WebPrivatePtr<WebCore::MediaStreamTrackSourcesRequest> m_private;
75 }; 80 };
76 81
77 } // namespace WebKit 82 } // namespace WebKit
78 83
79 #endif // WebSourceInfo_h 84 #endif // WebMediaStreamTrackSourcesRequest_h
OLDNEW
« no previous file with comments | « public/platform/WebMediaStreamCenter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698