Skip to content

Commit

Permalink
media: Post task in MediaDrmBridge::OnSessionExpirationUpdate().
Browse files Browse the repository at this point in the history
This was missed in https://codereview.chromium.org/1414923004/

BUG=546108

Review URL: https://codereview.chromium.org/1455723002

Cr-Commit-Position: refs/heads/master@{#360152}
  • Loading branch information
xhwang-chromium authored and Commit bot committed Nov 17, 2015
1 parent 80a49d2 commit 457554d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions media/base/android/media_drm_bridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ void MediaDrmBridge::SetMediaCryptoReadyCB(
media_crypto_ready_cb_ = media_crypto_ready_cb;
}

//------------------------------------------------------------------------------
// The following OnXxx functions are called from Java. The implementation must
// only do minimal work and then post tasks to avoid reentrancy issues.

Expand Down Expand Up @@ -672,9 +673,10 @@ void MediaDrmBridge::OnSessionExpirationUpdate(JNIEnv* env,
jbyteArray j_session_id,
jlong expiry_time_ms) {
DVLOG(2) << __FUNCTION__ << ": " << expiry_time_ms << " ms";
session_expiration_update_cb_.Run(
AsString(env, j_session_id),
base::Time::FromDoubleT(expiry_time_ms / 1000.0));
task_runner_->PostTask(
FROM_HERE,
base::Bind(session_expiration_update_cb_, AsString(env, j_session_id),
base::Time::FromDoubleT(expiry_time_ms / 1000.0)));
}

void MediaDrmBridge::OnLegacySessionError(JNIEnv* env,
Expand All @@ -701,6 +703,7 @@ void MediaDrmBridge::OnResetDeviceCredentialsCompleted(JNIEnv* env,
base::Bind(base::ResetAndReturn(&reset_credentials_cb_), success));
}

//------------------------------------------------------------------------------
// The following are private methods.

MediaDrmBridge::MediaDrmBridge(
Expand Down

0 comments on commit 457554d

Please sign in to comment.