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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 bool will_delete ALLOW_UNUSED = path.Set(temp_dir_); | 331 bool will_delete ALLOW_UNUSED = path.Set(temp_dir_); |
332 DCHECK(will_delete); | 332 DCHECK(will_delete); |
333 } | 333 } |
334 | 334 |
335 void IndexedDBInternalsUI::OnDownloadStarted( | 335 void IndexedDBInternalsUI::OnDownloadStarted( |
336 const base::FilePath& partition_path, | 336 const base::FilePath& partition_path, |
337 const GURL& origin_url, | 337 const GURL& origin_url, |
338 const base::FilePath& temp_path, | 338 const base::FilePath& temp_path, |
339 size_t connection_count, | 339 size_t connection_count, |
340 DownloadItem* item, | 340 DownloadItem* item, |
341 net::Error error) { | 341 DownloadInterruptReason interrupt_reason) { |
342 | 342 |
343 if (error != net::OK) { | 343 if (interrupt_reason != DOWNLOAD_INTERRUPT_REASON_NONE) { |
344 LOG(ERROR) | 344 LOG(ERROR) << "Error downloading database dump: " |
345 << "Error downloading database dump: " << net::ErrorToString(error); | 345 << DownloadInterruptReasonToString(interrupt_reason); |
346 return; | 346 return; |
347 } | 347 } |
348 | 348 |
349 item->AddObserver(new FileDeleter(temp_path)); | 349 item->AddObserver(new FileDeleter(temp_path)); |
350 web_ui()->CallJavascriptFunction( | 350 web_ui()->CallJavascriptFunction( |
351 "indexeddb.onOriginDownloadReady", | 351 "indexeddb.onOriginDownloadReady", |
352 base::StringValue(partition_path.value()), | 352 base::StringValue(partition_path.value()), |
353 base::StringValue(origin_url.spec()), | 353 base::StringValue(origin_url.spec()), |
354 base::FundamentalValue(double(connection_count))); | 354 base::FundamentalValue(double(connection_count))); |
355 } | 355 } |
356 | 356 |
357 } // namespace content | 357 } // namespace content |
OLD | NEW |