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 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 5 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
6 | 6 |
| 7 #include "base/logging.h" |
7 #include "content/browser/dom_storage/dom_storage_context_impl.h" | 8 #include "content/browser/dom_storage/dom_storage_context_impl.h" |
8 #include "webkit/browser/dom_storage/dom_storage_session.h" | 9 #include "webkit/browser/dom_storage/dom_storage_session.h" |
9 | 10 |
10 using dom_storage::DomStorageContext; | 11 using dom_storage::DomStorageContext; |
11 using dom_storage::DomStorageSession; | 12 using dom_storage::DomStorageSession; |
12 | 13 |
13 namespace content { | 14 namespace content { |
14 | 15 |
| 16 // static |
| 17 SessionStorageNamespace* |
| 18 SessionStorageNamespace::Clone(DOMStorageContext* context, |
| 19 SessionStorageNamespace* namespace_to_clone) { |
| 20 CHECK(static_cast<SessionStorageNamespaceImpl*>(namespace_to_clone)-> |
| 21 IsFromContext(static_cast<DOMStorageContextImpl*>(context))); |
| 22 return new SessionStorageNamespaceImpl( |
| 23 static_cast<DOMStorageContextImpl*>(context), namespace_to_clone->id()); |
| 24 } |
| 25 |
15 SessionStorageNamespaceImpl::SessionStorageNamespaceImpl( | 26 SessionStorageNamespaceImpl::SessionStorageNamespaceImpl( |
16 DOMStorageContextImpl* context) | 27 DOMStorageContextImpl* context) |
17 : session_(new DomStorageSession(context->context())) { | 28 : session_(new DomStorageSession(context->context())) { |
18 } | 29 } |
19 | 30 |
20 SessionStorageNamespaceImpl::SessionStorageNamespaceImpl( | 31 SessionStorageNamespaceImpl::SessionStorageNamespaceImpl( |
21 DOMStorageContextImpl* context, int64 namepace_id_to_clone) | 32 DOMStorageContextImpl* context, int64 namepace_id_to_clone) |
22 : session_(DomStorageSession::CloneFrom(context->context(), | 33 : session_(DomStorageSession::CloneFrom(context->context(), |
23 namepace_id_to_clone)) { | 34 namepace_id_to_clone)) { |
24 } | 35 } |
(...skipping 30 matching lines...) Expand all Loading... |
55 | 66 |
56 SessionStorageNamespaceImpl::SessionStorageNamespaceImpl( | 67 SessionStorageNamespaceImpl::SessionStorageNamespaceImpl( |
57 DomStorageSession* clone) | 68 DomStorageSession* clone) |
58 : session_(clone) { | 69 : session_(clone) { |
59 } | 70 } |
60 | 71 |
61 SessionStorageNamespaceImpl::~SessionStorageNamespaceImpl() { | 72 SessionStorageNamespaceImpl::~SessionStorageNamespaceImpl() { |
62 } | 73 } |
63 | 74 |
64 } // namespace content | 75 } // namespace content |
OLD | NEW |