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