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_SHARED_WORKER_SHARED_WORKER_SERVICE_IMPL_H_ |
| 6 #define CONTENT_BROWSER_SHARED_WORKER_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 |
| 17 class WorkerServiceObserver; |
| 18 |
| 19 // If "enable-embedded-shared-worker" is set this class will be used in stead of |
| 20 // WorkerServiceImpl. |
| 21 // TODO(horo): implement this class. |
| 22 class CONTENT_EXPORT SharedWorkerServiceImpl |
| 23 : public NON_EXPORTED_BASE(WorkerService) { |
| 24 public: |
| 25 // Returns the SharedWorkerServiceImpl singleton. |
| 26 static SharedWorkerServiceImpl* GetInstance(); |
| 27 |
| 28 // WorkerService implementation: |
| 29 virtual bool TerminateWorker(int process_id, int route_id) OVERRIDE; |
| 30 virtual std::vector<WorkerInfo> GetWorkers() OVERRIDE; |
| 31 virtual void AddObserver(WorkerServiceObserver* observer) OVERRIDE; |
| 32 virtual void RemoveObserver(WorkerServiceObserver* observer) OVERRIDE; |
| 33 |
| 34 private: |
| 35 friend struct DefaultSingletonTraits<SharedWorkerServiceImpl>; |
| 36 |
| 37 SharedWorkerServiceImpl(); |
| 38 virtual ~SharedWorkerServiceImpl(); |
| 39 |
| 40 ObserverList<WorkerServiceObserver> observers_; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(SharedWorkerServiceImpl); |
| 43 }; |
| 44 |
| 45 } // namespace content |
| 46 |
| 47 #endif // CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SERVICE_IMPL_H_ |
OLD | NEW |