OLD | NEW |
---|---|
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 "content/browser/frame_host/navigation_entry_impl.h" | |
10 #include "content/browser/frame_host/navigation_request_info.h" | 11 #include "content/browser/frame_host/navigation_request_info.h" |
11 | 12 |
12 namespace content { | 13 namespace content { |
13 class ResourceRequestBody; | 14 class ResourceRequestBody; |
14 | 15 |
15 // A UI thread object that owns a navigation request until it commits. It | 16 // A UI thread object that owns a navigation request until it commits. It |
Charlie Reis
2014/08/08 20:25:27
Is this class just for PlzNavigate? If so, let's
clamy
2014/08/12 12:13:15
Done.
| |
16 // ensures the UI thread can start a navigation request in the | 17 // ensures the UI thread can start a navigation request in the |
17 // ResourceDispatcherHost (that lives on the IO thread). | 18 // ResourceDispatcherHost (that lives on the IO thread). |
18 // TODO(clamy): Describe the interactions between the UI and IO thread during | 19 // TODO(clamy): Describe the interactions between the UI and IO thread during |
19 // the navigation following its refactoring. | 20 // the navigation following its refactoring. |
20 class NavigationRequest { | 21 class NavigationRequest { |
21 public: | 22 public: |
22 NavigationRequest(const NavigationRequestInfo& info, int64 frame_node_id); | 23 NavigationRequest(const NavigationRequestInfo& info, |
24 const NavigationEntryImpl& entry, | |
25 int64 frame_node_id); | |
23 | 26 |
24 ~NavigationRequest(); | 27 ~NavigationRequest(); |
25 | 28 |
26 const NavigationRequestInfo& info_for_testing() const { return info_; } | 29 const NavigationRequestInfo& info_for_testing() const { return info_; } |
30 const NavigationEntryImpl& entry() const { return entry_; } | |
27 int64 frame_node_id() const { return frame_node_id_; } | 31 int64 frame_node_id() const { return frame_node_id_; } |
28 | 32 |
29 // Called on the UI thread by the RenderFrameHostManager which owns the | 33 // Called on the UI thread by the RenderFrameHostManager which owns the |
30 // NavigationRequest. After calling this function, |body| can no longer be | 34 // NavigationRequest. After calling this function, |body| can no longer be |
31 // manipulated on the UI thread. | 35 // manipulated on the UI thread. |
32 void BeginNavigation(scoped_refptr<ResourceRequestBody> body); | 36 void BeginNavigation(scoped_refptr<ResourceRequestBody> body); |
33 | 37 |
38 // Change the url of entry_ to |final_url|, that the url the browser navigated | |
39 // to after the chain of redirects. | |
40 void UpdateEntryForCommit(const GURL& final_url); | |
41 | |
34 private: | 42 private: |
35 const NavigationRequestInfo info_; | 43 const NavigationRequestInfo info_; |
44 NavigationEntryImpl entry_; | |
clamy
2014/08/08 12:02:46
I am currently storing the NavigationEntry we need
Charlie Reis
2014/08/08 20:25:27
Yeah, we can't store a copy because NavigationEntr
clamy
2014/08/12 12:13:15
We need a navigation entry inside CommitNavigation
| |
36 const int64 frame_node_id_; | 45 const int64 frame_node_id_; |
37 | 46 |
38 DISALLOW_COPY_AND_ASSIGN(NavigationRequest); | 47 DISALLOW_COPY_AND_ASSIGN(NavigationRequest); |
39 }; | 48 }; |
40 | 49 |
41 } // namespace content | 50 } // namespace content |
42 | 51 |
43 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ | 52 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ |
OLD | NEW |