OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "config.h" | 31 #include "config.h" |
32 | 32 |
33 #include "public/platform/WebRTCSessionDescriptionRequest.h" | 33 #include "public/platform/WebRTCSessionDescriptionRequest.h" |
34 | 34 |
35 #include "platform/mediastream/RTCSessionDescriptionRequest.h" | 35 #include "platform/mediastream/RTCSessionDescriptionRequest.h" |
36 #include "public/platform/WebRTCSessionDescription.h" | 36 #include "public/platform/WebRTCSessionDescription.h" |
37 #include "wtf/PassOwnPtr.h" | 37 #include "wtf/PassOwnPtr.h" |
38 | 38 |
39 namespace blink { | 39 namespace blink { |
40 | 40 |
41 namespace { | |
42 | |
43 class ExtraDataContainer : public RTCSessionDescriptionRequest::ExtraData { | |
44 public: | |
45 ExtraDataContainer(PassOwnPtr<WebRTCSessionDescriptionRequest::ExtraData> ex
traData) : m_extraData(extraData) { } | |
46 | |
47 WebRTCSessionDescriptionRequest::ExtraData* extraData() { return m_extraData
.get(); } | |
48 | |
49 private: | |
50 OwnPtr<WebRTCSessionDescriptionRequest::ExtraData> m_extraData; | |
51 }; | |
52 | |
53 } // namespace | |
54 | |
55 WebRTCSessionDescriptionRequest::WebRTCSessionDescriptionRequest(RTCSessionDescr
iptionRequest* constraints) | 41 WebRTCSessionDescriptionRequest::WebRTCSessionDescriptionRequest(RTCSessionDescr
iptionRequest* constraints) |
56 : m_private(constraints) | 42 : m_private(constraints) |
57 { | 43 { |
58 } | 44 } |
59 | 45 |
60 void WebRTCSessionDescriptionRequest::assign(const WebRTCSessionDescriptionReque
st& other) | 46 void WebRTCSessionDescriptionRequest::assign(const WebRTCSessionDescriptionReque
st& other) |
61 { | 47 { |
62 m_private = other.m_private; | 48 m_private = other.m_private; |
63 } | 49 } |
64 | 50 |
65 void WebRTCSessionDescriptionRequest::reset() | 51 void WebRTCSessionDescriptionRequest::reset() |
66 { | 52 { |
67 m_private.reset(); | 53 m_private.reset(); |
68 } | 54 } |
69 | 55 |
70 void WebRTCSessionDescriptionRequest::requestSucceeded(const WebRTCSessionDescri
ption& sessionDescription) const | 56 void WebRTCSessionDescriptionRequest::requestSucceeded(const WebRTCSessionDescri
ption& sessionDescription) const |
71 { | 57 { |
72 ASSERT(m_private.get()); | 58 ASSERT(m_private.get()); |
73 m_private->requestSucceeded(sessionDescription); | 59 m_private->requestSucceeded(sessionDescription); |
74 } | 60 } |
75 | 61 |
76 void WebRTCSessionDescriptionRequest::requestFailed(const WebString& error) cons
t | 62 void WebRTCSessionDescriptionRequest::requestFailed(const WebString& error) cons
t |
77 { | 63 { |
78 ASSERT(m_private.get()); | 64 ASSERT(m_private.get()); |
79 m_private->requestFailed(error); | 65 m_private->requestFailed(error); |
80 } | 66 } |
81 | 67 |
82 WebRTCSessionDescriptionRequest::ExtraData* WebRTCSessionDescriptionRequest::ext
raData() const | |
83 { | |
84 RTCSessionDescriptionRequest::ExtraData* data = m_private->extraData(); | |
85 if (!data) | |
86 return 0; | |
87 return static_cast<ExtraDataContainer*>(data)->extraData(); | |
88 } | |
89 | |
90 void WebRTCSessionDescriptionRequest::setExtraData(ExtraData* extraData) | |
91 { | |
92 m_private->setExtraData(adoptPtr(new ExtraDataContainer(adoptPtr(extraData))
)); | |
93 } | |
94 | |
95 } // namespace blink | 68 } // namespace blink |
96 | |
OLD | NEW |