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

Side by Side Diff: content/child/navigator_connect/navigator_connect_provider.cc

Issue 921013002: Optionally have MessagePort pass data as base::Value, part 1. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-c-move-v8-value-converter
Patch Set: Update singly-included comment Created 5 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 unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/browser/shared_worker/shared_worker_service_impl_unittest.cc ('k') | content/child/webmessageportchannel_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698