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

Unified Diff: content/renderer/pepper/content_decryptor_delegate.cc

Issue 2655413003: Fix expiry time conversion in ContentDecryptorDelegate (Closed)
Patch Set: Fix expiry time conversion in ContentDecryptorDelegate Created 3 years, 11 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
« no previous file with comments | « no previous file | media/cdm/aes_decryptor_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/content_decryptor_delegate.cc
diff --git a/content/renderer/pepper/content_decryptor_delegate.cc b/content/renderer/pepper/content_decryptor_delegate.cc
index aca96613df423eb57ce91d67edbc78a2d159711d..88126db91a94887c7eaed102879cec97e80d40a8 100644
--- a/content/renderer/pepper/content_decryptor_delegate.cc
+++ b/content/renderer/pepper/content_decryptor_delegate.cc
@@ -830,8 +830,13 @@ void ContentDecryptorDelegate::OnSessionExpirationChange(
StringVar* session_id_string = StringVar::FromPPVar(session_id);
DCHECK(session_id_string);
- session_expiration_update_cb_.Run(session_id_string->value(),
- ppapi::PPTimeToTime(new_expiry_time));
+ // PPTimeToTime() converts exact 0 to base::Time::UnixEpoch, which is not
+ // desired here. We want to convert 0.0 to a null base::Time.
+ base::Time expiry_time;
+ if (new_expiry_time != 0.0)
+ expiry_time = ppapi::PPTimeToTime(new_expiry_time);
+
+ session_expiration_update_cb_.Run(session_id_string->value(), expiry_time);
}
void ContentDecryptorDelegate::OnSessionClosed(PP_Var session_id) {
« no previous file with comments | « no previous file | media/cdm/aes_decryptor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698