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

Unified Diff: components/policy/core/common/remote_commands/remote_command_job.cc

Issue 1923943003: Add logging to remote commands (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused include Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: components/policy/core/common/remote_commands/remote_command_job.cc
diff --git a/components/policy/core/common/remote_commands/remote_command_job.cc b/components/policy/core/common/remote_commands/remote_command_job.cc
index fb7caacebea062d8e59863335e5520c9626f61e5..211c4270743d241c648290752697b5434bb11602 100644
--- a/components/policy/core/common/remote_commands/remote_command_job.cc
+++ b/components/policy/core/common/remote_commands/remote_command_job.cc
@@ -57,6 +57,22 @@ bool RemoteCommandJob::Init(base::TimeTicks now,
if (!ParseCommandPayload(command.payload()))
return false;
+ switch (command.type()) {
+ case em::RemoteCommand_Type_COMMAND_ECHO_TEST: {
+ LOG(WARNING) << "Remote echo test command " << unique_id_
+ << " initialized.";
+ break;
+ }
+ case em::RemoteCommand_Type_DEVICE_REBOOT: {
+ LOG(WARNING) << "Remote reboot command " << unique_id_ << " initialized.";
+ break;
+ }
+ case em::RemoteCommand_Type_DEVICE_SCREENSHOT: {
+ LOG(WARNING) << "Remote screenshot command " << unique_id_
+ << " initialized.";
+ break;
+ }
+ }
status_ = NOT_STARTED;
return true;
}
@@ -65,12 +81,15 @@ bool RemoteCommandJob::Run(base::TimeTicks now,
const FinishedCallback& finished_callback) {
DCHECK(thread_checker_.CalledOnValidThread());
- if (status_ == INVALID)
+ if (status_ == INVALID) {
+ LOG(ERROR) << "Remote command " << unique_id_ << " is invalid.";
return false;
+ }
DCHECK_EQ(NOT_STARTED, status_);
if (IsExpired(now)) {
+ LOG(ERROR) << "Remote command " << unique_id_ << " expired.";
Andrew T Wilson (Slow) 2016/05/04 14:43:23 Maybe also print issued_time() and the current tim
Marton Hunyady 2016/05/09 13:48:15 Done, I'm logging the estimated age of the command
status_ = EXPIRED;
return false;
}

Powered by Google App Engine
This is Rietveld 408576698