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}
(cherry picked from commit 457554d)

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

Cr-Commit-Position: refs/branch-heads/2564@{crosswalk-project#38}
Cr-Branched-From: 1283eca-refs/heads/master@{#359700}
  • Loading branch information
xhwang-chromium committed Nov 18, 2015
1 parent e301499 commit 2bce7e8
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 @@ -523,6 +523,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 @@ -654,9 +655,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(
GetSessionId(env, j_session_id),
base::Time::FromDoubleT(expiry_time_ms / 1000.0));
task_runner_->PostTask(
FROM_HERE,
base::Bind(session_expiration_update_cb_, GetSessionId(env, j_session_id),
base::Time::FromDoubleT(expiry_time_ms / 1000.0)));
}

void MediaDrmBridge::OnLegacySessionError(JNIEnv* env,
Expand All @@ -683,6 +685,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 2bce7e8

Please sign in to comment.