| 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 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 size_t connection_count = context->GetConnectionCount(origin_url); | 210 size_t connection_count = context->GetConnectionCount(origin_url); |
| 211 | 211 |
| 212 base::ScopedTempDir temp_dir; | 212 base::ScopedTempDir temp_dir; |
| 213 if (!temp_dir.CreateUniqueTempDir()) | 213 if (!temp_dir.CreateUniqueTempDir()) |
| 214 return; | 214 return; |
| 215 | 215 |
| 216 // This will get cleaned up on the File thread after the download | 216 // This will get cleaned up on the File thread after the download |
| 217 // has completed. | 217 // has completed. |
| 218 base::FilePath temp_path = temp_dir.Take(); | 218 base::FilePath temp_path = temp_dir.Take(); |
| 219 | 219 |
| 220 std::string origin_id = webkit_database::GetIdentifierFromOrigin(origin_url); | 220 std::string origin_id = storage::GetIdentifierFromOrigin(origin_url); |
| 221 base::FilePath zip_path = | 221 base::FilePath zip_path = |
| 222 temp_path.AppendASCII(origin_id).AddExtension(FILE_PATH_LITERAL("zip")); | 222 temp_path.AppendASCII(origin_id).AddExtension(FILE_PATH_LITERAL("zip")); |
| 223 | 223 |
| 224 // This happens on the "webkit" thread (which is really just the IndexedDB | 224 // This happens on the "webkit" thread (which is really just the IndexedDB |
| 225 // thread) as a simple way to avoid another script reopening the origin | 225 // thread) as a simple way to avoid another script reopening the origin |
| 226 // while we are zipping. | 226 // while we are zipping. |
| 227 zip::Zip(context->GetFilePath(origin_url), zip_path, true); | 227 zip::Zip(context->GetFilePath(origin_url), zip_path, true); |
| 228 | 228 |
| 229 BrowserThread::PostTask(BrowserThread::UI, | 229 BrowserThread::PostTask(BrowserThread::UI, |
| 230 FROM_HERE, | 230 FROM_HERE, |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 | 356 |
| 357 item->AddObserver(new FileDeleter(temp_path)); | 357 item->AddObserver(new FileDeleter(temp_path)); |
| 358 web_ui()->CallJavascriptFunction( | 358 web_ui()->CallJavascriptFunction( |
| 359 "indexeddb.onOriginDownloadReady", | 359 "indexeddb.onOriginDownloadReady", |
| 360 base::StringValue(partition_path.value()), | 360 base::StringValue(partition_path.value()), |
| 361 base::StringValue(origin_url.spec()), | 361 base::StringValue(origin_url.spec()), |
| 362 base::FundamentalValue(static_cast<double>(connection_count))); | 362 base::FundamentalValue(static_cast<double>(connection_count))); |
| 363 } | 363 } |
| 364 | 364 |
| 365 } // namespace content | 365 } // namespace content |
| OLD | NEW |