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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js

Issue 2756103002: DevTools: remove SDK.ResourceTreeFrame.fromXXX methods (Closed)
Patch Set: remove unused code Created 3 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/bindings/SASSSourceMapping.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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 /** 497 /**
498 * @type {!Object.<string, !SDK.Resource>} 498 * @type {!Object.<string, !SDK.Resource>}
499 */ 499 */
500 this._resourcesMap = {}; 500 this._resourcesMap = {};
501 501
502 if (this._parentFrame) 502 if (this._parentFrame)
503 this._parentFrame._childFrames.push(this); 503 this._parentFrame._childFrames.push(this);
504 } 504 }
505 505
506 /** 506 /**
507 * @param {!SDK.ExecutionContext|!SDK.CSSStyleSheetHeader|!SDK.Resource} objec t
508 * @return {?SDK.ResourceTreeFrame}
509 */
510 static _fromObject(object) {
511 var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(object.target());
512 var frameId = object.frameId;
513 if (!resourceTreeModel || !frameId)
514 return null;
515 return resourceTreeModel.frameForId(frameId);
516 }
517
518 /**
519 * @param {!SDK.Script} script
520 * @return {?SDK.ResourceTreeFrame}
521 */
522 static fromScript(script) {
523 var executionContext = script.executionContext();
524 if (!executionContext)
525 return null;
526 return SDK.ResourceTreeFrame._fromObject(executionContext);
527 }
528
529 /**
530 * @param {!SDK.CSSStyleSheetHeader} header
531 * @return {?SDK.ResourceTreeFrame}
532 */
533 static fromStyleSheet(header) {
534 return SDK.ResourceTreeFrame._fromObject(header);
535 }
536
537 /**
538 * @param {!SDK.Resource} resource
539 * @return {?SDK.ResourceTreeFrame}
540 */
541 static fromResource(resource) {
542 return SDK.ResourceTreeFrame._fromObject(resource);
543 }
544
545 /**
546 * @return {!SDK.Target} 507 * @return {!SDK.Target}
547 */ 508 */
548 target() { 509 target() {
549 return this._model.target(); 510 return this._model.target();
550 } 511 }
551 512
552 /** 513 /**
553 * @return {string} 514 * @return {string}
554 */ 515 */
555 get id() { 516 get id() {
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Event s.InterstitialHidden); 841 this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Event s.InterstitialHidden);
881 } 842 }
882 843
883 /** 844 /**
884 * @override 845 * @override
885 */ 846 */
886 navigationRequested() { 847 navigationRequested() {
887 // Frontend is not interested in when navigations are requested. 848 // Frontend is not interested in when navigations are requested.
888 } 849 }
889 }; 850 };
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/bindings/SASSSourceMapping.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698