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

Side by Side Diff: chrome/browser/bookmarks/bookmark_html_writer.cc

Issue 2825003002: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/{a,b,c,d,e,f,g}* (Closed)
Patch Set: split rest of changes to 3 CLs Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/bookmarks/bookmark_html_writer.h" 5 #include "chrome/browser/bookmarks/bookmark_html_writer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 } 444 }
445 } 445 }
446 446
447 void BookmarkFaviconFetcher::ExecuteWriter() { 447 void BookmarkFaviconFetcher::ExecuteWriter() {
448 // BookmarkModel isn't thread safe (nor would we want to lock it down 448 // BookmarkModel isn't thread safe (nor would we want to lock it down
449 // for the duration of the write), as such we make a copy of the 449 // for the duration of the write), as such we make a copy of the
450 // BookmarkModel using BookmarkCodec then write from that. 450 // BookmarkModel using BookmarkCodec then write from that.
451 BookmarkCodec codec; 451 BookmarkCodec codec;
452 BrowserThread::PostTask( 452 BrowserThread::PostTask(
453 BrowserThread::FILE, FROM_HERE, 453 BrowserThread::FILE, FROM_HERE,
454 base::Bind( 454 base::BindOnce(
455 &Writer::DoWrite, 455 &Writer::DoWrite,
456 new Writer(codec.Encode( 456 new Writer(codec.Encode(
457 BookmarkModelFactory::GetForBrowserContext(profile_)), 457 BookmarkModelFactory::GetForBrowserContext(profile_)),
458 path_, favicons_map_.release(), observer_))); 458 path_, favicons_map_.release(), observer_)));
459 if (g_fetcher) { 459 if (g_fetcher) {
460 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, g_fetcher); 460 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, g_fetcher);
461 g_fetcher = nullptr; 461 g_fetcher = nullptr;
462 } 462 }
463 } 463 }
464 464
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 // BookmarkModel isn't thread safe (nor would we want to lock it down 515 // BookmarkModel isn't thread safe (nor would we want to lock it down
516 // for the duration of the write), as such we make a copy of the 516 // for the duration of the write), as such we make a copy of the
517 // BookmarkModel using BookmarkCodec then write from that. 517 // BookmarkModel using BookmarkCodec then write from that.
518 if (!g_fetcher) { 518 if (!g_fetcher) {
519 g_fetcher = new BookmarkFaviconFetcher(profile, path, observer); 519 g_fetcher = new BookmarkFaviconFetcher(profile, path, observer);
520 g_fetcher->ExportBookmarks(); 520 g_fetcher->ExportBookmarks();
521 } 521 }
522 } 522 }
523 523
524 } // namespace bookmark_html_writer 524 } // namespace bookmark_html_writer
OLDNEW
« no previous file with comments | « chrome/browser/background/background_mode_manager.cc ('k') | chrome/browser/browser_about_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698