Add a FrameHostMsg_BeginNavigation IPC
[chromium-blink-merge.git] / content / browser / frame_host / navigation_request.h
blobd8be70ba1bee21c7df45b73a99e291d60ee8f863
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_
8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h"
10 #include "content/browser/frame_host/navigation_request_info.h"
12 namespace content {
13 class ResourceRequestBody;
15 // A UI thread object that owns a navigation request until it commits. It
16 // ensures the UI thread can start a navigation request in the
17 // ResourceDispatcherHost (that lives on the IO thread).
18 // TODO(clamy): Describe the interactions between the UI and IO thread during
19 // the navigation following its refactoring.
20 class NavigationRequest {
21 public:
22 NavigationRequest(const NavigationRequestInfo& info, int64 frame_node_id);
24 ~NavigationRequest();
26 const NavigationRequestInfo& info_for_testing() const { return info_; }
27 int64 frame_node_id() const { return frame_node_id_; }
29 // Called on the UI thread by the RenderFrameHostManager which owns the
30 // NavigationRequest. After calling this function, |body| can no longer be
31 // manipulated on the UI thread.
32 void BeginNavigation(scoped_refptr<ResourceRequestBody> body);
34 private:
35 const NavigationRequestInfo info_;
36 const int64 frame_node_id_;
38 DISALLOW_COPY_AND_ASSIGN(NavigationRequest);
41 } // namespace content
43 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_