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

Side by Side Diff: chrome/browser/task_manager/task_manager.cc

Issue 7377010: This change will split the result codes between content and chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: actually rename the files Created 9 years, 5 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/task_manager/task_manager.h" 5 #include "chrome/browser/task_manager/task_manager.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/i18n/number_formatting.h" 8 #include "base/i18n/number_formatting.h"
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 // killing a process that manages several pages. 950 // killing a process that manages several pages.
951 return index < model_->ResourceCount() && 951 return index < model_->ResourceCount() &&
952 model_->GetResourceProcessHandle(index) == 952 model_->GetResourceProcessHandle(index) ==
953 base::GetCurrentProcessHandle(); 953 base::GetCurrentProcessHandle();
954 } 954 }
955 955
956 void TaskManager::KillProcess(int index) { 956 void TaskManager::KillProcess(int index) {
957 base::ProcessHandle process = model_->GetResourceProcessHandle(index); 957 base::ProcessHandle process = model_->GetResourceProcessHandle(index);
958 DCHECK(process); 958 DCHECK(process);
959 if (process != base::GetCurrentProcessHandle()) 959 if (process != base::GetCurrentProcessHandle())
960 base::KillProcess(process, ResultCodes::KILLED, false); 960 base::KillProcess(process, content::RESULT_CODE_KILLED, false);
961 } 961 }
962 962
963 void TaskManager::ActivateProcess(int index) { 963 void TaskManager::ActivateProcess(int index) {
964 // GetResourceTabContents returns a pointer to the relevant tab contents for 964 // GetResourceTabContents returns a pointer to the relevant tab contents for
965 // the resource. If the index doesn't correspond to a Tab (i.e. refers to 965 // the resource. If the index doesn't correspond to a Tab (i.e. refers to
966 // the Browser process or a plugin), GetTabContents will return NULL. 966 // the Browser process or a plugin), GetTabContents will return NULL.
967 TabContentsWrapper* chosen_tab_contents = 967 TabContentsWrapper* chosen_tab_contents =
968 model_->GetResourceTabContents(index); 968 model_->GetResourceTabContents(index);
969 if (chosen_tab_contents) { 969 if (chosen_tab_contents) {
970 static_cast<RenderViewHostDelegate*>(chosen_tab_contents->tab_contents())-> 970 static_cast<RenderViewHostDelegate*>(chosen_tab_contents->tab_contents())->
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 // Count the number of extensions with background pages (including 1080 // Count the number of extensions with background pages (including
1081 // incognito). 1081 // incognito).
1082 count += CountExtensionBackgroundPagesForProfile(profile); 1082 count += CountExtensionBackgroundPagesForProfile(profile);
1083 if (profile->HasOffTheRecordProfile()) { 1083 if (profile->HasOffTheRecordProfile()) {
1084 count += CountExtensionBackgroundPagesForProfile( 1084 count += CountExtensionBackgroundPagesForProfile(
1085 profile->GetOffTheRecordProfile()); 1085 profile->GetOffTheRecordProfile());
1086 } 1086 }
1087 } 1087 }
1088 return count; 1088 return count;
1089 } 1089 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698