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

Unified Diff: content/common/gpu/media/vaapi_video_decode_accelerator.cc

Issue 198073003: Remove some content_child dependency from content_common (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ffd442cb fix for bots barfing on clang style checks Created 6 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/common/gpu/gpu_channel_manager.cc ('k') | content/gpu/gpu_child_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/vaapi_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/vaapi_video_decode_accelerator.cc b/content/common/gpu/media/vaapi_video_decode_accelerator.cc
index 79860d5b60dc1190c7046da266eddec104a5c922..30a974bbb891c1c80f3e988a1c335ab6f9cc534c 100644
--- a/content/common/gpu/media/vaapi_video_decode_accelerator.cc
+++ b/content/common/gpu/media/vaapi_video_decode_accelerator.cc
@@ -9,7 +9,7 @@
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/synchronization/waitable_event.h"
-#include "content/child/child_thread.h"
+#include "base/threading/non_thread_safe.h"
#include "content/common/gpu/gpu_channel.h"
#include "content/common/gpu/media/vaapi_video_decode_accelerator.h"
#include "media/base/bind_to_current_loop.h"
@@ -68,7 +68,7 @@ void VaapiVideoDecodeAccelerator::NotifyError(Error error) {
//
// TFPPictures are used for output, contents of VASurfaces passed from decoder
// are put into the associated pixmap memory and sent to client.
-class VaapiVideoDecodeAccelerator::TFPPicture {
+class VaapiVideoDecodeAccelerator::TFPPicture : public base::NonThreadSafe {
public:
~TFPPicture();
@@ -158,10 +158,7 @@ VaapiVideoDecodeAccelerator::TFPPicture::Create(
bool VaapiVideoDecodeAccelerator::TFPPicture::Initialize(
const GLXFBConfig& fb_config) {
- // Check for NULL prevents unittests from crashing on nonexistent ChildThread.
- DCHECK(ChildThread::current() == NULL ||
- ChildThread::current()->message_loop() == base::MessageLoop::current());
-
+ DCHECK(CalledOnValidThread());
if (!make_context_current_.Run())
return false;
@@ -193,10 +190,7 @@ bool VaapiVideoDecodeAccelerator::TFPPicture::Initialize(
}
VaapiVideoDecodeAccelerator::TFPPicture::~TFPPicture() {
- // Check for NULL prevents unittests from crashing on nonexistent ChildThread.
- DCHECK(ChildThread::current() == NULL ||
- ChildThread::current()->message_loop() == base::MessageLoop::current());
-
+ DCHECK(CalledOnValidThread());
// Unbind surface from texture and deallocate resources.
if (glx_pixmap_ && make_context_current_.Run()) {
glXReleaseTexImageEXT(x_display_, glx_pixmap_, GLX_FRONT_LEFT_EXT);
@@ -209,12 +203,9 @@ VaapiVideoDecodeAccelerator::TFPPicture::~TFPPicture() {
}
bool VaapiVideoDecodeAccelerator::TFPPicture::Bind() {
+ DCHECK(CalledOnValidThread());
DCHECK(x_pixmap_);
DCHECK(glx_pixmap_);
- // Check for NULL prevents unittests from crashing on nonexistent ChildThread.
- DCHECK(ChildThread::current() == NULL ||
- ChildThread::current()->message_loop() == base::MessageLoop::current());
-
if (!make_context_current_.Run())
return false;
« no previous file with comments | « content/common/gpu/gpu_channel_manager.cc ('k') | content/gpu/gpu_child_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698