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

Side by Side Diff: media/base/media_log.cc

Issue 2815303006: Convert MediaLog from being ref counted to owned by WebMediaPlayer. (Closed)
Patch Set: Rebase. Created 3 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 unified diff | Download patch
« no previous file with comments | « media/base/media_log.h ('k') | media/base/mock_filters.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/base/media_log.h" 5 #include "media/base/media_log.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/atomic_sequence_num.h" 9 #include "base/atomic_sequence_num.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 } 371 }
372 372
373 void MediaLog::SetBooleanProperty( 373 void MediaLog::SetBooleanProperty(
374 const std::string& key, bool value) { 374 const std::string& key, bool value) {
375 std::unique_ptr<MediaLogEvent> event( 375 std::unique_ptr<MediaLogEvent> event(
376 CreateEvent(MediaLogEvent::PROPERTY_CHANGE)); 376 CreateEvent(MediaLogEvent::PROPERTY_CHANGE));
377 event->params.SetBoolean(key, value); 377 event->params.SetBoolean(key, value);
378 AddEvent(std::move(event)); 378 AddEvent(std::move(event));
379 } 379 }
380 380
381 LogHelper::LogHelper(MediaLog::MediaLogLevel level, 381 LogHelper::LogHelper(MediaLog::MediaLogLevel level, MediaLog* media_log)
382 const scoped_refptr<MediaLog>& media_log)
383 : level_(level), media_log_(media_log) { 382 : level_(level), media_log_(media_log) {
384 DCHECK(media_log_.get()); 383 DCHECK(media_log_);
385 } 384 }
386 385
387 LogHelper::~LogHelper() { 386 LogHelper::~LogHelper() {
388 media_log_->AddLogEvent(level_, stream_.str()); 387 media_log_->AddLogEvent(level_, stream_.str());
389 } 388 }
390 389
391 } //namespace media 390 } //namespace media
OLDNEW
« no previous file with comments | « media/base/media_log.h ('k') | media/base/mock_filters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698