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

Unified Diff: content/browser/storage_partition_impl.h

Issue 11366140: Fix on-disk structure for persistent storage in webview tags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 1 month 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: content/browser/storage_partition_impl.h
diff --git a/content/browser/storage_partition_impl.h b/content/browser/storage_partition_impl.h
index 97128378fdf180d010ea9602221a91384e10da39..490ca988b2277d2661c297c1f8ab0e9b08e64870 100644
--- a/content/browser/storage_partition_impl.h
+++ b/content/browser/storage_partition_impl.h
@@ -7,7 +7,6 @@
#include "base/compiler_specific.h"
#include "base/file_path.h"
-#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
#include "content/browser/appcache/chrome_appcache_service.h"
#include "content/browser/dom_storage/dom_storage_context_impl.h"
@@ -32,62 +31,18 @@ class StoragePartitionImpl : public StoragePartition {
virtual IndexedDBContextImpl* GetIndexedDBContext() OVERRIDE;
private:
- FRIEND_TEST_ALL_PREFIXES(StoragePartitionConfigTest, OperatorLess);
friend class StoragePartitionImplMap;
- // Each StoragePartition is uniquely identified by which partition domain
- // it belongs to (such as an app or the browser itself), the user supplied
- // partition name and the bit indicating whether it should be persisted on
- // disk or not. This structure contains those elements and is used as
- // uniqueness key to lookup StoragePartition objects in the global map.
+ // The |partition_path| is the absolute path to the root of this
+ // StoragePartition's on-disk storage.
//
- // TODO(nasko): It is equivalent, though not identical to the same structure
- // that lives in chrome profiles. The difference is that this one has
- // partition_domain and partition_name separate, while the latter one has
- // the path produced by combining the two pieces together.
- // The fix for http://crbug.com/159193 will remove the chrome version.
- struct StoragePartitionConfig {
- const std::string partition_domain;
- const std::string partition_name;
- const bool in_memory;
-
- StoragePartitionConfig(const std::string& domain,
- const std::string& partition,
- const bool& in_memory_only)
- : partition_domain(domain),
- partition_name(partition),
- in_memory(in_memory_only) {}
- };
-
- // Functor for operator <.
- struct StoragePartitionConfigLess {
- bool operator()(const StoragePartitionConfig& lhs,
- const StoragePartitionConfig& rhs) const {
- if (lhs.partition_domain != rhs.partition_domain)
- return lhs.partition_domain < rhs.partition_domain;
- else if (lhs.partition_name != rhs.partition_name)
- return lhs.partition_name < rhs.partition_name;
- else if (lhs.in_memory != rhs.in_memory)
- return lhs.in_memory < rhs.in_memory;
- else
- return false;
- }
- };
-
- // TODO(ajwong): Break the direct dependency on |context|. We only
- // need 3 pieces of info from it.
- static StoragePartitionImpl* Create(
- BrowserContext* context,
- const StoragePartitionConfig& partition_id,
- const FilePath& profile_path);
-
- // Returns the relative path from the profile's base directory, to the
- // directory that holds all the state for storage contexts in
- // |partition_config|. If any of the strings in |partition_config| contain
- // embedded nuls, the values will be truncated and only the portion prior to
- // the nul will be used.
- static FilePath GetStoragePartitionPath(
- const StoragePartitionConfig& partition_config);
+ // If |in_memory| is true, nothing is persisted to disk.
+ //
+ // TODO(ajwong): Should we assert that the |partition_path| is empty if
+ // in_memory is true.
nasko 2012/11/12 16:47:28 partition_path wouldn't be empty, would it? I thin
awong 2012/11/12 21:36:16 Reworded.
+ static StoragePartitionImpl* Create(BrowserContext* context,
+ bool in_memory,
+ const FilePath& profile_path);
StoragePartitionImpl(
const FilePath& partition_path,

Powered by Google App Engine
This is Rietveld 408576698