OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/policy/device_management_service.h" | 5 #include "chrome/browser/policy/device_management_service.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 void DeviceManagementRequestJobImpl::Run() { | 307 void DeviceManagementRequestJobImpl::Run() { |
308 service_->AddJob(this); | 308 service_->AddJob(this); |
309 } | 309 } |
310 | 310 |
311 void DeviceManagementRequestJobImpl::HandleResponse( | 311 void DeviceManagementRequestJobImpl::HandleResponse( |
312 const net::URLRequestStatus& status, | 312 const net::URLRequestStatus& status, |
313 int response_code, | 313 int response_code, |
314 const net::ResponseCookies& cookies, | 314 const net::ResponseCookies& cookies, |
315 const std::string& data) { | 315 const std::string& data) { |
316 if (status.status() != net::URLRequestStatus::SUCCESS) { | 316 if (status.status() != net::URLRequestStatus::SUCCESS) { |
| 317 LOG(WARNING) << "DMServer request failed, status: " << status.status() |
| 318 << ", error: " << status.error(); |
317 ReportError(DM_STATUS_REQUEST_FAILED); | 319 ReportError(DM_STATUS_REQUEST_FAILED); |
318 return; | 320 return; |
319 } | 321 } |
320 | 322 |
321 switch (response_code) { | 323 switch (response_code) { |
322 case kSuccess: { | 324 case kSuccess: { |
323 em::DeviceManagementResponse response; | 325 em::DeviceManagementResponse response; |
324 if (!response.ParseFromString(data)) { | 326 if (!response.ParseFromString(data)) { |
325 ReportError(DM_STATUS_RESPONSE_DECODING_ERROR); | 327 ReportError(DM_STATUS_RESPONSE_DECODING_ERROR); |
326 return; | 328 return; |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 } | 584 } |
583 } | 585 } |
584 | 586 |
585 const JobQueue::iterator elem = | 587 const JobQueue::iterator elem = |
586 std::find(queued_jobs_.begin(), queued_jobs_.end(), job); | 588 std::find(queued_jobs_.begin(), queued_jobs_.end(), job); |
587 if (elem != queued_jobs_.end()) | 589 if (elem != queued_jobs_.end()) |
588 queued_jobs_.erase(elem); | 590 queued_jobs_.erase(elem); |
589 } | 591 } |
590 | 592 |
591 } // namespace policy | 593 } // namespace policy |
OLD | NEW |