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 | 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 17 matching lines...) Expand all Loading... |
28 #include "bindings/v8/ScriptWrappable.h" | 28 #include "bindings/v8/ScriptWrappable.h" |
29 #include "wtf/HashMap.h" | 29 #include "wtf/HashMap.h" |
30 #include "wtf/PassRefPtr.h" | 30 #include "wtf/PassRefPtr.h" |
31 #include "wtf/RefCounted.h" | 31 #include "wtf/RefCounted.h" |
32 #include "wtf/Vector.h" | 32 #include "wtf/Vector.h" |
33 #include "wtf/text/StringHash.h" | 33 #include "wtf/text/StringHash.h" |
34 #include "wtf/text/WTFString.h" | 34 #include "wtf/text/WTFString.h" |
35 | 35 |
36 namespace WebCore { | 36 namespace WebCore { |
37 | 37 |
38 class RTCStatsReport : public RefCounted<RTCStatsReport>, public ScriptWrappable
{ | 38 class RTCStatsReport FINAL : public RefCountedWillBeGarbageCollectedFinalized<RT
CStatsReport>, public ScriptWrappable { |
39 public: | 39 public: |
40 static PassRefPtr<RTCStatsReport> create(const String& id, const String& typ
e, double timestamp); | 40 static PassRefPtrWillBeRawPtr<RTCStatsReport> create(const String& id, const
String& type, double timestamp); |
41 | 41 |
42 double timestamp() const { return m_timestamp; } | 42 double timestamp() const { return m_timestamp; } |
43 String id() { return m_id; } | 43 String id() { return m_id; } |
44 String type() { return m_type; } | 44 String type() { return m_type; } |
45 String stat(const String& name) { return m_stats.get(name); } | 45 String stat(const String& name) { return m_stats.get(name); } |
46 Vector<String> names() const; | 46 Vector<String> names() const; |
47 | 47 |
48 // DEPRECATED | 48 // DEPRECATED |
49 const PassRefPtr<RTCStatsReport> local(); | 49 const PassRefPtrWillBeRawPtr<RTCStatsReport> local(); |
50 // DEPRECATED | 50 // DEPRECATED |
51 const PassRefPtr<RTCStatsReport> remote(); | 51 const PassRefPtrWillBeRawPtr<RTCStatsReport> remote(); |
52 | 52 |
53 void addStatistic(const String& name, const String& value); | 53 void addStatistic(const String& name, const String& value); |
54 | 54 |
| 55 void trace(Visitor*) { } |
| 56 |
55 private: | 57 private: |
56 RTCStatsReport(const String& id, const String& type, double timestamp); | 58 RTCStatsReport(const String& id, const String& type, double timestamp); |
57 | 59 |
58 String m_id; | 60 String m_id; |
59 String m_type; | 61 String m_type; |
60 double m_timestamp; | 62 double m_timestamp; |
61 HashMap<String, String> m_stats; | 63 HashMap<String, String> m_stats; |
62 }; | 64 }; |
63 | 65 |
64 } // namespace WebCore | 66 } // namespace WebCore |
65 | 67 |
66 #endif // RTCStatsReport_h | 68 #endif // RTCStatsReport_h |
OLD | NEW |