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_browser_context.h" | 7 #include "android_webview/browser/aw_browser_context.h" |
8 #include "android_webview/browser/aw_contents_io_thread_client.h" | 8 #include "android_webview/browser/aw_contents_io_thread_client.h" |
9 #include "android_webview/browser/aw_cookie_access_policy.h" | 9 #include "android_webview/browser/aw_cookie_access_policy.h" |
10 #include "base/android/build_info.h" | 10 #include "base/android/build_info.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 net::URLRequest* request, | 62 net::URLRequest* request, |
63 const net::CompletionCallback& callback, | 63 const net::CompletionCallback& callback, |
64 const net::HttpResponseHeaders* original_response_headers, | 64 const net::HttpResponseHeaders* original_response_headers, |
65 scoped_refptr<net::HttpResponseHeaders>* override_response_headers, | 65 scoped_refptr<net::HttpResponseHeaders>* override_response_headers, |
66 GURL* allowed_unsafe_redirect_url) { | 66 GURL* allowed_unsafe_redirect_url) { |
67 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 67 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
68 int render_process_id, render_frame_id; | 68 int render_process_id, render_frame_id; |
69 if (original_response_headers->response_code() >= 400 && | 69 if (original_response_headers->response_code() >= 400 && |
70 content::ResourceRequestInfo::GetRenderFrameForRequest( | 70 content::ResourceRequestInfo::GetRenderFrameForRequest( |
71 request, &render_process_id, &render_frame_id)) { | 71 request, &render_process_id, &render_frame_id)) { |
72 scoped_ptr<AwContentsIoThreadClient> io_thread_client = | 72 std::unique_ptr<AwContentsIoThreadClient> io_thread_client = |
73 AwContentsIoThreadClient::FromID(render_process_id, render_frame_id); | 73 AwContentsIoThreadClient::FromID(render_process_id, render_frame_id); |
74 if (io_thread_client.get()) { | 74 if (io_thread_client.get()) { |
75 io_thread_client->OnReceivedHttpError(request, original_response_headers); | 75 io_thread_client->OnReceivedHttpError(request, original_response_headers); |
76 } | 76 } |
77 } | 77 } |
78 return net::OK; | 78 return net::OK; |
79 } | 79 } |
80 | 80 |
81 void AwNetworkDelegate::OnBeforeRedirect(net::URLRequest* request, | 81 void AwNetworkDelegate::OnBeforeRedirect(net::URLRequest* request, |
82 const GURL& new_location) { | 82 const GURL& new_location) { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 cookie_line, | 116 cookie_line, |
117 options); | 117 options); |
118 } | 118 } |
119 | 119 |
120 bool AwNetworkDelegate::OnCanAccessFile(const net::URLRequest& request, | 120 bool AwNetworkDelegate::OnCanAccessFile(const net::URLRequest& request, |
121 const base::FilePath& path) const { | 121 const base::FilePath& path) const { |
122 return true; | 122 return true; |
123 } | 123 } |
124 | 124 |
125 } // namespace android_webview | 125 } // namespace android_webview |
OLD | NEW |