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

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

Issue 15764004: DevTools: show extension name in console context switcher (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaseline. Created 6 years, 4 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 executionContexts: function() 60 executionContexts: function()
61 { 61 {
62 return Object.values(this._executionContextById); 62 return Object.values(this._executionContextById);
63 }, 63 },
64 64
65 /** 65 /**
66 * @param {!RuntimeAgent.ExecutionContextDescription} context 66 * @param {!RuntimeAgent.ExecutionContextDescription} context
67 */ 67 */
68 _executionContextCreated: function(context) 68 _executionContextCreated: function(context)
69 { 69 {
70 var executionContext = new WebInspector.ExecutionContext(this.target(), context.id, context.name, context.isPageContext, context.frameId); 70 var executionContext = new WebInspector.ExecutionContext(this.target(), context.id, context.name, context.origin, context.isPageContext, context.frameId );
71 this._executionContextById[executionContext.id] = executionContext; 71 this._executionContextById[executionContext.id] = executionContext;
72 this.dispatchEventToListeners(WebInspector.RuntimeModel.Events.Execution ContextCreated, executionContext); 72 this.dispatchEventToListeners(WebInspector.RuntimeModel.Events.Execution ContextCreated, executionContext);
73 }, 73 },
74 74
75 /** 75 /**
76 * @param {number} executionContextId 76 * @param {number} executionContextId
77 */ 77 */
78 _executionContextDestroyed: function(executionContextId) 78 _executionContextDestroyed: function(executionContextId)
79 { 79 {
80 var executionContext = this._executionContextById[executionContextId]; 80 var executionContext = this._executionContextById[executionContextId];
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 } 159 }
160 160
161 } 161 }
162 162
163 /** 163 /**
164 * @constructor 164 * @constructor
165 * @extends {WebInspector.SDKObject} 165 * @extends {WebInspector.SDKObject}
166 * @param {!WebInspector.Target} target 166 * @param {!WebInspector.Target} target
167 * @param {number|undefined} id 167 * @param {number|undefined} id
168 * @param {string} name 168 * @param {string} name
169 * @param {string} origin
169 * @param {boolean} isPageContext 170 * @param {boolean} isPageContext
170 * @param {string=} frameId 171 * @param {string=} frameId
171 */ 172 */
172 WebInspector.ExecutionContext = function(target, id, name, isPageContext, frameI d) 173 WebInspector.ExecutionContext = function(target, id, name, origin, isPageContext , frameId)
173 { 174 {
174 WebInspector.SDKObject.call(this, target); 175 WebInspector.SDKObject.call(this, target);
175 this.id = id; 176 this.id = id;
176 this.name = (isPageContext && !name) ? "<page context>" : name; 177 this.name = name;
178 this.origin = isPageContext && !origin ? "<page context>" : origin;
yurys 2014/08/25 09:22:30 I guess it should be assigned into .name ?
lushnikov 2014/08/27 08:20:26 Done.
177 this.isMainWorldContext = isPageContext; 179 this.isMainWorldContext = isPageContext;
178 this._debuggerModel = target.debuggerModel; 180 this._debuggerModel = target.debuggerModel;
179 this.frameId = frameId; 181 this.frameId = frameId;
180 } 182 }
181 183
182 /** 184 /**
183 * @param {!WebInspector.ExecutionContext} a 185 * @param {!WebInspector.ExecutionContext} a
184 * @param {!WebInspector.ExecutionContext} b 186 * @param {!WebInspector.ExecutionContext} b
185 * @return {number} 187 * @return {number}
186 */ 188 */
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 completionsReadyCallback(results); 403 completionsReadyCallback(results);
402 }, 404 },
403 405
404 __proto__: WebInspector.SDKObject.prototype 406 __proto__: WebInspector.SDKObject.prototype
405 } 407 }
406 408
407 /** 409 /**
408 * @type {!WebInspector.RuntimeModel} 410 * @type {!WebInspector.RuntimeModel}
409 */ 411 */
410 WebInspector.runtimeModel; 412 WebInspector.runtimeModel;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698