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

Side by Side Diff: content/public/test/test_service.cc

Issue 2871523002: Use OnceCallback on Mojo interfaces in //content (Closed)
Patch Set: . Created 3 years, 7 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/public/test/test_service.h ('k') | content/shell/BUILD.gn » ('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/public/test/test_service.h" 5 #include "content/public/test/test_service.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 19 matching lines...) Expand all
30 registry_.BindInterface(source_info, interface_name, 30 registry_.BindInterface(source_info, interface_name,
31 std::move(interface_pipe)); 31 std::move(interface_pipe));
32 } 32 }
33 33
34 void TestService::Create(const service_manager::BindSourceInfo& source_info, 34 void TestService::Create(const service_manager::BindSourceInfo& source_info,
35 mojom::TestServiceRequest request) { 35 mojom::TestServiceRequest request) {
36 DCHECK(!service_binding_.is_bound()); 36 DCHECK(!service_binding_.is_bound());
37 service_binding_.Bind(std::move(request)); 37 service_binding_.Bind(std::move(request));
38 } 38 }
39 39
40 void TestService::DoSomething(const DoSomethingCallback& callback) { 40 void TestService::DoSomething(DoSomethingCallback callback) {
41 callback.Run(); 41 std::move(callback).Run();
42 base::MessageLoop::current()->QuitWhenIdle(); 42 base::MessageLoop::current()->QuitWhenIdle();
43 } 43 }
44 44
45 void TestService::DoTerminateProcess( 45 void TestService::DoTerminateProcess(DoTerminateProcessCallback callback) {
46 const DoTerminateProcessCallback& callback) {
47 NOTREACHED(); 46 NOTREACHED();
48 } 47 }
49 48
50 void TestService::CreateFolder(const CreateFolderCallback& callback) { 49 void TestService::CreateFolder(CreateFolderCallback callback) {
51 NOTREACHED(); 50 NOTREACHED();
52 } 51 }
53 52
54 void TestService::GetRequestorName(const GetRequestorNameCallback& callback) { 53 void TestService::GetRequestorName(GetRequestorNameCallback callback) {
55 callback.Run(requestor_name_); 54 std::move(callback).Run(requestor_name_);
56 } 55 }
57 56
58 void TestService::CreateSharedBuffer( 57 void TestService::CreateSharedBuffer(const std::string& message,
59 const std::string& message, 58 CreateSharedBufferCallback callback) {
60 const CreateSharedBufferCallback& callback) {
61 NOTREACHED(); 59 NOTREACHED();
62 } 60 }
63 61
64 } // namespace content 62 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/test_service.h ('k') | content/shell/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698