OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/url_loader_factory_impl.h" | 5 #include "mojo/services/network/url_loader_factory_impl.h" |
6 | 6 |
7 #include "mojo/services/network/url_loader_impl.h" | 7 #include "mojo/services/network/url_loader_impl.h" |
8 | 8 |
9 namespace mojo { | 9 namespace mojo { |
10 | 10 |
11 URLLoaderFactoryImpl::URLLoaderFactoryImpl( | 11 URLLoaderFactoryImpl::URLLoaderFactoryImpl( |
12 ApplicationConnection* connection, | |
13 NetworkContext* context, | 12 NetworkContext* context, |
14 scoped_ptr<mojo::AppRefCount> app_refcount, | 13 scoped_ptr<mojo::AppRefCount> app_refcount, |
15 InterfaceRequest<URLLoaderFactory> request) | 14 InterfaceRequest<URLLoaderFactory> request) |
16 : context_(context), | 15 : context_(context), |
17 app_refcount_(app_refcount.Pass()), | 16 app_refcount_(app_refcount.Pass()), |
18 binding_(this, request.Pass()) { | 17 binding_(this, request.Pass()) { |
19 } | 18 } |
20 | 19 |
21 URLLoaderFactoryImpl::~URLLoaderFactoryImpl() { | 20 URLLoaderFactoryImpl::~URLLoaderFactoryImpl() { |
22 } | 21 } |
23 | 22 |
24 void URLLoaderFactoryImpl::CreateURLLoader(InterfaceRequest<URLLoader> loader) { | 23 void URLLoaderFactoryImpl::CreateURLLoader(InterfaceRequest<URLLoader> loader) { |
25 // TODO(darin): Plumb origin. Use for CORS. | 24 // TODO(darin): Plumb origin. Use for CORS. |
26 // TODO(beng): Figure out how to get origin through to here. | 25 // TODO(beng): Figure out how to get origin through to here. |
27 // The loader will delete itself when the pipe is closed, unless a request is | 26 // The loader will delete itself when the pipe is closed, unless a request is |
28 // in progress. In which case, the loader will delete itself when the request | 27 // in progress. In which case, the loader will delete itself when the request |
29 // is finished. | 28 // is finished. |
30 new URLLoaderImpl(context_, loader.Pass(), app_refcount_->Clone()); | 29 new URLLoaderImpl(context_, loader.Pass(), app_refcount_->Clone()); |
31 } | 30 } |
32 | 31 |
33 } // namespace mojo | 32 } // namespace mojo |
OLD | NEW |