| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/extensions/api/messaging/message_property_provider.h" | 5 #include "chrome/browser/extensions/api/messaging/message_property_provider.h" |
| 6 | 6 |
| 7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 std::string domain_bound_cert; | 50 std::string domain_bound_cert; |
| 51 net::ServerBoundCertService::RequestHandle request_handle; | 51 net::ServerBoundCertService::RequestHandle request_handle; |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 // static | 54 // static |
| 55 void MessagePropertyProvider::GetDomainBoundCertOnIOThread( | 55 void MessagePropertyProvider::GetDomainBoundCertOnIOThread( |
| 56 scoped_refptr<base::TaskRunner> original_task_runner, | 56 scoped_refptr<base::TaskRunner> original_task_runner, |
| 57 scoped_refptr<net::URLRequestContextGetter> request_context_getter, | 57 scoped_refptr<net::URLRequestContextGetter> request_context_getter, |
| 58 const std::string& host, | 58 const std::string& host, |
| 59 const DomainBoundCertCallback& reply) { | 59 const DomainBoundCertCallback& reply) { |
| 60 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 60 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| 61 net::ServerBoundCertService* server_bound_cert_service = | 61 net::ServerBoundCertService* server_bound_cert_service = |
| 62 request_context_getter->GetURLRequestContext()-> | 62 request_context_getter->GetURLRequestContext()-> |
| 63 server_bound_cert_service(); | 63 server_bound_cert_service(); |
| 64 GetDomainBoundCertOutput* output = new GetDomainBoundCertOutput(); | 64 GetDomainBoundCertOutput* output = new GetDomainBoundCertOutput(); |
| 65 net::CompletionCallback net_completion_callback = | 65 net::CompletionCallback net_completion_callback = |
| 66 base::Bind(&MessagePropertyProvider::GotDomainBoundCert, | 66 base::Bind(&MessagePropertyProvider::GotDomainBoundCert, |
| 67 original_task_runner, | 67 original_task_runner, |
| 68 base::Owned(output), | 68 base::Owned(output), |
| 69 reply); | 69 reply); |
| 70 int status = server_bound_cert_service->GetDomainBoundCert( | 70 int status = server_bound_cert_service->GetDomainBoundCert( |
| (...skipping 27 matching lines...) Expand all Loading... |
| 98 if (!net::JwkSerializer::ConvertSpkiFromDerToJwk(spki, &jwk_value)) { | 98 if (!net::JwkSerializer::ConvertSpkiFromDerToJwk(spki, &jwk_value)) { |
| 99 original_task_runner->PostTask(FROM_HERE, no_tls_channel_id_closure); | 99 original_task_runner->PostTask(FROM_HERE, no_tls_channel_id_closure); |
| 100 return; | 100 return; |
| 101 } | 101 } |
| 102 std::string jwk_str; | 102 std::string jwk_str; |
| 103 base::JSONWriter::Write(&jwk_value, &jwk_str); | 103 base::JSONWriter::Write(&jwk_value, &jwk_str); |
| 104 original_task_runner->PostTask(FROM_HERE, base::Bind(reply, jwk_str)); | 104 original_task_runner->PostTask(FROM_HERE, base::Bind(reply, jwk_str)); |
| 105 } | 105 } |
| 106 | 106 |
| 107 } // namespace extensions | 107 } // namespace extensions |
| OLD | NEW |