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

Side by Side Diff: content/browser/navigator_connect/navigator_connect_dispatcher_host.cc

Issue 944443003: Step two of optionally sending messages to/from message ports as base::Value. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-c-message-as-values-take2
Patch Set: use auto where it makes sense 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/browser/navigator_connect/navigator_connect_dispatcher_host.h" 5 #include "content/browser/navigator_connect/navigator_connect_dispatcher_host.h"
6 6
7 #include "content/browser/message_port_service.h" 7 #include "content/browser/message_port_service.h"
8 #include "content/browser/navigator_connect/navigator_connect_context_impl.h" 8 #include "content/browser/navigator_connect/navigator_connect_context_impl.h"
9 #include "content/browser/service_worker/service_worker_context_wrapper.h" 9 #include "content/browser/service_worker/service_worker_context_wrapper.h"
10 #include "content/common/navigator_connect_messages.h" 10 #include "content/common/navigator_connect_messages.h"
(...skipping 30 matching lines...) Expand all
41 41
42 DCHECK(client.message_port_id == MSG_ROUTING_NONE) 42 DCHECK(client.message_port_id == MSG_ROUTING_NONE)
43 << "Connect request should not include a message port"; 43 << "Connect request should not include a message port";
44 44
45 navigator_connect_context_->Connect( 45 navigator_connect_context_->Connect(
46 client, message_port_message_filter_, 46 client, message_port_message_filter_,
47 base::Bind(&NavigatorConnectDispatcherHost::OnConnectResult, this, 47 base::Bind(&NavigatorConnectDispatcherHost::OnConnectResult, this,
48 thread_id, request_id)); 48 thread_id, request_id));
49 } 49 }
50 50
51 void NavigatorConnectDispatcherHost::OnConnectResult(int thread_id, 51 void NavigatorConnectDispatcherHost::OnConnectResult(
52 int request_id, 52 int thread_id,
53 int message_port_id, 53 int request_id,
54 int message_port_route_id, 54 const TransferredMessagePort& message_port,
55 bool accept_connection) { 55 int message_port_route_id,
56 bool accept_connection) {
56 DCHECK_CURRENTLY_ON(BrowserThread::IO); 57 DCHECK_CURRENTLY_ON(BrowserThread::IO);
57 Send(new NavigatorConnectMsg_ConnectResult( 58 Send(new NavigatorConnectMsg_ConnectResult(
58 thread_id, request_id, message_port_id, message_port_route_id, 59 thread_id, request_id, message_port, message_port_route_id,
59 accept_connection)); 60 accept_connection));
60 } 61 }
61 62
62 } // namespace content 63 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698