| 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/base/network_delegate.h" | 5 #include "net/base/network_delegate.h" |
| 6 | 6 |
| 7 #include "base/trace_event/trace_event.h" |
| 7 #include "base/logging.h" | 8 #include "base/logging.h" |
| 8 #include "base/profiler/scoped_tracker.h" | 9 #include "base/profiler/scoped_tracker.h" |
| 9 #include "net/base/load_flags.h" | 10 #include "net/base/load_flags.h" |
| 10 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
| 11 #include "net/proxy/proxy_info.h" | 12 #include "net/proxy/proxy_info.h" |
| 12 #include "net/url_request/url_request.h" | 13 #include "net/url_request/url_request.h" |
| 13 | 14 |
| 14 namespace net { | 15 namespace net { |
| 15 | 16 |
| 16 int NetworkDelegate::NotifyBeforeURLRequest( | 17 int NetworkDelegate::NotifyBeforeURLRequest( |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 URLRequest* request, | 119 URLRequest* request, |
| 119 const AuthChallengeInfo& auth_info, | 120 const AuthChallengeInfo& auth_info, |
| 120 const AuthCallback& callback, | 121 const AuthCallback& callback, |
| 121 AuthCredentials* credentials) { | 122 AuthCredentials* credentials) { |
| 122 DCHECK(CalledOnValidThread()); | 123 DCHECK(CalledOnValidThread()); |
| 123 return OnAuthRequired(request, auth_info, callback, credentials); | 124 return OnAuthRequired(request, auth_info, callback, credentials); |
| 124 } | 125 } |
| 125 | 126 |
| 126 bool NetworkDelegate::CanGetCookies(const URLRequest& request, | 127 bool NetworkDelegate::CanGetCookies(const URLRequest& request, |
| 127 const CookieList& cookie_list) { | 128 const CookieList& cookie_list) { |
| 129 TRACE_EVENT0("toplevel", "NetworkDelegate::CanGetCookies"); |
| 128 DCHECK(CalledOnValidThread()); | 130 DCHECK(CalledOnValidThread()); |
| 129 DCHECK(!(request.load_flags() & LOAD_DO_NOT_SEND_COOKIES)); | 131 DCHECK(!(request.load_flags() & LOAD_DO_NOT_SEND_COOKIES)); |
| 130 return OnCanGetCookies(request, cookie_list); | 132 return OnCanGetCookies(request, cookie_list); |
| 131 } | 133 } |
| 132 | 134 |
| 133 bool NetworkDelegate::CanSetCookie(const URLRequest& request, | 135 bool NetworkDelegate::CanSetCookie(const URLRequest& request, |
| 134 const std::string& cookie_line, | 136 const std::string& cookie_line, |
| 135 CookieOptions* options) { | 137 CookieOptions* options) { |
| 136 DCHECK(CalledOnValidThread()); | 138 DCHECK(CalledOnValidThread()); |
| 137 DCHECK(!(request.load_flags() & LOAD_DO_NOT_SAVE_COOKIES)); | 139 DCHECK(!(request.load_flags() & LOAD_DO_NOT_SAVE_COOKIES)); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 162 bool NetworkDelegate::CancelURLRequestWithPolicyViolatingReferrerHeader( | 164 bool NetworkDelegate::CancelURLRequestWithPolicyViolatingReferrerHeader( |
| 163 const URLRequest& request, | 165 const URLRequest& request, |
| 164 const GURL& target_url, | 166 const GURL& target_url, |
| 165 const GURL& referrer_url) const { | 167 const GURL& referrer_url) const { |
| 166 DCHECK(CalledOnValidThread()); | 168 DCHECK(CalledOnValidThread()); |
| 167 return OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 169 return OnCancelURLRequestWithPolicyViolatingReferrerHeader( |
| 168 request, target_url, referrer_url); | 170 request, target_url, referrer_url); |
| 169 } | 171 } |
| 170 | 172 |
| 171 } // namespace net | 173 } // namespace net |
| OLD | NEW |