| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/net/resolve_proxy_msg_helper.h" | 5 #include "chrome/browser/net/resolve_proxy_msg_helper.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "chrome/browser/profile.h" | 8 #include "chrome/browser/profile.h" |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "net/url_request/url_request_context.h" | 10 #include "net/url_request/url_request_context.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 void ResolveProxyMsgHelper::StartPendingRequest() { | 48 void ResolveProxyMsgHelper::StartPendingRequest() { |
| 49 PendingRequest& req = pending_requests_.front(); | 49 PendingRequest& req = pending_requests_.front(); |
| 50 | 50 |
| 51 // Verify the request wasn't started yet. | 51 // Verify the request wasn't started yet. |
| 52 DCHECK(NULL == req.pac_req); | 52 DCHECK(NULL == req.pac_req); |
| 53 DCHECK(NULL == proxy_service_); | 53 DCHECK(NULL == proxy_service_); |
| 54 | 54 |
| 55 // Start the request. | 55 // Start the request. |
| 56 proxy_service_ = GetProxyService(); | 56 proxy_service_ = GetProxyService(); |
| 57 int result = proxy_service_->ResolveProxy( | 57 int result = proxy_service_->ResolveProxy( |
| 58 req.url, &proxy_info_, &callback_, &req.pac_req); | 58 NULL, req.url, &proxy_info_, &callback_, &req.pac_req); |
| 59 | 59 |
| 60 // Completed synchronously. | 60 // Completed synchronously. |
| 61 if (result != net::ERR_IO_PENDING) | 61 if (result != net::ERR_IO_PENDING) |
| 62 OnResolveProxyCompleted(result); | 62 OnResolveProxyCompleted(result); |
| 63 } | 63 } |
| 64 | 64 |
| 65 net::ProxyService* ResolveProxyMsgHelper::GetProxyService() const { | 65 net::ProxyService* ResolveProxyMsgHelper::GetProxyService() const { |
| 66 // Unit-tests specify their own proxy service to use. | 66 // Unit-tests specify their own proxy service to use. |
| 67 if (proxy_service_override_) | 67 if (proxy_service_override_) |
| 68 return proxy_service_override_; | 68 return proxy_service_override_; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 80 | 80 |
| 81 for (PendingRequestList::iterator it = pending_requests_.begin(); | 81 for (PendingRequestList::iterator it = pending_requests_.begin(); |
| 82 it != pending_requests_.end(); | 82 it != pending_requests_.end(); |
| 83 ++it) { | 83 ++it) { |
| 84 delete it->reply_msg; | 84 delete it->reply_msg; |
| 85 } | 85 } |
| 86 | 86 |
| 87 proxy_service_ = NULL; | 87 proxy_service_ = NULL; |
| 88 pending_requests_.clear(); | 88 pending_requests_.clear(); |
| 89 } | 89 } |
| OLD | NEW |