| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/indexed_db/indexed_db_backing_store.h" | 5 #include "content/browser/indexed_db/indexed_db_backing_store.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 3891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3902 DCHECK(!transaction_.get()); | 3902 DCHECK(!transaction_.get()); |
| 3903 transaction_ = IndexedDBClassFactory::Get()->CreateLevelDBTransaction( | 3903 transaction_ = IndexedDBClassFactory::Get()->CreateLevelDBTransaction( |
| 3904 backing_store_->db_.get()); | 3904 backing_store_->db_.get()); |
| 3905 | 3905 |
| 3906 // If incognito, this snapshots blobs just as the above transaction_ | 3906 // If incognito, this snapshots blobs just as the above transaction_ |
| 3907 // constructor snapshots the leveldb. | 3907 // constructor snapshots the leveldb. |
| 3908 for (const auto& iter : backing_store_->incognito_blob_map_) | 3908 for (const auto& iter : backing_store_->incognito_blob_map_) |
| 3909 incognito_blob_map_[iter.first] = iter.second->Clone().release(); | 3909 incognito_blob_map_[iter.first] = iter.second->Clone().release(); |
| 3910 } | 3910 } |
| 3911 | 3911 |
| 3912 static GURL getURLFromUUID(const string& uuid) { | 3912 static GURL getURLFromUUID(const std::string& uuid) { |
| 3913 return GURL("blob:uuid/" + uuid); | 3913 return GURL("blob:uuid/" + uuid); |
| 3914 } | 3914 } |
| 3915 | 3915 |
| 3916 leveldb::Status IndexedDBBackingStore::Transaction::HandleBlobPreTransaction( | 3916 leveldb::Status IndexedDBBackingStore::Transaction::HandleBlobPreTransaction( |
| 3917 BlobEntryKeyValuePairVec* new_blob_entries, | 3917 BlobEntryKeyValuePairVec* new_blob_entries, |
| 3918 WriteDescriptorVec* new_files_to_write) { | 3918 WriteDescriptorVec* new_files_to_write) { |
| 3919 if (backing_store_->is_incognito()) | 3919 if (backing_store_->is_incognito()) |
| 3920 return leveldb::Status::OK(); | 3920 return leveldb::Status::OK(); |
| 3921 | 3921 |
| 3922 new_blob_entries->clear(); | 3922 new_blob_entries->clear(); |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4288 int64_t size, | 4288 int64_t size, |
| 4289 base::Time last_modified) | 4289 base::Time last_modified) |
| 4290 : is_file_(true), | 4290 : is_file_(true), |
| 4291 file_path_(file_path), | 4291 file_path_(file_path), |
| 4292 key_(key), | 4292 key_(key), |
| 4293 size_(size), | 4293 size_(size), |
| 4294 last_modified_(last_modified) { | 4294 last_modified_(last_modified) { |
| 4295 } | 4295 } |
| 4296 | 4296 |
| 4297 } // namespace content | 4297 } // namespace content |
| OLD | NEW |