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

Unified Diff: chrome/browser/profiles/storage_partition_descriptor.h

Issue 11147026: Initial refactor to get profiles to propagate storage partition details. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing Android's BrowserContext. Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
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..87be9cc980bfac0b4d0b989296085312de0233f5
--- /dev/null
+++ b/chrome/browser/profiles/storage_partition_descriptor.h
@@ -0,0 +1,37 @@
+// 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_tables.h"
+
+// This structure combines the on-disk path and a boolean whether the partition
Charlie Reis 2012/10/30 17:47:48 nit: combines a StoragePartition's on-disk path an
nasko 2012/10/30 19:55:25 Done.
Charlie Reis 2012/10/30 20:13:07 Can you also add the "combines a StoragePartition'
nasko 2012/10/30 20:27:43 Done.
+// should be persisted on disk. It's purpose is to serve as a unique key to
Charlie Reis 2012/10/30 17:47:48 nit: Its
nasko 2012/10/30 19:55:25 Done.
+// look up RequestContext objects in the ProfileIOData derived classes.
+struct StoragePartitionDescriptor {
+ StoragePartitionDescriptor(const FilePath& partition_path,
+ const bool in_memory_only)
+ : 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_

Powered by Google App Engine
This is Rietveld 408576698