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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js

Issue 2931143003: DevTools: make debugger's rawLocationToUILocation return nullable type (Closed)
Patch Set: add test Created 3 years, 6 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 /** 472 /**
473 * @param {!Workspace.UISourceCode} uiSourceCode 473 * @param {!Workspace.UISourceCode} uiSourceCode
474 * @param {!Array.<!{breakpoint: !Bindings.BreakpointManager.Breakpoint, uiLoc ation: !Workspace.UILocation}>} breakpointLocations 474 * @param {!Array.<!{breakpoint: !Bindings.BreakpointManager.Breakpoint, uiLoc ation: !Workspace.UILocation}>} breakpointLocations
475 */ 475 */
476 _restoreBreakpoints(uiSourceCode, breakpointLocations) { 476 _restoreBreakpoints(uiSourceCode, breakpointLocations) {
477 var script = this._scriptForUISourceCode.get(uiSourceCode); 477 var script = this._scriptForUISourceCode.get(uiSourceCode);
478 if (!script) 478 if (!script)
479 return; 479 return;
480 var rawLocation = 480 var rawLocation =
481 /** @type {!SDK.DebuggerModel.Location} */ (this._debuggerModel.createRa wLocation(script, 0, 0)); 481 /** @type {!SDK.DebuggerModel.Location} */ (this._debuggerModel.createRa wLocation(script, 0, 0));
482 var scriptUISourceCode = Bindings.debuggerWorkspaceBinding.rawLocationToUILo cation(rawLocation).uiSourceCode; 482 var uiLocation = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(r awLocation);
483 if (scriptUISourceCode) 483 if (uiLocation)
484 this._scriptSnippetModel._restoreBreakpoints(scriptUISourceCode, breakpoin tLocations); 484 this._scriptSnippetModel._restoreBreakpoints(uiLocation.uiSourceCode, brea kpointLocations);
485 } 485 }
486 }; 486 };
487 487
488 /** 488 /**
489 * @implements {Common.ContentProvider} 489 * @implements {Common.ContentProvider}
490 * @unrestricted 490 * @unrestricted
491 */ 491 */
492 Snippets.SnippetContentProvider = class { 492 Snippets.SnippetContentProvider = class {
493 /** 493 /**
494 * @param {!Snippets.Snippet} snippet 494 * @param {!Snippets.Snippet} snippet
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 */ 609 */
610 deleteFile(uiSourceCode) { 610 deleteFile(uiSourceCode) {
611 this._model.deleteScriptSnippet(uiSourceCode); 611 this._model.deleteScriptSnippet(uiSourceCode);
612 } 612 }
613 }; 613 };
614 614
615 /** 615 /**
616 * @type {!Snippets.ScriptSnippetModel} 616 * @type {!Snippets.ScriptSnippetModel}
617 */ 617 */
618 Snippets.scriptSnippetModel = new Snippets.ScriptSnippetModel(Workspace.workspac e); 618 Snippets.scriptSnippetModel = new Snippets.ScriptSnippetModel(Workspace.workspac e);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698