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

Side by Side Diff: content/browser/download/download_resource_handler.h

Issue 129173002: Adds the new URLRequest::OnBeforeNetworkStart hook to the (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@defer_1_net
Patch Set: Created 6 years, 11 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 (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 CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // Send the download creation information to the download thread. 57 // Send the download creation information to the download thread.
58 virtual bool OnResponseStarted(int request_id, 58 virtual bool OnResponseStarted(int request_id,
59 ResourceResponse* response, 59 ResourceResponse* response,
60 bool* defer) OVERRIDE; 60 bool* defer) OVERRIDE;
61 61
62 // Pass-through implementation. 62 // Pass-through implementation.
63 virtual bool OnWillStart(int request_id, 63 virtual bool OnWillStart(int request_id,
64 const GURL& url, 64 const GURL& url,
65 bool* defer) OVERRIDE; 65 bool* defer) OVERRIDE;
66 66
67 // Pass-through implementation.
68 virtual bool OnBeforeNetworkStart(int request_id,
69 const GURL& url,
70 bool* defer) OVERRIDE;
71
67 // Create a new buffer, which will be handed to the download thread for file 72 // Create a new buffer, which will be handed to the download thread for file
68 // writing and deletion. 73 // writing and deletion.
69 virtual bool OnWillRead(int request_id, 74 virtual bool OnWillRead(int request_id,
70 scoped_refptr<net::IOBuffer>* buf, 75 scoped_refptr<net::IOBuffer>* buf,
71 int* buf_size, 76 int* buf_size,
72 int min_size) OVERRIDE; 77 int min_size) OVERRIDE;
73 78
74 virtual bool OnReadCompleted(int request_id, int bytes_read, 79 virtual bool OnReadCompleted(int request_id, int bytes_read,
75 bool* defer) OVERRIDE; 80 bool* defer) OVERRIDE;
76 81
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 127
123 static const int kReadBufSize = 32768; // bytes 128 static const int kReadBufSize = 32768; // bytes
124 static const int kThrottleTimeMs = 200; // milliseconds 129 static const int kThrottleTimeMs = 200; // milliseconds
125 130
126 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler); 131 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler);
127 }; 132 };
128 133
129 } // namespace content 134 } // namespace content
130 135
131 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ 136 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/download/download_resource_handler.cc » ('j') | content/browser/loader/resource_loader.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698