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

Unified Diff: chrome/browser/media/media_internals.h

Issue 9845033: Move the MediaObserver getter from ResourceContext to ContentBrowserClient, since we only need to s… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix dcheck Created 8 years, 9 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 | « chrome/browser/io_thread.cc ('k') | chrome/browser/media/media_internals.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/media_internals.h
===================================================================
--- chrome/browser/media/media_internals.h (revision 128803)
+++ chrome/browser/media/media_internals.h (working copy)
@@ -7,8 +7,8 @@
#pragma once
#include "base/memory/ref_counted.h"
+#include "base/memory/singleton.h"
#include "base/observer_list.h"
-#include "base/threading/non_thread_safe.h"
#include "base/values.h"
#include "content/public/browser/media_observer.h"
@@ -19,12 +19,14 @@
}
// This class stores information about currently active media.
-// All of its methods are called on the IO thread.
-class MediaInternals : public content::MediaObserver,
- public base::NonThreadSafe {
+// It's constructed on the UI thread but all of its methods are called on the IO
+// thread.
+class MediaInternals : public content::MediaObserver {
public:
virtual ~MediaInternals();
+ static MediaInternals* GetInstance();
+
// Overridden from content::MediaObserver:
virtual void OnDeleteAudioStream(void* host, int stream_id) OVERRIDE;
virtual void OnSetAudioStreamPlaying(void* host,
@@ -47,8 +49,8 @@
void SendEverything();
private:
- friend class IOThread;
friend class MediaInternalsTest;
+ friend struct DefaultSingletonTraits<MediaInternals>;
MediaInternals();
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | chrome/browser/media/media_internals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698