Skip to content

Commit

Permalink
The ChromeFrameAutomationClient::InitiateNavigation method saves the …
Browse files Browse the repository at this point in the history
…passed in url to its member

even if it disallows the navigation.

Fixed.

Review URL: http://codereview.chromium.org/501128

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35113 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
ananta@chromium.org committed Dec 21, 2009
1 parent 3bc7fe4 commit d5e13f5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions chrome_frame/chrome_frame_automation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ bool ChromeFrameAutomationClient::Initialize(
chrome_launch_params_.profile_name = profile_name;
chrome_launch_params_.extra_chrome_arguments = extra_chrome_arguments;
chrome_launch_params_.perform_version_check = perform_version_check;
chrome_launch_params_.url = url_;
chrome_launch_params_.url = navigate_after_initialization_ ? GURL() : url_;
chrome_launch_params_.incognito_mode = incognito;

proxy_factory_->GetAutomationServer(
Expand Down Expand Up @@ -520,16 +520,17 @@ bool ChromeFrameAutomationClient::InitiateNavigation(
if (url.empty())
return false;

url_ = GURL(url);
referrer_ = GURL(referrer);

GURL parsed_url(url);
// Catch invalid URLs early.
if (!url_.is_valid() || !IsValidUrlScheme(UTF8ToWide(url), is_privileged)) {
if (!parsed_url.is_valid() ||
!IsValidUrlScheme(UTF8ToWide(url), is_privileged)) {
DLOG(ERROR) << "Invalid URL passed to InitiateNavigation: " << url
<< " is_privileged=" << is_privileged;
return false;
}

url_ = parsed_url;
referrer_ = GURL(referrer);
navigate_after_initialization_ = false;

if (is_initialized()) {
Expand Down

0 comments on commit d5e13f5

Please sign in to comment.