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

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

Issue 154263004: Add commandline flag for ServiceWroker in the renderer process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated kinuko's comment Created 6 years, 9 months 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_PUBLIC_BROWSER_WORKER_SERVICE_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_WORKER_SERVICE_H_
6 #define CONTENT_PUBLIC_BROWSER_WORKER_SERVICE_H_ 6 #define CONTENT_PUBLIC_BROWSER_WORKER_SERVICE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/process/process.h" 10 #include "base/process/process.h"
11 #include "content/common/content_export.h" 11 #include "content/common/content_export.h"
12 #include "url/gurl.h" 12 #include "url/gurl.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 class WorkerServiceObserver; 16 class WorkerServiceObserver;
17 17
18 // A singleton for managing HTML5 shared web workers. These are run in a 18 // A singleton for managing HTML5 shared web workers. These are run in a
19 // separate process, since multiple renderer processes can be talking to a 19 // separate process, since multiple renderer processes can be talking to a
20 // single shared worker. All the methods below can only be called on the IO 20 // single shared worker. All the methods below can only be called on the IO
21 // thread. 21 // thread.
22 class WorkerService { 22 class WorkerService {
23 public: 23 public:
24 virtual ~WorkerService() {} 24 virtual ~WorkerService() {}
25 25
26 // Returns the WorkerService singleton. 26 // Returns the WorkerService singleton.
27 CONTENT_EXPORT static WorkerService* GetInstance(); 27 CONTENT_EXPORT static WorkerService* GetInstance();
28 28
29 // Determines whether embedded SharedWorker is enabled.
30 CONTENT_EXPORT static bool EmbeddedSharedWorkerEnabled();
31
29 // Terminates the given worker. Returns true if the process was found. 32 // Terminates the given worker. Returns true if the process was found.
30 virtual bool TerminateWorker(int process_id, int route_id) = 0; 33 virtual bool TerminateWorker(int process_id, int route_id) = 0;
31 34
32 struct WorkerInfo { 35 struct WorkerInfo {
33 GURL url; 36 GURL url;
34 base::string16 name; 37 base::string16 name;
35 int process_id; 38 int process_id;
36 int route_id; 39 int route_id;
37 base::ProcessHandle handle; 40 base::ProcessHandle handle;
38 }; 41 };
39 42
40 // Return information about all the currently running workers. 43 // Return information about all the currently running workers.
41 virtual std::vector<WorkerInfo> GetWorkers() = 0; 44 virtual std::vector<WorkerInfo> GetWorkers() = 0;
42 45
43 virtual void AddObserver(WorkerServiceObserver* observer) = 0; 46 virtual void AddObserver(WorkerServiceObserver* observer) = 0;
44 virtual void RemoveObserver(WorkerServiceObserver* observer) = 0; 47 virtual void RemoveObserver(WorkerServiceObserver* observer) = 0;
45 }; 48 };
46 49
47 } // namespace content 50 } // namespace content
48 51
49 #endif // CONTENT_PUBLIC_BROWSER_PLUGIN_SERVICE_H_ 52 #endif // CONTENT_PUBLIC_BROWSER_PLUGIN_SERVICE_H_
OLDNEW
« no previous file with comments | « content/browser/worker_host/worker_service_impl.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698