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

Side by Side Diff: services/file/file_service.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 | « services/file/file_service.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "services/file/file_service.h" 5 #include "services/file/file_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "components/filesystem/lock_table.h" 10 #include "components/filesystem/lock_table.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 // Variables that are only accessible on the |leveldb_service_runner_| thread. 67 // Variables that are only accessible on the |leveldb_service_runner_| thread.
68 std::unique_ptr<leveldb::mojom::LevelDBService> leveldb_service_; 68 std::unique_ptr<leveldb::mojom::LevelDBService> leveldb_service_;
69 mojo::BindingSet<leveldb::mojom::LevelDBService> leveldb_bindings_; 69 mojo::BindingSet<leveldb::mojom::LevelDBService> leveldb_bindings_;
70 70
71 DISALLOW_COPY_AND_ASSIGN(LevelDBServiceObjects); 71 DISALLOW_COPY_AND_ASSIGN(LevelDBServiceObjects);
72 }; 72 };
73 73
74 std::unique_ptr<service_manager::Service> CreateFileService( 74 std::unique_ptr<service_manager::Service> CreateFileService(
75 scoped_refptr<base::SingleThreadTaskRunner> file_service_runner, 75 scoped_refptr<base::SingleThreadTaskRunner> file_service_runner,
76 scoped_refptr<base::SingleThreadTaskRunner> leveldb_service_runner, 76 scoped_refptr<base::SingleThreadTaskRunner> leveldb_service_runner) {
77 const base::Closure& quit_closure) {
78 return base::MakeUnique<FileService>(std::move(file_service_runner), 77 return base::MakeUnique<FileService>(std::move(file_service_runner),
79 std::move(leveldb_service_runner)); 78 std::move(leveldb_service_runner));
80 } 79 }
81 80
82 FileService::FileService( 81 FileService::FileService(
83 scoped_refptr<base::SingleThreadTaskRunner> file_service_runner, 82 scoped_refptr<base::SingleThreadTaskRunner> file_service_runner,
84 scoped_refptr<base::SingleThreadTaskRunner> leveldb_service_runner) 83 scoped_refptr<base::SingleThreadTaskRunner> leveldb_service_runner)
85 : file_service_runner_(std::move(file_service_runner)), 84 : file_service_runner_(std::move(file_service_runner)),
86 leveldb_service_runner_(std::move(leveldb_service_runner)) {} 85 leveldb_service_runner_(std::move(leveldb_service_runner)) {}
87 86
(...skipping 29 matching lines...) Expand all
117 leveldb::mojom::LevelDBServiceRequest request) { 116 leveldb::mojom::LevelDBServiceRequest request) {
118 leveldb_service_runner_->PostTask( 117 leveldb_service_runner_->PostTask(
119 FROM_HERE, 118 FROM_HERE,
120 base::Bind( 119 base::Bind(
121 &FileService::LevelDBServiceObjects::OnLevelDBServiceRequest, 120 &FileService::LevelDBServiceObjects::OnLevelDBServiceRequest,
122 leveldb_objects_->AsWeakPtr(), remote_identity, 121 leveldb_objects_->AsWeakPtr(), remote_identity,
123 base::Passed(&request))); 122 base::Passed(&request)));
124 } 123 }
125 124
126 } // namespace user_service 125 } // namespace user_service
OLDNEW
« no previous file with comments | « services/file/file_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698