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

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

Issue 6628035: Move resource related IPCs to their own file in content. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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
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 #include "chrome/browser/renderer_host/download_throttling_resource_handler.h" 5 #include "chrome/browser/renderer_host/download_throttling_resource_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/download/download_util.h" 8 #include "chrome/browser/download/download_util.h"
9 #include "chrome/browser/renderer_host/download_resource_handler.h" 9 #include "chrome/browser/renderer_host/download_resource_handler.h"
10 #include "chrome/common/resource_response.h"
11 #include "content/browser/renderer_host/resource_dispatcher_host.h" 10 #include "content/browser/renderer_host/resource_dispatcher_host.h"
11 #include "content/common/resource_response.h"
12 #include "net/base/io_buffer.h" 12 #include "net/base/io_buffer.h"
13 #include "net/base/mime_sniffer.h" 13 #include "net/base/mime_sniffer.h"
14 14
15 DownloadThrottlingResourceHandler::DownloadThrottlingResourceHandler( 15 DownloadThrottlingResourceHandler::DownloadThrottlingResourceHandler(
16 ResourceDispatcherHost* host, 16 ResourceDispatcherHost* host,
17 net::URLRequest* request, 17 net::URLRequest* request,
18 const GURL& url, 18 const GURL& url,
19 int render_process_host_id, 19 int render_process_host_id,
20 int render_view_id, 20 int render_view_id,
21 int request_id, 21 int request_id,
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 int buf_size; 182 int buf_size;
183 if (download_handler_->OnWillRead(request_id_, &buffer, &buf_size, 183 if (download_handler_->OnWillRead(request_id_, &buffer, &buf_size,
184 tmp_buffer_length_)) { 184 tmp_buffer_length_)) {
185 CHECK(buf_size >= tmp_buffer_length_); 185 CHECK(buf_size >= tmp_buffer_length_);
186 memcpy(buffer->data(), tmp_buffer_->data(), tmp_buffer_length_); 186 memcpy(buffer->data(), tmp_buffer_->data(), tmp_buffer_length_);
187 download_handler_->OnReadCompleted(request_id_, &tmp_buffer_length_); 187 download_handler_->OnReadCompleted(request_id_, &tmp_buffer_length_);
188 } 188 }
189 tmp_buffer_length_ = 0; 189 tmp_buffer_length_ = 0;
190 tmp_buffer_ = NULL; 190 tmp_buffer_ = NULL;
191 } 191 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698