Chromium Code Reviews| Index: chrome/browser/profiles/storage_partition_descriptor.h |
| diff --git a/chrome/browser/profiles/storage_partition_descriptor.h b/chrome/browser/profiles/storage_partition_descriptor.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2654cee2f09eb95b74b0b1f10077cee61fec9c84 |
| --- /dev/null |
| +++ b/chrome/browser/profiles/storage_partition_descriptor.h |
| @@ -0,0 +1,38 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_PROFILES_STORAGE_PARTITION_DESCRIPTOR_H_ |
| +#define CHROME_BROWSER_PROFILES_STORAGE_PARTITION_DESCRIPTOR_H_ |
| + |
| +#include "base/file_path.h" |
| +#include "base/hash.h" |
|
awong
2012/10/29 23:37:40
you don't need these hash includes anymore.
nasko
2012/10/30 00:32:59
Done.
|
| +#include "base/hash_tables.h" |
| + |
| +// This structure combines the on-disk path and a boolean whether the partition |
| +// should be persisted on disk. It's purpose is to serve as a unique key to |
| +// look up RequestContext objects in the ProfileIOData derived classes. |
| +struct StoragePartitionDescriptor { |
| + StoragePartitionDescriptor(const FilePath& partition_path, |
| + const bool in_memory_only) |
|
awong
2012/10/29 23:37:40
spacing
nasko
2012/10/30 00:32:59
Done.
|
| + : path(partition_path), |
| + in_memory(in_memory_only) {} |
| + |
| + const FilePath path; |
| + const bool in_memory; |
| +}; |
| + |
| +// Functor for operator <. |
| +struct StoragePartitionDescriptorLess { |
| + bool operator()(const StoragePartitionDescriptor& lhs, |
| + const StoragePartitionDescriptor& rhs) const { |
| + if (lhs.path != rhs.path) |
| + return lhs.path < rhs.path; |
| + else if (lhs.in_memory != rhs.in_memory) |
| + return lhs.in_memory < rhs.in_memory; |
| + else |
| + return false; |
| + } |
| +}; |
| + |
| +#endif // CHROME_BROWSER_PROFILES_STORAGE_PARTITION_DESCRIPTOR_H_ |