OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 int int_; | 314 int int_; |
315 int64 int64_; | 315 int64 int64_; |
316 float float_; | 316 float float_; |
317 bool bool_; | 317 bool bool_; |
318 std::string* string_; | 318 std::string* string_; |
319 const char* static_string_; | 319 const char* static_string_; |
320 Id* id_; | 320 Id* id_; |
321 } value_; | 321 } value_; |
322 | 322 |
323 private: | 323 private: |
324 DISALLOW_COPY_AND_ASSIGN(Value); | 324 RTC_DISALLOW_COPY_AND_ASSIGN(Value); |
325 }; | 325 }; |
326 | 326 |
327 // TODO(tommi): Consider using a similar approach to how we store Ids using | 327 // TODO(tommi): Consider using a similar approach to how we store Ids using |
328 // scoped_refptr for values. | 328 // scoped_refptr for values. |
329 typedef rtc::linked_ptr<Value> ValuePtr; | 329 typedef rtc::linked_ptr<Value> ValuePtr; |
330 typedef std::map<StatsValueName, ValuePtr> Values; | 330 typedef std::map<StatsValueName, ValuePtr> Values; |
331 | 331 |
332 // Ownership of |id| is passed to |this|. | 332 // Ownership of |id| is passed to |this|. |
333 explicit StatsReport(const Id& id); | 333 explicit StatsReport(const Id& id); |
334 | 334 |
(...skipping 29 matching lines...) Expand all Loading... |
364 const Value* FindValue(StatsValueName name) const; | 364 const Value* FindValue(StatsValueName name) const; |
365 | 365 |
366 private: | 366 private: |
367 // The unique identifier for this object. | 367 // The unique identifier for this object. |
368 // This is used as a key for this report in ordered containers, | 368 // This is used as a key for this report in ordered containers, |
369 // so it must never be changed. | 369 // so it must never be changed. |
370 const Id id_; | 370 const Id id_; |
371 double timestamp_; // Time since 1970-01-01T00:00:00Z in milliseconds. | 371 double timestamp_; // Time since 1970-01-01T00:00:00Z in milliseconds. |
372 Values values_; | 372 Values values_; |
373 | 373 |
374 DISALLOW_COPY_AND_ASSIGN(StatsReport); | 374 RTC_DISALLOW_COPY_AND_ASSIGN(StatsReport); |
375 }; | 375 }; |
376 | 376 |
377 // Typedef for an array of const StatsReport pointers. | 377 // Typedef for an array of const StatsReport pointers. |
378 // Ownership of the pointers held by this implementation is assumed to lie | 378 // Ownership of the pointers held by this implementation is assumed to lie |
379 // elsewhere and lifetime guarantees are made by the implementation that uses | 379 // elsewhere and lifetime guarantees are made by the implementation that uses |
380 // this type. In the StatsCollector, object ownership lies with the | 380 // this type. In the StatsCollector, object ownership lies with the |
381 // StatsCollection class. | 381 // StatsCollection class. |
382 typedef std::vector<const StatsReport*> StatsReports; | 382 typedef std::vector<const StatsReport*> StatsReports; |
383 | 383 |
384 // A map from the report id to the report. | 384 // A map from the report id to the report. |
(...skipping 23 matching lines...) Expand all Loading... |
408 StatsReport* Find(const StatsReport::Id& id); | 408 StatsReport* Find(const StatsReport::Id& id); |
409 | 409 |
410 private: | 410 private: |
411 Container list_; | 411 Container list_; |
412 rtc::ThreadChecker thread_checker_; | 412 rtc::ThreadChecker thread_checker_; |
413 }; | 413 }; |
414 | 414 |
415 } // namespace webrtc | 415 } // namespace webrtc |
416 | 416 |
417 #endif // TALK_APP_WEBRTC_STATSTYPES_H_ | 417 #endif // TALK_APP_WEBRTC_STATSTYPES_H_ |
OLD | NEW |