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

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

Issue 14137016: Lower the priority of shared workers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes from review. Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/worker_host/worker_service_impl.h
diff --git a/content/browser/worker_host/worker_service_impl.h b/content/browser/worker_host/worker_service_impl.h
index 845f4334191b6124ba8da945e3f42b1303ed3f1b..a81d134648e94cf3917f2985f43b08ddac20c807 100644
--- a/content/browser/worker_host/worker_service_impl.h
+++ b/content/browser/worker_host/worker_service_impl.h
@@ -11,6 +11,7 @@
#include "base/observer_list.h"
#include "base/threading/non_thread_safe.h"
#include "content/browser/worker_host/worker_process_host.h"
+#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/worker_service.h"
@@ -21,6 +22,7 @@ namespace content {
class ResourceContext;
class WorkerServiceObserver;
class WorkerStoragePartition;
+class WorkerPrioritySetter;
class CONTENT_EXPORT WorkerServiceImpl
: public NON_EXPORTED_BASE(WorkerService) {
@@ -28,6 +30,9 @@ class CONTENT_EXPORT WorkerServiceImpl
// Returns the WorkerServiceImpl singleton.
static WorkerServiceImpl* GetInstance();
+ // Releases the priority setter to avoid memory leak error.
+ void PerformTeardownForTesting();
+
// WorkerService implementation:
virtual bool TerminateWorker(int process_id, int route_id) OVERRIDE;
virtual std::vector<WorkerInfo> GetWorkers() OVERRIDE;
@@ -72,6 +77,8 @@ class CONTENT_EXPORT WorkerServiceImpl
WorkerProcessHost* process,
int worker_route_id);
+ void NotifyWorkerProcessCreated();
+
// Used when we run each worker in a separate process.
static const int kMaxWorkersWhenSeparate;
static const int kMaxWorkersPerTabWhenSeparate;
@@ -122,7 +129,8 @@ class CONTENT_EXPORT WorkerServiceImpl
const WorkerStoragePartition& worker_partition,
ResourceContext* resource_context);
- NotificationRegistrar registrar_;
+ scoped_refptr<WorkerPrioritySetter> priority_setter_;
+
int next_worker_route_id_;
WorkerProcessHost::Instances queued_workers_;
« no previous file with comments | « content/browser/worker_host/worker_process_host.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