| 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/url_request/url_request.h" | 5 #include "net/url_request/url_request.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 headers->RemoveHeader(HttpRequestHeaders::kContentType); | 50 headers->RemoveHeader(HttpRequestHeaders::kContentType); |
| 51 headers->RemoveHeader(HttpRequestHeaders::kOrigin); | 51 headers->RemoveHeader(HttpRequestHeaders::kOrigin); |
| 52 } | 52 } |
| 53 | 53 |
| 54 // TODO(battre): Delete this, see http://crbug.com/89321: | 54 // TODO(battre): Delete this, see http://crbug.com/89321: |
| 55 // This counter keeps track of the identifiers used for URL requests so far. | 55 // This counter keeps track of the identifiers used for URL requests so far. |
| 56 // 0 is reserved to represent an invalid ID. | 56 // 0 is reserved to represent an invalid ID. |
| 57 uint64 g_next_url_request_identifier = 1; | 57 uint64 g_next_url_request_identifier = 1; |
| 58 | 58 |
| 59 // This lock protects g_next_url_request_identifier. | 59 // This lock protects g_next_url_request_identifier. |
| 60 base::LazyInstance<base::Lock, | 60 base::LazyInstance<base::Lock>::Leaky |
| 61 base::LeakyLazyInstanceTraits<base::Lock> > | |
| 62 g_next_url_request_identifier_lock = LAZY_INSTANCE_INITIALIZER; | 61 g_next_url_request_identifier_lock = LAZY_INSTANCE_INITIALIZER; |
| 63 | 62 |
| 64 // Returns an prior unused identifier for URL requests. | 63 // Returns an prior unused identifier for URL requests. |
| 65 uint64 GenerateURLRequestIdentifier() { | 64 uint64 GenerateURLRequestIdentifier() { |
| 66 base::AutoLock lock(g_next_url_request_identifier_lock.Get()); | 65 base::AutoLock lock(g_next_url_request_identifier_lock.Get()); |
| 67 return g_next_url_request_identifier++; | 66 return g_next_url_request_identifier++; |
| 68 } | 67 } |
| 69 | 68 |
| 70 } // namespace | 69 } // namespace |
| 71 | 70 |
| (...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 | 886 |
| 888 void URLRequest::SetUnblockedOnDelegate() { | 887 void URLRequest::SetUnblockedOnDelegate() { |
| 889 if (!blocked_on_delegate_) | 888 if (!blocked_on_delegate_) |
| 890 return; | 889 return; |
| 891 blocked_on_delegate_ = false; | 890 blocked_on_delegate_ = false; |
| 892 load_state_param_.clear(); | 891 load_state_param_.clear(); |
| 893 net_log_.EndEvent(NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE, NULL); | 892 net_log_.EndEvent(NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE, NULL); |
| 894 } | 893 } |
| 895 | 894 |
| 896 } // namespace net | 895 } // namespace net |
| OLD | NEW |