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

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

Issue 2889013002: DevTools: introduce uiSourceCode.mimeType() method (Closed)
Patch Set: address comments Created 3 years, 7 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 /** 98 /**
99 * @param {!SDK.Script} script 99 * @param {!SDK.Script} script
100 */ 100 */
101 addScript(script) { 101 addScript(script) {
102 var name = Common.ParsedURL.extractName(script.sourceURL); 102 var name = Common.ParsedURL.extractName(script.sourceURL);
103 var url = 'debugger:///VM' + script.scriptId + (name ? ' ' + name : ''); 103 var url = 'debugger:///VM' + script.scriptId + (name ? ' ' + name : '');
104 104
105 var uiSourceCode = this._project.createUISourceCode(url, Common.resourceType s.Script); 105 var uiSourceCode = this._project.createUISourceCode(url, Common.resourceType s.Script);
106 uiSourceCode[Bindings.DefaultScriptMapping._scriptSymbol] = script; 106 uiSourceCode[Bindings.DefaultScriptMapping._scriptSymbol] = script;
107 script[Bindings.DefaultScriptMapping._uiSourceCodeSymbol] = uiSourceCode; 107 script[Bindings.DefaultScriptMapping._uiSourceCodeSymbol] = uiSourceCode;
108 this._project.addUISourceCodeWithProvider(uiSourceCode, script, null); 108 this._project.addUISourceCodeWithProvider(uiSourceCode, script, null, 'text/ javascript');
109 109
110 this._debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel, uiSourc eCode, this); 110 this._debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel, uiSourc eCode, this);
111 this._debuggerWorkspaceBinding.pushSourceMapping(script, this); 111 this._debuggerWorkspaceBinding.pushSourceMapping(script, this);
112 } 112 }
113 113
114 /** 114 /**
115 * @param {!SDK.Script} script 115 * @param {!SDK.Script} script
116 */ 116 */
117 removeScript(script) { 117 removeScript(script) {
118 var uiSourceCode = script[Bindings.DefaultScriptMapping._uiSourceCodeSymbol] ; 118 var uiSourceCode = script[Bindings.DefaultScriptMapping._uiSourceCodeSymbol] ;
(...skipping 28 matching lines...) Expand all
147 147
148 dispose() { 148 dispose() {
149 Common.EventTarget.removeEventListeners(this._eventListeners); 149 Common.EventTarget.removeEventListeners(this._eventListeners);
150 this._debuggerReset(); 150 this._debuggerReset();
151 this._project.dispose(); 151 this._project.dispose();
152 } 152 }
153 }; 153 };
154 154
155 Bindings.DefaultScriptMapping._scriptSymbol = Symbol('symbol'); 155 Bindings.DefaultScriptMapping._scriptSymbol = Symbol('symbol');
156 Bindings.DefaultScriptMapping._uiSourceCodeSymbol = Symbol('uiSourceCodeSymbol') ; 156 Bindings.DefaultScriptMapping._uiSourceCodeSymbol = Symbol('uiSourceCodeSymbol') ;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698