Chromium Code Reviews| Index: content/browser/web_contents/navigation_controller_impl.cc |
| diff --git a/content/browser/web_contents/navigation_controller_impl.cc b/content/browser/web_contents/navigation_controller_impl.cc |
| index c539bbf1ff15fd356ba0dde192fda8037cefe1ed..455e8a844966627fb54dfe814e7d521905608cf3 100644 |
| --- a/content/browser/web_contents/navigation_controller_impl.cc |
| +++ b/content/browser/web_contents/navigation_controller_impl.cc |
| @@ -653,6 +653,35 @@ void NavigationControllerImpl::LoadDataWithBaseURL( |
| LoadEntry(entry); |
| } |
| +void NavigationControllerImpl::PostURL( |
| + const GURL& url, |
| + const content::Referrer& referrer, |
| + const scoped_refptr<base::RefCountedBytes> http_body, |
| + bool is_overriding_user_agent) { |
| + // Must be http scheme for a post request |
|
Charlie Reis
2012/07/30 20:36:38
nit: End with a period.
boliu
2012/07/30 21:53:45
Done.
|
| + if (!url.SchemeIs(chrome::kHttpScheme) && |
| + !url.SchemeIs(chrome::kHttpsScheme)) { |
| + NOTREACHED(); |
| + return; |
| + } |
| + |
| + needs_reload_ = false; |
| + |
| + NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry( |
| + CreateNavigationEntry( |
| + url, |
| + referrer, |
| + content::PAGE_TRANSITION_TYPED, |
| + false, |
| + std::string(), |
| + browser_context_)); |
| + entry->SetIsOverridingUserAgent(is_overriding_user_agent); |
| + entry->SetHasPostData(true); |
| + entry->SetBrowserInitiatedPostData(http_body); |
| + |
| + LoadEntry(entry); |
| +} |
| + |
| void NavigationControllerImpl::DocumentLoadedInFrame() { |
| last_document_loaded_ = base::TimeTicks::Now(); |
| } |
| @@ -729,6 +758,10 @@ bool NavigationControllerImpl::RendererDidNavigate( |
| NavigationEntryImpl* active_entry = |
| NavigationEntryImpl::FromNavigationEntry(GetActiveEntry()); |
| active_entry->SetContentState(params.content_state); |
| + // No longer needed since content state will hold the post data if any. |
| + active_entry->SetBrowserInitiatedPostData( |
| + scoped_refptr<base::RefCountedBytes>(NULL)); |
| + |
| // Once committed, we do not need to track if the entry was initiated by |
| // the renderer. |