| 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/renderer_host/x509_user_cert_resource_handler.h" | 5 #include "content/browser/renderer_host/x509_user_cert_resource_handler.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "content/browser/renderer_host/resource_request_info_impl.h" | 8 #include "content/browser/renderer_host/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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 const GURL& url, | 43 const GURL& url, |
| 44 ResourceResponse* resp, | 44 ResourceResponse* resp, |
| 45 bool* defer) { | 45 bool* defer) { |
| 46 url_ = url; | 46 url_ = url; |
| 47 return true; | 47 return true; |
| 48 } | 48 } |
| 49 | 49 |
| 50 bool X509UserCertResourceHandler::OnResponseStarted(int request_id, | 50 bool X509UserCertResourceHandler::OnResponseStarted(int request_id, |
| 51 ResourceResponse* resp, | 51 ResourceResponse* resp, |
| 52 bool* defer) { | 52 bool* defer) { |
| 53 return (resp->mime_type == "application/x-x509-user-cert"); | 53 return (resp->head.mime_type == "application/x-x509-user-cert"); |
| 54 } | 54 } |
| 55 | 55 |
| 56 bool X509UserCertResourceHandler::OnWillStart(int request_id, | 56 bool X509UserCertResourceHandler::OnWillStart(int request_id, |
| 57 const GURL& url, | 57 const GURL& url, |
| 58 bool* defer) { | 58 bool* defer) { |
| 59 return true; | 59 return true; |
| 60 } | 60 } |
| 61 | 61 |
| 62 bool X509UserCertResourceHandler::OnWillRead(int request_id, | 62 bool X509UserCertResourceHandler::OnWillRead(int request_id, |
| 63 net::IOBuffer** buf, | 63 net::IOBuffer** buf, |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 size_t data_len = buffer_[i].second; | 131 size_t data_len = buffer_[i].second; |
| 132 DCHECK(data != NULL); | 132 DCHECK(data != NULL); |
| 133 DCHECK_LE(bytes_copied + data_len, content_length_); | 133 DCHECK_LE(bytes_copied + data_len, content_length_); |
| 134 memcpy(resource_buffer_->data() + bytes_copied, data->data(), data_len); | 134 memcpy(resource_buffer_->data() + bytes_copied, data->data(), data_len); |
| 135 bytes_copied += data_len; | 135 bytes_copied += data_len; |
| 136 } | 136 } |
| 137 DCHECK_EQ(content_length_, bytes_copied); | 137 DCHECK_EQ(content_length_, bytes_copied); |
| 138 } | 138 } |
| 139 | 139 |
| 140 } // namespace content | 140 } // namespace content |
| OLD | NEW |