Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: chrome/browser/extensions/api/certificate_provider/certificate_provider_apitest.cc

Issue 2841623003: Remove base::Value::Get{Buffer,Size} (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 70 }
71 71
72 void StoreDigest(std::vector<uint8_t>* digest, 72 void StoreDigest(std::vector<uint8_t>* digest,
73 const base::Closure& callback, 73 const base::Closure& callback,
74 const base::Value* value) { 74 const base::Value* value) {
75 const base::Value* binary = nullptr; 75 const base::Value* binary = nullptr;
76 const bool is_binary = value->GetAsBinary(&binary); 76 const bool is_binary = value->GetAsBinary(&binary);
77 EXPECT_TRUE(is_binary) << "Unexpected value in StoreDigest"; 77 EXPECT_TRUE(is_binary) << "Unexpected value in StoreDigest";
78 if (is_binary) { 78 if (is_binary) {
79 const uint8_t* const binary_begin = 79 const uint8_t* const binary_begin =
80 reinterpret_cast<const uint8_t*>(binary->GetBuffer()); 80 reinterpret_cast<const uint8_t*>(binary->GetBlob().data());
81 digest->assign(binary_begin, binary_begin + binary->GetSize()); 81 digest->assign(binary_begin, binary_begin + binary->GetBlob().size());
Devlin 2017/04/24 18:18:45 does *digest = binary->GetBlob() work? Or does a
jdoerrie 2017/04/25 08:50:33 Done. I was indeed afraid that the compiler would
82 } 82 }
83 83
84 callback.Run(); 84 callback.Run();
85 } 85 }
86 86
87 // See net::SSLPrivateKey::SignDigest for the expected padding and DigestInfo 87 // See net::SSLPrivateKey::SignDigest for the expected padding and DigestInfo
88 // prefixing. 88 // prefixing.
89 bool RsaSign(const std::vector<uint8_t>& digest, 89 bool RsaSign(const std::vector<uint8_t>& digest,
90 crypto::RSAPrivateKey* key, 90 crypto::RSAPrivateKey* key,
91 std::vector<uint8_t>* signature) { 91 std::vector<uint8_t>* signature) {
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 chromeos::CertificateProviderService* service = 421 chromeos::CertificateProviderService* service =
422 LoadRequestPinExtension("request_pin", "basic_lock.html"); 422 LoadRequestPinExtension("request_pin", "basic_lock.html");
423 423
424 EnterCode(service, base::ASCIIToUTF16("123")); 424 EnterCode(service, base::ASCIIToUTF16("123"));
425 service->pin_dialog_manager()->active_window_for_testing()->Close(); 425 service->pin_dialog_manager()->active_window_for_testing()->Close();
426 base::RunLoop().RunUntilIdle(); 426 base::RunLoop().RunUntilIdle();
427 427
428 // The view should be set to nullptr when the window is closed. 428 // The view should be set to nullptr when the window is closed.
429 EXPECT_EQ(service->pin_dialog_manager()->active_view_for_testing(), nullptr); 429 EXPECT_EQ(service->pin_dialog_manager()->active_view_for_testing(), nullptr);
430 } 430 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698