OLD | NEW |
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" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 cert_type_ = net::GetCertificateMimeTypeForMimeType(resp->head.mime_type); | 49 cert_type_ = net::GetCertificateMimeTypeForMimeType(resp->head.mime_type); |
50 return cert_type_ != net::CERTIFICATE_MIME_TYPE_UNKNOWN; | 50 return cert_type_ != net::CERTIFICATE_MIME_TYPE_UNKNOWN; |
51 } | 51 } |
52 | 52 |
53 bool CertificateResourceHandler::OnWillStart(int request_id, | 53 bool CertificateResourceHandler::OnWillStart(int request_id, |
54 const GURL& url, | 54 const GURL& url, |
55 bool* defer) { | 55 bool* defer) { |
56 return true; | 56 return true; |
57 } | 57 } |
58 | 58 |
| 59 bool CertificateResourceHandler::OnBeforeNetworkStart(int request_id, |
| 60 const GURL& url, |
| 61 bool* defer) { |
| 62 return true; |
| 63 } |
| 64 |
59 bool CertificateResourceHandler::OnWillRead(int request_id, | 65 bool CertificateResourceHandler::OnWillRead(int request_id, |
60 scoped_refptr<net::IOBuffer>* buf, | 66 scoped_refptr<net::IOBuffer>* buf, |
61 int* buf_size, | 67 int* buf_size, |
62 int min_size) { | 68 int min_size) { |
63 static const int kReadBufSize = 32768; | 69 static const int kReadBufSize = 32768; |
64 | 70 |
65 // TODO(gauravsh): Should we use 'min_size' here? | 71 // TODO(gauravsh): Should we use 'min_size' here? |
66 DCHECK(buf && buf_size); | 72 DCHECK(buf && buf_size); |
67 if (!read_buffer_.get()) { | 73 if (!read_buffer_.get()) { |
68 read_buffer_ = new net::IOBuffer(kReadBufSize); | 74 read_buffer_ = new net::IOBuffer(kReadBufSize); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 DCHECK_EQ(content_length_, bytes_copied); | 144 DCHECK_EQ(content_length_, bytes_copied); |
139 } | 145 } |
140 | 146 |
141 void CertificateResourceHandler::OnDataDownloaded( | 147 void CertificateResourceHandler::OnDataDownloaded( |
142 int request_id, | 148 int request_id, |
143 int bytes_downloaded) { | 149 int bytes_downloaded) { |
144 NOTREACHED(); | 150 NOTREACHED(); |
145 } | 151 } |
146 | 152 |
147 } // namespace content | 153 } // namespace content |
OLD | NEW |