| 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 <memory> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 10 #include "base/sequenced_task_runner_helpers.h" | 12 #include "base/sequenced_task_runner_helpers.h" |
| 11 #include "content/browser/media/media_internals.h" | 13 #include "content/browser/media/media_internals.h" |
| 12 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 13 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
| 14 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
| 15 #include "net/log/net_log.h" | 17 #include "net/log/net_log.h" |
| 16 | 18 |
| 17 namespace base { | 19 namespace base { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 base::Value* GetConstants(); | 63 base::Value* GetConstants(); |
| 62 | 64 |
| 63 void ObserveMediaInternalsOnIOThread(); | 65 void ObserveMediaInternalsOnIOThread(); |
| 64 void StopObservingMediaInternalsOnIOThread(); | 66 void StopObservingMediaInternalsOnIOThread(); |
| 65 void GetEverythingOnIOThread(); | 67 void GetEverythingOnIOThread(); |
| 66 | 68 |
| 67 // Callback for MediaInternals to update. Must be called on UI thread. | 69 // Callback for MediaInternals to update. Must be called on UI thread. |
| 68 void UpdateUIOnUIThread(const base::string16& update); | 70 void UpdateUIOnUIThread(const base::string16& update); |
| 69 | 71 |
| 70 // Put |entry| on a list of events to be sent to the page. | 72 // Put |entry| on a list of events to be sent to the page. |
| 71 void AddNetEventOnUIThread(base::Value* entry); | 73 void AddNetEventOnUIThread(std::unique_ptr<base::Value> entry); |
| 72 | 74 |
| 73 // Send all pending events to the page. | 75 // Send all pending events to the page. |
| 74 void SendNetEventsOnUIThread(); | 76 void SendNetEventsOnUIThread(); |
| 75 | 77 |
| 76 // Call a JavaScript function on the page. Takes ownership of |args|. | 78 // Call a JavaScript function on the page. Takes ownership of |args|. |
| 77 void CallJavaScriptFunctionOnUIThread(const std::string& function, | 79 void CallJavaScriptFunctionOnUIThread(const std::string& function, |
| 78 base::Value* args); | 80 base::Value* args); |
| 79 | 81 |
| 80 MediaInternalsMessageHandler* handler_; | 82 MediaInternalsMessageHandler* handler_; |
| 81 std::unique_ptr<base::ListValue> pending_net_updates_; | 83 std::unique_ptr<base::ListValue> pending_net_updates_; |
| 82 NotificationRegistrar registrar_; | 84 NotificationRegistrar registrar_; |
| 83 MediaInternals::UpdateCallback update_callback_; | 85 MediaInternals::UpdateCallback update_callback_; |
| 84 | 86 |
| 85 DISALLOW_COPY_AND_ASSIGN(MediaInternalsProxy); | 87 DISALLOW_COPY_AND_ASSIGN(MediaInternalsProxy); |
| 86 }; | 88 }; |
| 87 | 89 |
| 88 } // namespace content | 90 } // namespace content |
| 89 | 91 |
| 90 #endif // CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_PROXY_H_ | 92 #endif // CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_PROXY_H_ |
| OLD | NEW |