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 28 matching lines...) Expand all Loading... |
39 const GURL& url, | 39 const GURL& url, |
40 content::ResourceResponse* resp, | 40 content::ResourceResponse* resp, |
41 bool* defer) { | 41 bool* defer) { |
42 url_ = url; | 42 url_ = url; |
43 return true; | 43 return true; |
44 } | 44 } |
45 | 45 |
46 bool X509UserCertResourceHandler::OnResponseStarted( | 46 bool X509UserCertResourceHandler::OnResponseStarted( |
47 int request_id, | 47 int request_id, |
48 content::ResourceResponse* resp) { | 48 content::ResourceResponse* resp) { |
49 return (resp->mime_type == "application/x-x509-user-cert"); | 49 return (resp->data.mime_type == "application/x-x509-user-cert"); |
50 } | 50 } |
51 | 51 |
52 bool X509UserCertResourceHandler::OnWillStart(int request_id, | 52 bool X509UserCertResourceHandler::OnWillStart(int request_id, |
53 const GURL& url, | 53 const GURL& url, |
54 bool* defer) { | 54 bool* defer) { |
55 return true; | 55 return true; |
56 } | 56 } |
57 | 57 |
58 bool X509UserCertResourceHandler::OnWillRead(int request_id, | 58 bool X509UserCertResourceHandler::OnWillRead(int request_id, |
59 net::IOBuffer** buf, | 59 net::IOBuffer** buf, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 } | 113 } |
114 | 114 |
115 X509UserCertResourceHandler::~X509UserCertResourceHandler() { | 115 X509UserCertResourceHandler::~X509UserCertResourceHandler() { |
116 } | 116 } |
117 | 117 |
118 void X509UserCertResourceHandler::AssembleResource() { | 118 void X509UserCertResourceHandler::AssembleResource() { |
119 size_t assembled_bytes = 0; | 119 size_t assembled_bytes = 0; |
120 resource_buffer_ = content::AssembleData(buffer_, &assembled_bytes); | 120 resource_buffer_ = content::AssembleData(buffer_, &assembled_bytes); |
121 DCHECK_EQ(content_length_, assembled_bytes); | 121 DCHECK_EQ(content_length_, assembled_bytes); |
122 } | 122 } |
OLD | NEW |