| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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 "chrome/browser/in_process_webkit/session_storage_namespace.h" | 5 #include "chrome/browser/in_process_webkit/session_storage_namespace.h" |
| 6 | 6 |
| 7 #include "chrome/browser/in_process_webkit/dom_storage_context.h" | 7 #include "chrome/browser/in_process_webkit/dom_storage_context.h" |
| 8 #include "chrome/browser/in_process_webkit/webkit_context.h" | 8 #include "chrome/browser/in_process_webkit/webkit_context.h" |
| 9 #include "chrome/browser/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 | 10 |
| 11 SessionStorageNamespace::SessionStorageNamespace(Profile* profile) | 11 SessionStorageNamespace::SessionStorageNamespace(Profile* profile) |
| 12 : webkit_context_(profile->GetWebKitContext()), | 12 : webkit_context_(profile->GetWebKitContext()), |
| 13 id_(webkit_context_->dom_storage_context() | 13 id_(webkit_context_->dom_storage_context() |
| 14 ->AllocateSessionStorageNamespaceId()) { | 14 ->AllocateSessionStorageNamespaceId()) { |
| 15 } | 15 } |
| 16 | 16 |
| 17 SessionStorageNamespace::SessionStorageNamespace(WebKitContext* webkit_context, | 17 SessionStorageNamespace::SessionStorageNamespace(WebKitContext* webkit_context, |
| 18 int64 id) | 18 int64 id) |
| 19 : webkit_context_(webkit_context), | 19 : webkit_context_(webkit_context), |
| 20 id_(id) { | 20 id_(id) { |
| 21 } | 21 } |
| 22 | 22 |
| 23 SessionStorageNamespace::~SessionStorageNamespace() { | 23 SessionStorageNamespace::~SessionStorageNamespace() { |
| 24 webkit_context_->DeleteSessionStorageNamespace(id_); | 24 webkit_context_->DeleteSessionStorageNamespace(id_); |
| 25 } | 25 } |
| 26 | 26 |
| 27 SessionStorageNamespace* SessionStorageNamespace::Clone() { | 27 SessionStorageNamespace* SessionStorageNamespace::Clone() { |
| 28 return new SessionStorageNamespace( | 28 return new SessionStorageNamespace( |
| 29 webkit_context_, | 29 webkit_context_, |
| 30 webkit_context_->dom_storage_context()->CloneSessionStorage(id_)); | 30 webkit_context_->dom_storage_context()->CloneSessionStorage(id_)); |
| 31 } | 31 } |
| OLD | NEW |