| 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 <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // Add all the prerender pages. | 100 // Add all the prerender pages. |
| 101 std::vector<Profile*> profiles( | 101 std::vector<Profile*> profiles( |
| 102 g_browser_process->profile_manager()->GetLoadedProfiles()); | 102 g_browser_process->profile_manager()->GetLoadedProfiles()); |
| 103 for (size_t i = 0; i < profiles.size(); ++i) { | 103 for (size_t i = 0; i < profiles.size(); ++i) { |
| 104 prerender::PrerenderManager* prerender_manager = | 104 prerender::PrerenderManager* prerender_manager = |
| 105 prerender::PrerenderManagerFactory::GetForProfile(profiles[i]); | 105 prerender::PrerenderManagerFactory::GetForProfile(profiles[i]); |
| 106 if (!prerender_manager) | 106 if (!prerender_manager) |
| 107 continue; | 107 continue; |
| 108 const std::vector<content::WebContents*> contentses = | 108 const std::vector<content::WebContents*> contentses = |
| 109 prerender_manager->GetAllPrerenderingContents(); | 109 prerender_manager->GetAllPrerenderingContents(); |
| 110 for (size_t j = 0; j < contentses.size(); ++j) | 110 web_contents->insert(contentses.begin(), contentses.end()); |
| 111 web_contents->insert(contentses[j]); | |
| 112 } | 111 } |
| 113 // Add all the Instant Extended prerendered NTPs. | 112 // Add all the Instant Extended prerendered NTPs. |
| 114 for (size_t i = 0; i < profiles.size(); ++i) { | 113 for (size_t i = 0; i < profiles.size(); ++i) { |
| 115 const InstantService* instant_service = | 114 const InstantService* instant_service = |
| 116 InstantServiceFactory::GetForProfile(profiles[i]); | 115 InstantServiceFactory::GetForProfile(profiles[i]); |
| 117 if (instant_service && instant_service->GetNTPContents()) | 116 if (instant_service && instant_service->GetNTPContents()) |
| 118 web_contents->insert(instant_service->GetNTPContents()); | 117 web_contents->insert(instant_service->GetNTPContents()); |
| 119 } | 118 } |
| 120 #if defined(ENABLE_FULL_PRINTING) | 119 #if defined(ENABLE_FULL_PRINTING) |
| 121 // Add all the pages being background printed. | 120 // Add all the pages being background printed. |
| 122 printing::BackgroundPrintingManager* printing_manager = | 121 printing::BackgroundPrintingManager* printing_manager = |
| 123 g_browser_process->background_printing_manager(); | 122 g_browser_process->background_printing_manager(); |
| 124 for (printing::BackgroundPrintingManager::WebContentsSet::const_iterator | 123 std::set<content::WebContents*> printing_contents = |
| 125 iter = printing_manager->begin(); | 124 printing_manager->CurrentContentSet(); |
| 126 iter != printing_manager->end(); ++iter) { | 125 web_contents->insert(printing_contents.begin(), printing_contents.end()); |
| 127 web_contents->insert(*iter); | |
| 128 } | |
| 129 #endif | 126 #endif |
| 130 } | 127 } |
| 131 | 128 |
| 132 } // namespace | 129 } // namespace |
| 133 | 130 |
| 134 class RendererDetails : public content::NotificationObserver { | 131 class RendererDetails : public content::NotificationObserver { |
| 135 public: | 132 public: |
| 136 typedef base::Callback<void(const base::ProcessId pid, | 133 typedef base::Callback<void(const base::ProcessId pid, |
| 137 const size_t v8_allocated, | 134 const size_t v8_allocated, |
| 138 const size_t v8_used)> V8DataCallback; | 135 const size_t v8_used)> V8DataCallback; |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 const std::string& function, const base::Value& args) { | 349 const std::string& function, const base::Value& args) { |
| 353 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 350 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 354 | 351 |
| 355 std::vector<const base::Value*> args_vector(1, &args); | 352 std::vector<const base::Value*> args_vector(1, &args); |
| 356 base::string16 update = | 353 base::string16 update = |
| 357 content::WebUI::GetJavascriptCall(function, args_vector); | 354 content::WebUI::GetJavascriptCall(function, args_vector); |
| 358 // Don't forward updates to a destructed UI. | 355 // Don't forward updates to a destructed UI. |
| 359 if (handler_) | 356 if (handler_) |
| 360 handler_->OnUpdate(update); | 357 handler_->OnUpdate(update); |
| 361 } | 358 } |
| OLD | NEW |