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

Unified Diff: chrome/browser/extensions/chrome_app_sorting.cc

Issue 1055453007: Added CHECKs for null pointers in ChromeAppSorting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added CHECK(this) just to make sure that ExtensionPrefs is non-null. Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/chrome_app_sorting.h ('k') | extensions/browser/app_sorting.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/chrome_app_sorting.cc
diff --git a/chrome/browser/extensions/chrome_app_sorting.cc b/chrome/browser/extensions/chrome_app_sorting.cc
index 5f05f47696b6cde21032152affaaf8571da231ec..a11e1a284a01d0432503ac60d9e0f12b96d924c0 100644
--- a/chrome/browser/extensions/chrome_app_sorting.cc
+++ b/chrome/browser/extensions/chrome_app_sorting.cc
@@ -60,6 +60,10 @@ void ChromeAppSorting::SetExtensionScopedPrefs(ExtensionScopedPrefs* prefs) {
extension_scoped_prefs_ = prefs;
}
+void ChromeAppSorting::CheckExtensionScopedPrefs() const {
+ CHECK(extension_scoped_prefs_);
+}
+
void ChromeAppSorting::SetExtensionSyncService(
ExtensionSyncService* extension_sync_service) {
extension_sync_service_ = extension_sync_service;
@@ -67,6 +71,7 @@ void ChromeAppSorting::SetExtensionSyncService(
void ChromeAppSorting::Initialize(
const extensions::ExtensionIdList& extension_ids) {
+ CHECK(extension_scoped_prefs_);
InitializePageOrdinalMap(extension_ids);
MigrateAppIndex(extension_ids);
@@ -470,6 +475,9 @@ syncer::StringOrdinal ChromeAppSorting::GetMinOrMaxAppLaunchOrdinalsOnPage(
void ChromeAppSorting::InitializePageOrdinalMap(
const extensions::ExtensionIdList& extension_ids) {
+ // TODO(mgiuca): Added this CHECK to try and diagnose http://crbug.com/476648.
+ // Remove it after the investigation is concluded.
+ CHECK(extension_scoped_prefs_);
for (extensions::ExtensionIdList::const_iterator ext_it =
extension_ids.begin(); ext_it != extension_ids.end(); ++ext_it) {
AddOrdinalMapping(*ext_it,
« no previous file with comments | « chrome/browser/extensions/chrome_app_sorting.h ('k') | extensions/browser/app_sorting.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698