Bug 1005755 - Update Net logging in the Console; r=nchevobbe
☠☠ backed out by 136ae00ec938 ☠ ☠
authorJan Odvarko <odvarko@gmail.com>
Mon, 16 Oct 2017 14:43:41 +0200
changeset 386403 463a6a947862af2613787447406e9636184aaecc
parent 386402 4cc8ddaca5bdc2e39207bc5964ae76ed27f2e0a6
child 386404 f384dd566e7f01c85924d69e1f093f21ed31e5a3
push id53370
push userjodvarko@mozilla.com
push dateMon, 16 Oct 2017 12:49:03 +0000
treeherderautoland@f384dd566e7f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnchevobbe
bugs1005755
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1005755 - Update Net logging in the Console; r=nchevobbe MozReview-Commit-ID: FKh9McENsBI
devtools/client/webconsole/new-console-output/components/message-types/NetworkEventMessage.js
--- a/devtools/client/webconsole/new-console-output/components/message-types/NetworkEventMessage.js
+++ b/devtools/client/webconsole/new-console-output/components/message-types/NetworkEventMessage.js
@@ -87,28 +87,45 @@ function NetworkEventMessage({
     }
   };
 
   // Message body components.
   const method = dom.span({className: "method" }, request.method);
   const xhr = isXHR
     ? dom.span({ className: "xhr" }, l10n.getStr("webConsoleXhrIndicator"))
     : null;
-  const url = dom.a({ className: "url", title: request.url, onClick: toggle },
+  const requestUrl = dom.a({ className: "url", title: request.url, onClick: toggle },
     request.url.replace(/\?.+/, ""));
   const statusBody = statusInfo
     ? dom.a({ className: "status", onClick: toggle }, statusInfo)
     : null;
 
-  const messageBody = [method, xhr, url, statusBody];
+  const messageBody = [method, xhr, requestUrl, statusBody];
+
+  // API consumed by Net monitor UI components. Most of the method
+  // are not needed in context of the Console panel (atm) and thus
+  // let's just provide empty implementation.
+  // Individual methods might be implemented step by step as needed.
+  let connector = {
+    viewSourceInDebugger: (url, line) => {
+      serviceContainer.onViewSourceInDebugger({url, line});
+    },
+    getLongString: () => {},
+    getTabTarget: () => {},
+    getNetworkRequest: () => {},
+    sendHTTPRequest: () => {},
+    setPreferences: () => {},
+    triggerActivity: () => {},
+  };
 
   // Only render the attachment if the network-event is
   // actually opened (performance optimization).
   const attachment = open && dom.div({className: "network-info devtools-monospace"},
     TabboxPanel({
+      connector,
       activeTabId: networkMessageActiveTabId,
       request: networkMessageUpdate,
       sourceMapService: serviceContainer.sourceMapService,
       openLink: serviceContainer.openLink,
       selectTab: (tabId) => {
         dispatch(actions.selectNetworkMessageTab(tabId));
       },
     })