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

Side by Side Diff: components/bookmarks/browser/bookmark_storage.cc

Issue 422673002: Move BookmarkNodeData into bookmarks namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mac Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/bookmarks/browser/bookmark_storage.h" 5 #include "components/bookmarks/browser/bookmark_storage.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/json/json_file_value_serializer.h" 10 #include "base/json/json_file_value_serializer.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 extra_nodes_ = load_extra_callback_.Run(&max_id_); 139 extra_nodes_ = load_extra_callback_.Run(&max_id_);
140 } 140 }
141 141
142 // BookmarkStorage ------------------------------------------------------------- 142 // BookmarkStorage -------------------------------------------------------------
143 143
144 BookmarkStorage::BookmarkStorage( 144 BookmarkStorage::BookmarkStorage(
145 BookmarkModel* model, 145 BookmarkModel* model,
146 const base::FilePath& profile_path, 146 const base::FilePath& profile_path,
147 base::SequencedTaskRunner* sequenced_task_runner) 147 base::SequencedTaskRunner* sequenced_task_runner)
148 : model_(model), 148 : model_(model),
149 writer_(profile_path.Append(bookmarks::kBookmarksFileName), 149 writer_(profile_path.Append(kBookmarksFileName), sequenced_task_runner),
150 sequenced_task_runner),
151 weak_factory_(this) { 150 weak_factory_(this) {
152 sequenced_task_runner_ = sequenced_task_runner; 151 sequenced_task_runner_ = sequenced_task_runner;
153 writer_.set_commit_interval(base::TimeDelta::FromMilliseconds(kSaveDelayMS)); 152 writer_.set_commit_interval(base::TimeDelta::FromMilliseconds(kSaveDelayMS));
154 sequenced_task_runner_->PostTask(FROM_HERE, 153 sequenced_task_runner_->PostTask(FROM_HERE,
155 base::Bind(&BackupCallback, writer_.path())); 154 base::Bind(&BackupCallback, writer_.path()));
156 } 155 }
157 156
158 BookmarkStorage::~BookmarkStorage() { 157 BookmarkStorage::~BookmarkStorage() {
159 if (writer_.HasPendingWrite()) 158 if (writer_.HasPendingWrite())
160 writer_.DoScheduledWrite(); 159 writer_.DoScheduledWrite();
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 } 206 }
208 207
209 std::string data; 208 std::string data;
210 if (!SerializeData(&data)) 209 if (!SerializeData(&data))
211 return false; 210 return false;
212 writer_.WriteNow(data); 211 writer_.WriteNow(data);
213 return true; 212 return true;
214 } 213 }
215 214
216 } // namespace bookmarks 215 } // namespace bookmarks
OLDNEW
« no previous file with comments | « components/bookmarks/browser/bookmark_pasteboard_helper_mac.mm ('k') | components/bookmarks/browser/bookmark_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698