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/logging.h" | 10 #include "base/logging.h" |
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 loader->cancel(); | 922 loader->cancel(); |
923 client_info->client->DidFail(client_info->id); | 923 client_info->client->DidFail(client_info->id); |
924 return; | 924 return; |
925 } | 925 } |
926 if (net::HttpResponseHeaders::IsRedirectResponseCode( | 926 if (net::HttpResponseHeaders::IsRedirectResponseCode( |
927 response.httpStatusCode())) { | 927 response.httpStatusCode())) { |
928 // If the plugin does not participate in url redirect notifications then | 928 // If the plugin does not participate in url redirect notifications then |
929 // just block cross origin 307 POST redirects. | 929 // just block cross origin 307 POST redirects. |
930 if (!client_info->notify_redirects) { | 930 if (!client_info->notify_redirects) { |
931 if (response.httpStatusCode() == 307 && | 931 if (response.httpStatusCode() == 307 && |
932 LowerCaseEqualsASCII(request.httpMethod().utf8(), "post")) { | 932 base::LowerCaseEqualsASCII(request.httpMethod().utf8(), "post")) { |
933 GURL original_request_url(response.url()); | 933 GURL original_request_url(response.url()); |
934 GURL response_url(request.url()); | 934 GURL response_url(request.url()); |
935 if (original_request_url.GetOrigin() != response_url.GetOrigin()) { | 935 if (original_request_url.GetOrigin() != response_url.GetOrigin()) { |
936 loader->setDefersLoading(true); | 936 loader->setDefersLoading(true); |
937 loader->cancel(); | 937 loader->cancel(); |
938 client_info->client->DidFail(client_info->id); | 938 client_info->client->DidFail(client_info->id); |
939 return; | 939 return; |
940 } | 940 } |
941 } | 941 } |
942 } else { | 942 } else { |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1525 case PLUGIN_SRC: | 1525 case PLUGIN_SRC: |
1526 webframe_->setReferrerForRequest(*request, plugin_url_); | 1526 webframe_->setReferrerForRequest(*request, plugin_url_); |
1527 break; | 1527 break; |
1528 | 1528 |
1529 default: | 1529 default: |
1530 break; | 1530 break; |
1531 } | 1531 } |
1532 } | 1532 } |
1533 | 1533 |
1534 } // namespace content | 1534 } // namespace content |
OLD | NEW |