diff options
author | brettw <brettw@chromium.org> | 2015-06-02 21:29:25 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-03 04:30:27 +0000 |
commit | bd4d71128239a38fa844c42e4110458109a8b135 (patch) | |
tree | 47ff0ad11b9270fb410d93632fd63a0c78218176 /storage | |
parent | 6f89d8f965bae07a352ee82abe1fb551f65d65e1 (diff) | |
download | chromium_src-bd4d71128239a38fa844c42e4110458109a8b135.zip chromium_src-bd4d71128239a38fa844c42e4110458109a8b135.tar.gz chromium_src-bd4d71128239a38fa844c42e4110458109a8b135.tar.bz2 |
Change most uses of Pickle to base::Pickle
There should be no behavior change.
TBR=jschuh (IPC messages)
Review URL: https://codereview.chromium.org/1154283003
Cr-Commit-Position: refs/heads/master@{#332552}
Diffstat (limited to 'storage')
3 files changed, 17 insertions, 17 deletions
diff --git a/storage/browser/fileapi/file_system_usage_cache.cc b/storage/browser/fileapi/file_system_usage_cache.cc index 8c65177..f1d3ece 100644 --- a/storage/browser/fileapi/file_system_usage_cache.cc +++ b/storage/browser/fileapi/file_system_usage_cache.cc @@ -38,8 +38,7 @@ const int FileSystemUsageCache::kUsageFileHeaderSize = 4; // Pickle::{Read,Write}Bool treat bool as int const int FileSystemUsageCache::kUsageFileSize = - sizeof(Pickle::Header) + - FileSystemUsageCache::kUsageFileHeaderSize + + sizeof(base::Pickle::Header) + FileSystemUsageCache::kUsageFileHeaderSize + sizeof(int) + sizeof(int32) + sizeof(int64); // NOLINT bool FileSystemUsageCache::GetUsage(const base::FilePath& usage_file_path, @@ -176,8 +175,8 @@ bool FileSystemUsageCache::Read(const base::FilePath& usage_file_path, if (usage_file_path.empty() || !ReadBytes(usage_file_path, buffer, kUsageFileSize)) return false; - Pickle read_pickle(buffer, kUsageFileSize); - PickleIterator iter(read_pickle); + base::Pickle read_pickle(buffer, kUsageFileSize); + base::PickleIterator iter(read_pickle); uint32 dirty = 0; int64 usage = 0; @@ -204,7 +203,7 @@ bool FileSystemUsageCache::Write(const base::FilePath& usage_file_path, int64 usage) { TRACE_EVENT0("FileSystem", "UsageCache::Write"); DCHECK(CalledOnValidThread()); - Pickle write_pickle; + base::Pickle write_pickle; write_pickle.WriteBytes(kUsageFileHeader, kUsageFileHeaderSize); write_pickle.WriteBool(is_valid); write_pickle.WriteUInt32(dirty); diff --git a/storage/browser/fileapi/sandbox_directory_database.cc b/storage/browser/fileapi/sandbox_directory_database.cc index 976a3fa..4543863 100644 --- a/storage/browser/fileapi/sandbox_directory_database.cc +++ b/storage/browser/fileapi/sandbox_directory_database.cc @@ -25,7 +25,7 @@ namespace { bool PickleFromFileInfo(const storage::SandboxDirectoryDatabase::FileInfo& info, - Pickle* pickle) { + base::Pickle* pickle) { DCHECK(pickle); std::string data_path; // Round off here to match the behavior of the filesystem on real files. @@ -46,9 +46,9 @@ bool PickleFromFileInfo(const storage::SandboxDirectoryDatabase::FileInfo& info, return false; } -bool FileInfoFromPickle(const Pickle& pickle, +bool FileInfoFromPickle(const base::Pickle& pickle, storage::SandboxDirectoryDatabase::FileInfo* info) { - PickleIterator iter(pickle); + base::PickleIterator iter(pickle); std::string data_path; std::string name; int64 internal_time; @@ -62,7 +62,7 @@ bool FileInfoFromPickle(const Pickle& pickle, info->modification_time = base::Time::FromInternalValue(internal_time); return true; } - LOG(ERROR) << "Pickle could not be digested!"; + LOG(ERROR) << "base::Pickle could not be digested!"; return false; } @@ -224,7 +224,8 @@ bool DatabaseCheckHelper::ScanDatabase() { // value: "<pickled FileInfo>" FileInfo file_info; if (!FileInfoFromPickle( - Pickle(itr->value().data(), itr->value().size()), &file_info)) + base::Pickle(itr->value().data(), itr->value().size()), + &file_info)) return false; FileId file_id = -1; @@ -498,7 +499,7 @@ bool SandboxDirectoryDatabase::GetFileInfo(FileId file_id, FileInfo* info) { db_->Get(leveldb::ReadOptions(), file_key, &file_data_string); if (status.ok()) { bool success = FileInfoFromPickle( - Pickle(file_data_string.data(), file_data_string.length()), info); + base::Pickle(file_data_string.data(), file_data_string.length()), info); if (!success) return false; if (!VerifyDataPath(info->data_path)) { @@ -621,7 +622,7 @@ bool SandboxDirectoryDatabase::UpdateModificationTime( if (!GetFileInfo(file_id, &info)) return false; info.modification_time = modification_time; - Pickle pickle; + base::Pickle pickle; if (!PickleFromFileInfo(info, &pickle)) return false; leveldb::Status status = db_->Put( @@ -653,7 +654,7 @@ bool SandboxDirectoryDatabase::OverwritingMoveFile( dest_file_info.data_path = src_file_info.data_path; if (!RemoveFileInfoHelper(src_file_id, &batch)) return false; - Pickle pickle; + base::Pickle pickle; if (!PickleFromFileInfo(dest_file_info, &pickle)) return false; batch.Put( @@ -899,7 +900,7 @@ bool SandboxDirectoryDatabase::AddFileInfoHelper( std::string child_key = GetChildLookupKey(info.parent_id, info.name); batch->Put(child_key, id_string); } - Pickle pickle; + base::Pickle pickle; if (!PickleFromFileInfo(info, &pickle)) return false; batch->Put( diff --git a/storage/browser/fileapi/sandbox_prioritized_origin_database.cc b/storage/browser/fileapi/sandbox_prioritized_origin_database.cc index 9a64edf..3a677a8 100644 --- a/storage/browser/fileapi/sandbox_prioritized_origin_database.cc +++ b/storage/browser/fileapi/sandbox_prioritized_origin_database.cc @@ -30,7 +30,7 @@ bool WritePrimaryOriginFile(const base::FilePath& path, return false; if (!file.created()) file.SetLength(0); - Pickle pickle; + base::Pickle pickle; pickle.WriteString(origin); file.Write(0, static_cast<const char*>(pickle.data()), pickle.size()); file.Flush(); @@ -42,8 +42,8 @@ bool ReadPrimaryOriginFile(const base::FilePath& path, std::string buffer; if (!base::ReadFileToString(path, &buffer)) return false; - Pickle pickle(buffer.data(), buffer.size()); - PickleIterator iter(pickle); + base::Pickle pickle(buffer.data(), buffer.size()); + base::PickleIterator iter(pickle); return iter.ReadString(origin) && !origin->empty(); } |