OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
6 | 6 |
7 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 7 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 info->replace_extension_localization_templates(), response); | 1033 info->replace_extension_localization_templates(), response); |
1034 if (!info->resource_handler()->OnRequestRedirected(info->request_id(), | 1034 if (!info->resource_handler()->OnRequestRedirected(info->request_id(), |
1035 new_url, | 1035 new_url, |
1036 response, defer_redirect)) | 1036 response, defer_redirect)) |
1037 CancelRequestInternal(request, false); | 1037 CancelRequestInternal(request, false); |
1038 } | 1038 } |
1039 | 1039 |
1040 void ResourceDispatcherHost::OnAuthRequired( | 1040 void ResourceDispatcherHost::OnAuthRequired( |
1041 net::URLRequest* request, | 1041 net::URLRequest* request, |
1042 net::AuthChallengeInfo* auth_info) { | 1042 net::AuthChallengeInfo* auth_info) { |
| 1043 if (request->load_flags() & net::LOAD_PREFETCH) { |
| 1044 request->CancelAuth(); |
| 1045 return; |
| 1046 } |
1043 // Create a login dialog on the UI thread to get authentication data, | 1047 // Create a login dialog on the UI thread to get authentication data, |
1044 // or pull from cache and continue on the IO thread. | 1048 // or pull from cache and continue on the IO thread. |
1045 // TODO(mpcomplete): We should block the parent tab while waiting for | 1049 // TODO(mpcomplete): We should block the parent tab while waiting for |
1046 // authentication. | 1050 // authentication. |
1047 // That would also solve the problem of the net::URLRequest being cancelled | 1051 // That would also solve the problem of the net::URLRequest being cancelled |
1048 // before we receive authentication. | 1052 // before we receive authentication. |
1049 ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); | 1053 ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); |
1050 DCHECK(!info->login_handler()) << | 1054 DCHECK(!info->login_handler()) << |
1051 "OnAuthRequired called with login_handler pending"; | 1055 "OnAuthRequired called with login_handler pending"; |
1052 info->set_login_handler(CreateLoginPrompt(auth_info, request)); | 1056 info->set_login_handler(CreateLoginPrompt(auth_info, request)); |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1947 return is_prefetch_enabled_; | 1951 return is_prefetch_enabled_; |
1948 } | 1952 } |
1949 | 1953 |
1950 // static | 1954 // static |
1951 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { | 1955 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { |
1952 is_prefetch_enabled_ = value; | 1956 is_prefetch_enabled_ = value; |
1953 } | 1957 } |
1954 | 1958 |
1955 // static | 1959 // static |
1956 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; | 1960 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; |
OLD | NEW |