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

Side by Side Diff: content/browser/frame_host/navigation_controller_impl.cc

Issue 1255103003: Fix race when reloading original URL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2454
Patch Set: Created 5 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 | « no previous file | content/browser/frame_host/navigation_controller_impl_browsertest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 /* 5 /*
6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * 10 *
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 if (current_index != -1) { 319 if (current_index != -1) {
320 entry = GetEntryAtIndex(current_index); 320 entry = GetEntryAtIndex(current_index);
321 } 321 }
322 } 322 }
323 323
324 // If we are no where, then we can't reload. TODO(darin): We should add a 324 // If we are no where, then we can't reload. TODO(darin): We should add a
325 // CanReload method. 325 // CanReload method.
326 if (!entry) 326 if (!entry)
327 return; 327 return;
328 328
329 if (reload_type == NavigationControllerImpl::RELOAD_ORIGINAL_REQUEST_URL &&
330 entry->GetOriginalRequestURL().is_valid() && !entry->GetHasPostData()) {
331 // We may have been redirected when navigating to the current URL.
332 // Use the URL the user originally intended to visit, if it's valid and if a
333 // POST wasn't involved; the latter case avoids issues with sending data to
334 // the wrong page.
335 entry->SetURL(entry->GetOriginalRequestURL());
336 entry->SetReferrer(Referrer());
337 }
338
339 if (g_check_for_repost && check_for_repost && 329 if (g_check_for_repost && check_for_repost &&
340 entry->GetHasPostData()) { 330 entry->GetHasPostData()) {
341 // The user is asking to reload a page with POST data. Prompt to make sure 331 // The user is asking to reload a page with POST data. Prompt to make sure
342 // they really want to do this. If they do, the dialog will call us back 332 // they really want to do this. If they do, the dialog will call us back
343 // with check_for_repost = false. 333 // with check_for_repost = false.
344 delegate_->NotifyBeforeFormRepostWarningShow(); 334 delegate_->NotifyBeforeFormRepostWarningShow();
345 335
346 pending_reload_ = reload_type; 336 pending_reload_ = reload_type;
347 delegate_->ActivateAndShowRepostFormWarningDialog(); 337 delegate_->ActivateAndShowRepostFormWarningDialog();
348 } else { 338 } else {
(...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after
1997 } 1987 }
1998 } 1988 }
1999 } 1989 }
2000 1990
2001 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 1991 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
2002 const base::Callback<base::Time()>& get_timestamp_callback) { 1992 const base::Callback<base::Time()>& get_timestamp_callback) {
2003 get_timestamp_callback_ = get_timestamp_callback; 1993 get_timestamp_callback_ = get_timestamp_callback;
2004 } 1994 }
2005 1995
2006 } // namespace content 1996 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_controller_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698