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

Side by Side Diff: chrome/browser/ui/browser_init.cc

Issue 6544023: Fix crashes in ExtensionService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comment/TODO Created 9 years, 10 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/ui/browser_init.h" 5 #include "chrome/browser/ui/browser_init.h"
6 6
7 #include <algorithm> // For max(). 7 #include <algorithm> // For max().
8 8
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/event_recorder.h" 10 #include "base/event_recorder.h"
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 void RecordCmdLineAppHistogram() { 450 void RecordCmdLineAppHistogram() {
451 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, 451 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram,
452 extension_misc::APP_LAUNCH_CMD_LINE_APP, 452 extension_misc::APP_LAUNCH_CMD_LINE_APP,
453 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); 453 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY);
454 } 454 }
455 455
456 void RecordAppLaunches( 456 void RecordAppLaunches(
457 Profile* profile, 457 Profile* profile,
458 const std::vector<GURL>& cmd_line_urls, 458 const std::vector<GURL>& cmd_line_urls,
459 const std::vector<BrowserInit::LaunchWithProfile::Tab>& autolaunch_tabs) { 459 const std::vector<BrowserInit::LaunchWithProfile::Tab>& autolaunch_tabs) {
460 // TODO: the ExtensionService should never be NULL, but in some cases it is,
461 // see bug 73768. After it is resolved, the explicit test can go away.
460 ExtensionService* extension_service = profile->GetExtensionService(); 462 ExtensionService* extension_service = profile->GetExtensionService();
463 if (!extension_service)
464 return;
461 465
462 for (size_t i = 0; i < cmd_line_urls.size(); ++i) { 466 for (size_t i = 0; i < cmd_line_urls.size(); ++i) {
463 if (extension_service->IsInstalledApp(cmd_line_urls.at(i))) { 467 if (extension_service->IsInstalledApp(cmd_line_urls.at(i))) {
464 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, 468 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram,
465 extension_misc::APP_LAUNCH_CMD_LINE_URL, 469 extension_misc::APP_LAUNCH_CMD_LINE_URL,
466 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); 470 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY);
467 } 471 }
468 } 472 }
469 473
470 for (size_t i = 0; i < autolaunch_tabs.size(); ++i) { 474 for (size_t i = 0; i < autolaunch_tabs.size(); ++i) {
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 return false; 1278 return false;
1275 automation->SetExpectedTabCount(expected_tabs); 1279 automation->SetExpectedTabCount(expected_tabs);
1276 1280
1277 AutomationProviderList* list = 1281 AutomationProviderList* list =
1278 g_browser_process->InitAutomationProviderList(); 1282 g_browser_process->InitAutomationProviderList();
1279 DCHECK(list); 1283 DCHECK(list);
1280 list->AddProvider(automation); 1284 list->AddProvider(automation);
1281 1285
1282 return true; 1286 return true;
1283 } 1287 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698