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

Side by Side Diff: chrome/browser/renderer_host/download_throttling_resource_handler.h

Issue 6459005: Cancel prerender when we discover a download starting from a page we are prer... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Now with conflicts resolved Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_RENDERER_HOST_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_ 5 #ifndef CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_
6 #define CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_ 6 #define CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "chrome/browser/download/download_request_limiter.h" 11 #include "chrome/browser/download/download_request_limiter.h"
12 #include "chrome/browser/renderer_host/resource_handler.h" 12 #include "chrome/browser/renderer_host/resource_handler.h"
13 #include "chrome/common/notification_type.h"
cbentzel 2011/02/10 14:44:34 Include not needed.
dominich 2011/02/10 18:46:22 Done.
13 #include "googleurl/src/gurl.h" 14 #include "googleurl/src/gurl.h"
14 15
15 class DownloadResourceHandler; 16 class DownloadResourceHandler;
16 class ResourceDispatcherHost; 17 class ResourceDispatcherHost;
18 class ResourceRequestDetails;
cbentzel 2011/02/10 14:44:34 This isn't needed now that you are passing NoDetai
dominich 2011/02/10 18:46:22 Done.
17 19
18 namespace net { 20 namespace net {
19 class URLRequest; 21 class URLRequest;
20 } // namespace net 22 } // namespace net
21 23
22 // DownloadThrottlingResourceHandler is used to determine if a download should 24 // DownloadThrottlingResourceHandler is used to determine if a download should
23 // be allowed. When a DownloadThrottlingResourceHandler is created it pauses the 25 // be allowed. When a DownloadThrottlingResourceHandler is created it pauses the
24 // download and asks the DownloadRequestLimiter if the download should be 26 // download and asks the DownloadRequestLimiter if the download should be
25 // allowed. The DownloadRequestLimiter notifies us asynchronously as to whether 27 // allowed. The DownloadRequestLimiter notifies us asynchronously as to whether
26 // the download is allowed or not. If the download is allowed the request is 28 // the download is allowed or not. If the download is allowed the request is
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // DownloadRequestLimiter::Callback implementation: 60 // DownloadRequestLimiter::Callback implementation:
59 virtual void CancelDownload(); 61 virtual void CancelDownload();
60 virtual void ContinueDownload(); 62 virtual void ContinueDownload();
61 virtual int GetRequestId(); 63 virtual int GetRequestId();
62 64
63 private: 65 private:
64 virtual ~DownloadThrottlingResourceHandler(); 66 virtual ~DownloadThrottlingResourceHandler();
65 67
66 void CopyTmpBufferToDownloadHandler(); 68 void CopyTmpBufferToDownloadHandler();
67 69
70 ResourceRequestDetails* GetResourceRequestDetails();
cbentzel 2011/02/10 14:44:34 Also not needed since passing NoDetails.
dominich 2011/02/10 18:46:22 Done.
71
68 ResourceDispatcherHost* host_; 72 ResourceDispatcherHost* host_;
69 net::URLRequest* request_; 73 net::URLRequest* request_;
70 GURL url_; 74 GURL url_;
71 int render_process_host_id_; 75 int render_process_host_id_;
72 int render_view_id_; 76 int render_view_id_;
73 int request_id_; 77 int request_id_;
74 78
75 // Handles the actual download. This is only created if the download is 79 // Handles the actual download. This is only created if the download is
76 // allowed to continue. 80 // allowed to continue.
77 scoped_refptr<DownloadResourceHandler> download_handler_; 81 scoped_refptr<DownloadResourceHandler> download_handler_;
(...skipping 10 matching lines...) Expand all
88 // If true the next call to OnReadCompleted is ignored. This is used if we're 92 // If true the next call to OnReadCompleted is ignored. This is used if we're
89 // paused during a call to OnReadCompleted. Pausing during OnReadCompleted 93 // paused during a call to OnReadCompleted. Pausing during OnReadCompleted
90 // results in two calls to OnReadCompleted for the same data. This make sure 94 // results in two calls to OnReadCompleted for the same data. This make sure
91 // we ignore one of them. 95 // we ignore one of them.
92 bool ignore_on_read_complete_; 96 bool ignore_on_read_complete_;
93 97
94 DISALLOW_COPY_AND_ASSIGN(DownloadThrottlingResourceHandler); 98 DISALLOW_COPY_AND_ASSIGN(DownloadThrottlingResourceHandler);
95 }; 99 };
96 100
97 #endif // CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_ 101 #endif // CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_THROTTLING_RESOURCE_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698