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

Side by Side Diff: chrome/browser/extensions/extensions_service.cc

Issue 2883057: Add debuggin CHECK to help track down ExtensionHost crasher (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: cr comment Created 10 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
« no previous file with comments | « chrome/browser/extensions/extension_host.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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/extensions/extensions_service.h" 5 #include "chrome/browser/extensions/extensions_service.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/histogram.h" 10 #include "base/histogram.h"
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1160 1160
1161 DevToolsManager::GetInstance()->AttachClientHost( 1161 DevToolsManager::GetInstance()->AttachClientHost(
1162 iter->second, host->render_view_host()); 1162 iter->second, host->render_view_host());
1163 orphaned_dev_tools_.erase(iter); 1163 orphaned_dev_tools_.erase(iter);
1164 break; 1164 break;
1165 } 1165 }
1166 1166
1167 case NotificationType::EXTENSION_PROCESS_TERMINATED: { 1167 case NotificationType::EXTENSION_PROCESS_TERMINATED: {
1168 DCHECK_EQ(profile_, Source<Profile>(source).ptr()); 1168 DCHECK_EQ(profile_, Source<Profile>(source).ptr());
1169 1169
1170 ExtensionHost* host = Details<ExtensionHost>(details).ptr();
1171
1172 // TODO(rafaelw): Remove this check and ExtensionHost::recently_deleted().
1173 // This is only here to help track down crbug.com/49114.
1174 ExtensionHost::HostPointerList::iterator iter =
1175 ExtensionHost::recently_deleted()->begin();
1176 for (; iter != ExtensionHost::recently_deleted()->end(); iter++) {
1177 if (*iter == host) {
1178 CHECK(host->GetURL().spec().size() + 2 != 0);
1179 break;
1180 }
1181 }
1182 if (iter == ExtensionHost::recently_deleted()->end())
1183 CHECK(host->GetURL().spec().size() + 1 != 0);
1184
1170 // Unload the entire extension. We want it to be in a consistent state: 1185 // Unload the entire extension. We want it to be in a consistent state:
1171 // either fully working or not loaded at all, but never half-crashed. 1186 // either fully working or not loaded at all, but never half-crashed.
1172 UnloadExtension(Details<ExtensionHost>(details).ptr()->extension()->id()); 1187 UnloadExtension(host->extension()->id());
1173 break; 1188 break;
1174 } 1189 }
1175 1190
1176 default: 1191 default:
1177 NOTREACHED() << "Unexpected notification type."; 1192 NOTREACHED() << "Unexpected notification type.";
1178 } 1193 }
1179 } 1194 }
1180 1195
1181 bool ExtensionsService::HasApps() { 1196 bool ExtensionsService::HasApps() {
1182 if (!extensions_enabled_) 1197 if (!extensions_enabled_)
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1370 // Finish installing on UI thread. 1385 // Finish installing on UI thread.
1371 ChromeThread::PostTask( 1386 ChromeThread::PostTask(
1372 ChromeThread::UI, FROM_HERE, 1387 ChromeThread::UI, FROM_HERE,
1373 NewRunnableMethod( 1388 NewRunnableMethod(
1374 frontend_, 1389 frontend_,
1375 &ExtensionsService::ContinueLoadAllExtensions, 1390 &ExtensionsService::ContinueLoadAllExtensions,
1376 extensions_to_reload, 1391 extensions_to_reload,
1377 start_time, 1392 start_time,
1378 true)); 1393 true));
1379 } 1394 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698