OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/chromeos/policy/upload_job_impl.h" | 5 #include "chrome/browser/chromeos/policy/upload_job_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 } | 173 } |
174 | 174 |
175 void UploadJobImpl::Start() { | 175 void UploadJobImpl::Start() { |
176 DCHECK(thread_checker_.CalledOnValidThread()); | 176 DCHECK(thread_checker_.CalledOnValidThread()); |
177 // Cannot start an upload on a busy or failed instance. | 177 // Cannot start an upload on a busy or failed instance. |
178 DCHECK_EQ(IDLE, state_); | 178 DCHECK_EQ(IDLE, state_); |
179 if (state_ != IDLE) | 179 if (state_ != IDLE) |
180 return; | 180 return; |
181 DCHECK_EQ(0, retry_); | 181 DCHECK_EQ(0, retry_); |
182 | 182 |
| 183 LOG(WARNING) << "Upload job started"; |
183 RequestAccessToken(); | 184 RequestAccessToken(); |
184 } | 185 } |
185 | 186 |
186 // static | 187 // static |
187 void UploadJobImpl::SetRetryDelayForTesting(long retry_delay_ms) { | 188 void UploadJobImpl::SetRetryDelayForTesting(long retry_delay_ms) { |
188 CHECK_GE(retry_delay_ms, 0); | 189 CHECK_GE(retry_delay_ms, 0); |
189 g_retry_delay_ms = retry_delay_ms; | 190 g_retry_delay_ms = retry_delay_ms; |
190 } | 191 } |
191 | 192 |
192 void UploadJobImpl::RequestAccessToken() { | 193 void UploadJobImpl::RequestAccessToken() { |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 HandleError(AUTHENTICATION_ERROR); | 379 HandleError(AUTHENTICATION_ERROR); |
379 } else { | 380 } else { |
380 LOG(ERROR) << "POST request failed with HTTP status code " | 381 LOG(ERROR) << "POST request failed with HTTP status code " |
381 << response_code << "."; | 382 << response_code << "."; |
382 HandleError(SERVER_ERROR); | 383 HandleError(SERVER_ERROR); |
383 } | 384 } |
384 } | 385 } |
385 } | 386 } |
386 | 387 |
387 } // namespace policy | 388 } // namespace policy |
OLD | NEW |