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

Unified Diff: content/browser/media/media_internals_proxy.h

Issue 12153002: Move chrome://media-internals to content. This allows us to hide implementation details from the pu… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 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
Index: content/browser/media/media_internals_proxy.h
===================================================================
--- content/browser/media/media_internals_proxy.h (revision 179909)
+++ content/browser/media/media_internals_proxy.h (working copy)
@@ -2,44 +2,42 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_UI_WEBUI_MEDIA_MEDIA_INTERNALS_PROXY_H_
-#define CHROME_BROWSER_UI_WEBUI_MEDIA_MEDIA_INTERNALS_PROXY_H_
+#ifndef CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_PROXY_H_
+#define CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_PROXY_H_
#include "base/memory/ref_counted.h"
#include "base/sequenced_task_runner_helpers.h"
-#include "base/string16.h"
-#include "chrome/browser/media/media_internals_observer.h"
+#include "content/browser/media/media_internals.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "net/base/net_log.h"
-class IOThread;
-class MediaInternalsMessageHandler;
-
namespace base {
class ListValue;
class Value;
}
+namespace content {
+class MediaInternalsMessageHandler;
+
// This class is a proxy between MediaInternals (on the IO thread) and
// MediaInternalsMessageHandler (on the UI thread).
// It is ref_counted to ensure that it completes all pending Tasks on both
// threads before destruction.
class MediaInternalsProxy
- : public MediaInternalsObserver,
- public base::RefCountedThreadSafe<
+ : public base::RefCountedThreadSafe<
MediaInternalsProxy,
- content::BrowserThread::DeleteOnUIThread>,
+ BrowserThread::DeleteOnUIThread>,
public net::NetLog::ThreadSafeObserver,
- public content::NotificationObserver {
+ public NotificationObserver {
public:
MediaInternalsProxy();
- // content::NotificationObserver implementation.
+ // NotificationObserver implementation.
virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
+ const NotificationSource& source,
+ const NotificationDetails& details) OVERRIDE;
// Register a Handler and start receiving callbacks from MediaInternals.
void Attach(MediaInternalsMessageHandler* handler);
@@ -50,15 +48,14 @@
// Have MediaInternals send all the data it has.
void GetEverything();
- // MediaInternalsObserver implementation. Called on the IO thread.
- virtual void OnUpdate(const string16& update) OVERRIDE;
+ // MediaInternals callback. Called on the IO thread.
+ void OnUpdate(const string16& update);
// net::NetLog::ThreadSafeObserver implementation. Callable from any thread:
virtual void OnAddEntry(const net::NetLog::Entry& entry) OVERRIDE;
private:
- friend struct content::BrowserThread::DeleteOnThread<
- content::BrowserThread::UI>;
+ friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>;
friend class base::DeleteHelper<MediaInternalsProxy>;
virtual ~MediaInternalsProxy();
@@ -81,11 +78,13 @@
base::Value* args);
MediaInternalsMessageHandler* handler_;
- IOThread* io_thread_;
scoped_ptr<base::ListValue> pending_net_updates_;
- content::NotificationRegistrar registrar_;
+ NotificationRegistrar registrar_;
+ MediaInternals::UpdateCallback update_callback_;
DISALLOW_COPY_AND_ASSIGN(MediaInternalsProxy);
};
-#endif // CHROME_BROWSER_UI_WEBUI_MEDIA_MEDIA_INTERNALS_PROXY_H_
+} // namespace content
+
+#endif // CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_PROXY_H_

Powered by Google App Engine
This is Rietveld 408576698