summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorwjia@chromium.org <wjia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-26 17:06:27 +0000
committerwjia@chromium.org <wjia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-26 17:06:27 +0000
commit715db119970f5e5ca3cf71dd353795449229b1f1 (patch)
treec0c6e51f61d41035dee4c007afe215f518e70569 /content
parent1bd6315534ddade5f8c7dba26c4b0c7df23ca0f8 (diff)
downloadchromium_src-715db119970f5e5ca3cf71dd353795449229b1f1.zip
chromium_src-715db119970f5e5ca3cf71dd353795449229b1f1.tar.gz
chromium_src-715db119970f5e5ca3cf71dd353795449229b1f1.tar.bz2
Use base::Unretained() around VideoCaptureModuleImpl since it's not ref counted by Chrome.
The creator of VideoCaptureModuleImpl has exclusive ownership. When it tries to release the object, it will wait for the VCMImplThread to be stopped, which means all pending tasks will be executed before the object is deleted. Chrome is not supposed to add reference of it. If Chrome adds reference and the creator calls release before some task is executed on VCMImplThread, then the VCMImpl dtor will be called on the VCMImplThread. But in dtor, it will try to stop VCMImplThread. That's wrong. BUG=none TEST=trybots Review URL: http://codereview.chromium.org/8394013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107370 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/renderer/media/video_capture_module_impl.cc10
-rw-r--r--content/renderer/media/video_capture_module_impl.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/content/renderer/media/video_capture_module_impl.cc b/content/renderer/media/video_capture_module_impl.cc
index 08123d7..b691234 100644
--- a/content/renderer/media/video_capture_module_impl.cc
+++ b/content/renderer/media/video_capture_module_impl.cc
@@ -59,14 +59,15 @@ WebRtc_Word32 VideoCaptureModuleImpl::StartCapture(
message_loop_proxy_->PostTask(
FROM_HERE,
base::Bind(&VideoCaptureModuleImpl::StartCaptureOnCaptureThread,
- this, capability));
+ base::Unretained(this), capability));
return 0;
}
WebRtc_Word32 VideoCaptureModuleImpl::StopCapture() {
message_loop_proxy_->PostTask(
FROM_HERE,
- base::Bind(&VideoCaptureModuleImpl::StopCaptureOnCaptureThread, this));
+ base::Bind(&VideoCaptureModuleImpl::StopCaptureOnCaptureThread,
+ base::Unretained(this)));
return 0;
}
@@ -91,7 +92,8 @@ void VideoCaptureModuleImpl::OnStarted(media::VideoCapture* capture) {
void VideoCaptureModuleImpl::OnStopped(media::VideoCapture* capture) {
message_loop_proxy_->PostTask(
FROM_HERE,
- base::Bind(&VideoCaptureModuleImpl::OnStoppedOnCaptureThread, this,
+ base::Bind(&VideoCaptureModuleImpl::OnStoppedOnCaptureThread,
+ base::Unretained(this),
capture));
}
@@ -114,7 +116,7 @@ void VideoCaptureModuleImpl::OnBufferReady(
message_loop_proxy_->PostTask(
FROM_HERE,
base::Bind(&VideoCaptureModuleImpl::OnBufferReadyOnCaptureThread,
- this, capture, buf));
+ base::Unretained(this), capture, buf));
}
void VideoCaptureModuleImpl::OnDeviceInfoReceived(
diff --git a/content/renderer/media/video_capture_module_impl.h b/content/renderer/media/video_capture_module_impl.h
index fc3bfc7..3f6385a 100644
--- a/content/renderer/media/video_capture_module_impl.h
+++ b/content/renderer/media/video_capture_module_impl.h
@@ -86,6 +86,4 @@ class VideoCaptureModuleImpl
DISALLOW_COPY_AND_ASSIGN(VideoCaptureModuleImpl);
};
-DISABLE_RUNNABLE_METHOD_REFCOUNT(VideoCaptureModuleImpl);
-
#endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_MODULE_IMPL_H_