OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/in_process_webkit/session_storage_namespace.h" |
| 6 |
| 7 #include "chrome/browser/in_process_webkit/dom_storage_context.h" |
| 8 #include "chrome/browser/in_process_webkit/webkit_context.h" |
| 9 #include "chrome/browser/profile.h" |
| 10 |
| 11 SessionStorageNamespace::SessionStorageNamespace(Profile* profile) |
| 12 : webkit_context_(profile->GetWebKitContext()), |
| 13 id_(webkit_context_->dom_storage_context() |
| 14 ->AllocateSessionStorageNamespaceId()) { |
| 15 } |
| 16 |
| 17 SessionStorageNamespace::SessionStorageNamespace(WebKitContext* webkit_context, |
| 18 int64 id) |
| 19 : webkit_context_(webkit_context), |
| 20 id_(id) { |
| 21 } |
| 22 |
| 23 SessionStorageNamespace::~SessionStorageNamespace() { |
| 24 webkit_context_->DeleteSessionStorageNamespace(id_); |
| 25 } |
| 26 |
| 27 SessionStorageNamespace* SessionStorageNamespace::Clone() { |
| 28 return new SessionStorageNamespace( |
| 29 webkit_context_, |
| 30 webkit_context_->dom_storage_context()->CloneSessionStorage(id_)); |
| 31 } |
OLD | NEW |