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

Unified Diff: content/renderer/media/render_media_log.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/media/media_internals_unittest.cc ('k') | content/renderer/media/render_media_log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/render_media_log.h
diff --git a/content/renderer/media/render_media_log.h b/content/renderer/media/render_media_log.h
index ed9ce629889c0b1d2c5eb53eb77f4db4d4fdcf8a..825125f7b8dfd30569baeb70ea4f026fc391ad8a 100644
--- a/content/renderer/media/render_media_log.h
+++ b/content/renderer/media/render_media_log.h
@@ -9,6 +9,7 @@
#include <vector>
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "base/synchronization/lock.h"
#include "base/time/time.h"
#include "content/common/content_export.h"
@@ -34,6 +35,7 @@ namespace content {
class CONTENT_EXPORT RenderMediaLog : public media::MediaLog {
public:
explicit RenderMediaLog(const GURL& security_origin);
+ ~RenderMediaLog() override;
// MediaLog implementation.
void AddEvent(std::unique_ptr<media::MediaLogEvent> event) override;
@@ -46,8 +48,6 @@ class CONTENT_EXPORT RenderMediaLog : public media::MediaLog {
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
private:
- ~RenderMediaLog() override;
-
// Posted as a delayed task on |task_runner_| to throttle ipc message
// frequency.
void SendQueuedMediaEvents();
@@ -79,6 +79,9 @@ class CONTENT_EXPORT RenderMediaLog : public media::MediaLog {
// Holds a copy of the most recent PIPELINE_ERROR, if any.
std::unique_ptr<media::MediaLogEvent> last_pipeline_error_;
+ base::WeakPtr<RenderMediaLog> weak_this_;
+ base::WeakPtrFactory<RenderMediaLog> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(RenderMediaLog);
};
« no previous file with comments | « content/browser/media/media_internals_unittest.cc ('k') | content/renderer/media/render_media_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698