Closed Bug 1094965 Opened 10 years ago Closed 10 years ago

move `fetch` from actors/script.js to DevToolsUtils.js

Categories

(DevTools :: Debugger, defect)

defect
Not set
normal

Tracking

(firefox35 fixed, firefox36 fixed)

RESOLVED FIXED
Firefox 36
Tracking Status
firefox35 --- fixed
firefox36 --- fixed

People

(Reporter: jlong, Assigned: jlong)

Details

Attachments

(1 file, 2 obsolete files)

I need to use the same `fetch` in Fever Dream to fetch the HTML of a page, and this seems like a good utility function anyway so lets move it until our utils so everyone can access it.
Attached patch 1094965.patch (obsolete) — Splinter Review
Attachment #8518267 - Flags: review?(nfitzgerald)
Comment on attachment 8518267 [details] [diff] [review]
1094965.patch

Review of attachment 8518267 [details] [diff] [review]:
-----------------------------------------------------------------

::: toolkit/devtools/DevToolsUtils.js
@@ +411,5 @@
> +/**
> + * Performs a request to load the desired URL and returns a promise.
> + *
> + * @param aURL String
> + *        The URL we will request.

While you're here, can you add an @param comment for aOptions?
Attachment #8518267 - Flags: review?(nfitzgerald) → review+
Attached patch 1094965.patch (obsolete) — Splinter Review
sweet, done
Attachment #8518267 - Attachment is obsolete: true
Attached patch 1094965.patchSplinter Review
Tests failed locally; had to import the `NetUtils` dependency as well (still lazily loads)
Attachment #8518280 - Attachment is obsolete: true
Assignee: nobody → jlong
Comment on attachment 8518305 [details] [diff] [review]
1094965.patch

Review of attachment 8518305 [details] [diff] [review]:
-----------------------------------------------------------------

::: toolkit/devtools/DevToolsUtils.js
@@ +407,5 @@
>      return temp[aSymbol || aName];
>    });
>  };
> +
> +exports.defineLazyGetter(this, "NetUtil", () => {

Why do you need to export NetUtil from this module?
(In reply to Panos Astithas [:past] (overloaded, please needinfo) from comment #5)
> 
> Why do you need to export NetUtil from this module?

I'm not exporting it, but lazy loading it because it's required inside of `fetch`. That's how it was loaded in the other file. Not sure if it's also attaching it to the module object, and effectively exporting it? This depends on that, but I think we want to lazy load it, is there a better way?
Comment on attachment 8518305 [details] [diff] [review]
1094965.patch

Review of attachment 8518305 [details] [diff] [review]:
-----------------------------------------------------------------

::: toolkit/devtools/DevToolsUtils.js
@@ +407,5 @@
>      return temp[aSymbol || aName];
>    });
>  };
> +
> +exports.defineLazyGetter(this, "NetUtil", () => {

defineLazyGetter is on exports, NetUtil is on this.
^ That was supposed to be a reply to Panos
D'oh, you are right. Please carry on.
Keywords: checkin-needed
Eddy, just want to make sure this is on the list of patches to apply to gum
https://hg.mozilla.org/mozilla-central/rev/4c618071bb26
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 36
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: