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

Side by Side Diff: content/browser/worker_host/worker_service.h

Issue 8381024: more content exports. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: don't link installer_unittests, setup against content Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/notification_service_impl.h ('k') | content/common/worker_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_WORKER_HOST_WORKER_SERVICE_H_ 5 #ifndef CONTENT_BROWSER_WORKER_HOST_WORKER_SERVICE_H_
6 #define CONTENT_BROWSER_WORKER_HOST_WORKER_SERVICE_H_ 6 #define CONTENT_BROWSER_WORKER_HOST_WORKER_SERVICE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
11 #include "base/observer_list.h" 11 #include "base/observer_list.h"
12 #include "base/threading/non_thread_safe.h" 12 #include "base/threading/non_thread_safe.h"
13 #include "content/browser/worker_host/worker_process_host.h" 13 #include "content/browser/worker_host/worker_process_host.h"
14 #include "content/common/content_export.h" 14 #include "content/common/content_export.h"
15 #include "content/public/browser/notification_registrar.h" 15 #include "content/public/browser/notification_registrar.h"
16 #include "googleurl/src/gurl.h" 16 #include "googleurl/src/gurl.h"
17 17
18 namespace content { 18 namespace content {
19 class ResourceContext; 19 class ResourceContext;
20 } // namespace content 20 } // namespace content
21 namespace net { 21 namespace net {
22 class URLRequestContextGetter; 22 class URLRequestContextGetter;
23 } // namespace net 23 } // namespace net
24 class WorkerServiceObserver; 24 class WorkerServiceObserver;
25 struct ViewHostMsg_CreateWorker_Params; 25 struct ViewHostMsg_CreateWorker_Params;
26 26
27 // A singleton for managing HTML5 web workers. 27 // A singleton for managing HTML5 web workers.
28 class WorkerService { 28 class CONTENT_EXPORT WorkerService {
29 public: 29 public:
30 // Returns the WorkerService singleton. 30 // Returns the WorkerService singleton.
31 static WorkerService* GetInstance(); 31 static WorkerService* GetInstance();
32 32
33 // These methods correspond to worker related IPCs. 33 // These methods correspond to worker related IPCs.
34 void CreateWorker(const ViewHostMsg_CreateWorker_Params& params, 34 void CreateWorker(const ViewHostMsg_CreateWorker_Params& params,
35 int route_id, 35 int route_id,
36 WorkerMessageFilter* filter, 36 WorkerMessageFilter* filter,
37 const content::ResourceContext& resource_context); 37 const content::ResourceContext& resource_context);
38 void LookupSharedWorker(const ViewHostMsg_CreateWorker_Params& params, 38 void LookupSharedWorker(const ViewHostMsg_CreateWorker_Params& params,
(...skipping 30 matching lines...) Expand all
69 WorkerProcessHost* process, 69 WorkerProcessHost* process,
70 int worker_route_id); 70 int worker_route_id);
71 void NotifyWorkerContextStarted( 71 void NotifyWorkerContextStarted(
72 WorkerProcessHost* process, 72 WorkerProcessHost* process,
73 int worker_route_id); 73 int worker_route_id);
74 74
75 // Used when multiple workers can run in the same process. 75 // Used when multiple workers can run in the same process.
76 static const int kMaxWorkerProcessesWhenSharing; 76 static const int kMaxWorkerProcessesWhenSharing;
77 77
78 // Used when we run each worker in a separate process. 78 // Used when we run each worker in a separate process.
79 CONTENT_EXPORT static const int kMaxWorkersWhenSeparate; 79 static const int kMaxWorkersWhenSeparate;
80 CONTENT_EXPORT static const int kMaxWorkersPerTabWhenSeparate; 80 static const int kMaxWorkersPerTabWhenSeparate;
81 81
82 private: 82 private:
83 friend struct DefaultSingletonTraits<WorkerService>; 83 friend struct DefaultSingletonTraits<WorkerService>;
84 84
85 WorkerService(); 85 WorkerService();
86 ~WorkerService(); 86 ~WorkerService();
87 87
88 // Given a WorkerInstance, create an associated worker process. 88 // Given a WorkerInstance, create an associated worker process.
89 bool CreateWorkerFromInstance(WorkerProcessHost::WorkerInstance instance); 89 bool CreateWorkerFromInstance(WorkerProcessHost::WorkerInstance instance);
90 90
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // We need to keep a list of these to synchronously detect shared worker 142 // We need to keep a list of these to synchronously detect shared worker
143 // URL mismatches when two pages launch shared workers simultaneously. 143 // URL mismatches when two pages launch shared workers simultaneously.
144 WorkerProcessHost::Instances pending_shared_workers_; 144 WorkerProcessHost::Instances pending_shared_workers_;
145 145
146 ObserverList<WorkerServiceObserver> observers_; 146 ObserverList<WorkerServiceObserver> observers_;
147 147
148 DISALLOW_COPY_AND_ASSIGN(WorkerService); 148 DISALLOW_COPY_AND_ASSIGN(WorkerService);
149 }; 149 };
150 150
151 #endif // CONTENT_BROWSER_WORKER_HOST_WORKER_SERVICE_H_ 151 #endif // CONTENT_BROWSER_WORKER_HOST_WORKER_SERVICE_H_
OLDNEW
« no previous file with comments | « content/browser/notification_service_impl.h ('k') | content/common/worker_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698