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

Side by Side Diff: chrome/browser/prerender/prerender_resource_throttle.h

Issue 893843003: Add RedirectInfo as a redirect parameter to ResourceThrottles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Document ResourceThrottle Created 5 years, 10 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 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 "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 14 matching lines...) Expand all
25 // TODO(davidben): Experiment with deferring network requests that 25 // TODO(davidben): Experiment with deferring network requests that
26 // would otherwise cancel the prerender. 26 // would otherwise cancel the prerender.
27 class PrerenderResourceThrottle 27 class PrerenderResourceThrottle
28 : public content::ResourceThrottle, 28 : public content::ResourceThrottle,
29 public base::SupportsWeakPtr<PrerenderResourceThrottle> { 29 public base::SupportsWeakPtr<PrerenderResourceThrottle> {
30 public: 30 public:
31 explicit PrerenderResourceThrottle(net::URLRequest* request); 31 explicit PrerenderResourceThrottle(net::URLRequest* request);
32 32
33 // content::ResourceThrottle implementation: 33 // content::ResourceThrottle implementation:
34 void WillStartRequest(bool* defer) override; 34 void WillStartRequest(bool* defer) override;
35 void WillRedirectRequest(const GURL& new_url, bool* defer) override; 35 void WillRedirectRequest(const net::RedirectInfo& redirect_info,
36 bool* defer) override;
36 const char* GetNameForLogging() const override; 37 const char* GetNameForLogging() const override;
37 38
38 // Called by the PrerenderContents when a prerender becomes visible. 39 // Called by the PrerenderContents when a prerender becomes visible.
39 // May only be called if currently throttling the resource. 40 // May only be called if currently throttling the resource.
40 void Resume(); 41 void Resume();
41 42
42 static void OverridePrerenderContentsForTesting(PrerenderContents* contents); 43 static void OverridePrerenderContentsForTesting(PrerenderContents* contents);
43 44
44 private: 45 private:
45 // Helper method to cancel the request. May only be called if currently 46 // Helper method to cancel the request. May only be called if currently
(...skipping 23 matching lines...) Expand all
69 int render_process_id, int render_frame_id); 70 int render_process_id, int render_frame_id);
70 71
71 net::URLRequest* request_; 72 net::URLRequest* request_;
72 73
73 DISALLOW_COPY_AND_ASSIGN(PrerenderResourceThrottle); 74 DISALLOW_COPY_AND_ASSIGN(PrerenderResourceThrottle);
74 }; 75 };
75 76
76 } // namespace prerender 77 } // namespace prerender
77 78
78 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_RESOURCE_THROTTLE_H_ 79 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_RESOURCE_THROTTLE_H_
OLDNEW
« no previous file with comments | « chrome/browser/download/download_resource_throttle.cc ('k') | chrome/browser/prerender/prerender_resource_throttle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698