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/browser/navigator_connect/navigator_connect_context_impl.h" | 5 #include "content/browser/navigator_connect/navigator_connect_context_impl.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "content/browser/message_port_service.h" | 10 #include "content/browser/message_port_service.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 const scoped_refptr<ServiceWorkerVersion>& worker, | 219 const scoped_refptr<ServiceWorkerVersion>& worker, |
220 int request_id, | 220 int request_id, |
221 ServicePortConnectResult result, | 221 ServicePortConnectResult result, |
222 const mojo::String& name, | 222 const mojo::String& name, |
223 const mojo::String& data) { | 223 const mojo::String& data) { |
224 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 224 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
225 | 225 |
226 if (!worker->FinishRequest(request_id)) | 226 if (!worker->FinishRequest(request_id)) |
227 return; | 227 return; |
228 | 228 |
229 if (result != SERVICE_PORT_CONNECT_RESULT_ACCEPT) { | 229 if (result != ServicePortConnectResult::ACCEPT) { |
230 OnConnectError(callback, client_port_id, service_port_id, | 230 OnConnectError(callback, client_port_id, service_port_id, |
231 SERVICE_WORKER_ERROR_FAILED); | 231 SERVICE_WORKER_ERROR_FAILED); |
232 return; | 232 return; |
233 } | 233 } |
234 | 234 |
235 // TODO(mek): Might have to do something else if the client connection got | 235 // TODO(mek): Might have to do something else if the client connection got |
236 // severed while the service side connection was being set up. | 236 // severed while the service side connection was being set up. |
237 callback.Run(client_port_id, true); | 237 callback.Run(client_port_id, true); |
238 } | 238 } |
239 | 239 |
(...skipping 17 matching lines...) Expand all Loading... |
257 DCHECK(active_version); | 257 DCHECK(active_version); |
258 | 258 |
259 const Port& port = ports_[port_id]; | 259 const Port& port = ports_[port_id]; |
260 NavigatorConnectClient client(port.target_url, port.client_origin, port_id); | 260 NavigatorConnectClient client(port.target_url, port.client_origin, port_id); |
261 active_version->DispatchCrossOriginMessageEvent( | 261 active_version->DispatchCrossOriginMessageEvent( |
262 client, message, sent_message_ports, | 262 client, message, sent_message_ports, |
263 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); | 263 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); |
264 } | 264 } |
265 | 265 |
266 } // namespace content | 266 } // namespace content |
OLD | NEW |