diff options
author | changbin.shao@intel.com <changbin.shao@intel.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-16 07:51:11 +0000 |
---|---|---|
committer | changbin.shao@intel.com <changbin.shao@intel.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-16 07:51:11 +0000 |
commit | 101616465fcc51d44a389621d1daced40c4ae6d2 (patch) | |
tree | 9e747ae89266e1623ce3ec0e485cbce7c6d6ed45 | |
parent | c96a456d97a28f7914f89a1caa5384d3bd7fa21f (diff) | |
download | chromium_src-101616465fcc51d44a389621d1daced40c4ae6d2.zip chromium_src-101616465fcc51d44a389621d1daced40c4ae6d2.tar.gz chromium_src-101616465fcc51d44a389621d1daced40c4ae6d2.tar.bz2 |
use type std::string instead of integer for MediaLogEvent::TOTAL_BYTES_SET
because overflow happens for integer larger than 2^31.
original review url: http://codereview.chromium.org/10828226
BUG=120328
Review URL: https://chromiumcodereview.appspot.com/10832334
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151861 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | media/base/media_log.cc | 6 | ||||
-rw-r--r-- | media/base/media_log.h | 4 | ||||
-rw-r--r-- | media/base/pipeline.cc | 6 |
4 files changed, 10 insertions, 7 deletions
@@ -173,6 +173,7 @@ Mao Yujie <yujie.mao@intel.com> Xu Samuel <samuel.xu@intel.com> Jin Yang <jin.a.yang@intel.com> Xinchao He <hexinchao@gmail.com> +Changbin Shao <changbin.shao@intel.com> Stephen Searles <stephen.searles@gmail.com> Arun Mankuzhi <arun.m@samsung.com> Taylor Price <trprice@gmail.com> diff --git a/media/base/media_log.cc b/media/base/media_log.cc index 509de03..e47286d 100644 --- a/media/base/media_log.cc +++ b/media/base/media_log.cc @@ -152,10 +152,10 @@ scoped_ptr<MediaLogEvent> MediaLog::CreateBooleanEvent( return event.Pass(); } -scoped_ptr<MediaLogEvent> MediaLog::CreateIntegerEvent( - MediaLogEvent::Type type, const char* property, int64 value) { +scoped_ptr<MediaLogEvent> MediaLog::CreateStringEvent( + MediaLogEvent::Type type, const char* property, const std::string& value) { scoped_ptr<MediaLogEvent> event(CreateEvent(type)); - event->params.SetInteger(property, value); + event->params.SetString(property, value); return event.Pass(); } diff --git a/media/base/media_log.h b/media/base/media_log.h index 0e93c6b..e72c08e 100644 --- a/media/base/media_log.h +++ b/media/base/media_log.h @@ -31,8 +31,8 @@ class MEDIA_EXPORT MediaLog : public base::RefCountedThreadSafe<MediaLog> { scoped_ptr<MediaLogEvent> CreateEvent(MediaLogEvent::Type type); scoped_ptr<MediaLogEvent> CreateBooleanEvent( MediaLogEvent::Type type, const char* property, bool value); - scoped_ptr<MediaLogEvent> CreateIntegerEvent( - MediaLogEvent::Type type, const char* property, int64 value); + scoped_ptr<MediaLogEvent> CreateStringEvent( + MediaLogEvent::Type type, const char* property, const std::string& value); scoped_ptr<MediaLogEvent> CreateTimeEvent( MediaLogEvent::Type type, const char* property, base::TimeDelta value); scoped_ptr<MediaLogEvent> CreateLoadEvent(const std::string& url); diff --git a/media/base/pipeline.cc b/media/base/pipeline.cc index 55f8a40..8e92570 100644 --- a/media/base/pipeline.cc +++ b/media/base/pipeline.cc @@ -13,6 +13,7 @@ #include "base/metrics/histogram.h" #include "base/message_loop.h" #include "base/stl_util.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/synchronization/condition_variable.h" #include "media/base/audio_decoder.h" @@ -390,8 +391,9 @@ void Pipeline::SetDuration(TimeDelta duration) { void Pipeline::SetTotalBytes(int64 total_bytes) { DCHECK(IsRunning()); media_log_->AddEvent( - media_log_->CreateIntegerEvent( - MediaLogEvent::TOTAL_BYTES_SET, "total_bytes", total_bytes)); + media_log_->CreateStringEvent( + MediaLogEvent::TOTAL_BYTES_SET, "total_bytes", + base::Int64ToString(total_bytes))); int64 total_mbytes = total_bytes >> 20; if (total_mbytes > kint32max) total_mbytes = kint32max; |