OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_DOM_STORAGE_DOM_STORAGE_NAMESPACE_H_ | 5 #ifndef WEBKIT_DOM_STORAGE_DOM_STORAGE_NAMESPACE_H_ |
6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_NAMESPACE_H_ | 6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_NAMESPACE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 const std::string& persistent_namespace_id() const { | 40 const std::string& persistent_namespace_id() const { |
41 return persistent_namespace_id_; | 41 return persistent_namespace_id_; |
42 } | 42 } |
43 | 43 |
44 // Returns the storage area for the given origin, | 44 // Returns the storage area for the given origin, |
45 // creating instance if needed. Each call to open | 45 // creating instance if needed. Each call to open |
46 // must be balanced with a call to CloseStorageArea. | 46 // must be balanced with a call to CloseStorageArea. |
47 DomStorageArea* OpenStorageArea(const GURL& origin); | 47 DomStorageArea* OpenStorageArea(const GURL& origin); |
48 void CloseStorageArea(DomStorageArea* area); | 48 void CloseStorageArea(DomStorageArea* area); |
49 | 49 |
| 50 // Returns the area for |origin| if it's open, otherwise NULL. |
| 51 DomStorageArea* GetOpenStorageArea(const GURL& origin); |
| 52 |
50 // Creates a clone of |this| namespace including | 53 // Creates a clone of |this| namespace including |
51 // shallow copies of all contained areas. | 54 // shallow copies of all contained areas. |
52 // Should only be called for session storage namespaces. | 55 // Should only be called for session storage namespaces. |
53 DomStorageNamespace* Clone(int64 clone_namespace_id, | 56 DomStorageNamespace* Clone(int64 clone_namespace_id, |
54 const std::string& clone_persistent_namespace_id); | 57 const std::string& clone_persistent_namespace_id); |
55 | 58 |
56 void DeleteOrigin(const GURL& origin); | 59 void DeleteOrigin(const GURL& origin); |
57 void PurgeMemory(); | 60 void PurgeMemory(); |
58 void Shutdown(); | 61 void Shutdown(); |
59 | 62 |
(...skipping 21 matching lines...) Expand all Loading... |
81 FilePath directory_; | 84 FilePath directory_; |
82 AreaMap areas_; | 85 AreaMap areas_; |
83 scoped_refptr<DomStorageTaskRunner> task_runner_; | 86 scoped_refptr<DomStorageTaskRunner> task_runner_; |
84 scoped_refptr<SessionStorageDatabase> session_storage_database_; | 87 scoped_refptr<SessionStorageDatabase> session_storage_database_; |
85 }; | 88 }; |
86 | 89 |
87 } // namespace dom_storage | 90 } // namespace dom_storage |
88 | 91 |
89 | 92 |
90 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_NAMESPACE_H_ | 93 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_NAMESPACE_H_ |
OLD | NEW |