| 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 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_INTERNALS_UI_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_INTERNALS_UI_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_INTERNALS_UI_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_INTERNALS_UI_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "content/public/browser/download_interrupt_reasons.h" | 15 #include "content/public/browser/download_interrupt_reasons.h" |
| 16 #include "content/public/browser/indexed_db_context.h" | 16 #include "content/public/browser/indexed_db_context.h" |
| 17 #include "content/public/browser/web_ui_controller.h" | 17 #include "content/public/browser/web_ui_controller.h" |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 class ListValue; | 20 class ListValue; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace url { |
| 24 class Origin; |
| 25 } |
| 26 |
| 23 namespace content { | 27 namespace content { |
| 24 | 28 |
| 25 class DownloadItem; | 29 class DownloadItem; |
| 26 class IndexedDBContextImpl; | 30 class IndexedDBContextImpl; |
| 27 class StoragePartition; | 31 class StoragePartition; |
| 28 | 32 |
| 29 // The implementation for the chrome://indexeddb-internals page. | 33 // The implementation for the chrome://indexeddb-internals page. |
| 30 class IndexedDBInternalsUI : public WebUIController { | 34 class IndexedDBInternalsUI : public WebUIController { |
| 31 public: | 35 public: |
| 32 explicit IndexedDBInternalsUI(WebUI* web_ui); | 36 explicit IndexedDBInternalsUI(WebUI* web_ui); |
| 33 ~IndexedDBInternalsUI() override; | 37 ~IndexedDBInternalsUI() override; |
| 34 | 38 |
| 35 private: | 39 private: |
| 36 void GetAllOrigins(const base::ListValue* args); | 40 void GetAllOrigins(const base::ListValue* args); |
| 37 void GetAllOriginsOnIndexedDBThread(scoped_refptr<IndexedDBContext> context, | 41 void GetAllOriginsOnIndexedDBThread(scoped_refptr<IndexedDBContext> context, |
| 38 const base::FilePath& context_path); | 42 const base::FilePath& context_path); |
| 39 void OnOriginsReady(std::unique_ptr<base::ListValue> origins, | 43 void OnOriginsReady(std::unique_ptr<base::ListValue> origins, |
| 40 const base::FilePath& path); | 44 const base::FilePath& path); |
| 41 | 45 |
| 42 void AddContextFromStoragePartition(StoragePartition* partition); | 46 void AddContextFromStoragePartition(StoragePartition* partition); |
| 43 | 47 |
| 44 void DownloadOriginData(const base::ListValue* args); | 48 void DownloadOriginData(const base::ListValue* args); |
| 45 void DownloadOriginDataOnIndexedDBThread( | 49 void DownloadOriginDataOnIndexedDBThread( |
| 46 const base::FilePath& partition_path, | 50 const base::FilePath& partition_path, |
| 47 const scoped_refptr<IndexedDBContextImpl> context, | 51 const scoped_refptr<IndexedDBContextImpl> context, |
| 48 const GURL& origin_url); | 52 const url::Origin& origin); |
| 49 void OnDownloadDataReady(const base::FilePath& partition_path, | 53 void OnDownloadDataReady(const base::FilePath& partition_path, |
| 50 const GURL& origin_url, | 54 const url::Origin& origin, |
| 51 const base::FilePath temp_path, | 55 const base::FilePath temp_path, |
| 52 const base::FilePath zip_path, | 56 const base::FilePath zip_path, |
| 53 size_t connection_count); | 57 size_t connection_count); |
| 54 void OnDownloadStarted(const base::FilePath& partition_path, | 58 void OnDownloadStarted(const base::FilePath& partition_path, |
| 55 const GURL& origin_url, | 59 const url::Origin& origin, |
| 56 const base::FilePath& temp_path, | 60 const base::FilePath& temp_path, |
| 57 size_t connection_count, | 61 size_t connection_count, |
| 58 DownloadItem* item, | 62 DownloadItem* item, |
| 59 DownloadInterruptReason interrupt_reason); | 63 DownloadInterruptReason interrupt_reason); |
| 60 | 64 |
| 61 void ForceCloseOrigin(const base::ListValue* args); | 65 void ForceCloseOrigin(const base::ListValue* args); |
| 62 void ForceCloseOriginOnIndexedDBThread( | 66 void ForceCloseOriginOnIndexedDBThread( |
| 63 const base::FilePath& partition_path, | 67 const base::FilePath& partition_path, |
| 64 const scoped_refptr<IndexedDBContextImpl> context, | 68 const scoped_refptr<IndexedDBContextImpl> context, |
| 65 const GURL& origin_url); | 69 const url::Origin& origin); |
| 66 void OnForcedClose(const base::FilePath& partition_path, | 70 void OnForcedClose(const base::FilePath& partition_path, |
| 67 const GURL& origin_url, | 71 const url::Origin& origin, |
| 68 size_t connection_count); | 72 size_t connection_count); |
| 69 bool GetOriginContext(const base::FilePath& path, | 73 bool GetOriginContext(const base::FilePath& path, |
| 70 const GURL& origin_url, | 74 const url::Origin& origin, |
| 71 scoped_refptr<IndexedDBContextImpl>* context); | 75 scoped_refptr<IndexedDBContextImpl>* context); |
| 72 bool GetOriginData(const base::ListValue* args, | 76 bool GetOriginData(const base::ListValue* args, |
| 73 base::FilePath* path, | 77 base::FilePath* path, |
| 74 GURL* origin_url, | 78 url::Origin* origin, |
| 75 scoped_refptr<IndexedDBContextImpl>* context); | 79 scoped_refptr<IndexedDBContextImpl>* context); |
| 76 | 80 |
| 77 DISALLOW_COPY_AND_ASSIGN(IndexedDBInternalsUI); | 81 DISALLOW_COPY_AND_ASSIGN(IndexedDBInternalsUI); |
| 78 }; | 82 }; |
| 79 | 83 |
| 80 } // namespace content | 84 } // namespace content |
| 81 | 85 |
| 82 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_INTERNALS_UI_H_ | 86 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_INTERNALS_UI_H_ |
| OLD | NEW |