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 "content/browser/dom_storage/dom_storage_context_wrapper.h" | 7 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
8 #include "content/browser/dom_storage/dom_storage_session.h" | 8 #include "content/browser/dom_storage/dom_storage_session.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
(...skipping 10 matching lines...) Expand all Loading... |
21 } | 21 } |
22 | 22 |
23 SessionStorageNamespaceImpl::SessionStorageNamespaceImpl( | 23 SessionStorageNamespaceImpl::SessionStorageNamespaceImpl( |
24 DOMStorageContextWrapper* context, const std::string& persistent_id) | 24 DOMStorageContextWrapper* context, const std::string& persistent_id) |
25 : session_(new DOMStorageSession(context->context(), persistent_id)) { | 25 : session_(new DOMStorageSession(context->context(), persistent_id)) { |
26 } | 26 } |
27 | 27 |
28 SessionStorageNamespaceImpl::SessionStorageNamespaceImpl( | 28 SessionStorageNamespaceImpl::SessionStorageNamespaceImpl( |
29 SessionStorageNamespaceImpl* master_session_storage_namespace) | 29 SessionStorageNamespaceImpl* master_session_storage_namespace) |
30 : session_(new DOMStorageSession( | 30 : session_(new DOMStorageSession( |
31 master_session_storage_namespace->session_)) { | 31 master_session_storage_namespace->session_.get())) { |
32 } | 32 } |
33 | 33 |
34 | 34 |
35 int64 SessionStorageNamespaceImpl::id() const { | 35 int64 SessionStorageNamespaceImpl::id() const { |
36 return session_->namespace_id(); | 36 return session_->namespace_id(); |
37 } | 37 } |
38 | 38 |
39 const std::string& SessionStorageNamespaceImpl::persistent_id() const { | 39 const std::string& SessionStorageNamespaceImpl::persistent_id() const { |
40 return session_->persistent_namespace_id(); | 40 return session_->persistent_namespace_id(); |
41 } | 41 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 session_->RemoveTransactionLogProcessId(process_id); | 74 session_->RemoveTransactionLogProcessId(process_id); |
75 } | 75 } |
76 | 76 |
77 void SessionStorageNamespaceImpl::Merge( | 77 void SessionStorageNamespaceImpl::Merge( |
78 bool actually_merge, | 78 bool actually_merge, |
79 int process_id, | 79 int process_id, |
80 SessionStorageNamespace* other, | 80 SessionStorageNamespace* other, |
81 const MergeResultCallback& callback) { | 81 const MergeResultCallback& callback) { |
82 SessionStorageNamespaceImpl* other_impl = | 82 SessionStorageNamespaceImpl* other_impl = |
83 static_cast<SessionStorageNamespaceImpl*>(other); | 83 static_cast<SessionStorageNamespaceImpl*>(other); |
84 session_->Merge(actually_merge, process_id, other_impl->session_, callback); | 84 session_->Merge( |
| 85 actually_merge, process_id, other_impl->session_.get(), callback); |
85 } | 86 } |
86 | 87 |
87 bool SessionStorageNamespaceImpl::IsAliasOf(SessionStorageNamespace* other) { | 88 bool SessionStorageNamespaceImpl::IsAliasOf(SessionStorageNamespace* other) { |
88 return persistent_id() == other->persistent_id(); | 89 return persistent_id() == other->persistent_id(); |
89 } | 90 } |
90 | 91 |
91 SessionStorageNamespace* SessionStorageNamespaceImpl::CreateAlias() { | 92 SessionStorageNamespace* SessionStorageNamespaceImpl::CreateAlias() { |
92 return new SessionStorageNamespaceImpl(this); | 93 return new SessionStorageNamespaceImpl(this); |
93 } | 94 } |
94 | 95 |
95 } // namespace content | 96 } // namespace content |
OLD | NEW |