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

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

Issue 2484633004: Change Lo-Fi bool to bitmask to support multiple Previews types (Closed)
Patch Set: fix ContentResourceProviderTest Created 3 years, 11 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
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 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/browser/global_request_id.h" 10 #include "content/public/browser/global_request_id.h"
11 #include "content/public/common/previews_state.h"
11 #include "content/public/common/resource_type.h" 12 #include "content/public/common/resource_type.h"
12 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" 13 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h"
13 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" 14 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h"
14 #include "ui/base/page_transition_types.h" 15 #include "ui/base/page_transition_types.h"
15 16
16 namespace net { 17 namespace net {
17 class URLRequest; 18 class URLRequest;
18 } 19 }
19 20
20 namespace content { 21 namespace content {
(...skipping 21 matching lines...) Expand all
42 CONTENT_EXPORT static void AllocateForTesting(net::URLRequest* request, 43 CONTENT_EXPORT static void AllocateForTesting(net::URLRequest* request,
43 ResourceType resource_type, 44 ResourceType resource_type,
44 ResourceContext* context, 45 ResourceContext* context,
45 int render_process_id, 46 int render_process_id,
46 int render_view_id, 47 int render_view_id,
47 int render_frame_id, 48 int render_frame_id,
48 bool is_main_frame, 49 bool is_main_frame,
49 bool parent_is_main_frame, 50 bool parent_is_main_frame,
50 bool allow_download, 51 bool allow_download,
51 bool is_async, 52 bool is_async,
52 bool is_using_lofi); 53 PreviewsState previews_state);
53 54
54 // Returns the associated RenderFrame for a given process. Returns false, if 55 // Returns the associated RenderFrame for a given process. Returns false, if
55 // there is no associated RenderFrame. This method does not rely on the 56 // there is no associated RenderFrame. This method does not rely on the
56 // request being allocated by the ResourceDispatcherHost, but works for all 57 // request being allocated by the ResourceDispatcherHost, but works for all
57 // URLRequests that are associated with a RenderFrame. 58 // URLRequests that are associated with a RenderFrame.
58 CONTENT_EXPORT static bool GetRenderFrameForRequest( 59 CONTENT_EXPORT static bool GetRenderFrameForRequest(
59 const net::URLRequest* request, 60 const net::URLRequest* request,
60 int* render_process_id, 61 int* render_process_id,
61 int* render_frame_id); 62 int* render_frame_id);
62 63
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // Returns false if there is NOT an associated render frame. 152 // Returns false if there is NOT an associated render frame.
152 virtual bool GetAssociatedRenderFrame(int* render_process_id, 153 virtual bool GetAssociatedRenderFrame(int* render_process_id,
153 int* render_frame_id) const = 0; 154 int* render_frame_id) const = 0;
154 155
155 // Returns true if this is associated with an asynchronous request. 156 // Returns true if this is associated with an asynchronous request.
156 virtual bool IsAsync() const = 0; 157 virtual bool IsAsync() const = 0;
157 158
158 // Whether this is a download. 159 // Whether this is a download.
159 virtual bool IsDownload() const = 0; 160 virtual bool IsDownload() const = 0;
160 161
161 // Whether this request if using Lo-Fi mode. 162 // Returns the current state of Previews.
162 virtual bool IsUsingLoFi() const = 0; 163 virtual PreviewsState GetPreviewsState() const = 0;
163 164
164 // PlzNavigate 165 // PlzNavigate
165 // Only used for navigations. Returns opaque data set by the embedder on the 166 // Only used for navigations. Returns opaque data set by the embedder on the
166 // UI thread at the beginning of navigation. 167 // UI thread at the beginning of navigation.
167 virtual NavigationUIData* GetNavigationUIData() const = 0; 168 virtual NavigationUIData* GetNavigationUIData() const = 0;
168 169
169 protected: 170 protected:
170 virtual ~ResourceRequestInfo() {} 171 virtual ~ResourceRequestInfo() {}
171 }; 172 };
172 173
173 } // namespace content 174 } // namespace content
174 175
175 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_REQUEST_INFO_H_ 176 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_REQUEST_INFO_H_
OLDNEW
« no previous file with comments | « content/public/browser/resource_dispatcher_host_delegate.cc ('k') | content/public/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698