Skip to content

Commit

Permalink
Bug 1404917 - Fetch response content only on-demand. r=Honza
Browse files Browse the repository at this point in the history
Response content should only be fetched whenever it is strictly needed
as it is the response body. A possibly very large string.
So, netmonitor UI should only retrieve it when users select the Response Panel
or do any other action that require having access to it (like "Copy response"
context menu).

MozReview-Commit-ID: CtpJ8PKsCsm

UltraBlame original commit: 291c051b786140efc73bb0f617cf4c07316492d8
  • Loading branch information
marco-c committed Oct 2, 2019
1 parent 1412b28 commit 0327cc5
Show file tree
Hide file tree
Showing 44 changed files with 1,757 additions and 1,119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,11 @@ connector
open
)
)
requestData
:
connector
.
requestData
}
)
;
Expand Down
3 changes: 0 additions & 3 deletions devtools/client/netmonitor/src/components/RequestListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,6 @@ eventTimings
securityState
"
"
responseContentDataUri
"
"
status
"
"
Expand Down
86 changes: 86 additions & 0 deletions devtools/client/netmonitor/src/components/ResponsePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,13 @@ openLink
PropTypes
.
func
connector
:
PropTypes
.
object
.
isRequired
}
;
}
Expand Down Expand Up @@ -299,6 +306,85 @@ this
)
;
}
componentDidMount
(
)
{
this
.
maybeFetchResponseContent
(
this
.
props
)
;
}
componentWillReceiveProps
(
nextProps
)
{
this
.
maybeFetchResponseContent
(
nextProps
)
;
}
maybeFetchResponseContent
(
props
)
{
if
(
props
.
request
.
responseContentAvailable
&
&
(
!
props
.
request
.
responseContent
|
|
!
props
.
request
.
responseContent
.
content
)
)
{
props
.
connector
.
requestData
(
props
.
request
.
id
"
responseContent
"
)
;
}
}
updateImageDimemsions
(
{
Expand Down
1 change: 1 addition & 0 deletions devtools/client/netmonitor/src/components/TabboxPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ ResponsePanel
{
request
openLink
connector
}
)
)
Expand Down
31 changes: 31 additions & 0 deletions devtools/client/netmonitor/src/connector/firefox-connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,19 @@ this
;
this
.
requestData
=
this
.
requestData
.
bind
(
this
)
;
this
.
getLongString
=
this
Expand Down Expand Up @@ -1255,6 +1268,24 @@ sourceLine
;
}
}
requestData
(
request
type
)
{
return
this
.
dataProvider
.
requestData
(
request
type
)
;
}
}
module
.
Expand Down
Loading

0 comments on commit 0327cc5

Please sign in to comment.