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

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

Issue 1257553002: [Proof-of-concept] PlzNavigate and Service Worker Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass navigation_provider_id 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
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 #include "content/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_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/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 1806 matching lines...) Expand 10 before | Expand all | Expand 10 after
1817 // correctly while waiting for a response. 1817 // correctly while waiting for a response.
1818 if (is_waiting && dialog_was_suppressed) 1818 if (is_waiting && dialog_was_suppressed)
1819 render_view_host_->delegate_->RendererUnresponsive(render_view_host_); 1819 render_view_host_->delegate_->RendererUnresponsive(render_view_host_);
1820 } 1820 }
1821 1821
1822 // PlzNavigate 1822 // PlzNavigate
1823 void RenderFrameHostImpl::CommitNavigation( 1823 void RenderFrameHostImpl::CommitNavigation(
1824 ResourceResponse* response, 1824 ResourceResponse* response,
1825 scoped_ptr<StreamHandle> body, 1825 scoped_ptr<StreamHandle> body,
1826 const CommonNavigationParams& common_params, 1826 const CommonNavigationParams& common_params,
1827 const RequestNavigationParams& request_params) { 1827 const RequestNavigationParams& request_params,
1828 int navigation_provider_id) {
1828 DCHECK((response && body.get()) || 1829 DCHECK((response && body.get()) ||
1829 !ShouldMakeNetworkRequestForURL(common_params.url)); 1830 !ShouldMakeNetworkRequestForURL(common_params.url));
1830 UpdatePermissionsForNavigation(common_params, request_params); 1831 UpdatePermissionsForNavigation(common_params, request_params);
1831 1832
1832 // Get back to a clean state, in case we start a new navigation without 1833 // Get back to a clean state, in case we start a new navigation without
1833 // completing a RFH swap or unload handler. 1834 // completing a RFH swap or unload handler.
1834 SetState(RenderFrameHostImpl::STATE_DEFAULT); 1835 SetState(RenderFrameHostImpl::STATE_DEFAULT);
1835 1836
1836 const GURL body_url = body.get() ? body->GetURL() : GURL(); 1837 const GURL body_url = body.get() ? body->GetURL() : GURL();
1837 const ResourceResponseHead head = response ? 1838 const ResourceResponseHead head = response ?
1838 response->head : ResourceResponseHead(); 1839 response->head : ResourceResponseHead();
1839 Send(new FrameMsg_CommitNavigation(routing_id_, head, body_url, common_params, 1840 Send(new FrameMsg_CommitNavigation(routing_id_, head, body_url, common_params,
1840 request_params)); 1841 request_params, navigation_provider_id));
1841 // TODO(clamy): Check if we should start the throbber for non javascript urls 1842 // TODO(clamy): Check if we should start the throbber for non javascript urls
1842 // here. 1843 // here.
1843 1844
1844 // TODO(clamy): Release the stream handle once the renderer has finished 1845 // TODO(clamy): Release the stream handle once the renderer has finished
1845 // reading it. 1846 // reading it.
1846 stream_handle_ = body.Pass(); 1847 stream_handle_ = body.Pass();
1847 1848
1848 // When navigating to a Javascript url, no commit is expected from the 1849 // When navigating to a Javascript url, no commit is expected from the
1849 // RenderFrameHost, nor should the throbber start. 1850 // RenderFrameHost, nor should the throbber start.
1850 if (!common_params.url.SchemeIs(url::kJavaScriptScheme)) { 1851 if (!common_params.url.SchemeIs(url::kJavaScriptScheme)) {
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
2169 ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( 2170 ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings(
2170 GetProcess()->GetID()) || 2171 GetProcess()->GetID()) ||
2171 // It's possible to load about:blank in a Web UI renderer. 2172 // It's possible to load about:blank in a Web UI renderer.
2172 // See http://crbug.com/42547 2173 // See http://crbug.com/42547
2173 (frame_tree_node_->current_url().spec() == url::kAboutBlankURL) || 2174 (frame_tree_node_->current_url().spec() == url::kAboutBlankURL) ||
2174 // InterstitialPageImpl should be the only case matching this. 2175 // InterstitialPageImpl should be the only case matching this.
2175 (delegate_->GetAsWebContents() == nullptr); 2176 (delegate_->GetAsWebContents() == nullptr);
2176 } 2177 }
2177 2178
2178 } // namespace content 2179 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698