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

Side by Side Diff: Source/devtools/front_end/sdk/ServiceWorkerManager.js

Issue 1318043003: DevTools: attempt to unflake http/tests/inspector/service-workers/service-workers-view.html. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tests Created 5 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/bindings/NetworkProject.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 369
370 this._manager._workers.set(workerId, this); 370 this._manager._workers.set(workerId, this);
371 WebInspector.targetManager.createTarget(title, WebInspector.Target.Type.Serv iceWorker, this._connection, manager.target(), targetCreated.bind(this)); 371 WebInspector.targetManager.createTarget(title, WebInspector.Target.Type.Serv iceWorker, this._connection, manager.target(), targetCreated.bind(this));
372 372
373 /** 373 /**
374 * @param {?WebInspector.Target} target 374 * @param {?WebInspector.Target} target
375 * @this {WebInspector.ServiceWorker} 375 * @this {WebInspector.ServiceWorker}
376 */ 376 */
377 function targetCreated(target) 377 function targetCreated(target)
378 { 378 {
379 if (!target) { 379 if (!this._connection || !target) {
380 this._manager._workers.delete(workerId); 380 this._manager._workers.delete(workerId);
381 return; 381 return;
382 } 382 }
383 this._target = target;
383 this._manager.dispatchEventToListeners(WebInspector.ServiceWorkerManager .Events.WorkersUpdated); 384 this._manager.dispatchEventToListeners(WebInspector.ServiceWorkerManager .Events.WorkersUpdated);
384 target.runtimeAgent().run(); 385 target.runtimeAgent().run();
385 } 386 }
386 } 387 }
387 388
388 WebInspector.ServiceWorker._lastAnonymousTargetId = 0; 389 WebInspector.ServiceWorker._lastAnonymousTargetId = 0;
389 390
390 WebInspector.ServiceWorker.prototype = { 391 WebInspector.ServiceWorker.prototype = {
391 /** 392 /**
392 * @return {string} 393 * @return {string}
(...skipping 19 matching lines...) Expand all
412 return this._scope; 413 return this._scope;
413 }, 414 },
414 415
415 stop: function() 416 stop: function()
416 { 417 {
417 this._agent.stop(this._workerId); 418 this._agent.stop(this._workerId);
418 }, 419 },
419 420
420 _closeConnection: function() 421 _closeConnection: function()
421 { 422 {
423 if (!this._target)
424 return;
422 this._connection._close(); 425 this._connection._close();
426 delete this._connection;
423 } 427 }
424 } 428 }
425 429
426 /** 430 /**
427 * @constructor 431 * @constructor
428 * @implements {ServiceWorkerAgent.Dispatcher} 432 * @implements {ServiceWorkerAgent.Dispatcher}
429 * @param {!WebInspector.ServiceWorkerManager} manager 433 * @param {!WebInspector.ServiceWorkerManager} manager
430 */ 434 */
431 WebInspector.ServiceWorkerDispatcher = function(manager) 435 WebInspector.ServiceWorkerDispatcher = function(manager)
432 { 436 {
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 }, 812 },
809 813
810 /** 814 /**
811 * @return {boolean} 815 * @return {boolean}
812 */ 816 */
813 _shouldBeRemoved: function() 817 _shouldBeRemoved: function()
814 { 818 {
815 return this._isRedundant() && (!this._hasErrorLog() || this._deleting); 819 return this._isRedundant() && (!this._hasErrorLog() || this._deleting);
816 } 820 }
817 } 821 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/bindings/NetworkProject.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698