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

Side by Side Diff: third_party/WebKit/Source/modules/peerconnection/RTCSessionDescription.cpp

Issue 2490543002: Measure usage of RTCSessionDescription's type and sdp attributes (Closed)
Patch Set: add missing "be" Created 4 years, 1 month 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
OLDNEW
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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "modules/peerconnection/RTCSessionDescription.h" 31 #include "modules/peerconnection/RTCSessionDescription.h"
32 32
33 #include "bindings/core/v8/ScriptValue.h" 33 #include "bindings/core/v8/ScriptValue.h"
34 #include "bindings/core/v8/V8ObjectBuilder.h" 34 #include "bindings/core/v8/V8ObjectBuilder.h"
35 #include "core/dom/ExecutionContext.h"
36 #include "core/frame/UseCounter.h"
35 #include "modules/peerconnection/RTCSessionDescriptionInit.h" 37 #include "modules/peerconnection/RTCSessionDescriptionInit.h"
36 38
37 namespace blink { 39 namespace blink {
38 40
39 RTCSessionDescription* RTCSessionDescription::create( 41 RTCSessionDescription* RTCSessionDescription::create(
42 ExecutionContext* context,
40 const RTCSessionDescriptionInit& descriptionInitDict) { 43 const RTCSessionDescriptionInit& descriptionInitDict) {
41 String type; 44 String type;
42 if (descriptionInitDict.hasType()) 45 if (descriptionInitDict.hasType())
43 type = descriptionInitDict.type(); 46 type = descriptionInitDict.type();
47 else
48 UseCounter::count(context, UseCounter::RTCSessionDescriptionInitNoType);
44 49
45 String sdp; 50 String sdp;
46 if (descriptionInitDict.hasSdp()) 51 if (descriptionInitDict.hasSdp())
47 sdp = descriptionInitDict.sdp(); 52 sdp = descriptionInitDict.sdp();
53 else
54 UseCounter::count(context, UseCounter::RTCSessionDescriptionInitNoSdp);
48 55
49 return new RTCSessionDescription(WebRTCSessionDescription(type, sdp)); 56 return new RTCSessionDescription(WebRTCSessionDescription(type, sdp));
50 } 57 }
51 58
52 RTCSessionDescription* RTCSessionDescription::create( 59 RTCSessionDescription* RTCSessionDescription::create(
53 WebRTCSessionDescription webSessionDescription) { 60 WebRTCSessionDescription webSessionDescription) {
54 return new RTCSessionDescription(webSessionDescription); 61 return new RTCSessionDescription(webSessionDescription);
55 } 62 }
56 63
57 RTCSessionDescription::RTCSessionDescription( 64 RTCSessionDescription::RTCSessionDescription(
(...skipping 27 matching lines...) Expand all
85 else 92 else
86 result.addString("sdp", sdp()); 93 result.addString("sdp", sdp());
87 return result.scriptValue(); 94 return result.scriptValue();
88 } 95 }
89 96
90 WebRTCSessionDescription RTCSessionDescription::webSessionDescription() { 97 WebRTCSessionDescription RTCSessionDescription::webSessionDescription() {
91 return m_webSessionDescription; 98 return m_webSessionDescription;
92 } 99 }
93 100
94 } // namespace blink 101 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698