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

Unified Diff: chrome/browser/bookmarks/bookmark_html_writer.cc

Issue 2216713002: Use BookmarkModelFactory::GetForBrowserContext everywhere (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bookmarks
Patch Set: Eliminate Profile::FromBrowserContext in some places Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/bookmarks/bookmark_html_writer.cc
diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/bookmarks/bookmark_html_writer.cc
index df55855046e679d38934e18993c7eb0cf1a6e3bc..9aaaeb0748ff1ebb3888d60c9cc159b310862194 100644
--- a/chrome/browser/bookmarks/bookmark_html_writer.cc
+++ b/chrome/browser/bookmarks/bookmark_html_writer.cc
@@ -409,10 +409,12 @@ BookmarkFaviconFetcher::~BookmarkFaviconFetcher() {
}
void BookmarkFaviconFetcher::ExportBookmarks() {
- ExtractUrls(BookmarkModelFactory::GetForProfile(
- profile_)->bookmark_bar_node());
- ExtractUrls(BookmarkModelFactory::GetForProfile(profile_)->other_node());
- ExtractUrls(BookmarkModelFactory::GetForProfile(profile_)->mobile_node());
+ ExtractUrls(BookmarkModelFactory::GetForBrowserContext(profile_)
+ ->bookmark_bar_node());
+ ExtractUrls(
+ BookmarkModelFactory::GetForBrowserContext(profile_)->other_node());
+ ExtractUrls(
+ BookmarkModelFactory::GetForBrowserContext(profile_)->mobile_node());
if (!bookmark_urls_.empty())
FetchNextFavicon();
else
@@ -448,10 +450,11 @@ void BookmarkFaviconFetcher::ExecuteWriter() {
BookmarkCodec codec;
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
- base::Bind(&Writer::DoWrite,
- new Writer(codec.Encode(BookmarkModelFactory::GetForProfile(
- profile_)),
- path_, favicons_map_.release(), observer_)));
+ base::Bind(
+ &Writer::DoWrite,
+ new Writer(codec.Encode(
+ BookmarkModelFactory::GetForBrowserContext(profile_)),
+ path_, favicons_map_.release(), observer_)));
if (g_fetcher) {
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, g_fetcher);
g_fetcher = nullptr;

Powered by Google App Engine
This is Rietveld 408576698