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

Unified Diff: Source/devtools/front_end/sdk/Target.js

Issue 674513002: DevTools: linkify relative links in console.log(new Error().stack) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address vsevik's comments Created 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/sdk/Target.js
diff --git a/Source/devtools/front_end/sdk/Target.js b/Source/devtools/front_end/sdk/Target.js
index c19c290afee15361cda88755320a9f44c40ec6bc..97e82cb1c6c301a2349759b2d40066e4537aa6e9 100644
--- a/Source/devtools/front_end/sdk/Target.js
+++ b/Source/devtools/front_end/sdk/Target.js
@@ -10,11 +10,13 @@
* @param {string} name
* @param {!InspectorBackendClass.Connection} connection
* @param {function(?WebInspector.Target)=} callback
+ * @param {string=} url
*/
-WebInspector.Target = function(name, connection, callback)
+WebInspector.Target = function(name, connection, callback, url)
{
Protocol.Agents.call(this, connection.agentsMap());
this._name = name;
+ this._url = url;
this._connection = connection;
connection.addEventListener(InspectorBackendClass.Connection.Events.Disconnected, this._onDisconnect, this);
this._id = WebInspector.Target._nextId++;
@@ -87,6 +89,15 @@ WebInspector.Target.prototype = {
},
/**
+ *
+ * @return {string}
+ */
+ url: function()
+ {
+ return this._url ? this._url : this.resourceTreeModel.inspectedPageURL();
+ },
+
+ /**
* @param {string} name
* @param {function()|null} callback
* @param {?Protocol.Error} error
@@ -445,10 +456,11 @@ WebInspector.TargetManager.prototype = {
* @param {string} name
* @param {!InspectorBackendClass.Connection} connection
* @param {function(?WebInspector.Target)=} callback
+ * @param {string=} url
*/
- createTarget: function(name, connection, callback)
+ createTarget: function(name, connection, callback, url)
{
- var target = new WebInspector.Target(name, connection, callbackWrapper.bind(this));
+ var target = new WebInspector.Target(name, connection, callbackWrapper.bind(this), url);
/**
* @this {WebInspector.TargetManager}

Powered by Google App Engine
This is Rietveld 408576698