Index: remoting/client/plugin/pepper_view.cc |
diff --git a/remoting/client/plugin/pepper_view.cc b/remoting/client/plugin/pepper_view.cc |
index a02ffed4c344c05a8ecf49b5d9bb321c4cf2cd85..c4883dd51acf5070077ca35e976cba3386db77f7 100644 |
--- a/remoting/client/plugin/pepper_view.cc |
+++ b/remoting/client/plugin/pepper_view.cc |
@@ -35,13 +35,11 @@ bool PepperView::Initialize() { |
} |
void PepperView::TearDown() { |
+ DCHECK(instance_->CurrentlyOnPluginThread()); |
} |
void PepperView::Paint() { |
- if (!instance_->CurrentlyOnPluginThread()) { |
- RunTaskOnPluginThread(NewTracedMethod(this, &PepperView::Paint)); |
- return; |
- } |
+ DCHECK(instance_->CurrentlyOnPluginThread()); |
TraceContext::tracer()->PrintString("Start Paint."); |
// TODO(ajwong): We're assuming the native format is BGRA_PREMUL below. This |
@@ -115,32 +113,20 @@ void PepperView::PaintFrame(media::VideoFrame* frame, UpdatedRects* rects) { |
} |
void PepperView::SetSolidFill(uint32 color) { |
- if (!instance_->CurrentlyOnPluginThread()) { |
- RunTaskOnPluginThread( |
- NewTracedMethod(this, &PepperView::SetSolidFill, color)); |
- return; |
- } |
+ DCHECK(instance_->CurrentlyOnPluginThread()); |
is_static_fill_ = true; |
static_fill_color_ = color; |
} |
void PepperView::UnsetSolidFill() { |
- if (!instance_->CurrentlyOnPluginThread()) { |
- RunTaskOnPluginThread( |
- NewTracedMethod(this, &PepperView::UnsetSolidFill)); |
- return; |
- } |
+ DCHECK(instance_->CurrentlyOnPluginThread()); |
is_static_fill_ = false; |
} |
void PepperView::SetConnectionState(ConnectionState state) { |
- if (!instance_->CurrentlyOnPluginThread()) { |
- RunTaskOnPluginThread( |
- NewRunnableMethod(this, &PepperView::SetConnectionState, state)); |
- return; |
- } |
+ DCHECK(instance_->CurrentlyOnPluginThread()); |
ChromotingScriptableObject* scriptable_obj = instance_->GetScriptableObject(); |
switch (state) { |
@@ -167,11 +153,7 @@ void PepperView::SetConnectionState(ConnectionState state) { |
} |
void PepperView::SetViewport(int x, int y, int width, int height) { |
- if (!instance_->CurrentlyOnPluginThread()) { |
- RunTaskOnPluginThread(NewTracedMethod(this, &PepperView::SetViewport, |
- x, y, width, height)); |
- return; |
- } |
+ DCHECK(instance_->CurrentlyOnPluginThread()); |
// TODO(ajwong): Should we ignore x & y updates? What do those even mean? |
@@ -197,6 +179,8 @@ void PepperView::AllocateFrame(media::VideoFrame::Format format, |
base::TimeDelta duration, |
scoped_refptr<media::VideoFrame>* frame_out, |
Task* done) { |
+ DCHECK(instance_->CurrentlyOnPluginThread()); |
+ |
// TODO(ajwong): Implement this to be backed by an pp::ImageData rather than |
// generic memory. |
media::VideoFrame::CreateFrame(media::VideoFrame::RGB32, |
@@ -211,6 +195,8 @@ void PepperView::AllocateFrame(media::VideoFrame::Format format, |
} |
void PepperView::ReleaseFrame(media::VideoFrame* frame) { |
+ DCHECK(instance_->CurrentlyOnPluginThread()); |
+ |
if (frame) { |
LOG(WARNING) << "Frame released."; |
frame->Release(); |
@@ -220,12 +206,7 @@ void PepperView::ReleaseFrame(media::VideoFrame* frame) { |
void PepperView::OnPartialFrameOutput(media::VideoFrame* frame, |
UpdatedRects* rects, |
Task* done) { |
- if (!instance_->CurrentlyOnPluginThread()) { |
- RunTaskOnPluginThread( |
- NewTracedMethod(this, &PepperView::OnPartialFrameOutput, |
- make_scoped_refptr(frame), rects, done)); |
- return; |
- } |
+ DCHECK(instance_->CurrentlyOnPluginThread()); |
TraceContext::tracer()->PrintString("Calling PaintFrame"); |
// TODO(ajwong): Clean up this API to be async so we don't need to use a |
@@ -236,6 +217,8 @@ void PepperView::OnPartialFrameOutput(media::VideoFrame* frame, |
} |
void PepperView::OnPaintDone() { |
+ DCHECK(instance_->CurrentlyOnPluginThread()); |
+ |
// TODO(ajwong):Probably should set some variable to allow repaints to |
// actually paint. |
TraceContext::tracer()->PrintString("Paint flushed"); |