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

Side by Side Diff: content/browser/service_worker/embedded_worker_instance.cc

Issue 912753002: Stop Service Workers that execute JavaScript for too long. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase? Created 5 years, 10 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "content/browser/service_worker/embedded_worker_instance.h" 5 #include "content/browser/service_worker/embedded_worker_instance.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 start_callback_ = callback; 297 start_callback_ = callback;
298 } 298 }
299 299
300 void EmbeddedWorkerInstance::OnReadyForInspection() { 300 void EmbeddedWorkerInstance::OnReadyForInspection() {
301 if (devtools_proxy_) 301 if (devtools_proxy_)
302 devtools_proxy_->NotifyWorkerReadyForInspection(); 302 devtools_proxy_->NotifyWorkerReadyForInspection();
303 } 303 }
304 304
305 void EmbeddedWorkerInstance::OnScriptLoaded(int thread_id) { 305 void EmbeddedWorkerInstance::OnScriptLoaded(int thread_id) {
306 thread_id_ = thread_id; 306 thread_id_ = thread_id;
307 FOR_EACH_OBSERVER(Listener, listener_list_, OnScriptLoaded());
307 } 308 }
308 309
309 void EmbeddedWorkerInstance::OnScriptLoadFailed() { 310 void EmbeddedWorkerInstance::OnScriptLoadFailed() {
310 } 311 }
311 312
312 void EmbeddedWorkerInstance::OnScriptEvaluated(bool success) { 313 void EmbeddedWorkerInstance::OnScriptEvaluated(bool success) {
313 DCHECK(!start_callback_.is_null()); 314 DCHECK(!start_callback_.is_null());
314 start_callback_.Run(success ? SERVICE_WORKER_OK 315 start_callback_.Run(success ? SERVICE_WORKER_OK
315 : SERVICE_WORKER_ERROR_START_WORKER_FAILED); 316 : SERVICE_WORKER_ERROR_START_WORKER_FAILED);
316 start_callback_.Reset(); 317 start_callback_.Reset();
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 392
392 void EmbeddedWorkerInstance::AddListener(Listener* listener) { 393 void EmbeddedWorkerInstance::AddListener(Listener* listener) {
393 listener_list_.AddObserver(listener); 394 listener_list_.AddObserver(listener);
394 } 395 }
395 396
396 void EmbeddedWorkerInstance::RemoveListener(Listener* listener) { 397 void EmbeddedWorkerInstance::RemoveListener(Listener* listener) {
397 listener_list_.RemoveObserver(listener); 398 listener_list_.RemoveObserver(listener);
398 } 399 }
399 400
400 } // namespace content 401 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698