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

Side by Side Diff: content/browser/loader/certificate_resource_handler.cc

Issue 398903002: Plumb redirect info out of net, through content, and into child processes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: darin comments Created 6 years, 4 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) 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 #include "content/browser/loader/certificate_resource_handler.h" 5 #include "content/browser/loader/certificate_resource_handler.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "content/browser/loader/resource_request_info_impl.h" 8 #include "content/browser/loader/resource_request_info_impl.h"
9 #include "content/public/browser/content_browser_client.h" 9 #include "content/public/browser/content_browser_client.h"
10 #include "content/public/common/resource_response.h" 10 #include "content/public/common/resource_response.h"
11 #include "net/base/io_buffer.h" 11 #include "net/base/io_buffer.h"
12 #include "net/base/mime_sniffer.h" 12 #include "net/base/mime_sniffer.h"
13 #include "net/base/mime_util.h" 13 #include "net/base/mime_util.h"
14 #include "net/http/http_response_headers.h" 14 #include "net/http/http_response_headers.h"
15 #include "net/url_request/redirect_info.h"
15 #include "net/url_request/url_request.h" 16 #include "net/url_request/url_request.h"
16 #include "net/url_request/url_request_status.h" 17 #include "net/url_request/url_request_status.h"
17 18
18 namespace content { 19 namespace content {
19 20
20 CertificateResourceHandler::CertificateResourceHandler( 21 CertificateResourceHandler::CertificateResourceHandler(
21 net::URLRequest* request) 22 net::URLRequest* request)
22 : ResourceHandler(request), 23 : ResourceHandler(request),
23 content_length_(0), 24 content_length_(0),
24 read_buffer_(NULL), 25 read_buffer_(NULL),
25 resource_buffer_(NULL), 26 resource_buffer_(NULL),
26 cert_type_(net::CERTIFICATE_MIME_TYPE_UNKNOWN) { 27 cert_type_(net::CERTIFICATE_MIME_TYPE_UNKNOWN) {
27 } 28 }
28 29
29 CertificateResourceHandler::~CertificateResourceHandler() { 30 CertificateResourceHandler::~CertificateResourceHandler() {
30 } 31 }
31 32
32 bool CertificateResourceHandler::OnUploadProgress(uint64 position, 33 bool CertificateResourceHandler::OnUploadProgress(uint64 position,
33 uint64 size) { 34 uint64 size) {
34 return true; 35 return true;
35 } 36 }
36 37
37 bool CertificateResourceHandler::OnRequestRedirected(const GURL& url, 38 bool CertificateResourceHandler::OnRequestRedirected(
38 ResourceResponse* resp, 39 const net::RedirectInfo& redirect_info,
39 bool* defer) { 40 ResourceResponse* resp,
40 url_ = url; 41 bool* defer) {
41 return true; 42 return true;
42 } 43 }
43 44
44 bool CertificateResourceHandler::OnResponseStarted(ResourceResponse* resp, 45 bool CertificateResourceHandler::OnResponseStarted(ResourceResponse* resp,
45 bool* defer) { 46 bool* defer) {
46 cert_type_ = net::GetCertificateMimeTypeForMimeType(resp->head.mime_type); 47 cert_type_ = net::GetCertificateMimeTypeForMimeType(resp->head.mime_type);
47 return cert_type_ != net::CERTIFICATE_MIME_TYPE_UNKNOWN; 48 return cert_type_ != net::CERTIFICATE_MIME_TYPE_UNKNOWN;
48 } 49 }
49 50
50 bool CertificateResourceHandler::OnWillStart(const GURL& url, bool* defer) { 51 bool CertificateResourceHandler::OnWillStart(const GURL& url, bool* defer) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 bytes_copied += data_len; 133 bytes_copied += data_len;
133 } 134 }
134 DCHECK_EQ(content_length_, bytes_copied); 135 DCHECK_EQ(content_length_, bytes_copied);
135 } 136 }
136 137
137 void CertificateResourceHandler::OnDataDownloaded(int bytes_downloaded) { 138 void CertificateResourceHandler::OnDataDownloaded(int bytes_downloaded) {
138 NOTREACHED(); 139 NOTREACHED();
139 } 140 }
140 141
141 } // namespace content 142 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/certificate_resource_handler.h ('k') | content/browser/loader/cross_site_resource_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698