summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchangbin.shao@intel.com <changbin.shao@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-16 07:51:11 +0000
committerchangbin.shao@intel.com <changbin.shao@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-16 07:51:11 +0000
commit101616465fcc51d44a389621d1daced40c4ae6d2 (patch)
tree9e747ae89266e1623ce3ec0e485cbce7c6d6ed45
parentc96a456d97a28f7914f89a1caa5384d3bd7fa21f (diff)
downloadchromium_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--AUTHORS1
-rw-r--r--media/base/media_log.cc6
-rw-r--r--media/base/media_log.h4
-rw-r--r--media/base/pipeline.cc6
4 files changed, 10 insertions, 7 deletions
diff --git a/AUTHORS b/AUTHORS
index 423ea26..5bfa385 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -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;