Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / content / child / request_extra_data.h
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.
4
5 #ifndef CONTENT_CHILD_REQUEST_EXTRA_DATA_H_
6 #define CONTENT_CHILD_REQUEST_EXTRA_DATA_H_
7
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"
13
14 namespace content {
15
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) {
20  public:
21   RequestExtraData(blink::WebPageVisibilityState visibility_state,
22                    const blink::WebString& custom_user_agent,
23                    bool was_after_preconnect_request,
24                    int render_frame_id,
25                    bool is_main_frame,
26                    int64 frame_id,
27                    const GURL& frame_origin,
28                    bool parent_is_main_frame,
29                    int64 parent_frame_id,
30                    bool allow_download,
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();
36
37   blink::WebPageVisibilityState visibility_state() const {
38     return visibility_state_;
39   }
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_;
50   }
51   int transferred_request_child_id() const {
52     return transferred_request_child_id_;
53   }
54   int transferred_request_request_id() const {
55     return transferred_request_request_id_;
56   }
57
58  private:
59   blink::WebPageVisibilityState visibility_state_;
60   int render_frame_id_;
61   bool is_main_frame_;
62   int64 frame_id_;
63   GURL frame_origin_;
64   bool parent_is_main_frame_;
65   int64 parent_frame_id_;
66   bool allow_download_;
67   PageTransition transition_type_;
68   bool should_replace_current_entry_;
69   int transferred_request_child_id_;
70   int transferred_request_request_id_;
71
72   DISALLOW_COPY_AND_ASSIGN(RequestExtraData);
73 };
74
75 }  // namespace content
76
77 #endif  // CONTENT_CHILD_REQUEST_EXTRA_DATA_H_