| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/child/navigator_connect/navigator_connect_provider.h" | 5 #include "content/child/navigator_connect/navigator_connect_provider.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "base/task_runner_util.h" | 9 #include "base/task_runner_util.h" |
| 10 #include "content/child/thread_safe_sender.h" | 10 #include "content/child/thread_safe_sender.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 void NavigatorConnectProvider::OnConnectResult(int thread_id, | 80 void NavigatorConnectProvider::OnConnectResult(int thread_id, |
| 81 int request_id, | 81 int request_id, |
| 82 int message_port_id, | 82 int message_port_id, |
| 83 int message_port_route_id, | 83 int message_port_route_id, |
| 84 bool allow_connect) { | 84 bool allow_connect) { |
| 85 blink::WebNavigatorConnectPortCallbacks* callbacks = | 85 blink::WebNavigatorConnectPortCallbacks* callbacks = |
| 86 requests_.Lookup(request_id); | 86 requests_.Lookup(request_id); |
| 87 DCHECK(callbacks); | 87 DCHECK(callbacks); |
| 88 | 88 |
| 89 if (allow_connect) { | 89 if (allow_connect) { |
| 90 callbacks->onSuccess(new WebMessagePortChannelImpl( | 90 WebMessagePortChannelImpl* channel = new WebMessagePortChannelImpl( |
| 91 message_port_route_id, message_port_id, main_loop_)); | 91 message_port_route_id, message_port_id, main_loop_); |
| 92 callbacks->onSuccess(channel); |
| 92 } else { | 93 } else { |
| 93 callbacks->onError(); | 94 callbacks->onError(); |
| 94 } | 95 } |
| 95 requests_.Remove(request_id); | 96 requests_.Remove(request_id); |
| 96 } | 97 } |
| 97 | 98 |
| 98 void NavigatorConnectProvider::OnWorkerRunLoopStopped() { | 99 void NavigatorConnectProvider::OnWorkerRunLoopStopped() { |
| 99 delete this; | 100 delete this; |
| 100 } | 101 } |
| 101 | 102 |
| 102 } // namespace content | 103 } // namespace content |
| OLD | NEW |