| 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 "base/base64.h" | 5 #include "base/base64.h" |
| 6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
| 7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 base::Unretained(&channel_id_cert), | 987 base::Unretained(&channel_id_cert), |
| 988 base::Unretained(&request_handle), | 988 base::Unretained(&request_handle), |
| 989 request_context_getter)); | 989 request_context_getter)); |
| 990 tls_channel_id_created_.Wait(); | 990 tls_channel_id_created_.Wait(); |
| 991 // Create the expected value. | 991 // Create the expected value. |
| 992 base::StringPiece spki; | 992 base::StringPiece spki; |
| 993 net::asn1::ExtractSPKIFromDERCert(channel_id_cert, &spki); | 993 net::asn1::ExtractSPKIFromDERCert(channel_id_cert, &spki); |
| 994 base::DictionaryValue jwk_value; | 994 base::DictionaryValue jwk_value; |
| 995 net::JwkSerializer::ConvertSpkiFromDerToJwk(spki, &jwk_value); | 995 net::JwkSerializer::ConvertSpkiFromDerToJwk(spki, &jwk_value); |
| 996 std::string tls_channel_id_value; | 996 std::string tls_channel_id_value; |
| 997 base::JSONWriter::Write(&jwk_value, &tls_channel_id_value); | 997 base::JSONWriter::Write(jwk_value, &tls_channel_id_value); |
| 998 return tls_channel_id_value; | 998 return tls_channel_id_value; |
| 999 } | 999 } |
| 1000 | 1000 |
| 1001 private: | 1001 private: |
| 1002 void CreateDomainBoundCertOnIOThread( | 1002 void CreateDomainBoundCertOnIOThread( |
| 1003 std::string* channel_id_private_key, | 1003 std::string* channel_id_private_key, |
| 1004 std::string* channel_id_cert, | 1004 std::string* channel_id_cert, |
| 1005 net::ChannelIDService::RequestHandle* request_handle, | 1005 net::ChannelIDService::RequestHandle* request_handle, |
| 1006 scoped_refptr<net::URLRequestContextGetter> request_context_getter) { | 1006 scoped_refptr<net::URLRequestContextGetter> request_context_getter) { |
| 1007 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 1007 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1200 ui_test_utils::NavigateToURL(browser(), chromium_org_url()); | 1200 ui_test_utils::NavigateToURL(browser(), chromium_org_url()); |
| 1201 EXPECT_EQ(COULD_NOT_ESTABLISH_CONNECTION_ERROR, | 1201 EXPECT_EQ(COULD_NOT_ESTABLISH_CONNECTION_ERROR, |
| 1202 CanConnectAndSendMessagesToMainFrame(invalid.get())); | 1202 CanConnectAndSendMessagesToMainFrame(invalid.get())); |
| 1203 } | 1203 } |
| 1204 | 1204 |
| 1205 #endif // !defined(OS_WIN) - http://crbug.com/350517. | 1205 #endif // !defined(OS_WIN) - http://crbug.com/350517. |
| 1206 | 1206 |
| 1207 } // namespace | 1207 } // namespace |
| 1208 | 1208 |
| 1209 }; // namespace extensions | 1209 }; // namespace extensions |
| OLD | NEW |