OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SERVICE_WORKER_SERVICE_WORKER_INTERNALS_UI_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_INTERNALS_UI_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_INTERNALS_UI_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_INTERNALS_UI_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/containers/scoped_ptr_hash_map.h" | 10 #include "base/containers/scoped_ptr_hash_map.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 typedef base::Callback<void(ServiceWorkerStatusCode)> StatusCallback; | 35 typedef base::Callback<void(ServiceWorkerStatusCode)> StatusCallback; |
36 typedef void (ServiceWorkerVersion::*ServiceWorkerVersionMethod)( | 36 typedef void (ServiceWorkerVersion::*ServiceWorkerVersionMethod)( |
37 const StatusCallback& callback); | 37 const StatusCallback& callback); |
38 | 38 |
39 explicit ServiceWorkerInternalsUI(WebUI* web_ui); | 39 explicit ServiceWorkerInternalsUI(WebUI* web_ui); |
40 | 40 |
41 private: | 41 private: |
42 class OperationProxy; | 42 class OperationProxy; |
43 class PartitionObserver; | 43 class PartitionObserver; |
44 | 44 |
45 virtual ~ServiceWorkerInternalsUI(); | 45 ~ServiceWorkerInternalsUI() override; |
46 void AddContextFromStoragePartition(StoragePartition* partition); | 46 void AddContextFromStoragePartition(StoragePartition* partition); |
47 | 47 |
48 void RemoveObserverFromStoragePartition(StoragePartition* partition); | 48 void RemoveObserverFromStoragePartition(StoragePartition* partition); |
49 | 49 |
50 // Called from Javascript. | 50 // Called from Javascript. |
51 void GetOptions(const base::ListValue* args); | 51 void GetOptions(const base::ListValue* args); |
52 void SetOption(const base::ListValue* args); | 52 void SetOption(const base::ListValue* args); |
53 void GetAllRegistrations(const base::ListValue* args); | 53 void GetAllRegistrations(const base::ListValue* args); |
54 void CallServiceWorkerVersionMethod(ServiceWorkerVersionMethod method, | 54 void CallServiceWorkerVersionMethod(ServiceWorkerVersionMethod method, |
55 const base::ListValue* args); | 55 const base::ListValue* args); |
56 void DispatchPushEvent(const base::ListValue* args); | 56 void DispatchPushEvent(const base::ListValue* args); |
57 void InspectWorker(const base::ListValue* args); | 57 void InspectWorker(const base::ListValue* args); |
58 void Unregister(const base::ListValue* args); | 58 void Unregister(const base::ListValue* args); |
59 void StartWorker(const base::ListValue* args); | 59 void StartWorker(const base::ListValue* args); |
60 | 60 |
61 bool GetServiceWorkerContext( | 61 bool GetServiceWorkerContext( |
62 int partition_id, | 62 int partition_id, |
63 scoped_refptr<ServiceWorkerContextWrapper>* context) const; | 63 scoped_refptr<ServiceWorkerContextWrapper>* context) const; |
64 void FindContext(int partition_id, | 64 void FindContext(int partition_id, |
65 StoragePartition** result_partition, | 65 StoragePartition** result_partition, |
66 StoragePartition* storage_partition) const; | 66 StoragePartition* storage_partition) const; |
67 | 67 |
68 base::ScopedPtrHashMap<uintptr_t, PartitionObserver> observers_; | 68 base::ScopedPtrHashMap<uintptr_t, PartitionObserver> observers_; |
69 int next_partition_id_; | 69 int next_partition_id_; |
70 }; | 70 }; |
71 | 71 |
72 } // namespace content | 72 } // namespace content |
73 | 73 |
74 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_INTERNALS_UI_H_ | 74 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_INTERNALS_UI_H_ |
OLD | NEW |