| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 int child_id, | 47 int child_id, |
| 48 int route_id, | 48 int route_id, |
| 49 int origin_pid, | 49 int origin_pid, |
| 50 int request_id, | 50 int request_id, |
| 51 bool is_main_frame, | 51 bool is_main_frame, |
| 52 int64 frame_id, | 52 int64 frame_id, |
| 53 bool parent_is_main_frame, | 53 bool parent_is_main_frame, |
| 54 int64 parent_frame_id, | 54 int64 parent_frame_id, |
| 55 ResourceType::Type resource_type, | 55 ResourceType::Type resource_type, |
| 56 PageTransition transition_type, | 56 PageTransition transition_type, |
| 57 uint64 upload_size, | |
| 58 bool is_download, | 57 bool is_download, |
| 59 bool allow_download, | 58 bool allow_download, |
| 60 bool has_user_gesture, | 59 bool has_user_gesture, |
| 61 WebKit::WebReferrerPolicy referrer_policy, | 60 WebKit::WebReferrerPolicy referrer_policy, |
| 62 ResourceContext* context); | 61 ResourceContext* context); |
| 63 virtual ~ResourceRequestInfoImpl(); | 62 virtual ~ResourceRequestInfoImpl(); |
| 64 | 63 |
| 65 // ResourceRequestInfo implementation: | 64 // ResourceRequestInfo implementation: |
| 66 virtual ResourceContext* GetContext() const OVERRIDE; | 65 virtual ResourceContext* GetContext() const OVERRIDE; |
| 67 virtual int GetChildID() const OVERRIDE; | 66 virtual int GetChildID() const OVERRIDE; |
| 68 virtual int GetRouteID() const OVERRIDE; | 67 virtual int GetRouteID() const OVERRIDE; |
| 69 virtual int GetOriginPID() const OVERRIDE; | 68 virtual int GetOriginPID() const OVERRIDE; |
| 70 virtual int GetRequestID() const OVERRIDE; | 69 virtual int GetRequestID() const OVERRIDE; |
| 71 virtual bool IsMainFrame() const OVERRIDE; | 70 virtual bool IsMainFrame() const OVERRIDE; |
| 72 virtual int64 GetFrameID() const OVERRIDE; | 71 virtual int64 GetFrameID() const OVERRIDE; |
| 73 virtual bool ParentIsMainFrame() const OVERRIDE; | 72 virtual bool ParentIsMainFrame() const OVERRIDE; |
| 74 virtual int64 GetParentFrameID() const OVERRIDE; | 73 virtual int64 GetParentFrameID() const OVERRIDE; |
| 75 virtual ResourceType::Type GetResourceType() const OVERRIDE; | 74 virtual ResourceType::Type GetResourceType() const OVERRIDE; |
| 76 virtual WebKit::WebReferrerPolicy GetReferrerPolicy() const OVERRIDE; | 75 virtual WebKit::WebReferrerPolicy GetReferrerPolicy() const OVERRIDE; |
| 77 virtual uint64 GetUploadSize() const OVERRIDE; | |
| 78 virtual bool HasUserGesture() const OVERRIDE; | 76 virtual bool HasUserGesture() const OVERRIDE; |
| 79 virtual bool GetAssociatedRenderView(int* render_process_id, | 77 virtual bool GetAssociatedRenderView(int* render_process_id, |
| 80 int* render_view_id) const OVERRIDE; | 78 int* render_view_id) const OVERRIDE; |
| 81 | 79 |
| 82 void AssociateWithRequest(net::URLRequest* request); | 80 void AssociateWithRequest(net::URLRequest* request); |
| 83 | 81 |
| 84 GlobalRequestID GetGlobalRequestID() const; | 82 GlobalRequestID GetGlobalRequestID() const; |
| 85 | 83 |
| 86 // CrossSiteResourceHandler for this request. May be null. | 84 // CrossSiteResourceHandler for this request. May be null. |
| 87 CrossSiteResourceHandler* cross_site_handler() { | 85 CrossSiteResourceHandler* cross_site_handler() { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 106 | 104 |
| 107 // Downloads are allowed only as a top level request. | 105 // Downloads are allowed only as a top level request. |
| 108 bool allow_download() const { return allow_download_; } | 106 bool allow_download() const { return allow_download_; } |
| 109 | 107 |
| 110 // Whether this is a download. | 108 // Whether this is a download. |
| 111 bool is_download() const { return is_download_; } | 109 bool is_download() const { return is_download_; } |
| 112 void set_is_download(bool download) { is_download_ = download; } | 110 void set_is_download(bool download) { is_download_ = download; } |
| 113 | 111 |
| 114 PageTransition transition_type() const { return transition_type_; } | 112 PageTransition transition_type() const { return transition_type_; } |
| 115 | 113 |
| 116 void set_upload_size(uint64 upload_size) { upload_size_ = upload_size; } | |
| 117 | |
| 118 // The approximate in-memory size (bytes) that we credited this request | 114 // The approximate in-memory size (bytes) that we credited this request |
| 119 // as consuming in |outstanding_requests_memory_cost_map_|. | 115 // as consuming in |outstanding_requests_memory_cost_map_|. |
| 120 int memory_cost() const { return memory_cost_; } | 116 int memory_cost() const { return memory_cost_; } |
| 121 void set_memory_cost(int cost) { memory_cost_ = cost; } | 117 void set_memory_cost(int cost) { memory_cost_ = cost; } |
| 122 | 118 |
| 123 // We hold a reference to the requested blob data to ensure it doesn't | 119 // 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. | 120 // get finally released prior to the net::URLRequestJob being started. |
| 125 webkit_blob::BlobData* requested_blob_data() const { | 121 webkit_blob::BlobData* requested_blob_data() const { |
| 126 return requested_blob_data_.get(); | 122 return requested_blob_data_.get(); |
| 127 } | 123 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 139 int request_id_; | 135 int request_id_; |
| 140 bool is_main_frame_; | 136 bool is_main_frame_; |
| 141 int64 frame_id_; | 137 int64 frame_id_; |
| 142 bool parent_is_main_frame_; | 138 bool parent_is_main_frame_; |
| 143 int64 parent_frame_id_; | 139 int64 parent_frame_id_; |
| 144 bool is_download_; | 140 bool is_download_; |
| 145 bool allow_download_; | 141 bool allow_download_; |
| 146 bool has_user_gesture_; | 142 bool has_user_gesture_; |
| 147 ResourceType::Type resource_type_; | 143 ResourceType::Type resource_type_; |
| 148 PageTransition transition_type_; | 144 PageTransition transition_type_; |
| 149 uint64 upload_size_; | |
| 150 int memory_cost_; | 145 int memory_cost_; |
| 151 scoped_refptr<webkit_blob::BlobData> requested_blob_data_; | 146 scoped_refptr<webkit_blob::BlobData> requested_blob_data_; |
| 152 WebKit::WebReferrerPolicy referrer_policy_; | 147 WebKit::WebReferrerPolicy referrer_policy_; |
| 153 ResourceContext* context_; | 148 ResourceContext* context_; |
| 154 | 149 |
| 155 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); | 150 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); |
| 156 }; | 151 }; |
| 157 | 152 |
| 158 } // namespace content | 153 } // namespace content |
| 159 | 154 |
| 160 #endif // CONTENT_BROWSER_RENDERER_HOST_RESOURCE_REQUEST_INFO_IMPL_H_ | 155 #endif // CONTENT_BROWSER_RENDERER_HOST_RESOURCE_REQUEST_INFO_IMPL_H_ |
| OLD | NEW |