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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/bindings/DefaultScriptMapping.js

Issue 2408203007: DevTools: teach network UISourceCodes to return metadata (Closed)
Patch Set: address comments Created 4 years, 2 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 */ 100 */
101 addScript: function(script) 101 addScript: function(script)
102 { 102 {
103 var name = WebInspector.ParsedURL.extractName(script.sourceURL); 103 var name = WebInspector.ParsedURL.extractName(script.sourceURL);
104 var url = "debugger:///VM" + script.scriptId + (name ? " " + name : ""); 104 var url = "debugger:///VM" + script.scriptId + (name ? " " + name : "");
105 105
106 var uiSourceCode = this._project.createUISourceCode(url, WebInspector.re sourceTypes.Script); 106 var uiSourceCode = this._project.createUISourceCode(url, WebInspector.re sourceTypes.Script);
107 uiSourceCode[WebInspector.DefaultScriptMapping._scriptSymbol] = script; 107 uiSourceCode[WebInspector.DefaultScriptMapping._scriptSymbol] = script;
108 this._uiSourceCodeForScriptId.set(script.scriptId, uiSourceCode); 108 this._uiSourceCodeForScriptId.set(script.scriptId, uiSourceCode);
109 this._scriptIdForUISourceCode.set(uiSourceCode, script.scriptId); 109 this._scriptIdForUISourceCode.set(uiSourceCode, script.scriptId);
110 this._project.addUISourceCodeWithProvider(uiSourceCode, script); 110 this._project.addUISourceCodeWithProvider(uiSourceCode, script, null);
111 111
112 this._debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel.targ et(), uiSourceCode, this); 112 this._debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel.targ et(), uiSourceCode, this);
113 this._debuggerWorkspaceBinding.pushSourceMapping(script, this); 113 this._debuggerWorkspaceBinding.pushSourceMapping(script, this);
114 }, 114 },
115 115
116 /** 116 /**
117 * @override 117 * @override
118 * @return {boolean} 118 * @return {boolean}
119 */ 119 */
120 isIdentity: function() 120 isIdentity: function()
(...skipping 28 matching lines...) Expand all
149 } 149 }
150 150
151 /** 151 /**
152 * @param {!WebInspector.Target} target 152 * @param {!WebInspector.Target} target
153 * @return {string} 153 * @return {string}
154 */ 154 */
155 WebInspector.DefaultScriptMapping.projectIdForTarget = function(target) 155 WebInspector.DefaultScriptMapping.projectIdForTarget = function(target)
156 { 156 {
157 return "debugger:" + target.id(); 157 return "debugger:" + target.id();
158 } 158 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698