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

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

Issue 1200393002: Add more string_util functions to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string
Patch Set: Android Created 5 years, 6 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 | « extensions/browser/user_script_loader.cc ('k') | extensions/common/error_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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 }
OLDNEW
« no previous file with comments | « extensions/browser/user_script_loader.cc ('k') | extensions/common/error_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698