• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "webkit/child/weburlrequest_extradata_impl.h"
12 
13 namespace content {
14 
15 // The RenderView stores an instance of this class in the "extra data" of each
16 // ResourceRequest (see RenderFrameImpl::willSendRequest).
17 class CONTENT_EXPORT RequestExtraData
NON_EXPORTED_BASE(public webkit_glue::WebURLRequestExtraDataImpl)18     : NON_EXPORTED_BASE(public webkit_glue::WebURLRequestExtraDataImpl) {
19  public:
20   RequestExtraData(blink::WebReferrerPolicy referrer_policy,
21                    const blink::WebString& custom_user_agent,
22                    bool was_after_preconnect_request,
23                    int render_frame_id,
24                    bool is_main_frame,
25                    int64 frame_id,
26                    const GURL& frame_origin,
27                    bool parent_is_main_frame,
28                    int64 parent_frame_id,
29                    bool allow_download,
30                    PageTransition transition_type,
31                    bool should_replace_current_entry,
32                    int transferred_request_child_id,
33                    int transferred_request_request_id);
34   virtual ~RequestExtraData();
35 
36   int render_frame_id() const { return render_frame_id_; }
37   bool is_main_frame() const { return is_main_frame_; }
38   int64 frame_id() const { return frame_id_; }
39   GURL frame_origin() const { return frame_origin_; }
40   bool parent_is_main_frame() const { return parent_is_main_frame_; }
41   int64 parent_frame_id() const { return parent_frame_id_; }
42   bool allow_download() const { return allow_download_; }
43   PageTransition transition_type() const { return transition_type_; }
44   bool should_replace_current_entry() const {
45     return should_replace_current_entry_;
46   }
47   int transferred_request_child_id() const {
48     return transferred_request_child_id_;
49   }
50   int transferred_request_request_id() const {
51     return transferred_request_request_id_;
52   }
53 
54  private:
55   int render_frame_id_;
56   bool is_main_frame_;
57   int64 frame_id_;
58   GURL frame_origin_;
59   bool parent_is_main_frame_;
60   int64 parent_frame_id_;
61   bool allow_download_;
62   PageTransition transition_type_;
63   bool should_replace_current_entry_;
64   int transferred_request_child_id_;
65   int transferred_request_request_id_;
66 
67   DISALLOW_COPY_AND_ASSIGN(RequestExtraData);
68 };
69 
70 }  // namespace content
71 
72 #endif  // CONTENT_CHILD_REQUEST_EXTRA_DATA_H_
73