| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "sync/syncable/syncable_base_transaction.h" | 5 #include "sync/syncable/syncable_base_transaction.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "sync/syncable/directory.h" | 8 #include "sync/syncable/directory.h" |
| 9 | 9 |
| 10 namespace syncer { | 10 namespace syncer { |
| 11 namespace syncable { | 11 namespace syncable { |
| 12 | 12 |
| 13 Directory* BaseTransaction::directory() const { |
| 14 return directory_; |
| 15 } |
| 16 |
| 17 Id BaseTransaction::root_id() const { |
| 18 return Id(); |
| 19 } |
| 20 |
| 13 void BaseTransaction::Lock() { | 21 void BaseTransaction::Lock() { |
| 14 TRACE_EVENT2("sync_lock_contention", "AcquireLock", | 22 TRACE_EVENT2("sync_lock_contention", "AcquireLock", |
| 15 "src_file", from_here_.file_name(), | 23 "src_file", from_here_.file_name(), |
| 16 "src_func", from_here_.function_name()); | 24 "src_func", from_here_.function_name()); |
| 17 | 25 |
| 18 directory_->kernel_->transaction_mutex.Acquire(); | 26 directory_->kernel_->transaction_mutex.Acquire(); |
| 19 } | 27 } |
| 20 | 28 |
| 21 void BaseTransaction::Unlock() { | 29 void BaseTransaction::Unlock() { |
| 22 directory_->kernel_->transaction_mutex.Release(); | 30 directory_->kernel_->transaction_mutex.Release(); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 "src_file", from_here_.file_name(), | 69 "src_file", from_here_.file_name(), |
| 62 "src_func", from_here_.function_name()); | 70 "src_func", from_here_.function_name()); |
| 63 } | 71 } |
| 64 | 72 |
| 65 BaseTransaction::~BaseTransaction() { | 73 BaseTransaction::~BaseTransaction() { |
| 66 TRACE_EVENT_END0("sync", name_); | 74 TRACE_EVENT_END0("sync", name_); |
| 67 } | 75 } |
| 68 | 76 |
| 69 } // namespace syncable | 77 } // namespace syncable |
| 70 } // namespace syncer | 78 } // namespace syncer |
| OLD | NEW |