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 "content/renderer/npapi/webplugin_impl.h" | 5 #include "content/renderer/npapi/webplugin_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/crash_logging.h" | 9 #include "base/debug/crash_logging.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 loader->cancel(); | 935 loader->cancel(); |
936 client_info->client->DidFail(client_info->id); | 936 client_info->client->DidFail(client_info->id); |
937 return; | 937 return; |
938 } | 938 } |
939 if (net::HttpResponseHeaders::IsRedirectResponseCode( | 939 if (net::HttpResponseHeaders::IsRedirectResponseCode( |
940 response.httpStatusCode())) { | 940 response.httpStatusCode())) { |
941 // If the plugin does not participate in url redirect notifications then | 941 // If the plugin does not participate in url redirect notifications then |
942 // just block cross origin 307 POST redirects. | 942 // just block cross origin 307 POST redirects. |
943 if (!client_info->notify_redirects) { | 943 if (!client_info->notify_redirects) { |
944 if (response.httpStatusCode() == 307 && | 944 if (response.httpStatusCode() == 307 && |
945 LowerCaseEqualsASCII(request.httpMethod().utf8(), "post")) { | 945 base::LowerCaseEqualsASCII(request.httpMethod().utf8(), "post")) { |
946 GURL original_request_url(response.url()); | 946 GURL original_request_url(response.url()); |
947 GURL response_url(request.url()); | 947 GURL response_url(request.url()); |
948 if (original_request_url.GetOrigin() != response_url.GetOrigin()) { | 948 if (original_request_url.GetOrigin() != response_url.GetOrigin()) { |
949 loader->setDefersLoading(true); | 949 loader->setDefersLoading(true); |
950 loader->cancel(); | 950 loader->cancel(); |
951 client_info->client->DidFail(client_info->id); | 951 client_info->client->DidFail(client_info->id); |
952 return; | 952 return; |
953 } | 953 } |
954 } | 954 } |
955 } else { | 955 } else { |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1541 case PLUGIN_SRC: | 1541 case PLUGIN_SRC: |
1542 webframe_->setReferrerForRequest(*request, plugin_url_); | 1542 webframe_->setReferrerForRequest(*request, plugin_url_); |
1543 break; | 1543 break; |
1544 | 1544 |
1545 default: | 1545 default: |
1546 break; | 1546 break; |
1547 } | 1547 } |
1548 } | 1548 } |
1549 | 1549 |
1550 } // namespace content | 1550 } // namespace content |
OLD | NEW |