| 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" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 const base::WeakPtr<PrerenderResourceThrottle>& throttle, | 66 const base::WeakPtr<PrerenderResourceThrottle>& throttle, |
| 67 const std::string& follow_only_when_prerender_shown_header, | 67 const std::string& follow_only_when_prerender_shown_header, |
| 68 content::ResourceType resource_type, | 68 content::ResourceType resource_type, |
| 69 bool async, | 69 bool async, |
| 70 bool is_no_store, | 70 bool is_no_store, |
| 71 const GURL& new_url, | 71 const GURL& new_url, |
| 72 const content::ResourceRequestInfo::WebContentsGetter& | 72 const content::ResourceRequestInfo::WebContentsGetter& |
| 73 web_contents_getter); | 73 web_contents_getter); |
| 74 | 74 |
| 75 static void WillProcessResponseOnUI( | 75 static void WillProcessResponseOnUI( |
| 76 const base::WeakPtr<PrerenderResourceThrottle>& throttle, |
| 76 bool is_main_resource, | 77 bool is_main_resource, |
| 77 bool is_no_store, | 78 bool is_no_store, |
| 78 int redirect_count, | 79 int redirect_count, |
| 80 bool has_appcache, |
| 81 const content::ResourceRequestInfo::WebContentsGetter& |
| 82 web_contents_getter, |
| 79 scoped_refptr<PrerenderThrottleInfo> prerender_throttle_info); | 83 scoped_refptr<PrerenderThrottleInfo> prerender_throttle_info); |
| 80 | 84 |
| 81 // Helper to return the PrerenderContents given a WebContentsGetter. May | 85 // Helper to return the PrerenderContents given a WebContentsGetter. May |
| 82 // return nullptr if it's gone. | 86 // return nullptr if it's gone. |
| 83 static PrerenderContents* PrerenderContentsFromGetter( | 87 static PrerenderContents* PrerenderContentsFromGetter( |
| 84 const content::ResourceRequestInfo::WebContentsGetter& | 88 const content::ResourceRequestInfo::WebContentsGetter& |
| 85 web_contents_getter); | 89 web_contents_getter); |
| 86 | 90 |
| 87 // Sets the prerender mode. Must be called before |ResumeHandler()|. | 91 // Sets the prerender mode. Must be called before |ResumeHandler()|. |
| 88 void SetPrerenderMode(PrerenderMode mode); | 92 void SetPrerenderMode(PrerenderMode mode); |
| 89 | 93 |
| 90 net::URLRequest* request_; | 94 net::URLRequest* request_; |
| 91 int load_flags_; // Load flags to be OR'ed with the existing request flags. | 95 int load_flags_; // Load flags to be OR'ed with the existing request flags. |
| 92 | 96 |
| 93 scoped_refptr<PrerenderThrottleInfo> prerender_throttle_info_; | 97 scoped_refptr<PrerenderThrottleInfo> prerender_throttle_info_; |
| 94 | 98 |
| 95 DISALLOW_COPY_AND_ASSIGN(PrerenderResourceThrottle); | 99 DISALLOW_COPY_AND_ASSIGN(PrerenderResourceThrottle); |
| 96 }; | 100 }; |
| 97 | 101 |
| 98 } // namespace prerender | 102 } // namespace prerender |
| 99 | 103 |
| 100 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_RESOURCE_THROTTLE_H_ | 104 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_RESOURCE_THROTTLE_H_ |
| OLD | NEW |