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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/sync_task_token.cc

Issue 298003003: [SyncFS] Wire TaskLogger to SyncTaskToken and SyncTaskManager (1/3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 6 years, 7 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 | Annotate | Revision Log
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 "chrome/browser/sync_file_system/drive_backend/sync_task_token.h" 5 #include "chrome/browser/sync_file_system/drive_backend/sync_task_token.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/sync_file_system/drive_backend/sync_task_manager.h" 8 #include "chrome/browser/sync_file_system/drive_backend/sync_task_manager.h"
9 #include "chrome/browser/sync_file_system/drive_backend/task_dependency_manager. h" 9 #include "chrome/browser/sync_file_system/drive_backend/task_dependency_manager. h"
10 10
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 } 86 }
87 87
88 const BlockingFactor* SyncTaskToken::blocking_factor() const { 88 const BlockingFactor* SyncTaskToken::blocking_factor() const {
89 return blocking_factor_.get(); 89 return blocking_factor_.get();
90 } 90 }
91 91
92 void SyncTaskToken::clear_blocking_factor() { 92 void SyncTaskToken::clear_blocking_factor() {
93 blocking_factor_.reset(); 93 blocking_factor_.reset();
94 } 94 }
95 95
96 void SyncTaskToken::InitializeTaskLog(const std::string& task_description) {
97 DCHECK(task_log_);
98 task_log_->start_time = base::TimeTicks::Now();
99 task_log_->task_description = task_description;
100 }
101
102 void SyncTaskToken::FinalizeTaskLog(const std::string& result_description) {
103 DCHECK(task_log_);
104 task_log_->result_description = result_description;
105 task_log_->end_time = base::TimeTicks::Now();
106 }
107
108 void SyncTaskToken::RecordLog(const std::string& message) {
109 DCHECK(task_log_);
110 task_log_->details.push_back(message);
111 }
112
113 void SyncTaskToken::SetTaskLog(scoped_ptr<TaskLogger::TaskLog> task_log) {
114 task_log_ = task_log.Pass();
115 }
116
117 scoped_ptr<TaskLogger::TaskLog> SyncTaskToken::PassTaskLog() {
118 return task_log_.Pass();
119 }
120
96 SyncTaskToken::SyncTaskToken(const base::WeakPtr<SyncTaskManager>& manager, 121 SyncTaskToken::SyncTaskToken(const base::WeakPtr<SyncTaskManager>& manager,
97 int64 token_id, 122 int64 token_id,
98 scoped_ptr<BlockingFactor> blocking_factor, 123 scoped_ptr<BlockingFactor> blocking_factor,
99 const SyncStatusCallback& callback) 124 const SyncStatusCallback& callback)
100 : manager_(manager), 125 : manager_(manager),
101 token_id_(token_id), 126 token_id_(token_id),
102 callback_(callback), 127 callback_(callback),
103 blocking_factor_(blocking_factor.Pass()) { 128 blocking_factor_(blocking_factor.Pass()) {
104 } 129 }
105 130
106 } // namespace drive_backend 131 } // namespace drive_backend
107 } // namespace sync_file_system 132 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « chrome/browser/sync_file_system/drive_backend/sync_task_token.h ('k') | chrome/browser/sync_file_system/task_logger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698