| 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 os_version.c_str()); | 179 os_version.c_str()); |
| 180 return platform; | 180 return platform; |
| 181 } | 181 } |
| 182 | 182 |
| 183 // Custom request context implementation that allows to override the user agent, | 183 // Custom request context implementation that allows to override the user agent, |
| 184 // amongst others. Wraps a baseline request context from which we reuse the | 184 // amongst others. Wraps a baseline request context from which we reuse the |
| 185 // networking components. | 185 // networking components. |
| 186 class DeviceManagementRequestContext : public net::URLRequestContext { | 186 class DeviceManagementRequestContext : public net::URLRequestContext { |
| 187 public: | 187 public: |
| 188 explicit DeviceManagementRequestContext(net::URLRequestContext* base_context); | 188 explicit DeviceManagementRequestContext(net::URLRequestContext* base_context); |
| 189 |
| 190 private: |
| 189 virtual ~DeviceManagementRequestContext(); | 191 virtual ~DeviceManagementRequestContext(); |
| 190 | 192 |
| 191 private: | |
| 192 // Overridden from net::URLRequestContext: | 193 // Overridden from net::URLRequestContext: |
| 193 virtual const std::string& GetUserAgent(const GURL& url) const OVERRIDE; | 194 virtual const std::string& GetUserAgent(const GURL& url) const OVERRIDE; |
| 194 }; | 195 }; |
| 195 | 196 |
| 196 DeviceManagementRequestContext::DeviceManagementRequestContext( | 197 DeviceManagementRequestContext::DeviceManagementRequestContext( |
| 197 net::URLRequestContext* base_context) { | 198 net::URLRequestContext* base_context) { |
| 198 // Share resolver, proxy service and ssl bits with the baseline context. This | 199 // Share resolver, proxy service and ssl bits with the baseline context. This |
| 199 // is important so we don't make redundant requests (e.g. when resolving proxy | 200 // is important so we don't make redundant requests (e.g. when resolving proxy |
| 200 // auto configuration). | 201 // auto configuration). |
| 201 set_net_log(base_context->net_log()); | 202 set_net_log(base_context->net_log()); |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 } | 586 } |
| 586 } | 587 } |
| 587 | 588 |
| 588 const JobQueue::iterator elem = | 589 const JobQueue::iterator elem = |
| 589 std::find(queued_jobs_.begin(), queued_jobs_.end(), job); | 590 std::find(queued_jobs_.begin(), queued_jobs_.end(), job); |
| 590 if (elem != queued_jobs_.end()) | 591 if (elem != queued_jobs_.end()) |
| 591 queued_jobs_.erase(elem); | 592 queued_jobs_.erase(elem); |
| 592 } | 593 } |
| 593 | 594 |
| 594 } // namespace policy | 595 } // namespace policy |
| OLD | NEW |