Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(594)

Side by Side Diff: content/renderer/npapi/webplugin_impl.cc

Issue 23064011: Consolidate scheme checks into an easy GURL method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/media/webmediaplayer_impl.cc ('k') | content/renderer/savable_resources.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/debug/crash_logging.h" 8 #include "base/debug/crash_logging.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/linked_ptr.h" 10 #include "base/memory/linked_ptr.h"
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 // If we got this far, we're routing content to a target frame. 709 // If we got this far, we're routing content to a target frame.
710 // Go fetch the URL. 710 // Go fetch the URL.
711 711
712 GURL complete_url = CompleteURL(url); 712 GURL complete_url = CompleteURL(url);
713 // Remove when flash bug is fixed. http://crbug.com/40016. 713 // Remove when flash bug is fixed. http://crbug.com/40016.
714 if (!WebPluginImpl::IsValidUrl(complete_url, referrer_flag)) 714 if (!WebPluginImpl::IsValidUrl(complete_url, referrer_flag))
715 return INVALID_URL; 715 return INVALID_URL;
716 716
717 if (strcmp(method, "GET") != 0) { 717 if (strcmp(method, "GET") != 0) {
718 // We're only going to route HTTP/HTTPS requests 718 // We're only going to route HTTP/HTTPS requests
719 if (!(complete_url.SchemeIs("http") || complete_url.SchemeIs("https"))) 719 if (!complete_url.SchemeIsHTTPOrHTTPS())
720 return INVALID_URL; 720 return INVALID_URL;
721 } 721 }
722 722
723 WebURLRequest request(complete_url); 723 WebURLRequest request(complete_url);
724 SetReferrer(&request, referrer_flag); 724 SetReferrer(&request, referrer_flag);
725 725
726 request.setHTTPMethod(WebString::fromUTF8(method)); 726 request.setHTTPMethod(WebString::fromUTF8(method));
727 request.setFirstPartyForCookies( 727 request.setFirstPartyForCookies(
728 webframe_->document().firstPartyForCookies()); 728 webframe_->document().firstPartyForCookies());
729 request.setHasUserGesture(popups_allowed); 729 request.setHasUserGesture(popups_allowed);
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
1466 case PLUGIN_SRC: 1466 case PLUGIN_SRC:
1467 webframe_->setReferrerForRequest(*request, plugin_url_); 1467 webframe_->setReferrerForRequest(*request, plugin_url_);
1468 break; 1468 break;
1469 1469
1470 default: 1470 default:
1471 break; 1471 break;
1472 } 1472 }
1473 } 1473 }
1474 1474
1475 } // namespace content 1475 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webmediaplayer_impl.cc ('k') | content/renderer/savable_resources.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698