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

Unified Diff: media/base/media_log.cc

Issue 1906423005: Replace scoped_ptr with std::unique_ptr in //media/base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-media-base: android Created 4 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/media_log.h ('k') | media/base/media_log_event.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/media_log.cc
diff --git a/media/base/media_log.cc b/media/base/media_log.cc
index 128e5138ff51401d80cc45dd8e2f15fa34a9f1b0..ee3c99cce23ea96cd1fd7814db676f6b296788b7 100644
--- a/media/base/media_log.cc
+++ b/media/base/media_log.cc
@@ -148,43 +148,43 @@ MediaLog::MediaLog() : id_(g_media_log_count.GetNext()) {}
MediaLog::~MediaLog() {}
-void MediaLog::AddEvent(scoped_ptr<MediaLogEvent> event) {}
+void MediaLog::AddEvent(std::unique_ptr<MediaLogEvent> event) {}
std::string MediaLog::GetLastErrorMessage() {
return "";
}
-scoped_ptr<MediaLogEvent> MediaLog::CreateEvent(MediaLogEvent::Type type) {
- scoped_ptr<MediaLogEvent> event(new MediaLogEvent);
+std::unique_ptr<MediaLogEvent> MediaLog::CreateEvent(MediaLogEvent::Type type) {
+ std::unique_ptr<MediaLogEvent> event(new MediaLogEvent);
event->id = id_;
event->type = type;
event->time = base::TimeTicks::Now();
return event;
}
-scoped_ptr<MediaLogEvent> MediaLog::CreateBooleanEvent(
+std::unique_ptr<MediaLogEvent> MediaLog::CreateBooleanEvent(
MediaLogEvent::Type type,
const std::string& property,
bool value) {
- scoped_ptr<MediaLogEvent> event(CreateEvent(type));
+ std::unique_ptr<MediaLogEvent> event(CreateEvent(type));
event->params.SetBoolean(property, value);
return event;
}
-scoped_ptr<MediaLogEvent> MediaLog::CreateStringEvent(
+std::unique_ptr<MediaLogEvent> MediaLog::CreateStringEvent(
MediaLogEvent::Type type,
const std::string& property,
const std::string& value) {
- scoped_ptr<MediaLogEvent> event(CreateEvent(type));
+ std::unique_ptr<MediaLogEvent> event(CreateEvent(type));
event->params.SetString(property, value);
return event;
}
-scoped_ptr<MediaLogEvent> MediaLog::CreateTimeEvent(
+std::unique_ptr<MediaLogEvent> MediaLog::CreateTimeEvent(
MediaLogEvent::Type type,
const std::string& property,
base::TimeDelta value) {
- scoped_ptr<MediaLogEvent> event(CreateEvent(type));
+ std::unique_ptr<MediaLogEvent> event(CreateEvent(type));
if (value.is_max())
event->params.SetString(property, "unknown");
else
@@ -192,47 +192,51 @@ scoped_ptr<MediaLogEvent> MediaLog::CreateTimeEvent(
return event;
}
-scoped_ptr<MediaLogEvent> MediaLog::CreateLoadEvent(const std::string& url) {
- scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::LOAD));
+std::unique_ptr<MediaLogEvent> MediaLog::CreateLoadEvent(
+ const std::string& url) {
+ std::unique_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::LOAD));
event->params.SetString("url", url);
return event;
}
-scoped_ptr<MediaLogEvent> MediaLog::CreateSeekEvent(float seconds) {
- scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::SEEK));
+std::unique_ptr<MediaLogEvent> MediaLog::CreateSeekEvent(float seconds) {
+ std::unique_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::SEEK));
event->params.SetDouble("seek_target", seconds);
return event;
}
-scoped_ptr<MediaLogEvent> MediaLog::CreatePipelineStateChangedEvent(
+std::unique_ptr<MediaLogEvent> MediaLog::CreatePipelineStateChangedEvent(
PipelineImpl::State state) {
- scoped_ptr<MediaLogEvent> event(
+ std::unique_ptr<MediaLogEvent> event(
CreateEvent(MediaLogEvent::PIPELINE_STATE_CHANGED));
event->params.SetString("pipeline_state",
PipelineImpl::GetStateString(state));
return event;
}
-scoped_ptr<MediaLogEvent> MediaLog::CreatePipelineErrorEvent(
+std::unique_ptr<MediaLogEvent> MediaLog::CreatePipelineErrorEvent(
PipelineStatus error) {
- scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::PIPELINE_ERROR));
+ std::unique_ptr<MediaLogEvent> event(
+ CreateEvent(MediaLogEvent::PIPELINE_ERROR));
event->params.SetInteger("pipeline_error", error);
return event;
}
-scoped_ptr<MediaLogEvent> MediaLog::CreateVideoSizeSetEvent(
- size_t width, size_t height) {
- scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::VIDEO_SIZE_SET));
+std::unique_ptr<MediaLogEvent> MediaLog::CreateVideoSizeSetEvent(
+ size_t width,
+ size_t height) {
+ std::unique_ptr<MediaLogEvent> event(
+ CreateEvent(MediaLogEvent::VIDEO_SIZE_SET));
event->params.SetInteger("width", width);
event->params.SetInteger("height", height);
return event;
}
-scoped_ptr<MediaLogEvent> MediaLog::CreateBufferedExtentsChangedEvent(
+std::unique_ptr<MediaLogEvent> MediaLog::CreateBufferedExtentsChangedEvent(
int64_t start,
int64_t current,
int64_t end) {
- scoped_ptr<MediaLogEvent> event(
+ std::unique_ptr<MediaLogEvent> event(
CreateEvent(MediaLogEvent::BUFFERED_EXTENTS_CHANGED));
// These values are headed to JS where there is no int64_t so we use a double
// and accept loss of precision above 2^53 bytes (8 Exabytes).
@@ -243,28 +247,32 @@ scoped_ptr<MediaLogEvent> MediaLog::CreateBufferedExtentsChangedEvent(
}
void MediaLog::AddLogEvent(MediaLogLevel level, const std::string& message) {
- scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogLevelToEventType(level)));
+ std::unique_ptr<MediaLogEvent> event(
+ CreateEvent(MediaLogLevelToEventType(level)));
event->params.SetString(MediaLogLevelToString(level), message);
AddEvent(std::move(event));
}
void MediaLog::SetStringProperty(
const std::string& key, const std::string& value) {
- scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::PROPERTY_CHANGE));
+ std::unique_ptr<MediaLogEvent> event(
+ CreateEvent(MediaLogEvent::PROPERTY_CHANGE));
event->params.SetString(key, value);
AddEvent(std::move(event));
}
void MediaLog::SetDoubleProperty(
const std::string& key, double value) {
- scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::PROPERTY_CHANGE));
+ std::unique_ptr<MediaLogEvent> event(
+ CreateEvent(MediaLogEvent::PROPERTY_CHANGE));
event->params.SetDouble(key, value);
AddEvent(std::move(event));
}
void MediaLog::SetBooleanProperty(
const std::string& key, bool value) {
- scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::PROPERTY_CHANGE));
+ std::unique_ptr<MediaLogEvent> event(
+ CreateEvent(MediaLogEvent::PROPERTY_CHANGE));
event->params.SetBoolean(key, value);
AddEvent(std::move(event));
}
« no previous file with comments | « media/base/media_log.h ('k') | media/base/media_log_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698