Commit a0f902cf authored by Hajime Hoshi's avatar Hajime Hoshi Committed by Commit Bot

Pass approprite task runners to AssociatedBinding::Bind via DevToolsAgent

This is part of efforts to replace base::ThreadTaskRunnerHandle::Get()
and SequencedTaskRunnerHandle::Get() with other appropriate task runners
in the renderer.

Bug: 786332
Change-Id: I91647355e2e9d955fcf62020fca175182f35e467
Reviewed-on: https://chromium-review.googlesource.com/c/1293258Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601875}
parent 094762b7
......@@ -353,7 +353,9 @@ void WebDevToolsAgentImpl::WillBeDestroyed() {
void WebDevToolsAgentImpl::BindRequest(
mojom::blink::DevToolsAgentHostAssociatedPtrInfo host_ptr_info,
mojom::blink::DevToolsAgentAssociatedRequest request) {
agent_->BindRequest(std::move(host_ptr_info), std::move(request));
agent_->BindRequest(
std::move(host_ptr_info), std::move(request),
web_local_frame_impl_->GetTaskRunner(blink::TaskType::kInternalDefault));
}
void WebDevToolsAgentImpl::DetachSession(InspectorSession* session) {
......
......@@ -89,7 +89,7 @@ class DevToolsAgent::Session::IOSession : public mojom::blink::DevToolsSession {
~IOSession() override {}
void BindInterface(mojom::blink::DevToolsSessionRequest request) {
binding_.Bind(std::move(request));
binding_.Bind(std::move(request), io_task_runner_);
}
void DeleteSoon() { io_task_runner_->DeleteSoon(FROM_HERE, this); }
......@@ -220,9 +220,10 @@ void DevToolsAgent::Dispose() {
void DevToolsAgent::BindRequest(
mojom::blink::DevToolsAgentHostAssociatedPtrInfo host_ptr_info,
mojom::blink::DevToolsAgentAssociatedRequest request) {
mojom::blink::DevToolsAgentAssociatedRequest request,
scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
DCHECK(!binding_);
binding_.Bind(std::move(request));
binding_.Bind(std::move(request), std::move(task_runner));
host_ptr_.Bind(std::move(host_ptr_info));
host_ptr_.set_connection_error_handler(
WTF::Bind(&DevToolsAgent::CleanupConnection, WrapWeakPersistent(this)));
......
......@@ -42,7 +42,8 @@ class CORE_EXPORT DevToolsAgent
void Dispose();
void FlushProtocolNotifications();
void BindRequest(mojom::blink::DevToolsAgentHostAssociatedPtrInfo,
mojom::blink::DevToolsAgentAssociatedRequest);
mojom::blink::DevToolsAgentAssociatedRequest,
scoped_refptr<base::SingleThreadTaskRunner> task_runner);
virtual void Trace(blink::Visitor*);
private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment