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 "net/proxy/proxy_script_fetcher_impl.h" | 5 #include "net/proxy/proxy_script_fetcher_impl.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/i18n/icu_string_conversions.h" | 8 #include "base/i18n/icu_string_conversions.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 } | 70 } |
71 | 71 |
72 } // namespace | 72 } // namespace |
73 | 73 |
74 ProxyScriptFetcherImpl::ProxyScriptFetcherImpl( | 74 ProxyScriptFetcherImpl::ProxyScriptFetcherImpl( |
75 URLRequestContext* url_request_context) | 75 URLRequestContext* url_request_context) |
76 : weak_factory_(this), | 76 : weak_factory_(this), |
77 url_request_context_(url_request_context), | 77 url_request_context_(url_request_context), |
78 buf_(new IOBuffer(kBufSize)), | 78 buf_(new IOBuffer(kBufSize)), |
79 next_id_(0), | 79 next_id_(0), |
80 cur_request_(NULL), | |
81 cur_request_id_(0), | 80 cur_request_id_(0), |
82 result_code_(OK), | 81 result_code_(OK), |
83 result_text_(NULL), | 82 result_text_(NULL), |
84 max_response_bytes_(kDefaultMaxResponseBytes), | 83 max_response_bytes_(kDefaultMaxResponseBytes), |
85 max_duration_(base::TimeDelta::FromMilliseconds(kDefaultMaxDurationMs)) { | 84 max_duration_(base::TimeDelta::FromMilliseconds(kDefaultMaxDurationMs)) { |
86 DCHECK(url_request_context); | 85 DCHECK(url_request_context); |
87 } | 86 } |
88 | 87 |
89 ProxyScriptFetcherImpl::~ProxyScriptFetcherImpl() { | 88 ProxyScriptFetcherImpl::~ProxyScriptFetcherImpl() { |
90 // The URLRequest's destructor will cancel the outstanding request, and | 89 // The URLRequest's destructor will cancel the outstanding request, and |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 // is still applicable. | 312 // is still applicable. |
314 if (cur_request_id_ != id) | 313 if (cur_request_id_ != id) |
315 return; | 314 return; |
316 | 315 |
317 DCHECK(cur_request_.get()); | 316 DCHECK(cur_request_.get()); |
318 result_code_ = ERR_TIMED_OUT; | 317 result_code_ = ERR_TIMED_OUT; |
319 cur_request_->Cancel(); | 318 cur_request_->Cancel(); |
320 } | 319 } |
321 | 320 |
322 } // namespace net | 321 } // namespace net |
OLD | NEW |