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

Side by Side Diff: mojo/services/network/network_service_impl.cc

Issue 515923003: Mojo: Add a WebSocket/Client interface and hook it up to the HTML viewer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 "mojo/services/network/network_service_impl.h" 5 #include "mojo/services/network/network_service_impl.h"
6 6
7 #include "mojo/public/cpp/application/application_connection.h" 7 #include "mojo/public/cpp/application/application_connection.h"
8 #include "mojo/services/network/cookie_store_impl.h" 8 #include "mojo/services/network/cookie_store_impl.h"
9 #include "mojo/services/network/url_loader_impl.h" 9 #include "mojo/services/network/url_loader_impl.h"
10 #include "mojo/services/network/web_socket_impl.h"
10 11
11 namespace mojo { 12 namespace mojo {
12 13
13 NetworkServiceImpl::NetworkServiceImpl(ApplicationConnection* connection, 14 NetworkServiceImpl::NetworkServiceImpl(ApplicationConnection* connection,
14 NetworkContext* context) 15 NetworkContext* context)
15 : context_(context), 16 : context_(context),
16 origin_(GURL(connection->GetRemoteApplicationURL()).GetOrigin()) { 17 origin_(GURL(connection->GetRemoteApplicationURL()).GetOrigin()) {
17 } 18 }
18 19
19 NetworkServiceImpl::~NetworkServiceImpl() { 20 NetworkServiceImpl::~NetworkServiceImpl() {
20 } 21 }
21 22
22 void NetworkServiceImpl::CreateURLLoader(InterfaceRequest<URLLoader> loader) { 23 void NetworkServiceImpl::CreateURLLoader(InterfaceRequest<URLLoader> loader) {
23 // TODO(darin): Plumb origin_. Use for CORS. 24 // TODO(darin): Plumb origin_. Use for CORS.
24 BindToRequest(new URLLoaderImpl(context_), &loader); 25 BindToRequest(new URLLoaderImpl(context_), &loader);
25 } 26 }
26 27
27 void NetworkServiceImpl::GetCookieStore(InterfaceRequest<CookieStore> store) { 28 void NetworkServiceImpl::GetCookieStore(InterfaceRequest<CookieStore> store) {
28 BindToRequest(new CookieStoreImpl(context_, origin_), &store); 29 BindToRequest(new CookieStoreImpl(context_, origin_), &store);
29 } 30 }
30 31
32 void NetworkServiceImpl::CreateWebSocket(InterfaceRequest<WebSocket> socket) {
33 BindToRequest(new WebSocketImpl(context_), &socket);
34 }
35
31 } // namespace mojo 36 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698