Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: content/public/browser/resource_request_info.h

Issue 10310124: Implement a ResourceThrottle for URL overriding in Chrome on Android. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix build (Referrer is a struct, not a class) Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/public/browser/render_view_host.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 14 matching lines...) Expand all
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 ResourceType::Type resource_type,
35 ResourceContext* context); 35 ResourceContext* context,
36 int render_process_id,
37 int render_view_id);
36 38
37 // Returns the associated RenderView for a given process. Returns false, if 39 // Returns the associated RenderView for a given process. Returns false, if
38 // there is no associated RenderView. This method does not rely on the 40 // there is no associated RenderView. This method does not rely on the
39 // request being allocated by the ResourceDispatcherHost, but works for all 41 // request being allocated by the ResourceDispatcherHost, but works for all
40 // URLRequests that are associated with a RenderView. 42 // URLRequests that are associated with a RenderView.
41 CONTENT_EXPORT static bool GetRenderViewForRequest( 43 CONTENT_EXPORT static bool GetRenderViewForRequest(
42 const net::URLRequest* request, 44 const net::URLRequest* request,
43 int* render_process_id, 45 int* render_process_id,
44 int* render_view_id); 46 int* render_view_id);
45 47
(...skipping 30 matching lines...) Expand all
76 // Returns the associated resource type. 78 // Returns the associated resource type.
77 virtual ResourceType::Type GetResourceType() const = 0; 79 virtual ResourceType::Type GetResourceType() const = 0;
78 80
79 // Returns the associated referrer policy. 81 // Returns the associated referrer policy.
80 virtual WebKit::WebReferrerPolicy GetReferrerPolicy() const = 0; 82 virtual WebKit::WebReferrerPolicy GetReferrerPolicy() const = 0;
81 83
82 // When there is upload data, this is the byte count of that data. When there 84 // When there is upload data, this is the byte count of that data. When there
83 // is no upload, this will be 0. 85 // is no upload, this will be 0.
84 virtual uint64 GetUploadSize() const = 0; 86 virtual uint64 GetUploadSize() const = 0;
85 87
88 // True if the request was initiated by a user action (like a tap to follow
89 // a link).
90 virtual bool HasUserGesture() const = 0;
91
86 // Returns false if there is NOT an associated render view. 92 // Returns false if there is NOT an associated render view.
87 virtual bool GetAssociatedRenderView(int* render_process_id, 93 virtual bool GetAssociatedRenderView(int* render_process_id,
88 int* render_view_id) const = 0; 94 int* render_view_id) const = 0;
89 95
90 protected: 96 protected:
91 virtual ~ResourceRequestInfo() {} 97 virtual ~ResourceRequestInfo() {}
92 }; 98 };
93 99
94 } // namespace content 100 } // namespace content
95 101
96 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_REQUEST_INFO_H_ 102 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_REQUEST_INFO_H_
OLDNEW
« no previous file with comments | « content/public/browser/render_view_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698