OLD | NEW |
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/leveldb_value_store.h" | 5 #include "extensions/browser/value_store/leveldb_value_store.h" |
6 | 6 |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 | 428 |
429 scoped_ptr<ValueStore::Error> LeveldbValueStore::ToValueStoreError( | 429 scoped_ptr<ValueStore::Error> LeveldbValueStore::ToValueStoreError( |
430 const leveldb::Status& status, | 430 const leveldb::Status& status, |
431 scoped_ptr<std::string> key) { | 431 scoped_ptr<std::string> key) { |
432 CHECK(!status.ok()); | 432 CHECK(!status.ok()); |
433 CHECK(!status.IsNotFound()); // not an error | 433 CHECK(!status.IsNotFound()); // not an error |
434 | 434 |
435 std::string message = status.ToString(); | 435 std::string message = status.ToString(); |
436 // The message may contain |db_path_|, which may be considered sensitive | 436 // The message may contain |db_path_|, which may be considered sensitive |
437 // data, and those strings are passed to the extension, so strip it out. | 437 // data, and those strings are passed to the extension, so strip it out. |
438 ReplaceSubstringsAfterOffset(&message, 0u, db_path_.AsUTF8Unsafe(), "..."); | 438 base::ReplaceSubstringsAfterOffset( |
| 439 &message, 0u, db_path_.AsUTF8Unsafe(), "..."); |
439 | 440 |
440 return Error::Create(CORRUPTION, message, key.Pass()); | 441 return Error::Create(CORRUPTION, message, key.Pass()); |
441 } | 442 } |
OLD | NEW |