~osomon/oxide/reset-touch-selection-state-when-navigating

« back to all changes in this revision

Viewing changes to shared/browser/oxide_render_widget_host_view.cc

  • Committer: Chris Coulson
  • Date: 2016-02-20 16:51:13 UTC
  • Revision ID: chris.coulson@canonical.com-20160220165113-v5awjx81y2idcbrf
Don't call in to RWHV on the compositor thread

Show diffs side-by-side

added added

removed removed

Lines of Context:
133
133
  surface->AddDestructionDependency(sequence);
134
134
}
135
135
 
 
136
void DrawCallback(const cc::SurfaceFactory::DrawCallback& callback,
 
137
                  cc::SurfaceDrawStatus status) {
 
138
  if (content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
 
139
    callback.Run(status);
 
140
  } else {
 
141
    content::BrowserThread::PostTask(
 
142
        content::BrowserThread::UI,
 
143
        FROM_HERE,
 
144
        base::Bind(&DrawCallback, callback, status));
 
145
  }
 
146
}
 
147
 
136
148
} // namespace
137
149
 
138
150
void RenderWidgetHostView::OnTextInputStateChanged(
306
318
    cc::SurfaceFactory::DrawCallback ack_callback =
307
319
        base::Bind(&RenderWidgetHostView::RunAckCallbacks,
308
320
                   weak_ptr_factory_.GetWeakPtr());
 
321
    cc::SurfaceFactory::DrawCallback wrapped_ack_callback =
 
322
        base::Bind(&DrawCallback, ack_callback);
309
323
    surface_factory_->SubmitCompositorFrame(surface_id_,
310
324
                                            std::move(frame),
311
 
                                            ack_callback);
 
325
                                            wrapped_ack_callback);
312
326
  }
313
327
 
314
328
  last_frame_size_dip_ = frame_size_dip;