Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Unified Diff: content/browser/worker_host/worker_service_impl.h

Issue 9052007: Create an API around WorkerService that chrome consumes. Rename the existing WorkerService to Wor... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/worker_host/worker_service.cc ('k') | content/browser/worker_host/worker_service_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/worker_host/worker_service_impl.h
===================================================================
--- content/browser/worker_host/worker_service_impl.h (revision 115981)
+++ content/browser/worker_host/worker_service_impl.h (working copy)
@@ -11,32 +11,34 @@
#include "base/observer_list.h"
#include "base/threading/non_thread_safe.h"
#include "content/browser/worker_host/worker_process_host.h"
-#include "content/common/content_export.h"
#include "content/public/browser/notification_registrar.h"
-#include "googleurl/src/gurl.h"
+#include "content/public/browser/worker_service.h"
+class GURL;
struct ViewHostMsg_CreateWorker_Params;
-class WorkerServiceObserver;
namespace content {
class ResourceContext;
-} // namespace content
+class WorkerServiceObserver;
-// A singleton for managing HTML5 web workers.
-class CONTENT_EXPORT WorkerService {
+class CONTENT_EXPORT WorkerServiceImpl : public WorkerService {
public:
- // Returns the WorkerService singleton.
- static WorkerService* GetInstance();
+ // Returns the WorkerServiceImpl singleton.
+ static WorkerServiceImpl* GetInstance();
+ // WorkerService implementation:
+ virtual void AddObserver(WorkerServiceObserver* observer) OVERRIDE;
+ virtual void RemoveObserver(WorkerServiceObserver* observer) OVERRIDE;
+
// These methods correspond to worker related IPCs.
void CreateWorker(const ViewHostMsg_CreateWorker_Params& params,
int route_id,
WorkerMessageFilter* filter,
- const content::ResourceContext& resource_context);
+ const ResourceContext& resource_context);
void LookupSharedWorker(const ViewHostMsg_CreateWorker_Params& params,
int route_id,
WorkerMessageFilter* filter,
- const content::ResourceContext* resource_context,
+ const ResourceContext* resource_context,
bool* exists,
bool* url_error);
void CancelCreateDedicatedWorker(int route_id, WorkerMessageFilter* filter);
@@ -60,9 +62,6 @@
const WorkerProcessHost::WorkerInstance* FindWorkerInstance(
int worker_process_id);
- void AddObserver(WorkerServiceObserver* observer);
- void RemoveObserver(WorkerServiceObserver* observer);
-
void NotifyWorkerDestroyed(
WorkerProcessHost* process,
int worker_route_id);
@@ -78,10 +77,10 @@
static const int kMaxWorkersPerTabWhenSeparate;
private:
- friend struct DefaultSingletonTraits<WorkerService>;
+ friend struct DefaultSingletonTraits<WorkerServiceImpl>;
- WorkerService();
- ~WorkerService();
+ WorkerServiceImpl();
+ virtual ~WorkerServiceImpl();
// Given a WorkerInstance, create an associated worker process.
bool CreateWorkerFromInstance(WorkerProcessHost::WorkerInstance instance);
@@ -116,22 +115,22 @@
WorkerProcessHost::WorkerInstance* CreatePendingInstance(
const GURL& url,
const string16& name,
- const content::ResourceContext* resource_context);
+ const ResourceContext* resource_context);
WorkerProcessHost::WorkerInstance* FindPendingInstance(
const GURL& url,
const string16& name,
- const content::ResourceContext* resource_context);
+ const ResourceContext* resource_context);
void RemovePendingInstances(
const GURL& url,
const string16& name,
- const content::ResourceContext* resource_context);
+ const ResourceContext* resource_context);
WorkerProcessHost::WorkerInstance* FindSharedWorkerInstance(
const GURL& url,
const string16& name,
- const content::ResourceContext* resource_context);
+ const ResourceContext* resource_context);
- content::NotificationRegistrar registrar_;
+ NotificationRegistrar registrar_;
int next_worker_route_id_;
WorkerProcessHost::Instances queued_workers_;
@@ -143,7 +142,9 @@
ObserverList<WorkerServiceObserver> observers_;
- DISALLOW_COPY_AND_ASSIGN(WorkerService);
+ DISALLOW_COPY_AND_ASSIGN(WorkerServiceImpl);
};
+} // namespace content
+
#endif // CONTENT_BROWSER_WORKER_HOST_WORKER_SERVICE_H_
« no previous file with comments | « content/browser/worker_host/worker_service.cc ('k') | content/browser/worker_host/worker_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698