зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 2 changesets (bug 1734573) per developer's request CLOSED TREE
Backed out changeset 7d7d9674f18f (bug 1734573) Backed out changeset 0e5afef7d074 (bug 1734573)
This commit is contained in:
Родитель
f80d90ffef
Коммит
0ac4387461
|
@ -44,10 +44,10 @@ add_task(async function() {
|
|||
HTTPS_CONTENT_TYPE_SJS + "?fmt=br",
|
||||
{
|
||||
status: 200,
|
||||
statusText: "OK",
|
||||
type: "json",
|
||||
fullMimeType: "text/json",
|
||||
transferred: L10N.getFormatStrWithNumbers("networkMenu.sizeB", 252),
|
||||
statusText: "Connected",
|
||||
type: "plain",
|
||||
fullMimeType: "text/plain",
|
||||
transferred: L10N.getFormatStrWithNumbers("networkMenu.sizeB", 60),
|
||||
size: L10N.getFormatStrWithNumbers("networkMenu.sizeB", 64),
|
||||
time: true,
|
||||
}
|
||||
|
|
|
@ -341,8 +341,8 @@ function handleRequest(request, response) {
|
|||
break;
|
||||
}
|
||||
case "br": {
|
||||
response.setStatusLine(request.httpVersion, status, "OK");
|
||||
response.setHeader("Content-Type", "text/json", false);
|
||||
response.setStatusLine(request.httpVersion, status, "Connected");
|
||||
response.setHeader("Content-Type", "text/plain", false);
|
||||
response.setHeader("Content-Encoding", "br", false);
|
||||
setCacheHeaders();
|
||||
response.setHeader("Content-Length", "10", false);
|
||||
|
|
|
@ -2395,25 +2395,18 @@ nsresult nsHttpTransaction::ProcessData(char* buf, uint32_t count,
|
|||
if (count && bytesConsumed) memmove(buf, buf + bytesConsumed, count);
|
||||
|
||||
// report the completed response header
|
||||
if (mActivityDistributor && mResponseHead && mHaveAllHeaders) {
|
||||
auto reportResponseHeader = [&](uint32_t aSubType) {
|
||||
nsAutoCString completeResponseHeaders;
|
||||
mResponseHead->Flatten(completeResponseHeaders, false);
|
||||
completeResponseHeaders.AppendLiteral("\r\n");
|
||||
rv = mActivityDistributor->ObserveActivityWithArgs(
|
||||
HttpActivityArgs(mChannelId),
|
||||
NS_HTTP_ACTIVITY_TYPE_HTTP_TRANSACTION, aSubType, PR_Now(), 0,
|
||||
completeResponseHeaders);
|
||||
if (NS_FAILED(rv)) {
|
||||
LOG3(("ObserveActivity failed (%08x)", static_cast<uint32_t>(rv)));
|
||||
}
|
||||
};
|
||||
|
||||
if (mConnection->IsProxyConnectInProgress()) {
|
||||
reportResponseHeader(NS_HTTP_ACTIVITY_SUBTYPE_PROXY_RESPONSE_HEADER);
|
||||
} else if (!mReportedResponseHeader) {
|
||||
mReportedResponseHeader = true;
|
||||
reportResponseHeader(NS_HTTP_ACTIVITY_SUBTYPE_RESPONSE_HEADER);
|
||||
if (mActivityDistributor && mResponseHead && mHaveAllHeaders &&
|
||||
!mReportedResponseHeader) {
|
||||
mReportedResponseHeader = true;
|
||||
nsAutoCString completeResponseHeaders;
|
||||
mResponseHead->Flatten(completeResponseHeaders, false);
|
||||
completeResponseHeaders.AppendLiteral("\r\n");
|
||||
rv = mActivityDistributor->ObserveActivityWithArgs(
|
||||
HttpActivityArgs(mChannelId), NS_HTTP_ACTIVITY_TYPE_HTTP_TRANSACTION,
|
||||
NS_HTTP_ACTIVITY_SUBTYPE_RESPONSE_HEADER, PR_Now(), 0,
|
||||
completeResponseHeaders);
|
||||
if (NS_FAILED(rv)) {
|
||||
LOG3(("ObserveActivity failed (%08x)", static_cast<uint32_t>(rv)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,13 +97,12 @@ interface nsIHttpActivityObserver : nsISupports
|
|||
const unsigned long ACTIVITY_TYPE_SOCKET_TRANSPORT = 0x0001;
|
||||
const unsigned long ACTIVITY_TYPE_HTTP_TRANSACTION = 0x0002;
|
||||
|
||||
const unsigned long ACTIVITY_SUBTYPE_REQUEST_HEADER = 0x5001;
|
||||
const unsigned long ACTIVITY_SUBTYPE_REQUEST_BODY_SENT = 0x5002;
|
||||
const unsigned long ACTIVITY_SUBTYPE_RESPONSE_START = 0x5003;
|
||||
const unsigned long ACTIVITY_SUBTYPE_RESPONSE_HEADER = 0x5004;
|
||||
const unsigned long ACTIVITY_SUBTYPE_RESPONSE_COMPLETE = 0x5005;
|
||||
const unsigned long ACTIVITY_SUBTYPE_TRANSACTION_CLOSE = 0x5006;
|
||||
const unsigned long ACTIVITY_SUBTYPE_PROXY_RESPONSE_HEADER = 0x5007;
|
||||
const unsigned long ACTIVITY_SUBTYPE_REQUEST_HEADER = 0x5001;
|
||||
const unsigned long ACTIVITY_SUBTYPE_REQUEST_BODY_SENT = 0x5002;
|
||||
const unsigned long ACTIVITY_SUBTYPE_RESPONSE_START = 0x5003;
|
||||
const unsigned long ACTIVITY_SUBTYPE_RESPONSE_HEADER = 0x5004;
|
||||
const unsigned long ACTIVITY_SUBTYPE_RESPONSE_COMPLETE = 0x5005;
|
||||
const unsigned long ACTIVITY_SUBTYPE_TRANSACTION_CLOSE = 0x5006;
|
||||
|
||||
/**
|
||||
* When aActivityType is ACTIVITY_TYPE_SOCKET_TRANSPORT
|
||||
|
@ -146,8 +145,6 @@ interface nsIHttpActivityObserver : nsISupports
|
|||
nsIHttpActivityObserver::ACTIVITY_SUBTYPE_RESPONSE_COMPLETE
|
||||
#define NS_HTTP_ACTIVITY_SUBTYPE_TRANSACTION_CLOSE \
|
||||
nsIHttpActivityObserver::ACTIVITY_SUBTYPE_TRANSACTION_CLOSE
|
||||
#define NS_HTTP_ACTIVITY_SUBTYPE_PROXY_RESPONSE_HEADER \
|
||||
nsIHttpActivityObserver::ACTIVITY_SUBTYPE_PROXY_RESPONSE_HEADER
|
||||
|
||||
%}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче