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

Unified Diff: content/browser/media/cdm/browser_cdm_manager.cc

Issue 1099633003: Bind BrowserCdmManager callbacks to UI thread before passing to CDM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/cdm/browser_cdm_manager.cc
diff --git a/content/browser/media/cdm/browser_cdm_manager.cc b/content/browser/media/cdm/browser_cdm_manager.cc
index 3eb55f1efc9e383c9f5620ed46b56770a1994a89..5dbbd7d5e107ec4f7bad417b3268b6f2886fb020 100644
--- a/content/browser/media/cdm/browser_cdm_manager.cc
+++ b/content/browser/media/cdm/browser_cdm_manager.cc
@@ -20,6 +20,7 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
+#include "media/base/bind_to_current_loop.h"
#include "media/base/browser_cdm.h"
#include "media/base/browser_cdm_factory.h"
#include "media/base/cdm_promise.h"
@@ -439,9 +440,10 @@ void BrowserCdmManager::OnDestroyCdm(int render_frame_id, int cdm_id) {
}
// Use a weak pointer here instead of |this| to avoid circular references.
-#define BROWSER_CDM_MANAGER_CB(func) \
- base::Bind(&BrowserCdmManager::func, weak_ptr_factory_.GetWeakPtr(), \
- render_frame_id, cdm_id)
+#define BROWSER_CDM_MANAGER_CB(func) \
+ media::BindToCurrentLoop( \
+ base::Bind(&BrowserCdmManager::func, weak_ptr_factory_.GetWeakPtr(), \
+ render_frame_id, cdm_id))
xhwang 2015/04/20 18:21:12 This will cause those callbacks to be posted alway
void BrowserCdmManager::AddCdm(int render_frame_id,
int cdm_id,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698