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

Side by Side Diff: chrome/browser/download/download_resource_throttle.h

Issue 9522006: Make DownloadResourceThrottle robust to ContinueDownload being called before (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/download/download_resource_throttle.cc » ('j') | 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 CHROME_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_THROTTLE_H_ 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_THROTTLE_H_
6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_THROTTLE_H_ 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_THROTTLE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "chrome/browser/download/download_request_limiter.h" 10 #include "chrome/browser/download/download_request_limiter.h"
(...skipping 18 matching lines...) Expand all
29 int request_id); 29 int request_id);
30 30
31 // content::ResourceThrottle implementation: 31 // content::ResourceThrottle implementation:
32 virtual void WillStartRequest(bool* defer) OVERRIDE; 32 virtual void WillStartRequest(bool* defer) OVERRIDE;
33 virtual void WillRedirectRequest(const GURL& new_url, bool* defer) OVERRIDE; 33 virtual void WillRedirectRequest(const GURL& new_url, bool* defer) OVERRIDE;
34 virtual void WillProcessResponse(bool* defer) OVERRIDE; 34 virtual void WillProcessResponse(bool* defer) OVERRIDE;
35 35
36 private: 36 private:
37 virtual ~DownloadResourceThrottle(); 37 virtual ~DownloadResourceThrottle();
38 38
39 void WillDownload(bool* defer);
39 void ContinueDownload(bool allow); 40 void ContinueDownload(bool allow);
40 41
42 // Set to true when we are querying the DownloadRequestLimiter.
43 bool querying_limiter_;
44
41 // Set to true when we know that the request is allowed to start. 45 // Set to true when we know that the request is allowed to start.
42 bool request_allowed_; 46 bool request_allowed_;
43 47
44 // Set to true when we have deferred the request. 48 // Set to true when we have deferred the request.
45 bool request_deferred_; 49 bool request_deferred_;
46 50
47 DISALLOW_COPY_AND_ASSIGN(DownloadResourceThrottle); 51 DISALLOW_COPY_AND_ASSIGN(DownloadResourceThrottle);
48 }; 52 };
49 53
50 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_THROTTLE_H_ 54 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_THROTTLE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/download_resource_throttle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698