diff options
author | davidben <davidben@chromium.org> | 2014-10-07 11:52:04 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-07 18:52:17 +0000 |
commit | a5496d6d37a8e4e571d14256d504b15784274001 (patch) | |
tree | 262c66885cfc539ac067a706e8444de6dbf818a4 /content/browser/frame_host/navigation_request.cc | |
parent | 8831427bce44557656e72995f2e4bdf475eaa022 (diff) | |
download | chromium_src-a5496d6d37a8e4e571d14256d504b15784274001.zip chromium_src-a5496d6d37a8e4e571d14256d504b15784274001.tar.gz chromium_src-a5496d6d37a8e4e571d14256d504b15784274001.tar.bz2 |
Pass ResourceResponse and StreamHandle in CommitNavigation.
Split out from https://codereview.chromium.org/519533002/.
NavigationBeforeCommitInfo is removed in favor of the already existing
ResourceResponse object. In addition, replace the stream URL with a
StreamHandle which maintains ownership. The ownership is transferred
to the UI thread, which will then maintain ownership on behalf of the renderer.
This loses navigation_request_id, so also remove the existing stub code in
NavigationRequest; that will be handled by a UI-thread NavigationURLLoader
object to hide all the IO thread business, including cancellation, from the
UI thread navigation code.
BUG=376015
Review URL: https://codereview.chromium.org/612903004
Cr-Commit-Position: refs/heads/master@{#298531}
Diffstat (limited to 'content/browser/frame_host/navigation_request.cc')
-rw-r--r-- | content/browser/frame_host/navigation_request.cc | 56 |
1 files changed, 3 insertions, 53 deletions
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc index 4e33ea5..8b87b7e 100644 --- a/content/browser/frame_host/navigation_request.cc +++ b/content/browser/frame_host/navigation_request.cc @@ -4,48 +4,16 @@ #include "content/browser/frame_host/navigation_request.h" -#include "base/logging.h" #include "content/browser/frame_host/navigation_request_info.h" -#include "content/browser/loader/resource_dispatcher_host_impl.h" #include "content/common/resource_request_body.h" -#include "content/public/browser/browser_thread.h" namespace content { -namespace { - -// The next available browser-global navigation request ID. -static int64 next_navigation_request_id_ = 0; - -void OnBeginNavigation(const CommonNavigationParams& common_params, - const NavigationRequestInfo& info, - scoped_refptr<ResourceRequestBody> request_body, - int64 navigation_request_id, - int64 frame_tree_node_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - ResourceDispatcherHostImpl::Get()->StartNavigationRequest( - common_params, - info, - request_body, - navigation_request_id, - frame_tree_node_id); -} - -void CancelNavigationRequest(int64 navigation_request_id, - int64 frame_tree_node_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - ResourceDispatcherHostImpl::Get()->CancelNavigationRequest( - navigation_request_id, frame_tree_node_id); -} - -} // namespace - NavigationRequest::NavigationRequest( - int64 frame_tree_node_id, + FrameTreeNode* frame_tree_node, const CommonNavigationParams& common_params, const CommitNavigationParams& commit_params) - : navigation_request_id_(++next_navigation_request_id_), - frame_tree_node_id_(frame_tree_node_id), + : frame_tree_node_(frame_tree_node), common_params_(common_params), commit_params_(commit_params) { } @@ -57,25 +25,7 @@ void NavigationRequest::BeginNavigation( scoped_ptr<NavigationRequestInfo> info, scoped_refptr<ResourceRequestBody> request_body) { info_ = info.Pass(); - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - BrowserThread::PostTask( - BrowserThread::IO, - FROM_HERE, - base::Bind(&OnBeginNavigation, - common_params_, - *info_, - request_body, - navigation_request_id_, - frame_tree_node_id_)); -} - -void NavigationRequest::CancelNavigation() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - BrowserThread::PostTask( - BrowserThread::IO, - FROM_HERE, - base::Bind(&CancelNavigationRequest, - navigation_request_id_, frame_tree_node_id_)); + NOTIMPLEMENTED(); } } // namespace content |