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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
110 AssembleResource(); | 110 AssembleResource(); |
111 | 111 |
112 const void* content_bytes = NULL; | 112 const void* content_bytes = NULL; |
113 if (resource_buffer_.get()) | 113 if (resource_buffer_.get()) |
114 content_bytes = resource_buffer_->data(); | 114 content_bytes = resource_buffer_->data(); |
115 | 115 |
116 // Note that it's up to the browser to verify that the certificate | 116 // Note that it's up to the browser to verify that the certificate |
117 // data is well-formed. | 117 // data is well-formed. |
118 const ResourceRequestInfo* info = GetRequestInfo(); | 118 const ResourceRequestInfo* info = GetRequestInfo(); |
119 GetContentClient()->browser()->AddCertificate( | 119 GetContentClient()->browser()->AddCertificate( |
120 request(), cert_type_, content_bytes, content_length_, | 120 cert_type_, content_bytes, content_length_, |
121 info->GetChildID(), info->GetRouteID()); | 121 info->GetChildID(), info->GetRenderFrameID()); |
davidben
2014/05/27 21:07:12
I suspect this'll need to change again later if we
| |
122 } | 122 } |
123 | 123 |
124 void CertificateResourceHandler::AssembleResource() { | 124 void CertificateResourceHandler::AssembleResource() { |
125 // 0-length IOBuffers are not allowed. | 125 // 0-length IOBuffers are not allowed. |
126 if (content_length_ == 0) { | 126 if (content_length_ == 0) { |
127 resource_buffer_ = NULL; | 127 resource_buffer_ = NULL; |
128 return; | 128 return; |
129 } | 129 } |
130 | 130 |
131 // Create the new buffer. | 131 // Create the new buffer. |
(...skipping 12 matching lines...) Expand all Loading... | |
144 DCHECK_EQ(content_length_, bytes_copied); | 144 DCHECK_EQ(content_length_, bytes_copied); |
145 } | 145 } |
146 | 146 |
147 void CertificateResourceHandler::OnDataDownloaded( | 147 void CertificateResourceHandler::OnDataDownloaded( |
148 int request_id, | 148 int request_id, |
149 int bytes_downloaded) { | 149 int bytes_downloaded) { |
150 NOTREACHED(); | 150 NOTREACHED(); |
151 } | 151 } |
152 | 152 |
153 } // namespace content | 153 } // namespace content |
OLD | NEW |