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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 CONTENT_EXPORT static const ResourceRequestInfo* ForRequest( | 26 CONTENT_EXPORT static const ResourceRequestInfo* ForRequest( |
27 const net::URLRequest* request); | 27 const net::URLRequest* request); |
28 | 28 |
29 // Allocates a new, dummy ResourceRequestInfo and associates it with the | 29 // Allocates a new, dummy ResourceRequestInfo and associates it with the |
30 // given URLRequest. | 30 // given URLRequest. |
31 // NOTE: Add more parameters if you need to initialize other fields. | 31 // NOTE: Add more parameters if you need to initialize other fields. |
32 CONTENT_EXPORT static void AllocateForTesting( | 32 CONTENT_EXPORT static void AllocateForTesting( |
33 net::URLRequest* request, | 33 net::URLRequest* request, |
34 ResourceContext* context); | 34 ResourceContext* context); |
35 | 35 |
| 36 // Returns the associated RenderView for a given process. Returns false, if |
| 37 // there is no associated RenderView. This method does not rely on the |
| 38 // request being allocated by the ResourceDispatcherHost, but works for all |
| 39 // URLRequests that are associated with a RenderView. |
| 40 CONTENT_EXPORT static bool GetRenderViewForRequest( |
| 41 const net::URLRequest* request, |
| 42 int* render_process_id, |
| 43 int* render_view_id); |
| 44 |
36 // Returns the associated ResourceContext. | 45 // Returns the associated ResourceContext. |
37 virtual ResourceContext* GetContext() const = 0; | 46 virtual ResourceContext* GetContext() const = 0; |
38 | 47 |
39 // The child process unique ID of the requestor. | 48 // The child process unique ID of the requestor. |
40 virtual int GetChildID() const = 0; | 49 virtual int GetChildID() const = 0; |
41 | 50 |
42 // The IPC route identifier for this request (this identifies the RenderView | 51 // The IPC route identifier for this request (this identifies the RenderView |
43 // or like-thing in the renderer that the request gets routed to). | 52 // or like-thing in the renderer that the request gets routed to). |
44 virtual int GetRouteID() const = 0; | 53 virtual int GetRouteID() const = 0; |
45 | 54 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 virtual bool GetAssociatedRenderView(int* render_process_id, | 86 virtual bool GetAssociatedRenderView(int* render_process_id, |
78 int* render_view_id) const = 0; | 87 int* render_view_id) const = 0; |
79 | 88 |
80 protected: | 89 protected: |
81 virtual ~ResourceRequestInfo() {} | 90 virtual ~ResourceRequestInfo() {} |
82 }; | 91 }; |
83 | 92 |
84 } // namespace content | 93 } // namespace content |
85 | 94 |
86 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_REQUEST_INFO_H_ | 95 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_REQUEST_INFO_H_ |
OLD | NEW |