| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_ | 5 #ifndef CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_ |
| 6 #define CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_ | 6 #define CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "content/common/storage_partition_service.mojom.h" | 14 #include "content/common/storage_partition_service.mojom.h" |
| 15 #include "content/public/browser/dom_storage_context.h" | 15 #include "content/public/browser/dom_storage_context.h" |
| 16 #include "url/origin.h" |
| 16 | 17 |
| 17 namespace base { | 18 namespace base { |
| 18 class FilePath; | 19 class FilePath; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace storage { | 22 namespace storage { |
| 22 class SpecialStoragePolicy; | 23 class SpecialStoragePolicy; |
| 23 } | 24 } |
| 24 | 25 |
| 25 namespace content { | 26 namespace content { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 56 // the implementation for details. | 57 // the implementation for details. |
| 57 void SetForceKeepSessionState(); | 58 void SetForceKeepSessionState(); |
| 58 | 59 |
| 59 // Called when the BrowserContext/Profile is going away. | 60 // Called when the BrowserContext/Profile is going away. |
| 60 void Shutdown(); | 61 void Shutdown(); |
| 61 | 62 |
| 62 void Flush(); | 63 void Flush(); |
| 63 | 64 |
| 64 // See StoragePartitionService interface. | 65 // See StoragePartitionService interface. |
| 65 void OpenLocalStorage( | 66 void OpenLocalStorage( |
| 66 const mojo::String& origin, | 67 const url::Origin& origin, |
| 67 mojo::InterfaceRequest<LevelDBWrapper> request); | 68 mojo::InterfaceRequest<LevelDBWrapper> request); |
| 68 | 69 |
| 69 private: | 70 private: |
| 70 friend class DOMStorageMessageFilter; // for access to context() | 71 friend class DOMStorageMessageFilter; // for access to context() |
| 71 friend class SessionStorageNamespaceImpl; // ditto | 72 friend class SessionStorageNamespaceImpl; // ditto |
| 72 friend class base::RefCountedThreadSafe<DOMStorageContextWrapper>; | 73 friend class base::RefCountedThreadSafe<DOMStorageContextWrapper>; |
| 73 | 74 |
| 74 ~DOMStorageContextWrapper() override; | 75 ~DOMStorageContextWrapper() override; |
| 75 DOMStorageContextImpl* context() const { return context_.get(); } | 76 DOMStorageContextImpl* context() const { return context_.get(); } |
| 76 | 77 |
| 77 void LevelDBWrapperImplHasNoBindings(const std::string& origin); | 78 void LevelDBWrapperImplHasNoBindings(const url::Origin& origin); |
| 78 | 79 |
| 79 // Used for mojo-based LocalStorage implementation (behind | 80 // Used for mojo-based LocalStorage implementation (behind |
| 80 // --mojo-local-storage for now). Maps between an origin and its prefixed | 81 // --mojo-local-storage for now). Maps between an origin and its prefixed |
| 81 // LevelDB view. | 82 // LevelDB view. |
| 82 std::map<std::string, scoped_ptr<LevelDBWrapperImpl>> level_db_wrappers_; | 83 std::map<url::Origin, scoped_ptr<LevelDBWrapperImpl>> level_db_wrappers_; |
| 83 | 84 |
| 84 scoped_refptr<DOMStorageContextImpl> context_; | 85 scoped_refptr<DOMStorageContextImpl> context_; |
| 85 | 86 |
| 86 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextWrapper); | 87 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextWrapper); |
| 87 }; | 88 }; |
| 88 | 89 |
| 89 } // namespace content | 90 } // namespace content |
| 90 | 91 |
| 91 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_ | 92 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_ |
| OLD | NEW |