| OLD | NEW |
| 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 "chrome/browser/ui/webui/sync_file_system_internals/sync_file_system_in
ternals_handler.h" | 5 #include "chrome/browser/ui/webui/sync_file_system_internals/sync_file_system_in
ternals_handler.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 void SyncFileSystemInternalsHandler::OnLogRecorded( | 100 void SyncFileSystemInternalsHandler::OnLogRecorded( |
| 101 const sync_file_system::TaskLogger::TaskLog& task_log) { | 101 const sync_file_system::TaskLogger::TaskLog& task_log) { |
| 102 base::DictionaryValue dict; | 102 base::DictionaryValue dict; |
| 103 int64_t duration = (task_log.end_time - task_log.start_time).InMilliseconds(); | 103 int64_t duration = (task_log.end_time - task_log.start_time).InMilliseconds(); |
| 104 dict.SetInteger("duration", duration); | 104 dict.SetInteger("duration", duration); |
| 105 dict.SetString("task_description", task_log.task_description); | 105 dict.SetString("task_description", task_log.task_description); |
| 106 dict.SetString("result_description", task_log.result_description); | 106 dict.SetString("result_description", task_log.result_description); |
| 107 | 107 |
| 108 std::unique_ptr<base::ListValue> details(new base::ListValue); | 108 std::unique_ptr<base::ListValue> details(new base::ListValue); |
| 109 details->AppendStrings(task_log.details); | 109 details->AppendStrings(task_log.details); |
| 110 dict.Set("details", std::move(details)); | 110 dict.Set("details", details.release()); |
| 111 web_ui()->CallJavascriptFunctionUnsafe("TaskLog.onTaskLogRecorded", dict); | 111 web_ui()->CallJavascriptFunctionUnsafe("TaskLog.onTaskLogRecorded", dict); |
| 112 } | 112 } |
| 113 | 113 |
| 114 void SyncFileSystemInternalsHandler::GetServiceStatus( | 114 void SyncFileSystemInternalsHandler::GetServiceStatus( |
| 115 const base::ListValue* args) { | 115 const base::ListValue* args) { |
| 116 SyncServiceState state_enum = sync_file_system::SYNC_SERVICE_DISABLED; | 116 SyncServiceState state_enum = sync_file_system::SYNC_SERVICE_DISABLED; |
| 117 sync_file_system::SyncFileSystemService* sync_service = | 117 sync_file_system::SyncFileSystemService* sync_service = |
| 118 SyncFileSystemServiceFactory::GetForProfile(profile_); | 118 SyncFileSystemServiceFactory::GetForProfile(profile_); |
| 119 if (sync_service) | 119 if (sync_service) |
| 120 state_enum = sync_service->GetSyncServiceState(); | 120 state_enum = sync_service->GetSyncServiceState(); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 DCHECK(sync_service->task_logger()); | 185 DCHECK(sync_service->task_logger()); |
| 186 const sync_file_system::TaskLogger::LogList& log = | 186 const sync_file_system::TaskLogger::LogList& log = |
| 187 sync_service->task_logger()->GetLog(); | 187 sync_service->task_logger()->GetLog(); |
| 188 | 188 |
| 189 for (sync_file_system::TaskLogger::LogList::const_iterator itr = log.begin(); | 189 for (sync_file_system::TaskLogger::LogList::const_iterator itr = log.begin(); |
| 190 itr != log.end(); ++itr) | 190 itr != log.end(); ++itr) |
| 191 OnLogRecorded(**itr); | 191 OnLogRecorded(**itr); |
| 192 } | 192 } |
| 193 | 193 |
| 194 } // namespace syncfs_internals | 194 } // namespace syncfs_internals |
| OLD | NEW |