OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_PRERENDER_PRERENDER_RESOURCE_THROTTLE_H_ | 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_RESOURCE_THROTTLE_H_ |
6 #define CHROME_BROWSER_PRERENDER_PRERENDER_RESOURCE_THROTTLE_H_ | 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_RESOURCE_THROTTLE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "chrome/common/prerender_types.h" | |
13 #include "content/public/browser/resource_request_info.h" | 14 #include "content/public/browser/resource_request_info.h" |
14 #include "content/public/browser/resource_throttle.h" | 15 #include "content/public/browser/resource_throttle.h" |
15 #include "content/public/common/resource_type.h" | 16 #include "content/public/common/resource_type.h" |
16 | 17 |
17 class GURL; | 18 class GURL; |
18 | 19 |
19 namespace net { | 20 namespace net { |
20 class URLRequest; | 21 class URLRequest; |
21 } | 22 } |
22 | 23 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
76 bool is_no_store, | 77 bool is_no_store, |
77 int redirect_count, | 78 int redirect_count, |
78 scoped_refptr<PrerenderThrottleInfo> prerender_throttle_info); | 79 scoped_refptr<PrerenderThrottleInfo> prerender_throttle_info); |
79 | 80 |
80 // Helper to return the PrerenderContents given a WebContentsGetter. May | 81 // Helper to return the PrerenderContents given a WebContentsGetter. May |
81 // return nullptr if it's gone. | 82 // return nullptr if it's gone. |
82 static PrerenderContents* PrerenderContentsFromGetter( | 83 static PrerenderContents* PrerenderContentsFromGetter( |
83 const content::ResourceRequestInfo::WebContentsGetter& | 84 const content::ResourceRequestInfo::WebContentsGetter& |
84 web_contents_getter); | 85 web_contents_getter); |
85 | 86 |
87 // Sets the prerender mode. Must be called befor ResumeHandler(). | |
clamy
2016/12/23 12:33:32
nit:s/befor/before
| |
88 void SetPrerenderMode(PrerenderMode mode); | |
89 | |
86 net::URLRequest* request_; | 90 net::URLRequest* request_; |
91 int load_flags_; // Load flags to be OR'ed with the existing request flags. | |
87 | 92 |
88 scoped_refptr<PrerenderThrottleInfo> prerender_throttle_info_; | 93 scoped_refptr<PrerenderThrottleInfo> prerender_throttle_info_; |
89 | 94 |
90 DISALLOW_COPY_AND_ASSIGN(PrerenderResourceThrottle); | 95 DISALLOW_COPY_AND_ASSIGN(PrerenderResourceThrottle); |
91 }; | 96 }; |
92 | 97 |
93 } // namespace prerender | 98 } // namespace prerender |
94 | 99 |
95 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_RESOURCE_THROTTLE_H_ | 100 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_RESOURCE_THROTTLE_H_ |
OLD | NEW |