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

Unified Diff: ios/chrome/browser/reading_list/reading_list_model_factory.cc

Issue 2512653003: Fix nullptr exception on ios_internal (Closed)
Patch Set: Created 4 years, 1 month 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 | « ios/chrome/browser/reading_list/reading_list_model_factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/reading_list/reading_list_model_factory.cc
diff --git a/ios/chrome/browser/reading_list/reading_list_model_factory.cc b/ios/chrome/browser/reading_list/reading_list_model_factory.cc
index 24eb53a7cf79c010320e2967ddc202b64dfc1788..393422c2419c77aff7f2f48a37d07944004d0406 100644
--- a/ios/chrome/browser/reading_list/reading_list_model_factory.cc
+++ b/ios/chrome/browser/reading_list/reading_list_model_factory.cc
@@ -21,11 +21,13 @@
#include "ios/web/public/web_thread.h"
// static
+bool ReadingListModelFactory::IsReadingListEnabled() {
+ return experimental_flags::IsReadingListEnabled();
+}
+
+// static
ReadingListModel* ReadingListModelFactory::GetForBrowserState(
ios::ChromeBrowserState* browser_state) {
- if (!experimental_flags::IsReadingListEnabled()) {
- return nullptr;
- }
return static_cast<ReadingListModelImpl*>(
GetInstance()->GetServiceForBrowserState(browser_state, true));
}
@@ -33,9 +35,6 @@ ReadingListModel* ReadingListModelFactory::GetForBrowserState(
// static
ReadingListModel* ReadingListModelFactory::GetForBrowserStateIfExists(
ios::ChromeBrowserState* browser_state) {
- if (!experimental_flags::IsReadingListEnabled()) {
- return nullptr;
- }
return static_cast<ReadingListModelImpl*>(
GetInstance()->GetServiceForBrowserState(browser_state, false));
}
« no previous file with comments | « ios/chrome/browser/reading_list/reading_list_model_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698