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