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

Side by Side Diff: components/sync/base/extensions_activity.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. 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 unified diff | Download patch
« no previous file with comments | « components/sync/base/extensions_activity.h ('k') | components/sync/base/get_session_name.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "sync/util/extensions_activity.h" 5 #include "components/sync/base/extensions_activity.h"
6 6
7 namespace syncer { 7 namespace syncer {
8 8
9 ExtensionsActivity::Record::Record() 9 ExtensionsActivity::Record::Record() : bookmark_write_count(0U) {}
10 : bookmark_write_count(0U) {}
11 10
12 ExtensionsActivity::Record::~Record() {} 11 ExtensionsActivity::Record::~Record() {}
13 12
14 ExtensionsActivity::ExtensionsActivity() {} 13 ExtensionsActivity::ExtensionsActivity() {}
15 14
16 ExtensionsActivity::~ExtensionsActivity() {} 15 ExtensionsActivity::~ExtensionsActivity() {}
17 16
18 void ExtensionsActivity::GetAndClearRecords(Records* buffer) { 17 void ExtensionsActivity::GetAndClearRecords(Records* buffer) {
19 base::AutoLock lock(records_lock_); 18 base::AutoLock lock(records_lock_);
20 buffer->clear(); 19 buffer->clear();
21 buffer->swap(records_); 20 buffer->swap(records_);
22 } 21 }
23 22
24 void ExtensionsActivity::PutRecords(const Records& records) { 23 void ExtensionsActivity::PutRecords(const Records& records) {
25 base::AutoLock lock(records_lock_); 24 base::AutoLock lock(records_lock_);
26 for (Records::const_iterator i = records.begin(); i != records.end(); ++i) { 25 for (Records::const_iterator i = records.begin(); i != records.end(); ++i) {
27 records_[i->first].extension_id = i->second.extension_id; 26 records_[i->first].extension_id = i->second.extension_id;
28 records_[i->first].bookmark_write_count += i->second.bookmark_write_count; 27 records_[i->first].bookmark_write_count += i->second.bookmark_write_count;
29 } 28 }
30 } 29 }
31 30
32 void ExtensionsActivity::UpdateRecord(const std::string& extension_id) { 31 void ExtensionsActivity::UpdateRecord(const std::string& extension_id) {
33 base::AutoLock lock(records_lock_); 32 base::AutoLock lock(records_lock_);
34 Record& record = records_[extension_id]; 33 Record& record = records_[extension_id];
35 record.extension_id = extension_id; 34 record.extension_id = extension_id;
36 record.bookmark_write_count++; 35 record.bookmark_write_count++;
37 } 36 }
38 37
39 } // namespace syncer 38 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/base/extensions_activity.h ('k') | components/sync/base/get_session_name.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698