Ben Murdoch | bb1529c | 2013-08-08 10:24:53 +0100 | [diff] [blame^] | 1 | // Copyright 2013 The Chromium Authors. All rights reserved. |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Ben Murdoch | bb1529c | 2013-08-08 10:24:53 +0100 | [diff] [blame^] | 5 | #include "content/browser/dom_storage/session_storage_database_adapter.h" |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 6 | |
Ben Murdoch | bb1529c | 2013-08-08 10:24:53 +0100 | [diff] [blame^] | 7 | #include "content/browser/dom_storage/session_storage_database.h" |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 8 | |
Ben Murdoch | bb1529c | 2013-08-08 10:24:53 +0100 | [diff] [blame^] | 9 | namespace content { |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 10 | |
| 11 | SessionStorageDatabaseAdapter::SessionStorageDatabaseAdapter( |
| 12 | SessionStorageDatabase* db, |
| 13 | const std::string& permanent_namespace_id, |
| 14 | const GURL& origin) |
| 15 | : db_(db), |
| 16 | permanent_namespace_id_(permanent_namespace_id), |
| 17 | origin_(origin) { |
| 18 | } |
| 19 | |
| 20 | SessionStorageDatabaseAdapter::~SessionStorageDatabaseAdapter() { } |
| 21 | |
Ben Murdoch | bb1529c | 2013-08-08 10:24:53 +0100 | [diff] [blame^] | 22 | void SessionStorageDatabaseAdapter::ReadAllValues(DOMStorageValuesMap* result) { |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 23 | db_->ReadAreaValues(permanent_namespace_id_, origin_, result); |
| 24 | } |
| 25 | |
| 26 | bool SessionStorageDatabaseAdapter::CommitChanges( |
Ben Murdoch | bb1529c | 2013-08-08 10:24:53 +0100 | [diff] [blame^] | 27 | bool clear_all_first, const DOMStorageValuesMap& changes) { |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 28 | return db_->CommitAreaChanges(permanent_namespace_id_, origin_, |
| 29 | clear_all_first, changes); |
| 30 | } |
| 31 | |
Ben Murdoch | bb1529c | 2013-08-08 10:24:53 +0100 | [diff] [blame^] | 32 | } // namespace content |