Chromium Code Reviews| 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_request_info.h" | 10 #include "content/browser/frame_host/navigation_request_info.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 class ResourceRequestBody; | 13 class ResourceRequestBody; |
| 14 | 14 |
| 15 // PlzNavigate | 15 // PlzNavigate |
| 16 // 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 |
| 17 // ensures the UI thread can start a navigation request in the | 17 // ensures the UI thread can start a navigation request in the |
| 18 // ResourceDispatcherHost (that lives on the IO thread). | 18 // ResourceDispatcherHost (that lives on the IO thread). |
| 19 // 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 |
| 20 // the navigation following its refactoring. | 20 // the navigation following its refactoring. |
| 21 class NavigationRequest { | 21 class NavigationRequest { |
| 22 public: | 22 public: |
| 23 NavigationRequest(const NavigationRequestInfo& info, int64 frame_node_id); | 23 NavigationRequest(const NavigationRequestInfo& info, int64 frame_node_id); |
| 24 | 24 |
| 25 ~NavigationRequest(); | 25 ~NavigationRequest(); |
| 26 | 26 |
| 27 const NavigationRequestInfo& info() const { return info_; } | 27 const NavigationRequestInfo& info() const { return info_; } |
|
clamy
2014/08/28 12:17:01
Why did you move those methods?
carlosk
2014/09/01 13:37:22
I just wanted to group the accessors/getters altog
| |
| 28 int64 frame_node_id() const { return frame_node_id_; } | 28 int64 frame_node_id() const { return frame_node_id_; } |
| 29 | 29 |
| 30 // Called on the UI thread by the RenderFrameHostManager which owns the | 30 // Called on the UI thread by the RenderFrameHostManager which owns the |
| 31 // NavigationRequest. After calling this function, |body| can no longer be | 31 // NavigationRequest. After calling this function, |body| can no longer be |
| 32 // manipulated on the UI thread. | 32 // manipulated on the UI thread. |
| 33 void BeginNavigation(scoped_refptr<ResourceRequestBody> body); | 33 void BeginNavigation(scoped_refptr<ResourceRequestBody> body); |
| 34 | 34 |
| 35 int64 navigation_request_id() const { return navigation_request_id_; } | |
| 36 | |
| 35 private: | 37 private: |
| 38 // The next available browser-global navigation request ID. | |
| 39 static int64 next_navigation_request_id_; | |
|
davidben
2014/08/25 17:31:34
Nit: This may as well be a global in navigation_re
carlosk
2014/08/27 15:31:59
Done.
| |
| 40 | |
| 41 const int64 navigation_request_id_; | |
| 36 const NavigationRequestInfo info_; | 42 const NavigationRequestInfo info_; |
| 37 const int64 frame_node_id_; | 43 const int64 frame_node_id_; |
| 38 | 44 |
| 39 DISALLOW_COPY_AND_ASSIGN(NavigationRequest); | 45 DISALLOW_COPY_AND_ASSIGN(NavigationRequest); |
| 40 }; | 46 }; |
| 41 | 47 |
| 42 } // namespace content | 48 } // namespace content |
| 43 | 49 |
| 44 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ | 50 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ |
| OLD | NEW |