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

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

Issue 342068: Third patch in getting rid of caching MessageLoop pointers and always using C... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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
===================================================================
--- chrome/browser/bookmarks/bookmark_html_writer.cc (revision 30650)
+++ chrome/browser/bookmarks/bookmark_html_writer.cc (working copy)
@@ -14,6 +14,7 @@
#include "base/values.h"
#include "chrome/browser/bookmarks/bookmark_codec.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
+#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/history/history_types.h"
#include "grit/generated_resources.h"
#include "net/base/escape.h"
@@ -316,18 +317,13 @@
} // namespace
-void WriteBookmarks(MessageLoop* thread,
- BookmarkModel* model,
- const FilePath& path) {
+void WriteBookmarks(BookmarkModel* model, const FilePath& path) {
// BookmarkModel isn't thread safe (nor would we want to lock it down
// for the duration of the write), as such we make a copy of the
// BookmarkModel using BookmarkCodec then write from that.
BookmarkCodec codec;
- scoped_ptr<Writer> writer(new Writer(codec.Encode(model), path));
- if (thread)
- thread->PostTask(FROM_HERE, writer.release());
- else
- writer->Run();
+ ChromeThread::PostTask(
+ ChromeThread::FILE, FROM_HERE, new Writer(codec.Encode(model), path));
}
} // namespace bookmark_html_writer
« no previous file with comments | « chrome/browser/bookmarks/bookmark_html_writer.h ('k') | chrome/browser/bookmarks/bookmark_html_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698