| 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_internals_ui.h" | 5 #include "content/browser/indexed_db/indexed_db_internals_ui.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 size_t connection_count = context->GetConnectionCount(origin); | 225 size_t connection_count = context->GetConnectionCount(origin); |
| 226 | 226 |
| 227 base::ScopedTempDir temp_dir; | 227 base::ScopedTempDir temp_dir; |
| 228 if (!temp_dir.CreateUniqueTempDir()) | 228 if (!temp_dir.CreateUniqueTempDir()) |
| 229 return; | 229 return; |
| 230 | 230 |
| 231 // This will get cleaned up on the File thread after the download | 231 // This will get cleaned up on the File thread after the download |
| 232 // has completed. | 232 // has completed. |
| 233 base::FilePath temp_path = temp_dir.Take(); | 233 base::FilePath temp_path = temp_dir.Take(); |
| 234 | 234 |
| 235 std::string origin_id = | 235 std::string origin_id = storage::GetIdentifierFromOrigin(origin.GetURL()); |
| 236 storage::GetIdentifierFromOrigin(GURL(origin.Serialize())); | |
| 237 base::FilePath zip_path = | 236 base::FilePath zip_path = |
| 238 temp_path.AppendASCII(origin_id).AddExtension(FILE_PATH_LITERAL("zip")); | 237 temp_path.AppendASCII(origin_id).AddExtension(FILE_PATH_LITERAL("zip")); |
| 239 | 238 |
| 240 std::vector<base::FilePath> paths = context->GetStoragePaths(origin); | 239 std::vector<base::FilePath> paths = context->GetStoragePaths(origin); |
| 241 zip::ZipWithFilterCallback(context->data_path(), zip_path, | 240 zip::ZipWithFilterCallback(context->data_path(), zip_path, |
| 242 base::Bind(AllowWhitelistedPaths, paths)); | 241 base::Bind(AllowWhitelistedPaths, paths)); |
| 243 | 242 |
| 244 BrowserThread::PostTask( | 243 BrowserThread::PostTask( |
| 245 BrowserThread::UI, FROM_HERE, | 244 BrowserThread::UI, FROM_HERE, |
| 246 base::Bind(&IndexedDBInternalsUI::OnDownloadDataReady, | 245 base::Bind(&IndexedDBInternalsUI::OnDownloadDataReady, |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 358 |
| 360 item->AddObserver(new FileDeleter(temp_path)); | 359 item->AddObserver(new FileDeleter(temp_path)); |
| 361 web_ui()->CallJavascriptFunctionUnsafe( | 360 web_ui()->CallJavascriptFunctionUnsafe( |
| 362 "indexeddb.onOriginDownloadReady", | 361 "indexeddb.onOriginDownloadReady", |
| 363 base::StringValue(partition_path.value()), | 362 base::StringValue(partition_path.value()), |
| 364 base::StringValue(origin.Serialize()), | 363 base::StringValue(origin.Serialize()), |
| 365 base::FundamentalValue(static_cast<double>(connection_count))); | 364 base::FundamentalValue(static_cast<double>(connection_count))); |
| 366 } | 365 } |
| 367 | 366 |
| 368 } // namespace content | 367 } // namespace content |
| OLD | NEW |