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

Side by Side Diff: content/shell/utility/shell_content_utility_client.cc

Issue 2484953002: Eliminate quit closure argument to embedded service factories (Closed)
Patch Set: . Created 4 years, 1 month 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/public/common/service_info.h ('k') | media/mojo/services/main.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 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 "content/shell/utility/shell_content_utility_client.h" 5 #include "content/shell/utility/shell_content_utility_client.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 callback.Run(std::move(buffer)); 60 callback.Run(std::move(buffer));
61 } 61 }
62 62
63 private: 63 private:
64 explicit TestServiceImpl() {} 64 explicit TestServiceImpl() {}
65 65
66 DISALLOW_COPY_AND_ASSIGN(TestServiceImpl); 66 DISALLOW_COPY_AND_ASSIGN(TestServiceImpl);
67 }; 67 };
68 68
69 std::unique_ptr<service_manager::Service> CreateTestService( 69 std::unique_ptr<service_manager::Service> CreateTestService() {
70 const base::Closure& quit_closure) {
71 return std::unique_ptr<service_manager::Service>(new TestService); 70 return std::unique_ptr<service_manager::Service>(new TestService);
72 } 71 }
73 72
74 } // namespace 73 } // namespace
75 74
76 ShellContentUtilityClient::~ShellContentUtilityClient() { 75 ShellContentUtilityClient::~ShellContentUtilityClient() {
77 } 76 }
78 77
79 void ShellContentUtilityClient::RegisterServices(StaticServiceMap* services) { 78 void ShellContentUtilityClient::RegisterServices(StaticServiceMap* services) {
80 ServiceInfo info; 79 ServiceInfo info;
81 info.factory = base::Bind(&CreateTestService); 80 info.factory = base::Bind(&CreateTestService);
82 services->insert(std::make_pair(kTestServiceUrl, info)); 81 services->insert(std::make_pair(kTestServiceUrl, info));
83 } 82 }
84 83
85 void ShellContentUtilityClient::ExposeInterfacesToBrowser( 84 void ShellContentUtilityClient::ExposeInterfacesToBrowser(
86 service_manager::InterfaceRegistry* registry) { 85 service_manager::InterfaceRegistry* registry) {
87 registry->AddInterface(base::Bind(&TestServiceImpl::Create)); 86 registry->AddInterface(base::Bind(&TestServiceImpl::Create));
88 } 87 }
89 88
90 } // namespace content 89 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/service_info.h ('k') | media/mojo/services/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698