| 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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 // Retry the job if it failed due to a broken proxy, by bypassing the | 533 // Retry the job if it failed due to a broken proxy, by bypassing the |
| 534 // proxy on the next try. Don't retry if this URLFetcher already bypassed | 534 // proxy on the next try. Don't retry if this URLFetcher already bypassed |
| 535 // the proxy. | 535 // the proxy. |
| 536 bool retry = false; | 536 bool retry = false; |
| 537 if ((source->GetLoadFlags() & net::LOAD_BYPASS_PROXY) == 0) { | 537 if ((source->GetLoadFlags() & net::LOAD_BYPASS_PROXY) == 0) { |
| 538 if (!source->GetStatus().is_success() && | 538 if (!source->GetStatus().is_success() && |
| 539 IsProxyError(source->GetStatus())) { | 539 IsProxyError(source->GetStatus())) { |
| 540 LOG(WARNING) << "Proxy failed while contacting dmserver."; | 540 LOG(WARNING) << "Proxy failed while contacting dmserver."; |
| 541 retry = true; | 541 retry = true; |
| 542 } else if (source->GetStatus().is_success() && | 542 } else if (source->GetStatus().is_success() && |
| 543 source->GetResponseCode() == kSuccess && |
| 543 source->WasFetchedViaProxy() && | 544 source->WasFetchedViaProxy() && |
| 544 !IsProtobufMimeType(source)) { | 545 !IsProtobufMimeType(source)) { |
| 545 // The proxy server can be misconfigured but pointing to an existing | 546 // The proxy server can be misconfigured but pointing to an existing |
| 546 // server that replies to requests. Try to recover if a successful | 547 // server that replies to requests. Try to recover if a successful |
| 547 // request that went through a proxy returns an unexpected mime type. | 548 // request that went through a proxy returns an unexpected mime type. |
| 548 LOG(WARNING) << "Got bad mime-type in response from dmserver that was " | 549 LOG(WARNING) << "Got bad mime-type in response from dmserver that was " |
| 549 << "fetched via a proxy."; | 550 << "fetched via a proxy."; |
| 550 retry = true; | 551 retry = true; |
| 551 } | 552 } |
| 552 } | 553 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 581 } | 582 } |
| 582 } | 583 } |
| 583 | 584 |
| 584 const JobQueue::iterator elem = | 585 const JobQueue::iterator elem = |
| 585 std::find(queued_jobs_.begin(), queued_jobs_.end(), job); | 586 std::find(queued_jobs_.begin(), queued_jobs_.end(), job); |
| 586 if (elem != queued_jobs_.end()) | 587 if (elem != queued_jobs_.end()) |
| 587 queued_jobs_.erase(elem); | 588 queued_jobs_.erase(elem); |
| 588 } | 589 } |
| 589 | 590 |
| 590 } // namespace policy | 591 } // namespace policy |
| OLD | NEW |