| 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 "webkit/dom_storage/dom_storage_session.h" | 5 #include "webkit/dom_storage/dom_storage_session.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/tracked_objects.h" | 10 #include "base/tracked_objects.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 context->task_runner()->PostTask( | 33 context->task_runner()->PostTask( |
| 34 FROM_HERE, | 34 FROM_HERE, |
| 35 base::Bind(&DomStorageContext::CreateSessionNamespace, | 35 base::Bind(&DomStorageContext::CreateSessionNamespace, |
| 36 context_, namespace_id_, persistent_namespace_id_)); | 36 context_, namespace_id_, persistent_namespace_id_)); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void DomStorageSession::SetShouldPersist(bool should_persist) { | 39 void DomStorageSession::SetShouldPersist(bool should_persist) { |
| 40 should_persist_ = should_persist; | 40 should_persist_ = should_persist; |
| 41 } | 41 } |
| 42 | 42 |
| 43 bool DomStorageSession::should_persist() const { |
| 44 return should_persist_; |
| 45 } |
| 46 |
| 43 bool DomStorageSession::IsFromContext(DomStorageContext* context) { | 47 bool DomStorageSession::IsFromContext(DomStorageContext* context) { |
| 44 return context_.get() == context; | 48 return context_.get() == context; |
| 45 } | 49 } |
| 46 | 50 |
| 47 DomStorageSession* DomStorageSession::Clone() { | 51 DomStorageSession* DomStorageSession::Clone() { |
| 48 return CloneFrom(context_, namespace_id_); | 52 return CloneFrom(context_, namespace_id_); |
| 49 } | 53 } |
| 50 | 54 |
| 51 // static | 55 // static |
| 52 DomStorageSession* DomStorageSession::CloneFrom(DomStorageContext* context, | 56 DomStorageSession* DomStorageSession::CloneFrom(DomStorageContext* context, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 71 } | 75 } |
| 72 | 76 |
| 73 DomStorageSession::~DomStorageSession() { | 77 DomStorageSession::~DomStorageSession() { |
| 74 context_->task_runner()->PostTask( | 78 context_->task_runner()->PostTask( |
| 75 FROM_HERE, | 79 FROM_HERE, |
| 76 base::Bind(&DomStorageContext::DeleteSessionNamespace, | 80 base::Bind(&DomStorageContext::DeleteSessionNamespace, |
| 77 context_, namespace_id_, should_persist_)); | 81 context_, namespace_id_, should_persist_)); |
| 78 } | 82 } |
| 79 | 83 |
| 80 } // namespace dom_storage | 84 } // namespace dom_storage |
| OLD | NEW |