| 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 #include "chrome/browser/ui/webui/memory_internals/memory_internals_proxy.h" | 5 #include "chrome/browser/ui/webui/memory_internals/memory_internals_proxy.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 using content::BrowserThread; | 26 using content::BrowserThread; |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 class BrowserProcessDetails : public MemoryDetails { | 30 class BrowserProcessDetails : public MemoryDetails { |
| 31 public: | 31 public: |
| 32 typedef base::Callback<void(const ProcessData&)> DataCallback; | 32 typedef base::Callback<void(const ProcessData&)> DataCallback; |
| 33 explicit BrowserProcessDetails(const DataCallback& callback) | 33 explicit BrowserProcessDetails(const DataCallback& callback) |
| 34 : callback_(callback) {} | 34 : callback_(callback) {} |
| 35 virtual void OnDetailsAvailable() { | 35 virtual void OnDetailsAvailable() OVERRIDE { |
| 36 const std::vector<ProcessData>& browser_processes = processes(); | 36 const std::vector<ProcessData>& browser_processes = processes(); |
| 37 callback_.Run(browser_processes[0]); | 37 callback_.Run(browser_processes[0]); |
| 38 } | 38 } |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 virtual ~BrowserProcessDetails() {} | 41 virtual ~BrowserProcessDetails() {} |
| 42 | 42 |
| 43 DataCallback callback_; | 43 DataCallback callback_; |
| 44 | 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(BrowserProcessDetails); | 45 DISALLOW_COPY_AND_ASSIGN(BrowserProcessDetails); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 void MemoryInternalsProxy::CallJavaScriptFunctionOnUIThread( | 107 void MemoryInternalsProxy::CallJavaScriptFunctionOnUIThread( |
| 108 const std::string& function, base::Value* args) { | 108 const std::string& function, base::Value* args) { |
| 109 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 109 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 110 | 110 |
| 111 std::vector<const base::Value*> args_vector; | 111 std::vector<const base::Value*> args_vector; |
| 112 args_vector.push_back(args); | 112 args_vector.push_back(args); |
| 113 string16 update = content::WebUI::GetJavascriptCall(function, args_vector); | 113 string16 update = content::WebUI::GetJavascriptCall(function, args_vector); |
| 114 UpdateUIOnUIThread(update); | 114 UpdateUIOnUIThread(update); |
| 115 } | 115 } |
| OLD | NEW |