| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_UI_WEBUI_MEMORY_INTERNALS_MEMORY_INTERNALS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_MEMORY_INTERNALS_MEMORY_INTERNALS_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_MEMORY_INTERNALS_MEMORY_INTERNALS_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_MEMORY_INTERNALS_MEMORY_INTERNALS_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "content/public/browser/web_ui_message_handler.h" | 12 #include "content/public/browser/web_ui_message_handler.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class ListValue; | 15 class ListValue; |
| 16 } | 16 } |
| 17 | 17 |
| 18 class MemoryInternalsProxy; | 18 class MemoryInternalsProxy; |
| 19 | 19 |
| 20 // This class handles messages to and from MemoryInternalsUI. | 20 // This class handles messages to and from MemoryInternalsUI. |
| 21 // It does all its work on the IO thread through the proxy below. | 21 // It does all its work on the IO thread through the proxy below. |
| 22 class MemoryInternalsHandler : public content::WebUIMessageHandler { | 22 class MemoryInternalsHandler : public content::WebUIMessageHandler { |
| 23 public: | 23 public: |
| 24 MemoryInternalsHandler(); | 24 MemoryInternalsHandler(); |
| 25 virtual ~MemoryInternalsHandler(); | 25 ~MemoryInternalsHandler() override; |
| 26 | 26 |
| 27 virtual void RegisterMessages() override; | 27 void RegisterMessages() override; |
| 28 | 28 |
| 29 // JavaScript message handlers. | 29 // JavaScript message handlers. |
| 30 void OnJSUpdate(const base::ListValue* list); | 30 void OnJSUpdate(const base::ListValue* list); |
| 31 | 31 |
| 32 // MemoryInternals message handlers. | 32 // MemoryInternals message handlers. |
| 33 void OnUpdate(const base::string16& update); | 33 void OnUpdate(const base::string16& update); |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 scoped_refptr<MemoryInternalsProxy> proxy_; | 36 scoped_refptr<MemoryInternalsProxy> proxy_; |
| 37 | 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(MemoryInternalsHandler); | 38 DISALLOW_COPY_AND_ASSIGN(MemoryInternalsHandler); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 #endif // CHROME_BROWSER_UI_WEBUI_MEMORY_INTERNALS_MEMORY_INTERNALS_HANDLER_H_ | 41 #endif // CHROME_BROWSER_UI_WEBUI_MEMORY_INTERNALS_MEMORY_INTERNALS_HANDLER_H_ |
| OLD | NEW |