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

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

Issue 2920223002: Add additional histograms with suffixes to ImportantFileWriter. (Closed)
Patch Set: Minor fix of std::string::append. Created 3 years, 6 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
« no previous file with comments | « base/files/important_file_writer_unittest.cc ('k') | components/feedback/feedback_report.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 // BookmarkStorage ------------------------------------------------------------- 147 // BookmarkStorage -------------------------------------------------------------
148 148
149 BookmarkStorage::BookmarkStorage( 149 BookmarkStorage::BookmarkStorage(
150 BookmarkModel* model, 150 BookmarkModel* model,
151 const base::FilePath& profile_path, 151 const base::FilePath& profile_path,
152 base::SequencedTaskRunner* sequenced_task_runner) 152 base::SequencedTaskRunner* sequenced_task_runner)
153 : model_(model), 153 : model_(model),
154 writer_(profile_path.Append(kBookmarksFileName), 154 writer_(profile_path.Append(kBookmarksFileName),
155 sequenced_task_runner, 155 sequenced_task_runner,
156 base::TimeDelta::FromMilliseconds(kSaveDelayMS)), 156 base::TimeDelta::FromMilliseconds(kSaveDelayMS),
157 "BookmarkStorage"),
157 sequenced_task_runner_(sequenced_task_runner), 158 sequenced_task_runner_(sequenced_task_runner),
158 weak_factory_(this) { 159 weak_factory_(this) {}
159 }
160 160
161 BookmarkStorage::~BookmarkStorage() { 161 BookmarkStorage::~BookmarkStorage() {
162 if (writer_.HasPendingWrite()) 162 if (writer_.HasPendingWrite())
163 writer_.DoScheduledWrite(); 163 writer_.DoScheduledWrite();
164 } 164 }
165 165
166 void BookmarkStorage::LoadBookmarks( 166 void BookmarkStorage::LoadBookmarks(
167 std::unique_ptr<BookmarkLoadDetails> details, 167 std::unique_ptr<BookmarkLoadDetails> details,
168 const scoped_refptr<base::SequencedTaskRunner>& task_runner) { 168 const scoped_refptr<base::SequencedTaskRunner>& task_runner) {
169 sequenced_task_runner_->PostTask( 169 sequenced_task_runner_->PostTask(
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 } 229 }
230 230
231 std::unique_ptr<std::string> data(new std::string); 231 std::unique_ptr<std::string> data(new std::string);
232 if (!SerializeData(data.get())) 232 if (!SerializeData(data.get()))
233 return false; 233 return false;
234 writer_.WriteNow(std::move(data)); 234 writer_.WriteNow(std::move(data));
235 return true; 235 return true;
236 } 236 }
237 237
238 } // namespace bookmarks 238 } // namespace bookmarks
OLDNEW
« no previous file with comments | « base/files/important_file_writer_unittest.cc ('k') | components/feedback/feedback_report.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698