OLD | NEW |
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 |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "config.h" | 26 #include "config.h" |
27 #include "public/platform/WebMediaStreamTrackSourcesRequest.h" | 27 #include "public/platform/WebMediaStreamTrackSourcesRequest.h" |
28 | 28 |
29 #include "platform/mediastream/MediaStreamTrackSourcesRequest.h" | 29 #include "platform/mediastream/MediaStreamTrackSourcesRequest.h" |
30 #include "public/platform/WebSourceInfo.h" | 30 #include "public/platform/WebSourceInfo.h" |
31 #include "wtf/PassOwnPtr.h" | 31 #include "wtf/PassOwnPtr.h" |
32 #include "wtf/text/WTFString.h" | 32 #include "wtf/text/WTFString.h" |
33 | 33 |
34 namespace blink { | 34 namespace blink { |
35 | 35 |
36 namespace { | |
37 | |
38 class ExtraDataContainer : public MediaStreamTrackSourcesRequest::ExtraData { | |
39 public: | |
40 ExtraDataContainer(PassOwnPtr<WebMediaStreamTrackSourcesRequest::ExtraData>
extraData) : m_extraData(extraData) { } | |
41 | |
42 WebMediaStreamTrackSourcesRequest::ExtraData* extraData() { return m_extraDa
ta.get(); } | |
43 | |
44 private: | |
45 OwnPtr<WebMediaStreamTrackSourcesRequest::ExtraData> m_extraData; | |
46 }; | |
47 | |
48 } // namespace | |
49 | |
50 WebMediaStreamTrackSourcesRequest::WebMediaStreamTrackSourcesRequest(MediaStream
TrackSourcesRequest* request) | 36 WebMediaStreamTrackSourcesRequest::WebMediaStreamTrackSourcesRequest(MediaStream
TrackSourcesRequest* request) |
51 : m_private(request) | 37 : m_private(request) |
52 { | 38 { |
53 } | 39 } |
54 | 40 |
55 void WebMediaStreamTrackSourcesRequest::assign(const WebMediaStreamTrackSourcesR
equest& other) | 41 void WebMediaStreamTrackSourcesRequest::assign(const WebMediaStreamTrackSourcesR
equest& other) |
56 { | 42 { |
57 m_private = other.m_private; | 43 m_private = other.m_private; |
58 } | 44 } |
59 | 45 |
60 void WebMediaStreamTrackSourcesRequest::reset() | 46 void WebMediaStreamTrackSourcesRequest::reset() |
61 { | 47 { |
62 m_private.reset(); | 48 m_private.reset(); |
63 } | 49 } |
64 | 50 |
65 WebString WebMediaStreamTrackSourcesRequest::origin() const | 51 WebString WebMediaStreamTrackSourcesRequest::origin() const |
66 { | 52 { |
67 ASSERT(m_private.get()); | 53 ASSERT(m_private.get()); |
68 return m_private->origin(); | 54 return m_private->origin(); |
69 } | 55 } |
70 | 56 |
71 void WebMediaStreamTrackSourcesRequest::requestSucceeded(const WebVector<WebSour
ceInfo>& sourceInfos) const | 57 void WebMediaStreamTrackSourcesRequest::requestSucceeded(const WebVector<WebSour
ceInfo>& sourceInfos) const |
72 { | 58 { |
73 ASSERT(m_private.get()); | 59 ASSERT(m_private.get()); |
74 m_private->requestSucceeded(sourceInfos); | 60 m_private->requestSucceeded(sourceInfos); |
75 } | 61 } |
76 | 62 |
77 WebMediaStreamTrackSourcesRequest::ExtraData* WebMediaStreamTrackSourcesRequest:
:extraData() const | |
78 { | |
79 MediaStreamTrackSourcesRequest::ExtraData* data = m_private->extraData(); | |
80 if (!data) | |
81 return 0; | |
82 return static_cast<ExtraDataContainer*>(data)->extraData(); | |
83 } | |
84 | |
85 void WebMediaStreamTrackSourcesRequest::setExtraData(ExtraData* extraData) | |
86 { | |
87 m_private->setExtraData(adoptPtr(new ExtraDataContainer(adoptPtr(extraData))
)); | |
88 } | |
89 | |
90 } // namespace blink | 63 } // namespace blink |
91 | |
OLD | NEW |