OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_WORKER_HOST_SHARED_WORKER_SERVICE_IMPL_H_ |
| 6 #define CONTENT_BROWSER_WORKER_HOST_SHARED_WORKER_SERVICE_IMPL_H_ |
| 7 |
| 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/singleton.h" |
| 10 #include "base/observer_list.h" |
| 11 #include "content/public/browser/notification_observer.h" |
| 12 #include "content/public/browser/notification_registrar.h" |
| 13 #include "content/public/browser/worker_service.h" |
| 14 |
| 15 namespace content { |
| 16 class WorkerServiceObserver; |
| 17 |
| 18 // If "enable-embedded-shared-worker" is set this class will be used in stead of |
| 19 // WorkerServiceImpl. |
| 20 // TODO(horo): implement this class. |
| 21 class CONTENT_EXPORT SharedWorkerServiceImpl |
| 22 : public NON_EXPORTED_BASE(WorkerService) { |
| 23 public: |
| 24 // Returns the SharedWorkerServiceImpl singleton. |
| 25 static SharedWorkerServiceImpl* GetInstance(); |
| 26 |
| 27 // WorkerService implementation: |
| 28 virtual bool TerminateWorker(int process_id, int route_id) OVERRIDE; |
| 29 virtual std::vector<WorkerInfo> GetWorkers() OVERRIDE; |
| 30 virtual void AddObserver(WorkerServiceObserver* observer) OVERRIDE; |
| 31 virtual void RemoveObserver(WorkerServiceObserver* observer) OVERRIDE; |
| 32 |
| 33 private: |
| 34 friend struct DefaultSingletonTraits<SharedWorkerServiceImpl>; |
| 35 |
| 36 SharedWorkerServiceImpl(); |
| 37 virtual ~SharedWorkerServiceImpl(); |
| 38 |
| 39 ObserverList<WorkerServiceObserver> observers_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(SharedWorkerServiceImpl); |
| 42 }; |
| 43 |
| 44 } // namespace content |
| 45 |
| 46 #endif // CONTENT_BROWSER_WORKER_HOST_SHARED_WORKER_SERVICE_IMPL_H_ |
OLD | NEW |