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

Unified Diff: content/browser/worker_host/worker_process_host.cc

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_process_host.cc
diff --git a/content/browser/worker_host/worker_process_host.cc b/content/browser/worker_host/worker_process_host.cc
index b818b9d1b8945698b6994a912286db94b84a5b56..d00cfb95f32a85cb21e580c300ab4c9374f8b1f7 100644
--- a/content/browser/worker_host/worker_process_host.cc
+++ b/content/browser/worker_host/worker_process_host.cc
@@ -114,7 +114,8 @@ WorkerProcessHost::WorkerProcessHost(
ResourceContext* resource_context,
const WorkerStoragePartition& partition)
: resource_context_(resource_context),
- partition_(partition) {
+ partition_(partition),
+ process_launched_(false) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(resource_context_);
process_.reset(
@@ -318,6 +319,9 @@ bool WorkerProcessHost::FilterMessage(const IPC::Message& message,
}
void WorkerProcessHost::OnProcessLaunched() {
+ process_launched_ = true;
+
+ WorkerServiceImpl::GetInstance()->NotifyWorkerProcessCreated();
}
bool WorkerProcessHost::OnMessageReceived(const IPC::Message& message) {
@@ -538,6 +542,10 @@ void WorkerProcessHost::TerminateWorker(int worker_route_id) {
Send(new WorkerMsg_TerminateWorkerContext(worker_route_id));
}
+void WorkerProcessHost::SetBackgrounded(bool backgrounded) {
+ process_->SetBackgrounded(backgrounded);
+}
+
const ChildProcessData& WorkerProcessHost::GetData() {
return process_->GetData();
}
« no previous file with comments | « content/browser/worker_host/worker_process_host.h ('k') | content/browser/worker_host/worker_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698