Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Side by Side Diff: extensions/browser/process_manager.cc

Issue 449043002: [DevTools] Make DevTools clients talk directly to DevToolsAgentHost instead of using DevToolsManage… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed DetachAllClients Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/shell/browser/webkit_test_controller.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "extensions/browser/process_manager.h" 5 #include "extensions/browser/process_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "base/metrics/histogram.h" 12 #include "base/metrics/histogram.h"
13 #include "base/stl_util.h" 13 #include "base/stl_util.h"
14 #include "base/strings/string_number_conversions.h" 14 #include "base/strings/string_number_conversions.h"
15 #include "base/time/time.h" 15 #include "base/time/time.h"
16 #include "content/public/browser/browser_context.h" 16 #include "content/public/browser/browser_context.h"
17 #include "content/public/browser/browser_thread.h" 17 #include "content/public/browser/browser_thread.h"
18 #include "content/public/browser/devtools_agent_host.h" 18 #include "content/public/browser/devtools_agent_host.h"
19 #include "content/public/browser/devtools_manager.h"
20 #include "content/public/browser/notification_service.h" 19 #include "content/public/browser/notification_service.h"
21 #include "content/public/browser/render_frame_host.h" 20 #include "content/public/browser/render_frame_host.h"
22 #include "content/public/browser/render_process_host.h" 21 #include "content/public/browser/render_process_host.h"
23 #include "content/public/browser/render_view_host.h" 22 #include "content/public/browser/render_view_host.h"
24 #include "content/public/browser/site_instance.h" 23 #include "content/public/browser/site_instance.h"
25 #include "content/public/browser/web_contents.h" 24 #include "content/public/browser/web_contents.h"
26 #include "content/public/browser/web_contents_delegate.h" 25 #include "content/public/browser/web_contents_delegate.h"
27 #include "content/public/browser/web_contents_observer.h" 26 #include "content/public/browser/web_contents_observer.h"
28 #include "content/public/browser/web_contents_user_data.h" 27 #include "content/public/browser/web_contents_user_data.h"
29 #include "content/public/common/renderer_preferences.h" 28 #include "content/public/common/renderer_preferences.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 } 278 }
280 event_page_suspending_time_ = base::TimeDelta::FromSeconds(5); 279 event_page_suspending_time_ = base::TimeDelta::FromSeconds(5);
281 unsigned suspending_time_msec = 0; 280 unsigned suspending_time_msec = 0;
282 if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 281 if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
283 extensions::switches::kEventPageSuspendingTime), 282 extensions::switches::kEventPageSuspendingTime),
284 &suspending_time_msec)) { 283 &suspending_time_msec)) {
285 event_page_suspending_time_ = 284 event_page_suspending_time_ =
286 base::TimeDelta::FromMilliseconds(suspending_time_msec); 285 base::TimeDelta::FromMilliseconds(suspending_time_msec);
287 } 286 }
288 287
289 content::DevToolsManager::GetInstance()->AddAgentStateCallback( 288 content::DevToolsAgentHost::AddAgentStateCallback(devtools_callback_);
290 devtools_callback_);
291 289
292 OnKeepaliveImpulseCheck(); 290 OnKeepaliveImpulseCheck();
293 } 291 }
294 292
295 ProcessManager::~ProcessManager() { 293 ProcessManager::~ProcessManager() {
296 CloseBackgroundHosts(); 294 CloseBackgroundHosts();
297 DCHECK(background_hosts_.empty()); 295 DCHECK(background_hosts_.empty());
298 content::DevToolsManager::GetInstance()->RemoveAgentStateCallback( 296 content::DevToolsAgentHost::RemoveAgentStateCallback(devtools_callback_);
299 devtools_callback_);
300 } 297 }
301 298
302 const ProcessManager::ViewSet ProcessManager::GetAllViews() const { 299 const ProcessManager::ViewSet ProcessManager::GetAllViews() const {
303 ViewSet result; 300 ViewSet result;
304 for (ExtensionRenderViews::const_iterator iter = 301 for (ExtensionRenderViews::const_iterator iter =
305 all_extension_views_.begin(); 302 all_extension_views_.begin();
306 iter != all_extension_views_.end(); ++iter) { 303 iter != all_extension_views_.end(); ++iter) {
307 result.insert(iter->first); 304 result.insert(iter->first);
308 } 305 }
309 return result; 306 return result;
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 SiteInstance* IncognitoProcessManager::GetSiteInstanceForURL(const GURL& url) { 945 SiteInstance* IncognitoProcessManager::GetSiteInstanceForURL(const GURL& url) {
949 const Extension* extension = 946 const Extension* extension =
950 extension_registry_->enabled_extensions().GetExtensionOrAppByURL(url); 947 extension_registry_->enabled_extensions().GetExtensionOrAppByURL(url);
951 if (extension && !IncognitoInfo::IsSplitMode(extension)) 948 if (extension && !IncognitoInfo::IsSplitMode(extension))
952 return original_manager_->GetSiteInstanceForURL(url); 949 return original_manager_->GetSiteInstanceForURL(url);
953 950
954 return ProcessManager::GetSiteInstanceForURL(url); 951 return ProcessManager::GetSiteInstanceForURL(url);
955 } 952 }
956 953
957 } // namespace extensions 954 } // namespace extensions
OLDNEW
« no previous file with comments | « content/shell/browser/webkit_test_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698