OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/sync/test/fake_extensions_activity_monitor.h" | |
6 | |
7 #include "base/logging.h" | |
8 | |
9 namespace browser_sync { | |
10 | |
11 FakeExtensionsActivityMonitor::FakeExtensionsActivityMonitor() {} | |
12 | |
13 FakeExtensionsActivityMonitor::~FakeExtensionsActivityMonitor() { | |
14 DCHECK(non_thread_safe_.CalledOnValidThread()); | |
15 } | |
16 | |
17 void FakeExtensionsActivityMonitor::GetAndClearRecords(Records* buffer) { | |
18 DCHECK(non_thread_safe_.CalledOnValidThread()); | |
19 buffer->clear(); | |
20 buffer->swap(records_); | |
21 } | |
22 | |
23 void FakeExtensionsActivityMonitor::PutRecords(const Records& records) { | |
24 DCHECK(non_thread_safe_.CalledOnValidThread()); | |
25 for (Records::const_iterator i = records.begin(); i != records.end(); ++i) { | |
26 records_[i->first].extension_id = i->second.extension_id; | |
27 records_[i->first].bookmark_write_count += i->second.bookmark_write_count; | |
28 } | |
29 } | |
30 | |
31 } // namespace browser_sync | |
OLD | NEW |