| 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/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" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
| 13 #include "base/strings/sys_string_conversions.h" | 13 #include "base/strings/sys_string_conversions.h" |
| 14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 15 #include "extensions/browser/value_store/value_store_util.h" | 15 #include "extensions/browser/value_store/value_store_util.h" |
| 16 #include "third_party/leveldatabase/src/include/leveldb/iterator.h" | 16 #include "third_party/leveldatabase/src/include/leveldb/iterator.h" |
| 17 #include "third_party/leveldatabase/src/include/leveldb/write_batch.h" | 17 #include "third_party/leveldatabase/src/include/leveldb/write_batch.h" |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 CHECK(!status.ok()); | 433 CHECK(!status.ok()); |
| 434 CHECK(!status.IsNotFound()); // not an error | 434 CHECK(!status.IsNotFound()); // not an error |
| 435 | 435 |
| 436 std::string message = status.ToString(); | 436 std::string message = status.ToString(); |
| 437 // The message may contain |db_path_|, which may be considered sensitive | 437 // The message may contain |db_path_|, which may be considered sensitive |
| 438 // data, and those strings are passed to the extension, so strip it out. | 438 // data, and those strings are passed to the extension, so strip it out. |
| 439 ReplaceSubstringsAfterOffset(&message, 0u, db_path_.AsUTF8Unsafe(), "..."); | 439 ReplaceSubstringsAfterOffset(&message, 0u, db_path_.AsUTF8Unsafe(), "..."); |
| 440 | 440 |
| 441 return Error::Create(CORRUPTION, message, key.Pass()); | 441 return Error::Create(CORRUPTION, message, key.Pass()); |
| 442 } | 442 } |
| OLD | NEW |