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

Unified Diff: content/browser/media/media_internals_proxy.cc

Issue 1000373002: favor DCHECK_CURRENTLY_ON for better logs in content/browser/[f-p]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 5 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
« no previous file with comments | « content/browser/media/media_internals_handler.cc ('k') | content/browser/media/webrtc_identity_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/media_internals_proxy.cc
diff --git a/content/browser/media/media_internals_proxy.cc b/content/browser/media/media_internals_proxy.cc
index 4193a8348120adad9567bc781373813fbc852c8b..11804046ea4e97ddb183eba635f90d82e57ee612 100644
--- a/content/browser/media/media_internals_proxy.cc
+++ b/content/browser/media/media_internals_proxy.cc
@@ -33,7 +33,7 @@ MediaInternalsProxy::MediaInternalsProxy() {
void MediaInternalsProxy::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(type, NOTIFICATION_RENDERER_PROCESS_TERMINATED);
RenderProcessHost* process = Source<RenderProcessHost>(source).ptr();
CallJavaScriptFunctionOnUIThread("media.onRendererTerminated",
@@ -41,7 +41,7 @@ void MediaInternalsProxy::Observe(int type,
}
void MediaInternalsProxy::Attach(MediaInternalsMessageHandler* handler) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
handler_ = handler;
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
@@ -49,7 +49,7 @@ void MediaInternalsProxy::Attach(MediaInternalsMessageHandler* handler) {
}
void MediaInternalsProxy::Detach() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
handler_ = NULL;
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
@@ -58,7 +58,7 @@ void MediaInternalsProxy::Detach() {
}
void MediaInternalsProxy::GetEverything() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Ask MediaInternals for all its data.
BrowserThread::PostTask(
@@ -70,7 +70,7 @@ void MediaInternalsProxy::GetEverything() {
}
void MediaInternalsProxy::OnUpdate(const base::string16& update) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&MediaInternalsProxy::UpdateUIOnUIThread, this, update));
@@ -116,7 +116,7 @@ base::Value* MediaInternalsProxy::GetConstants() {
}
void MediaInternalsProxy::ObserveMediaInternalsOnIOThread() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
update_callback_ = base::Bind(&MediaInternalsProxy::OnUpdate,
base::Unretained(this));
MediaInternals::GetInstance()->AddUpdateCallback(update_callback_);
@@ -127,7 +127,7 @@ void MediaInternalsProxy::ObserveMediaInternalsOnIOThread() {
}
void MediaInternalsProxy::StopObservingMediaInternalsOnIOThread() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
MediaInternals::GetInstance()->RemoveUpdateCallback(update_callback_);
if (GetContentClient()->browser()->GetNetLog()) {
net::NetLog* net_log = GetContentClient()->browser()->GetNetLog();
@@ -136,20 +136,20 @@ void MediaInternalsProxy::StopObservingMediaInternalsOnIOThread() {
}
void MediaInternalsProxy::GetEverythingOnIOThread() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
MediaInternals::GetInstance()->SendAudioStreamData();
MediaInternals::GetInstance()->SendVideoCaptureDeviceCapabilities();
}
void MediaInternalsProxy::UpdateUIOnUIThread(const base::string16& update) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Don't forward updates to a destructed UI.
if (handler_)
handler_->OnUpdate(update);
}
void MediaInternalsProxy::AddNetEventOnUIThread(base::Value* entry) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Send the updates to the page in kMediaInternalsProxyEventDelayMilliseconds
// if an update is not already pending.
@@ -165,14 +165,14 @@ void MediaInternalsProxy::AddNetEventOnUIThread(base::Value* entry) {
}
void MediaInternalsProxy::SendNetEventsOnUIThread() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
CallJavaScriptFunctionOnUIThread("media.onNetUpdate",
pending_net_updates_.release());
}
void MediaInternalsProxy::CallJavaScriptFunctionOnUIThread(
const std::string& function, base::Value* args) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
scoped_ptr<base::Value> args_value(args);
std::vector<const base::Value*> args_vector;
args_vector.push_back(args_value.get());
« no previous file with comments | « content/browser/media/media_internals_handler.cc ('k') | content/browser/media/webrtc_identity_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698