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

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

Issue 298333003: DevTools: Implement console message logging through an extension (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Implement a common MessageSink Created 6 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 | Annotate | Revision Log
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 for (var i = 0; i < sourceURLs.length; ++i) { 127 for (var i = 0; i < sourceURLs.length; ++i) {
128 var sourceURL = sourceURLs[i]; 128 var sourceURL = sourceURLs[i];
129 if (this._sourceMapForURL.get(sourceURL)) 129 if (this._sourceMapForURL.get(sourceURL))
130 continue; 130 continue;
131 this._sourceMapForURL.put(sourceURL, sourceMap); 131 this._sourceMapForURL.put(sourceURL, sourceMap);
132 if (!this._workspace.hasMappingForURL(sourceURL) && !this._works pace.uiSourceCodeForURL(sourceURL)) { 132 if (!this._workspace.hasMappingForURL(sourceURL) && !this._works pace.uiSourceCodeForURL(sourceURL)) {
133 var contentProvider = sourceMap.sourceContentProvider(source URL, WebInspector.resourceTypes.Script); 133 var contentProvider = sourceMap.sourceContentProvider(source URL, WebInspector.resourceTypes.Script);
134 this._networkWorkspaceBinding.addFileForURL(sourceURL, conte ntProvider, script.isContentScript()); 134 this._networkWorkspaceBinding.addFileForURL(sourceURL, conte ntProvider, script.isContentScript());
135 } 135 }
136 var uiSourceCode = this._workspace.uiSourceCodeForURL(sourceURL) ; 136 var uiSourceCode = this._workspace.uiSourceCodeForURL(sourceURL) ;
137 if (uiSourceCode) 137 if (uiSourceCode) {
138 this._bindUISourceCode(uiSourceCode); 138 this._bindUISourceCode(uiSourceCode);
139 else 139 } else {
140 this._target.consoleModel.showErrorMessage(WebInspector.UISt ring("Failed to locate workspace file mapped to URL %s from source map %s", sour ceURL, sourceMap.url())); 140 // FIXME: Make use of this._target once we have more targets .
141 WebInspector.messageSink.addErrorMessage(WebInspector.UIStri ng("Failed to locate workspace file mapped to URL %s from source map %s", source URL, sourceMap.url()), true);
142 }
141 } 143 }
142 script.updateLocations(); 144 script.updateLocations();
143 } 145 }
144 }, 146 },
145 147
146 /** 148 /**
147 * @return {boolean} 149 * @return {boolean}
148 */ 150 */
149 isIdentity: function() 151 isIdentity: function()
150 { 152 {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 254
253 this._sourceMapForURL.keys().forEach(unbindUISourceCodeForURL.bind(this) ); 255 this._sourceMapForURL.keys().forEach(unbindUISourceCodeForURL.bind(this) );
254 256
255 this._sourceMapForSourceMapURL = {}; 257 this._sourceMapForSourceMapURL = {};
256 this._pendingSourceMapLoadingCallbacks = {}; 258 this._pendingSourceMapLoadingCallbacks = {};
257 this._sourceMapForScriptId = {}; 259 this._sourceMapForScriptId = {};
258 this._scriptForSourceMap.clear(); 260 this._scriptForSourceMap.clear();
259 this._sourceMapForURL.clear(); 261 this._sourceMapForURL.clear();
260 } 262 }
261 } 263 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698