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_PUBLIC_BROWSER_RESOURCE_REQUEST_INFO_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_REQUEST_INFO_H_ |
6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_REQUEST_INFO_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_REQUEST_INFO_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "content/public/common/resource_type.h" | 10 #include "content/public/common/resource_type.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 // Each URLRequest allocated by the ResourceDispatcherHost has a | 23 // Each URLRequest allocated by the ResourceDispatcherHost has a |
24 // ResourceRequestInfo instance associated with it. | 24 // ResourceRequestInfo instance associated with it. |
25 class ResourceRequestInfo { | 25 class ResourceRequestInfo { |
26 public: | 26 public: |
27 // Returns the ResourceRequestInfo associated with the given URLRequest. | 27 // Returns the ResourceRequestInfo associated with the given URLRequest. |
28 CONTENT_EXPORT static const ResourceRequestInfo* ForRequest( | 28 CONTENT_EXPORT static const ResourceRequestInfo* ForRequest( |
29 const net::URLRequest* request); | 29 const net::URLRequest* request); |
30 | 30 |
31 // Allocates a new, dummy ResourceRequestInfo and associates it with the | 31 // Allocates a new, dummy ResourceRequestInfo and associates it with the |
32 // given URLRequest. | 32 // given URLRequest. |
| 33 // |
| 34 // The RenderView routing ID must correspond to the RenderView of the |
| 35 // RenderFrame, both of which share the same RenderProcess. This may be a |
| 36 // different RenderView than the WebContents' main RenderView. If the |
| 37 // download is not associated with a frame, the IDs can be all -1. |
| 38 // |
33 // NOTE: Add more parameters if you need to initialize other fields. | 39 // NOTE: Add more parameters if you need to initialize other fields. |
34 CONTENT_EXPORT static void AllocateForTesting(net::URLRequest* request, | 40 CONTENT_EXPORT static void AllocateForTesting(net::URLRequest* request, |
35 ResourceType resource_type, | 41 ResourceType resource_type, |
36 ResourceContext* context, | 42 ResourceContext* context, |
37 int render_process_id, | 43 int render_process_id, |
38 int render_view_id, | 44 int render_view_id, |
39 int render_frame_id, | 45 int render_frame_id, |
40 bool is_main_frame, | 46 bool is_main_frame, |
41 bool parent_is_main_frame, | 47 bool parent_is_main_frame, |
42 bool allow_download, | 48 bool allow_download, |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // Whether this request if using Lo-Fi mode. | 152 // Whether this request if using Lo-Fi mode. |
147 virtual bool IsUsingLoFi() const = 0; | 153 virtual bool IsUsingLoFi() const = 0; |
148 | 154 |
149 protected: | 155 protected: |
150 virtual ~ResourceRequestInfo() {} | 156 virtual ~ResourceRequestInfo() {} |
151 }; | 157 }; |
152 | 158 |
153 } // namespace content | 159 } // namespace content |
154 | 160 |
155 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_REQUEST_INFO_H_ | 161 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_REQUEST_INFO_H_ |
OLD | NEW |