OLD | NEW |
1 // Copyright (c) 2011 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/in_process_webkit/session_storage_namespace.h" | 5 #include "webkit/dom_storage/dom_storage_session.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/browser/in_process_webkit/dom_storage_context.h" | 8 #include "webkit/dom_storage/dom_storage_context.h" |
9 #include "content/browser/in_process_webkit/webkit_context.h" | |
10 | 9 |
11 SessionStorageNamespace::SessionStorageNamespace(WebKitContext* webkit_context) | 10 namespace dom_storage { |
12 : webkit_context_(webkit_context), | 11 |
13 id_(webkit_context_->dom_storage_context() | 12 DOMStorageSession::DOMStorageSession(DOMStorageContext* context) |
14 ->AllocateSessionStorageNamespaceId()) { | 13 : context_(context), |
| 14 namespace_id_(context->CreateSessionStorageNamespace()) { |
15 } | 15 } |
16 | 16 |
17 SessionStorageNamespace::SessionStorageNamespace(WebKitContext* webkit_context, | 17 DOMStorageSession::DOMStorageSession(DOMStorageContext* context, |
18 int64 id) | 18 int64 namespace_id) |
19 : webkit_context_(webkit_context), | 19 : context_(context), |
20 id_(id) { | 20 namespace_id_(namespace_id) { |
21 DCHECK(webkit_context_); | 21 DCHECK(context); |
22 } | 22 } |
23 | 23 |
24 SessionStorageNamespace::~SessionStorageNamespace() { | 24 DOMStorageSession::~DOMStorageSession() { |
25 webkit_context_->DeleteSessionStorageNamespace(id_); | 25 context_->DeleteSessionStorageNamespace(namespace_id_); |
26 } | 26 } |
27 | 27 |
28 SessionStorageNamespace* SessionStorageNamespace::Clone() { | 28 DOMStorageSession* DOMStorageSession::Clone() { |
29 return new SessionStorageNamespace( | 29 return new DOMStorageSession( |
30 webkit_context_, | 30 context_, context_->CloneSessionStorageNamespace(namespace_id_)); |
31 webkit_context_->dom_storage_context()->CloneSessionStorage(id_)); | |
32 } | 31 } |
| 32 |
| 33 } // namespace dom_storage |
OLD | NEW |