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 "android_webview/browser/net/aw_network_delegate.h" | 5 #include "android_webview/browser/net/aw_network_delegate.h" |
6 | 6 |
7 #include "android_webview/browser/aw_contents_io_thread_client.h" | 7 #include "android_webview/browser/aw_contents_io_thread_client.h" |
8 #include "android_webview/browser/aw_cookie_access_policy.h" | 8 #include "android_webview/browser/aw_cookie_access_policy.h" |
9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 void AwNetworkDelegate::OnSendHeaders(net::URLRequest* request, | 48 void AwNetworkDelegate::OnSendHeaders(net::URLRequest* request, |
49 const net::HttpRequestHeaders& headers) { | 49 const net::HttpRequestHeaders& headers) { |
50 } | 50 } |
51 | 51 |
52 int AwNetworkDelegate::OnHeadersReceived( | 52 int AwNetworkDelegate::OnHeadersReceived( |
53 net::URLRequest* request, | 53 net::URLRequest* request, |
54 const net::CompletionCallback& callback, | 54 const net::CompletionCallback& callback, |
55 const net::HttpResponseHeaders* original_response_headers, | 55 const net::HttpResponseHeaders* original_response_headers, |
56 scoped_refptr<net::HttpResponseHeaders>* override_response_headers, | 56 scoped_refptr<net::HttpResponseHeaders>* override_response_headers, |
57 GURL* allowed_unsafe_redirect_url) { | 57 GURL* allowed_unsafe_redirect_url) { |
58 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 58 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
59 int render_process_id, render_frame_id; | 59 int render_process_id, render_frame_id; |
60 if (original_response_headers->response_code() >= 400 && | 60 if (original_response_headers->response_code() >= 400 && |
61 content::ResourceRequestInfo::GetRenderFrameForRequest( | 61 content::ResourceRequestInfo::GetRenderFrameForRequest( |
62 request, &render_process_id, &render_frame_id)) { | 62 request, &render_process_id, &render_frame_id)) { |
63 scoped_ptr<AwContentsIoThreadClient> io_thread_client = | 63 scoped_ptr<AwContentsIoThreadClient> io_thread_client = |
64 AwContentsIoThreadClient::FromID(render_process_id, render_frame_id); | 64 AwContentsIoThreadClient::FromID(render_process_id, render_frame_id); |
65 if (io_thread_client.get()) { | 65 if (io_thread_client.get()) { |
66 io_thread_client->OnReceivedHttpError(request, original_response_headers); | 66 io_thread_client->OnReceivedHttpError(request, original_response_headers); |
67 } | 67 } |
68 } | 68 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 const base::FilePath& path) const { | 116 const base::FilePath& path) const { |
117 return true; | 117 return true; |
118 } | 118 } |
119 | 119 |
120 bool AwNetworkDelegate::OnCanThrottleRequest( | 120 bool AwNetworkDelegate::OnCanThrottleRequest( |
121 const net::URLRequest& request) const { | 121 const net::URLRequest& request) const { |
122 return false; | 122 return false; |
123 } | 123 } |
124 | 124 |
125 } // namespace android_webview | 125 } // namespace android_webview |
OLD | NEW |