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

Side by Side Diff: extensions/browser/value_store/value_store_frontend.cc

Issue 598173003: Run clang-modernize -use-nullptr over src/extensions/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/value_store/value_store_frontend.h" 5 #include "extensions/browser/value_store/value_store_frontend.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "content/public/browser/browser_thread.h" 11 #include "content/public/browser/browser_thread.h"
12 #include "extensions/browser/value_store/leveldb_value_store.h" 12 #include "extensions/browser/value_store/leveldb_value_store.h"
13 13
14 using content::BrowserThread; 14 using content::BrowserThread;
15 15
16 class ValueStoreFrontend::Backend : public base::RefCountedThreadSafe<Backend> { 16 class ValueStoreFrontend::Backend : public base::RefCountedThreadSafe<Backend> {
17 public: 17 public:
18 Backend() : storage_(NULL) {} 18 Backend() : storage_(nullptr) {}
19 19
20 void Init(const base::FilePath& db_path) { 20 void Init(const base::FilePath& db_path) {
21 DCHECK_CURRENTLY_ON(BrowserThread::FILE); 21 DCHECK_CURRENTLY_ON(BrowserThread::FILE);
22 DCHECK(!storage_); 22 DCHECK(!storage_);
23 TRACE_EVENT0("ValueStoreFrontend::Backend", "Init"); 23 TRACE_EVENT0("ValueStoreFrontend::Backend", "Init");
24 db_path_ = db_path; 24 db_path_ = db_path;
25 storage_ = new LeveldbValueStore(db_path); 25 storage_ = new LeveldbValueStore(db_path);
26 } 26 }
27 27
28 // This variant is useful for testing (using a mock ValueStore). 28 // This variant is useful for testing (using a mock ValueStore).
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 backend_, key, base::Passed(&value))); 138 backend_, key, base::Passed(&value)));
139 } 139 }
140 140
141 void ValueStoreFrontend::Remove(const std::string& key) { 141 void ValueStoreFrontend::Remove(const std::string& key) {
142 DCHECK(CalledOnValidThread()); 142 DCHECK(CalledOnValidThread());
143 143
144 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, 144 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
145 base::Bind(&ValueStoreFrontend::Backend::Remove, 145 base::Bind(&ValueStoreFrontend::Backend::Remove,
146 backend_, key)); 146 backend_, key));
147 } 147 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698