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

Side by Side Diff: content/browser/frame_host/navigation_request.h

Issue 818853005: Store NavigationEntryImpl data into NavigationRequest for later usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed respective TODOs. Created 5 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "content/browser/loader/navigation_url_loader_delegate.h" 11 #include "content/browser/loader/navigation_url_loader_delegate.h"
12 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 #include "content/common/navigation_params.h" 13 #include "content/common/navigation_params.h"
14 14
15 namespace content { 15 namespace content {
16 16
17 class FrameTreeNode; 17 class FrameTreeNode;
18 class NavigationEntryImpl;
18 class NavigationURLLoader; 19 class NavigationURLLoader;
19 class ResourceRequestBody; 20 class ResourceRequestBody;
21 class SiteInstanceImpl;
20 struct NavigationRequestInfo; 22 struct NavigationRequestInfo;
21 23
22 // PlzNavigate 24 // PlzNavigate
23 // A UI thread object that owns a navigation request until it commits. It 25 // A UI thread object that owns a navigation request until it commits. It
24 // ensures the UI thread can start a navigation request in the 26 // ensures the UI thread can start a navigation request in the
25 // ResourceDispatcherHost (that lives on the IO thread). 27 // ResourceDispatcherHost (that lives on the IO thread).
26 // TODO(clamy): Describe the interactions between the UI and IO thread during 28 // TODO(clamy): Describe the interactions between the UI and IO thread during
27 // the navigation following its refactoring. 29 // the navigation following its refactoring.
28 class CONTENT_EXPORT NavigationRequest : public NavigationURLLoaderDelegate { 30 class CONTENT_EXPORT NavigationRequest : public NavigationURLLoaderDelegate {
29 public: 31 public:
(...skipping 24 matching lines...) Expand all
54 const CommitNavigationParams& commit_params); 56 const CommitNavigationParams& commit_params);
55 57
56 ~NavigationRequest() override; 58 ~NavigationRequest() override;
57 59
58 // Called on the UI thread by the RenderFrameHostManager which owns the 60 // Called on the UI thread by the RenderFrameHostManager which owns the
59 // NavigationRequest. Takes ownership of |info|. After calling this function, 61 // NavigationRequest. Takes ownership of |info|. After calling this function,
60 // |body| can no longer be manipulated on the UI thread. 62 // |body| can no longer be manipulated on the UI thread.
61 void BeginNavigation(scoped_ptr<NavigationRequestInfo> info, 63 void BeginNavigation(scoped_ptr<NavigationRequestInfo> info,
62 scoped_refptr<ResourceRequestBody> body); 64 scoped_refptr<ResourceRequestBody> body);
63 65
66 // Copies some specific data from the NavigationEntryImpl used later in the
67 // navigation process.
68 void CopyDataFrom(const NavigationEntryImpl& navitation_entry);
nasko 2015/01/16 15:03:24 The name seems a bit strange, either CopyData and
carlosk 2015/01/19 15:02:52 The method was removed in favor of an optional con
69
64 CommonNavigationParams& common_params() { return common_params_; } 70 CommonNavigationParams& common_params() { return common_params_; }
65 71
66 const CommitNavigationParams& commit_params() const { return commit_params_; } 72 const CommitNavigationParams& commit_params() const { return commit_params_; }
67 73
68 NavigationURLLoader* loader_for_testing() const { return loader_.get(); } 74 NavigationURLLoader* loader_for_testing() const { return loader_.get(); }
69 75
70 NavigationState state() const { return state_; } 76 NavigationState state() const { return state_; }
71 77
78 SiteInstanceImpl* source_site_instance() const {
79 return source_site_instance_.get();
80 }
81
82 SiteInstanceImpl* dest_site_instance() const {
83 return dest_site_instance_.get();
84 }
85
86 bool is_restore() const { return is_restore_; };
87
88 bool is_view_source() const { return is_view_source_; };
89
90 int bindings() const { return bindings_; };
91
72 void SetWaitingForRendererResponse() { 92 void SetWaitingForRendererResponse() {
73 DCHECK(state_ == NOT_STARTED); 93 DCHECK(state_ == NOT_STARTED);
74 state_ = WAITING_FOR_RENDERER_RESPONSE; 94 state_ = WAITING_FOR_RENDERER_RESPONSE;
75 } 95 }
76 96
77 private: 97 private:
78 // NavigationURLLoaderDelegate implementation. 98 // NavigationURLLoaderDelegate implementation.
79 void OnRequestRedirected( 99 void OnRequestRedirected(
80 const net::RedirectInfo& redirect_info, 100 const net::RedirectInfo& redirect_info,
81 const scoped_refptr<ResourceResponse>& response) override; 101 const scoped_refptr<ResourceResponse>& response) override;
82 void OnResponseStarted(const scoped_refptr<ResourceResponse>& response, 102 void OnResponseStarted(const scoped_refptr<ResourceResponse>& response,
83 scoped_ptr<StreamHandle> body) override; 103 scoped_ptr<StreamHandle> body) override;
84 void OnRequestFailed(int net_error) override; 104 void OnRequestFailed(int net_error) override;
85 105
86 FrameTreeNode* frame_tree_node_; 106 FrameTreeNode* frame_tree_node_;
87 107
88 // Initialized on creation of the NavigationRequest. Sent to the renderer when 108 // Initialized on creation of the NavigationRequest. Sent to the renderer when
89 // the navigation is ready to commit. 109 // the navigation is ready to commit.
90 // Note: When the navigation is ready to commit, the url in |common_params| 110 // Note: When the navigation is ready to commit, the url in |common_params|
91 // will be set to the final navigation url, obtained after following all 111 // will be set to the final navigation url, obtained after following all
92 // redirects. 112 // redirects.
93 CommonNavigationParams common_params_; 113 CommonNavigationParams common_params_;
94 const CommitNavigationParams commit_params_; 114 const CommitNavigationParams commit_params_;
95 115
96 NavigationState state_; 116 NavigationState state_;
97 117
98 scoped_ptr<NavigationURLLoader> loader_; 118 scoped_ptr<NavigationURLLoader> loader_;
99 119
120 // These next items are used in browser-initiated navigations to store
121 // information from the NavigationEntryImpl that is required after request
122 // creation time.
123 scoped_refptr<SiteInstanceImpl> source_site_instance_;
124 scoped_refptr<SiteInstanceImpl> dest_site_instance_;
125 bool is_restore_;
126 bool is_view_source_;
127 int bindings_;
128
100 DISALLOW_COPY_AND_ASSIGN(NavigationRequest); 129 DISALLOW_COPY_AND_ASSIGN(NavigationRequest);
101 }; 130 };
102 131
103 } // namespace content 132 } // namespace content
104 133
105 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ 134 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_request.cc » ('j') | content/browser/frame_host/navigation_request.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698