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

Side by Side Diff: chrome/browser/automation/url_request_slow_download_job.cc

Issue 115870: Reduce header dependencies in net/ (Closed)
Patch Set: Created 11 years, 6 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/automation/url_request_slow_download_job.h" 5 #include "chrome/browser/automation/url_request_slow_download_job.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "googleurl/src/gurl.h" 9 #include "googleurl/src/gurl.h"
10 #include "net/base/io_buffer.h"
10 #include "net/http/http_response_headers.h" 11 #include "net/http/http_response_headers.h"
11 #include "net/url_request/url_request.h" 12 #include "net/url_request/url_request.h"
12 #include "net/url_request/url_request_filter.h" 13 #include "net/url_request/url_request_filter.h"
13 14
14 const int kFirstDownloadSize = 1024 * 35; 15 const int kFirstDownloadSize = 1024 * 35;
15 const int kSecondDownloadSize = 1024 * 10; 16 const int kSecondDownloadSize = 1024 * 10;
16 17
17 const char URLRequestSlowDownloadJob::kUnknownSizeUrl[] = 18 const char URLRequestSlowDownloadJob::kUnknownSizeUrl[] =
18 "http://url.handled.by.slow.download/download-unknown-size"; 19 "http://url.handled.by.slow.download/download-unknown-size";
19 const char URLRequestSlowDownloadJob::kKnownSizeUrl[] = 20 const char URLRequestSlowDownloadJob::kKnownSizeUrl[] =
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 // ParseRawHeaders expects \0 to end each header line. 163 // ParseRawHeaders expects \0 to end each header line.
163 ReplaceSubstringsAfterOffset(&raw_headers, 0, "\n", std::string("\0", 1)); 164 ReplaceSubstringsAfterOffset(&raw_headers, 0, "\n", std::string("\0", 1));
164 info->headers = new net::HttpResponseHeaders(raw_headers); 165 info->headers = new net::HttpResponseHeaders(raw_headers);
165 } 166 }
166 167
167 bool URLRequestSlowDownloadJob::GetMimeType(std::string* mime_type) const { 168 bool URLRequestSlowDownloadJob::GetMimeType(std::string* mime_type) const {
168 net::HttpResponseInfo info; 169 net::HttpResponseInfo info;
169 GetResponseInfoConst(&info); 170 GetResponseInfoConst(&info);
170 return info.headers && info.headers->GetMimeType(mime_type); 171 return info.headers && info.headers->GetMimeType(mime_type);
171 } 172 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chrome_plugin_host.cc » ('j') | chrome/browser/renderer_host/safe_browsing_resource_handler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698