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

Side by Side Diff: components/sync/model_impl/model_type_store_impl.cc

Issue 2872933002: Use constexpr TaskTraits constructor everywhere. (Closed)
Patch Set: fix-build-error 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 | « chrome/browser/supervised_user/supervised_user_url_filter.cc ('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 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 "components/sync/model_impl/model_type_store_impl.h" 5 #include "components/sync/model_impl/model_type_store_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 class TaskRunnerMap { 61 class TaskRunnerMap {
62 public: 62 public:
63 TaskRunnerMap() = default; 63 TaskRunnerMap() = default;
64 64
65 scoped_refptr<base::SequencedTaskRunner> GetOrCreateTaskRunner( 65 scoped_refptr<base::SequencedTaskRunner> GetOrCreateTaskRunner(
66 const std::string& path) { 66 const std::string& path) {
67 base::AutoLock scoped_lock(lock_); 67 base::AutoLock scoped_lock(lock_);
68 auto iter = task_runner_map_.find(path); 68 auto iter = task_runner_map_.find(path);
69 if (iter == task_runner_map_.end()) { 69 if (iter == task_runner_map_.end()) {
70 scoped_refptr<base::SequencedTaskRunner> task_runner = 70 scoped_refptr<base::SequencedTaskRunner> task_runner =
71 CreateSequencedTaskRunnerWithTraits( 71 base::CreateSequencedTaskRunnerWithTraits(
72 base::TaskTraits().MayBlock().WithShutdownBehavior( 72 {base::MayBlock(), base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN});
73 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN));
74 task_runner_map_[path] = task_runner; 73 task_runner_map_[path] = task_runner;
75 return task_runner; 74 return task_runner;
76 } else { 75 } else {
77 return iter->second; 76 return iter->second;
78 } 77 }
79 } 78 }
80 79
81 private: 80 private:
82 mutable base::Lock lock_; 81 mutable base::Lock lock_;
83 std::map<std::string, scoped_refptr<base::SequencedTaskRunner>> 82 std::map<std::string, scoped_refptr<base::SequencedTaskRunner>>
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 } 414 }
416 415
417 ModelTypeStoreImpl::WriteBatchImpl::WriteBatchImpl(ModelTypeStore* store) 416 ModelTypeStoreImpl::WriteBatchImpl::WriteBatchImpl(ModelTypeStore* store)
418 : WriteBatch(store) { 417 : WriteBatch(store) {
419 leveldb_write_batch_ = base::MakeUnique<leveldb::WriteBatch>(); 418 leveldb_write_batch_ = base::MakeUnique<leveldb::WriteBatch>();
420 } 419 }
421 420
422 ModelTypeStoreImpl::WriteBatchImpl::~WriteBatchImpl() {} 421 ModelTypeStoreImpl::WriteBatchImpl::~WriteBatchImpl() {}
423 422
424 } // namespace syncer 423 } // namespace syncer
OLDNEW
« no previous file with comments | « chrome/browser/supervised_user/supervised_user_url_filter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698