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

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

Issue 2712983004: Simplify/Cleanup MediaClient (Closed)
Patch Set: Little fixes Created 3 years, 9 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/render_media_log.cc
diff --git a/content/renderer/media/render_media_log.cc b/content/renderer/media/render_media_log.cc
index 1169f685b5a81ec6885ef39e92a8cb96195c0301..7273d9802e55e013547fc4b2fe80b82fe091692a 100644
--- a/content/renderer/media/render_media_log.cc
+++ b/content/renderer/media/render_media_log.cc
@@ -141,7 +141,19 @@ void RenderMediaLog::RecordRapporWithSecurityOrigin(const std::string& metric) {
return;
}
- GetContentClient()->renderer()->RecordRapporURL(metric, security_origin_);
+ RecordRapporWithURL(metric, security_origin_);
+}
+
+void RenderMediaLog::RecordRapporWithURL(const std::string& metric,
+ const GURL& url) {
+ if (!task_runner_->BelongsToCurrentThread()) {
+ task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&RenderMediaLog::RecordRapporWithURL, this, metric, url));
+ return;
+ }
+
+ GetContentClient()->renderer()->RecordRapporURL(metric, url);
}
void RenderMediaLog::SendQueuedMediaEvents() {

Powered by Google App Engine
This is Rietveld 408576698