| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef CONTENT_NETWORK_NETWORK_CONTEXT_H_ | 5 #ifndef CONTENT_NETWORK_NETWORK_CONTEXT_H_ |
| 6 #define CONTENT_NETWORK_NETWORK_CONTEXT_H_ | 6 #define CONTENT_NETWORK_NETWORK_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // Put it below |url_request_context_| so that it outlives all the | 55 // Put it below |url_request_context_| so that it outlives all the |
| 56 // NetworkServiceURLLoaderFactoryImpl instances. | 56 // NetworkServiceURLLoaderFactoryImpl instances. |
| 57 mojo::StrongBindingSet<mojom::URLLoaderFactory> loader_factory_bindings_; | 57 mojo::StrongBindingSet<mojom::URLLoaderFactory> loader_factory_bindings_; |
| 58 | 58 |
| 59 // URLLoaderImpls register themselves with the NetworkContext so that they can | 59 // URLLoaderImpls register themselves with the NetworkContext so that they can |
| 60 // be cleaned up when the NetworkContext goes away. This is needed as | 60 // be cleaned up when the NetworkContext goes away. This is needed as |
| 61 // net::URLRequests held by URLLoaderImpls have to be gone when | 61 // net::URLRequests held by URLLoaderImpls have to be gone when |
| 62 // net::URLRequestContext (held by NetworkContext) is destroyed. | 62 // net::URLRequestContext (held by NetworkContext) is destroyed. |
| 63 std::set<URLLoaderImpl*> url_loaders_; | 63 std::set<URLLoaderImpl*> url_loaders_; |
| 64 | 64 |
| 65 // Set when entering the destructor, in order to avoid manipulations of the | |
| 66 // |url_loaders_| (as a url_loader might delete itself in Cleanup()). | |
| 67 bool in_shutdown_; | |
| 68 | |
| 69 mojom::NetworkContextParamsPtr params_; | 65 mojom::NetworkContextParamsPtr params_; |
| 70 | 66 |
| 71 mojo::Binding<mojom::NetworkContext> binding_; | 67 mojo::Binding<mojom::NetworkContext> binding_; |
| 72 | 68 |
| 73 DISALLOW_COPY_AND_ASSIGN(NetworkContext); | 69 DISALLOW_COPY_AND_ASSIGN(NetworkContext); |
| 74 }; | 70 }; |
| 75 | 71 |
| 76 } // namespace content | 72 } // namespace content |
| 77 | 73 |
| 78 #endif // CONTENT_NETWORK_NETWORK_CONTEXT_H_ | 74 #endif // CONTENT_NETWORK_NETWORK_CONTEXT_H_ |
| OLD | NEW |