| OLD | NEW |
| 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 #ifndef CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_PROXY_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_PROXY_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_PROXY_H_ | 6 #define CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_PROXY_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/sequenced_task_runner_helpers.h" | 9 #include "base/sequenced_task_runner_helpers.h" |
| 10 #include "content/browser/media/media_internals.h" | 10 #include "content/browser/media/media_internals.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 MediaInternalsProxy, | 30 MediaInternalsProxy, |
| 31 BrowserThread::DeleteOnUIThread>, | 31 BrowserThread::DeleteOnUIThread>, |
| 32 public net::NetLog::ThreadSafeObserver, | 32 public net::NetLog::ThreadSafeObserver, |
| 33 public NotificationObserver { | 33 public NotificationObserver { |
| 34 public: | 34 public: |
| 35 MediaInternalsProxy(); | 35 MediaInternalsProxy(); |
| 36 | 36 |
| 37 // NotificationObserver implementation. | 37 // NotificationObserver implementation. |
| 38 virtual void Observe(int type, | 38 virtual void Observe(int type, |
| 39 const NotificationSource& source, | 39 const NotificationSource& source, |
| 40 const NotificationDetails& details) OVERRIDE; | 40 const NotificationDetails& details) override; |
| 41 | 41 |
| 42 // Register a Handler and start receiving callbacks from MediaInternals. | 42 // Register a Handler and start receiving callbacks from MediaInternals. |
| 43 void Attach(MediaInternalsMessageHandler* handler); | 43 void Attach(MediaInternalsMessageHandler* handler); |
| 44 | 44 |
| 45 // Unregister the same and stop receiving callbacks. | 45 // Unregister the same and stop receiving callbacks. |
| 46 void Detach(); | 46 void Detach(); |
| 47 | 47 |
| 48 // Have MediaInternals send all the data it has. | 48 // Have MediaInternals send all the data it has. |
| 49 void GetEverything(); | 49 void GetEverything(); |
| 50 | 50 |
| 51 // MediaInternals callback. Called on the IO thread. | 51 // MediaInternals callback. Called on the IO thread. |
| 52 void OnUpdate(const base::string16& update); | 52 void OnUpdate(const base::string16& update); |
| 53 | 53 |
| 54 // net::NetLog::ThreadSafeObserver implementation. Callable from any thread: | 54 // net::NetLog::ThreadSafeObserver implementation. Callable from any thread: |
| 55 virtual void OnAddEntry(const net::NetLog::Entry& entry) OVERRIDE; | 55 virtual void OnAddEntry(const net::NetLog::Entry& entry) override; |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>; | 58 friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>; |
| 59 friend class base::DeleteHelper<MediaInternalsProxy>; | 59 friend class base::DeleteHelper<MediaInternalsProxy>; |
| 60 virtual ~MediaInternalsProxy(); | 60 virtual ~MediaInternalsProxy(); |
| 61 | 61 |
| 62 // Build a dictionary mapping constant names to values. | 62 // Build a dictionary mapping constant names to values. |
| 63 base::Value* GetConstants(); | 63 base::Value* GetConstants(); |
| 64 | 64 |
| 65 void ObserveMediaInternalsOnIOThread(); | 65 void ObserveMediaInternalsOnIOThread(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 81 scoped_ptr<base::ListValue> pending_net_updates_; | 81 scoped_ptr<base::ListValue> pending_net_updates_; |
| 82 NotificationRegistrar registrar_; | 82 NotificationRegistrar registrar_; |
| 83 MediaInternals::UpdateCallback update_callback_; | 83 MediaInternals::UpdateCallback update_callback_; |
| 84 | 84 |
| 85 DISALLOW_COPY_AND_ASSIGN(MediaInternalsProxy); | 85 DISALLOW_COPY_AND_ASSIGN(MediaInternalsProxy); |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 } // namespace content | 88 } // namespace content |
| 89 | 89 |
| 90 #endif // CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_PROXY_H_ | 90 #endif // CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_PROXY_H_ |
| OLD | NEW |