OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_RENDERER_HOST_RESOURCE_REQUEST_INFO_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RESOURCE_REQUEST_INFO_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RESOURCE_REQUEST_INFO_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RESOURCE_REQUEST_INFO_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 virtual int GetRouteID() const OVERRIDE; | 67 virtual int GetRouteID() const OVERRIDE; |
68 virtual int GetOriginPID() const OVERRIDE; | 68 virtual int GetOriginPID() const OVERRIDE; |
69 virtual int GetRequestID() const OVERRIDE; | 69 virtual int GetRequestID() const OVERRIDE; |
70 virtual bool IsMainFrame() const OVERRIDE; | 70 virtual bool IsMainFrame() const OVERRIDE; |
71 virtual int64 GetFrameID() const OVERRIDE; | 71 virtual int64 GetFrameID() const OVERRIDE; |
72 virtual bool ParentIsMainFrame() const OVERRIDE; | 72 virtual bool ParentIsMainFrame() const OVERRIDE; |
73 virtual int64 GetParentFrameID() const OVERRIDE; | 73 virtual int64 GetParentFrameID() const OVERRIDE; |
74 virtual ResourceType::Type GetResourceType() const OVERRIDE; | 74 virtual ResourceType::Type GetResourceType() const OVERRIDE; |
75 virtual WebKit::WebReferrerPolicy GetReferrerPolicy() const OVERRIDE; | 75 virtual WebKit::WebReferrerPolicy GetReferrerPolicy() const OVERRIDE; |
76 virtual bool HasUserGesture() const OVERRIDE; | 76 virtual bool HasUserGesture() const OVERRIDE; |
| 77 virtual bool WasIgnoredByHandler() const OVERRIDE; |
77 virtual bool GetAssociatedRenderView(int* render_process_id, | 78 virtual bool GetAssociatedRenderView(int* render_process_id, |
78 int* render_view_id) const OVERRIDE; | 79 int* render_view_id) const OVERRIDE; |
79 | 80 |
| 81 |
80 void AssociateWithRequest(net::URLRequest* request); | 82 void AssociateWithRequest(net::URLRequest* request); |
81 | 83 |
82 GlobalRequestID GetGlobalRequestID() const; | 84 GlobalRequestID GetGlobalRequestID() const; |
83 | 85 |
84 // CrossSiteResourceHandler for this request. May be null. | 86 // CrossSiteResourceHandler for this request. May be null. |
85 CrossSiteResourceHandler* cross_site_handler() { | 87 CrossSiteResourceHandler* cross_site_handler() { |
86 return cross_site_handler_; | 88 return cross_site_handler_; |
87 } | 89 } |
88 void set_cross_site_handler(CrossSiteResourceHandler* h) { | 90 void set_cross_site_handler(CrossSiteResourceHandler* h) { |
89 cross_site_handler_ = h; | 91 cross_site_handler_ = h; |
(...skipping 14 matching lines...) Expand all Loading... |
104 | 106 |
105 // Downloads are allowed only as a top level request. | 107 // Downloads are allowed only as a top level request. |
106 bool allow_download() const { return allow_download_; } | 108 bool allow_download() const { return allow_download_; } |
107 | 109 |
108 // Whether this is a download. | 110 // Whether this is a download. |
109 bool is_download() const { return is_download_; } | 111 bool is_download() const { return is_download_; } |
110 void set_is_download(bool download) { is_download_ = download; } | 112 void set_is_download(bool download) { is_download_ = download; } |
111 | 113 |
112 PageTransition transition_type() const { return transition_type_; } | 114 PageTransition transition_type() const { return transition_type_; } |
113 | 115 |
| 116 void set_was_ignored_by_handler(bool value) { |
| 117 was_ignored_by_handler_ = value; |
| 118 } |
| 119 |
114 // The approximate in-memory size (bytes) that we credited this request | 120 // The approximate in-memory size (bytes) that we credited this request |
115 // as consuming in |outstanding_requests_memory_cost_map_|. | 121 // as consuming in |outstanding_requests_memory_cost_map_|. |
116 int memory_cost() const { return memory_cost_; } | 122 int memory_cost() const { return memory_cost_; } |
117 void set_memory_cost(int cost) { memory_cost_ = cost; } | 123 void set_memory_cost(int cost) { memory_cost_ = cost; } |
118 | 124 |
119 // We hold a reference to the requested blob data to ensure it doesn't | 125 // We hold a reference to the requested blob data to ensure it doesn't |
120 // get finally released prior to the net::URLRequestJob being started. | 126 // get finally released prior to the net::URLRequestJob being started. |
121 webkit_blob::BlobData* requested_blob_data() const { | 127 webkit_blob::BlobData* requested_blob_data() const { |
122 return requested_blob_data_.get(); | 128 return requested_blob_data_.get(); |
123 } | 129 } |
124 void set_requested_blob_data(webkit_blob::BlobData* data); | 130 void set_requested_blob_data(webkit_blob::BlobData* data); |
125 | 131 |
126 private: | 132 private: |
127 // Non-owning, may be NULL. | 133 // Non-owning, may be NULL. |
128 CrossSiteResourceHandler* cross_site_handler_; | 134 CrossSiteResourceHandler* cross_site_handler_; |
129 AsyncResourceHandler* async_handler_; | 135 AsyncResourceHandler* async_handler_; |
130 | 136 |
131 ProcessType process_type_; | 137 ProcessType process_type_; |
132 int child_id_; | 138 int child_id_; |
133 int route_id_; | 139 int route_id_; |
134 int origin_pid_; | 140 int origin_pid_; |
135 int request_id_; | 141 int request_id_; |
136 bool is_main_frame_; | 142 bool is_main_frame_; |
137 int64 frame_id_; | 143 int64 frame_id_; |
138 bool parent_is_main_frame_; | 144 bool parent_is_main_frame_; |
139 int64 parent_frame_id_; | 145 int64 parent_frame_id_; |
140 bool is_download_; | 146 bool is_download_; |
141 bool allow_download_; | 147 bool allow_download_; |
142 bool has_user_gesture_; | 148 bool has_user_gesture_; |
| 149 bool was_ignored_by_handler_; |
143 ResourceType::Type resource_type_; | 150 ResourceType::Type resource_type_; |
144 PageTransition transition_type_; | 151 PageTransition transition_type_; |
145 int memory_cost_; | 152 int memory_cost_; |
146 scoped_refptr<webkit_blob::BlobData> requested_blob_data_; | 153 scoped_refptr<webkit_blob::BlobData> requested_blob_data_; |
147 WebKit::WebReferrerPolicy referrer_policy_; | 154 WebKit::WebReferrerPolicy referrer_policy_; |
148 ResourceContext* context_; | 155 ResourceContext* context_; |
149 | 156 |
150 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); | 157 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); |
151 }; | 158 }; |
152 | 159 |
153 } // namespace content | 160 } // namespace content |
154 | 161 |
155 #endif // CONTENT_BROWSER_RENDERER_HOST_RESOURCE_REQUEST_INFO_IMPL_H_ | 162 #endif // CONTENT_BROWSER_RENDERER_HOST_RESOURCE_REQUEST_INFO_IMPL_H_ |
OLD | NEW |