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

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

Issue 467653002: Revert of [DevTools] Make DevTools clients talk directly to DevToolsAgentHost instead of using DevToolsManage… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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"
19 #include "content/public/browser/notification_service.h" 20 #include "content/public/browser/notification_service.h"
20 #include "content/public/browser/render_frame_host.h" 21 #include "content/public/browser/render_frame_host.h"
21 #include "content/public/browser/render_process_host.h" 22 #include "content/public/browser/render_process_host.h"
22 #include "content/public/browser/render_view_host.h" 23 #include "content/public/browser/render_view_host.h"
23 #include "content/public/browser/site_instance.h" 24 #include "content/public/browser/site_instance.h"
24 #include "content/public/browser/web_contents.h" 25 #include "content/public/browser/web_contents.h"
25 #include "content/public/browser/web_contents_delegate.h" 26 #include "content/public/browser/web_contents_delegate.h"
26 #include "content/public/browser/web_contents_observer.h" 27 #include "content/public/browser/web_contents_observer.h"
27 #include "content/public/browser/web_contents_user_data.h" 28 #include "content/public/browser/web_contents_user_data.h"
28 #include "content/public/common/renderer_preferences.h" 29 #include "content/public/common/renderer_preferences.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 } 279 }
279 event_page_suspending_time_ = base::TimeDelta::FromSeconds(5); 280 event_page_suspending_time_ = base::TimeDelta::FromSeconds(5);
280 unsigned suspending_time_msec = 0; 281 unsigned suspending_time_msec = 0;
281 if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 282 if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
282 extensions::switches::kEventPageSuspendingTime), 283 extensions::switches::kEventPageSuspendingTime),
283 &suspending_time_msec)) { 284 &suspending_time_msec)) {
284 event_page_suspending_time_ = 285 event_page_suspending_time_ =
285 base::TimeDelta::FromMilliseconds(suspending_time_msec); 286 base::TimeDelta::FromMilliseconds(suspending_time_msec);
286 } 287 }
287 288
288 content::DevToolsAgentHost::AddAgentStateCallback(devtools_callback_); 289 content::DevToolsManager::GetInstance()->AddAgentStateCallback(
290 devtools_callback_);
289 291
290 OnKeepaliveImpulseCheck(); 292 OnKeepaliveImpulseCheck();
291 } 293 }
292 294
293 ProcessManager::~ProcessManager() { 295 ProcessManager::~ProcessManager() {
294 CloseBackgroundHosts(); 296 CloseBackgroundHosts();
295 DCHECK(background_hosts_.empty()); 297 DCHECK(background_hosts_.empty());
296 content::DevToolsAgentHost::RemoveAgentStateCallback(devtools_callback_); 298 content::DevToolsManager::GetInstance()->RemoveAgentStateCallback(
299 devtools_callback_);
297 } 300 }
298 301
299 const ProcessManager::ViewSet ProcessManager::GetAllViews() const { 302 const ProcessManager::ViewSet ProcessManager::GetAllViews() const {
300 ViewSet result; 303 ViewSet result;
301 for (ExtensionRenderViews::const_iterator iter = 304 for (ExtensionRenderViews::const_iterator iter =
302 all_extension_views_.begin(); 305 all_extension_views_.begin();
303 iter != all_extension_views_.end(); ++iter) { 306 iter != all_extension_views_.end(); ++iter) {
304 result.insert(iter->first); 307 result.insert(iter->first);
305 } 308 }
306 return result; 309 return result;
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 SiteInstance* IncognitoProcessManager::GetSiteInstanceForURL(const GURL& url) { 921 SiteInstance* IncognitoProcessManager::GetSiteInstanceForURL(const GURL& url) {
919 const Extension* extension = 922 const Extension* extension =
920 extension_registry_->enabled_extensions().GetExtensionOrAppByURL(url); 923 extension_registry_->enabled_extensions().GetExtensionOrAppByURL(url);
921 if (extension && !IncognitoInfo::IsSplitMode(extension)) 924 if (extension && !IncognitoInfo::IsSplitMode(extension))
922 return original_manager_->GetSiteInstanceForURL(url); 925 return original_manager_->GetSiteInstanceForURL(url);
923 926
924 return ProcessManager::GetSiteInstanceForURL(url); 927 return ProcessManager::GetSiteInstanceForURL(url);
925 } 928 }
926 929
927 } // namespace extensions 930 } // 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