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

Side by Side Diff: services/file/file_service.cc

Issue 2259823003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | services/shell/background/tests/background_shell_unittest.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 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 std::unique_ptr<leveldb::mojom::LevelDBService> leveldb_service_; 66 std::unique_ptr<leveldb::mojom::LevelDBService> leveldb_service_;
67 mojo::BindingSet<leveldb::mojom::LevelDBService> leveldb_bindings_; 67 mojo::BindingSet<leveldb::mojom::LevelDBService> leveldb_bindings_;
68 68
69 DISALLOW_COPY_AND_ASSIGN(LevelDBServiceObjects); 69 DISALLOW_COPY_AND_ASSIGN(LevelDBServiceObjects);
70 }; 70 };
71 71
72 std::unique_ptr<shell::Service> CreateFileService( 72 std::unique_ptr<shell::Service> CreateFileService(
73 scoped_refptr<base::SingleThreadTaskRunner> file_service_runner, 73 scoped_refptr<base::SingleThreadTaskRunner> file_service_runner,
74 scoped_refptr<base::SingleThreadTaskRunner> leveldb_service_runner, 74 scoped_refptr<base::SingleThreadTaskRunner> leveldb_service_runner,
75 const base::Closure& quit_closure) { 75 const base::Closure& quit_closure) {
76 return base::WrapUnique(new FileService( 76 return base::MakeUnique<FileService>(std::move(file_service_runner),
77 std::move(file_service_runner), std::move(leveldb_service_runner))); 77 std::move(leveldb_service_runner));
78 } 78 }
79 79
80 FileService::FileService( 80 FileService::FileService(
81 scoped_refptr<base::SingleThreadTaskRunner> file_service_runner, 81 scoped_refptr<base::SingleThreadTaskRunner> file_service_runner,
82 scoped_refptr<base::SingleThreadTaskRunner> leveldb_service_runner) 82 scoped_refptr<base::SingleThreadTaskRunner> leveldb_service_runner)
83 : file_service_runner_(std::move(file_service_runner)), 83 : file_service_runner_(std::move(file_service_runner)),
84 leveldb_service_runner_(std::move(leveldb_service_runner)) {} 84 leveldb_service_runner_(std::move(leveldb_service_runner)) {}
85 85
86 FileService::~FileService() { 86 FileService::~FileService() {
87 file_service_runner_->DeleteSoon(FROM_HERE, file_system_objects_.release()); 87 file_service_runner_->DeleteSoon(FROM_HERE, file_system_objects_.release());
(...skipping 27 matching lines...) Expand all
115 leveldb::mojom::LevelDBServiceRequest request) { 115 leveldb::mojom::LevelDBServiceRequest request) {
116 leveldb_service_runner_->PostTask( 116 leveldb_service_runner_->PostTask(
117 FROM_HERE, 117 FROM_HERE,
118 base::Bind( 118 base::Bind(
119 &FileService::LevelDBServiceObjects::OnLevelDBServiceRequest, 119 &FileService::LevelDBServiceObjects::OnLevelDBServiceRequest,
120 leveldb_objects_->AsWeakPtr(), remote_identity, 120 leveldb_objects_->AsWeakPtr(), remote_identity,
121 base::Passed(&request))); 121 base::Passed(&request)));
122 } 122 }
123 123
124 } // namespace user_service 124 } // namespace user_service
OLDNEW
« no previous file with comments | « no previous file | services/shell/background/tests/background_shell_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698