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

Side by Side Diff: content/network/network_service.h

Issue 2837813004: Sync the browser test host resolver with the network process before a test runs. (Closed)
Patch Set: review comments Created 3 years, 8 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
« no previous file with comments | « content/network/manifest.json ('k') | content/network/network_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_SERVICE_H_ 5 #ifndef CONTENT_NETWORK_NETWORK_SERVICE_H_
6 #define CONTENT_NETWORK_NETWORK_SERVICE_H_ 6 #define CONTENT_NETWORK_NETWORK_SERVICE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "content/common/url_loader_factory.mojom.h" 11 #include "content/common/url_loader_factory.mojom.h"
12 #include "content/network/network_context.h" 12 #include "content/network/network_context.h"
13 #include "mojo/public/cpp/bindings/strong_binding_set.h" 13 #include "mojo/public/cpp/bindings/strong_binding_set.h"
14 #include "services/service_manager/public/cpp/binder_registry.h" 14 #include "services/service_manager/public/cpp/binder_registry.h"
15 #include "services/service_manager/public/cpp/interface_factory.h" 15 #include "services/service_manager/public/cpp/interface_factory.h"
16 #include "services/service_manager/public/cpp/service.h" 16 #include "services/service_manager/public/cpp/service.h"
17 17
18 namespace content { 18 namespace content {
19 19
20 class NetworkService 20 class NetworkService
21 : public service_manager::Service, 21 : public service_manager::Service,
22 public service_manager::InterfaceFactory<mojom::URLLoaderFactory> { 22 public service_manager::InterfaceFactory<mojom::URLLoaderFactory> {
23 public: 23 public:
24 NetworkService(); 24 explicit NetworkService(
25 std::unique_ptr<service_manager::BinderRegistry> registry);
25 ~NetworkService() override; 26 ~NetworkService() override;
26 27
27 static std::unique_ptr<service_manager::Service> CreateNetworkService();
28
29 private: 28 private:
30 // service_manager::Service implementation. 29 // service_manager::Service implementation.
31 void OnBindInterface(const service_manager::ServiceInfo& source_info, 30 void OnBindInterface(const service_manager::ServiceInfo& source_info,
32 const std::string& interface_name, 31 const std::string& interface_name,
33 mojo::ScopedMessagePipeHandle interface_pipe) override; 32 mojo::ScopedMessagePipeHandle interface_pipe) override;
34 33
35 // service_manager::InterfaceFactory<mojom::UrlLoaderFactory>: 34 // service_manager::InterfaceFactory<mojom::UrlLoaderFactory>:
36 void Create(const service_manager::Identity& remote_identity, 35 void Create(const service_manager::Identity& remote_identity,
37 mojom::URLLoaderFactoryRequest request) override; 36 mojom::URLLoaderFactoryRequest request) override;
38 37
39 service_manager::BinderRegistry registry_; 38 std::unique_ptr<service_manager::BinderRegistry> registry_;
40 39
41 NetworkContext context_; 40 NetworkContext context_;
42 41
43 // Put it below |context_| so that |context_| outlives all the 42 // Put it below |context_| so that |context_| outlives all the
44 // NetworkServiceURLLoaderFactoryImpl instances. 43 // NetworkServiceURLLoaderFactoryImpl instances.
45 mojo::StrongBindingSet<mojom::URLLoaderFactory> loader_factory_bindings_; 44 mojo::StrongBindingSet<mojom::URLLoaderFactory> loader_factory_bindings_;
46 45
47 DISALLOW_COPY_AND_ASSIGN(NetworkService); 46 DISALLOW_COPY_AND_ASSIGN(NetworkService);
48 }; 47 };
49 48
50 } // namespace content 49 } // namespace content
51 50
52 #endif // CONTENT_NETWORK_NETWORK_SERVICE_H_ 51 #endif // CONTENT_NETWORK_NETWORK_SERVICE_H_
OLDNEW
« no previous file with comments | « content/network/manifest.json ('k') | content/network/network_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698