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

Unified Diff: content/renderer/media/rtc_certificate_generator.cc

Issue 2432493002: Handle RTCCertificate::fromPEM returning nullptr, with a unit test. (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/rtc_certificate_generator.cc
diff --git a/content/renderer/media/rtc_certificate_generator.cc b/content/renderer/media/rtc_certificate_generator.cc
index 7ea08094a312e4d62e1a8c10911fcc09c693794e..bf1e2e22e97f5662274591377c7edab3da5590d9 100644
--- a/content/renderer/media/rtc_certificate_generator.cc
+++ b/content/renderer/media/rtc_certificate_generator.cc
@@ -166,8 +166,9 @@ std::unique_ptr<blink::WebRTCCertificate> RTCCertificateGenerator::fromPEM(
rtc::RTCCertificate::FromPEM(
rtc::RTCCertificatePEM(pem_private_key.utf8(),
pem_certificate.utf8()));
- return std::unique_ptr<blink::WebRTCCertificate>(
- new RTCCertificate(certificate));
+ if (!certificate)
+ return nullptr;
+ return base::MakeUnique<RTCCertificate>(certificate);
}
} // namespace content
« no previous file with comments | « no previous file | content/test/test_blink_web_unit_test_support.cc » ('j') | content/test/test_blink_web_unit_test_support.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698