Revert "Reland c91b178b07b0d - Delete dead signin code (SigninGlobalError)"
[chromium-blink-merge.git] / chrome / browser / profiles / storage_partition_descriptor.h
blob361319978e4f1ad36c9d9d94072766924c9f40d7
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_PROFILES_STORAGE_PARTITION_DESCRIPTOR_H_
6 #define CHROME_BROWSER_PROFILES_STORAGE_PARTITION_DESCRIPTOR_H_
8 #include "base/containers/hash_tables.h"
9 #include "base/files/file_path.h"
11 // This structure combines a StoragePartition's on-disk path and a boolean for
12 // whether the partition should be persisted on disk. Its purpose is to serve as
13 // a unique key to look up RequestContext objects in the ProfileIOData derived
14 // classes.
15 struct StoragePartitionDescriptor {
16 StoragePartitionDescriptor(const base::FilePath& partition_path,
17 const bool in_memory_only)
18 : path(partition_path),
19 in_memory(in_memory_only) {}
21 const base::FilePath path;
22 const bool in_memory;
25 // Functor for operator <.
26 struct StoragePartitionDescriptorLess {
27 bool operator()(const StoragePartitionDescriptor& lhs,
28 const StoragePartitionDescriptor& rhs) const {
29 if (lhs.path != rhs.path)
30 return lhs.path < rhs.path;
31 else if (lhs.in_memory != rhs.in_memory)
32 return lhs.in_memory < rhs.in_memory;
33 else
34 return false;
38 #endif // CHROME_BROWSER_PROFILES_STORAGE_PARTITION_DESCRIPTOR_H_