| 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 13 matching lines...) Expand all Loading... |
| 24 public: | 24 public: |
| 25 // Returns the ResourceRequestInfo associated with the given URLRequest. | 25 // Returns the ResourceRequestInfo associated with the given URLRequest. |
| 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 ResourceType::Type resource_type, |
| 34 ResourceContext* context); | 35 ResourceContext* context); |
| 35 | 36 |
| 36 // Returns the associated RenderView for a given process. Returns false, if | 37 // 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 // there is no associated RenderView. This method does not rely on the |
| 38 // request being allocated by the ResourceDispatcherHost, but works for all | 39 // request being allocated by the ResourceDispatcherHost, but works for all |
| 39 // URLRequests that are associated with a RenderView. | 40 // URLRequests that are associated with a RenderView. |
| 40 CONTENT_EXPORT static bool GetRenderViewForRequest( | 41 CONTENT_EXPORT static bool GetRenderViewForRequest( |
| 41 const net::URLRequest* request, | 42 const net::URLRequest* request, |
| 42 int* render_process_id, | 43 int* render_process_id, |
| 43 int* render_view_id); | 44 int* render_view_id); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 virtual bool GetAssociatedRenderView(int* render_process_id, | 87 virtual bool GetAssociatedRenderView(int* render_process_id, |
| 87 int* render_view_id) const = 0; | 88 int* render_view_id) const = 0; |
| 88 | 89 |
| 89 protected: | 90 protected: |
| 90 virtual ~ResourceRequestInfo() {} | 91 virtual ~ResourceRequestInfo() {} |
| 91 }; | 92 }; |
| 92 | 93 |
| 93 } // namespace content | 94 } // namespace content |
| 94 | 95 |
| 95 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_REQUEST_INFO_H_ | 96 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_REQUEST_INFO_H_ |
| OLD | NEW |