1 // Copyright (c) 2012 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_CHILD_REQUEST_EXTRA_DATA_H_
6 #define CONTENT_CHILD_REQUEST_EXTRA_DATA_H_
8 #include "base/compiler_specific.h"
9 #include "content/common/content_export.h"
10 #include "content/public/common/page_transition_types.h"
11 #include "third_party/WebKit/public/web/WebPageVisibilityState.h"
12 #include "webkit/child/weburlrequest_extradata_impl.h"
16 // The RenderView stores an instance of this class in the "extra data" of each
17 // ResourceRequest (see RenderFrameImpl::willSendRequest).
18 class CONTENT_EXPORT RequestExtraData
19 : NON_EXPORTED_BASE(public webkit_glue::WebURLRequestExtraDataImpl
) {
21 RequestExtraData(blink::WebPageVisibilityState visibility_state
,
22 const blink::WebString
& custom_user_agent
,
23 bool was_after_preconnect_request
,
27 const GURL
& frame_origin
,
28 bool parent_is_main_frame
,
29 int64 parent_frame_id
,
31 PageTransition transition_type
,
32 bool should_replace_current_entry
,
33 int transferred_request_child_id
,
34 int transferred_request_request_id
);
35 virtual ~RequestExtraData();
37 blink::WebPageVisibilityState
visibility_state() const {
38 return visibility_state_
;
40 int render_frame_id() const { return render_frame_id_
; }
41 bool is_main_frame() const { return is_main_frame_
; }
42 int64
frame_id() const { return frame_id_
; }
43 GURL
frame_origin() const { return frame_origin_
; }
44 bool parent_is_main_frame() const { return parent_is_main_frame_
; }
45 int64
parent_frame_id() const { return parent_frame_id_
; }
46 bool allow_download() const { return allow_download_
; }
47 PageTransition
transition_type() const { return transition_type_
; }
48 bool should_replace_current_entry() const {
49 return should_replace_current_entry_
;
51 int transferred_request_child_id() const {
52 return transferred_request_child_id_
;
54 int transferred_request_request_id() const {
55 return transferred_request_request_id_
;
59 blink::WebPageVisibilityState visibility_state_
;
64 bool parent_is_main_frame_
;
65 int64 parent_frame_id_
;
67 PageTransition transition_type_
;
68 bool should_replace_current_entry_
;
69 int transferred_request_child_id_
;
70 int transferred_request_request_id_
;
72 DISALLOW_COPY_AND_ASSIGN(RequestExtraData
);
75 } // namespace content
77 #endif // CONTENT_CHILD_REQUEST_EXTRA_DATA_H_