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

Side by Side Diff: third_party/leveldatabase/env_chromium.cc

Issue 2722293002: Fix lifetime of leveldb::MojoEnv instances. (Closed)
Patch Set: annotate leaks Created 3 years, 8 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 (c) 2011 The LevelDB Authors. All rights reserved. 1 // Copyright (c) 2011 The LevelDB 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. See the AUTHORS file for names of contributors. 3 // found in the LICENSE file. See the AUTHORS file for names of contributors.
4 4
5 #include "third_party/leveldatabase/env_chromium.h" 5 #include "third_party/leveldatabase/env_chromium.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #if defined(OS_POSIX) 9 #if defined(OS_POSIX)
10 #include <dirent.h> 10 #include <dirent.h>
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 552
553 ChromiumEnv::ChromiumEnv(const std::string& name) 553 ChromiumEnv::ChromiumEnv(const std::string& name)
554 : kMaxRetryTimeMillis(1000), 554 : kMaxRetryTimeMillis(1000),
555 name_(name), 555 name_(name),
556 bgsignal_(&mu_), 556 bgsignal_(&mu_),
557 started_bgthread_(false) { 557 started_bgthread_(false) {
558 uma_ioerror_base_name_ = name_ + ".IOError.BFE"; 558 uma_ioerror_base_name_ = name_ + ".IOError.BFE";
559 } 559 }
560 560
561 ChromiumEnv::~ChromiumEnv() { 561 ChromiumEnv::~ChromiumEnv() {
562 // In chromium, ChromiumEnv is leaked. It'd be nice to add NOTREACHED here to 562 // In chromium, ChromiumEnv is leaked. The NOTREACHED here is to ensure that
563 // ensure that behavior isn't accidentally changed, but there's an instance in 563 // behavior isn't accidentally changed.
564 // a unit test that is deleted. 564 NOTREACHED();
565 } 565 }
566 566
567 bool ChromiumEnv::FileExists(const std::string& fname) { 567 bool ChromiumEnv::FileExists(const std::string& fname) {
568 return base::PathExists(FilePath::FromUTF8Unsafe(fname)); 568 return base::PathExists(FilePath::FromUTF8Unsafe(fname));
569 } 569 }
570 570
571 const char* ChromiumEnv::FileErrorString(base::File::Error error) { 571 const char* ChromiumEnv::FileErrorString(base::File::Error error) {
572 switch (error) { 572 switch (error) {
573 case base::File::FILE_ERROR_FAILED: 573 case base::File::FILE_ERROR_FAILED:
574 return "No further details."; 574 return "No further details.";
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 1073
1074 } // namespace leveldb_env 1074 } // namespace leveldb_env
1075 1075
1076 namespace leveldb { 1076 namespace leveldb {
1077 1077
1078 Env* Env::Default() { 1078 Env* Env::Default() {
1079 return leveldb_env::default_env.Pointer(); 1079 return leveldb_env::default_env.Pointer();
1080 } 1080 }
1081 1081
1082 } // namespace leveldb 1082 } // namespace leveldb
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698