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

Side by Side Diff: content/browser/indexed_db/indexed_db_backing_store.cc

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "content/browser/indexed_db/indexed_db_backing_store.h" 5 #include "content/browser/indexed_db/indexed_db_backing_store.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 const GURL& origin_url, 951 const GURL& origin_url,
952 const std::string& message) { 952 const std::string& message) {
953 const base::FilePath info_path = 953 const base::FilePath info_path =
954 path_base.Append(ComputeCorruptionFileName(origin_url)); 954 path_base.Append(ComputeCorruptionFileName(origin_url));
955 if (IsPathTooLong(info_path)) 955 if (IsPathTooLong(info_path))
956 return false; 956 return false;
957 957
958 base::DictionaryValue root_dict; 958 base::DictionaryValue root_dict;
959 root_dict.SetString("message", message); 959 root_dict.SetString("message", message);
960 std::string output_js; 960 std::string output_js;
961 base::JSONWriter::Write(&root_dict, &output_js); 961 base::JSONWriter::Write(root_dict, &output_js);
962 962
963 base::File file(info_path, 963 base::File file(info_path,
964 base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE); 964 base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE);
965 if (!file.IsValid()) 965 if (!file.IsValid())
966 return false; 966 return false;
967 int written = file.Write(0, output_js.c_str(), output_js.length()); 967 int written = file.Write(0, output_js.c_str(), output_js.length());
968 return size_t(written) == output_js.length(); 968 return size_t(written) == output_js.length();
969 } 969 }
970 970
971 // static 971 // static
(...skipping 3447 matching lines...) Expand 10 before | Expand all | Expand 10 after
4419 4419
4420 IndexedDBBackingStore::Transaction::WriteDescriptor::WriteDescriptor( 4420 IndexedDBBackingStore::Transaction::WriteDescriptor::WriteDescriptor(
4421 const WriteDescriptor& other) = default; 4421 const WriteDescriptor& other) = default;
4422 IndexedDBBackingStore::Transaction::WriteDescriptor::~WriteDescriptor() = 4422 IndexedDBBackingStore::Transaction::WriteDescriptor::~WriteDescriptor() =
4423 default; 4423 default;
4424 IndexedDBBackingStore::Transaction::WriteDescriptor& 4424 IndexedDBBackingStore::Transaction::WriteDescriptor&
4425 IndexedDBBackingStore::Transaction::WriteDescriptor:: 4425 IndexedDBBackingStore::Transaction::WriteDescriptor::
4426 operator=(const WriteDescriptor& other) = default; 4426 operator=(const WriteDescriptor& other) = default;
4427 4427
4428 } // namespace content 4428 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/geolocation/network_location_request.cc ('k') | content/browser/tracing/tracing_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698