зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1857153 - Only create qlog folder in parent process, r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D190149
This commit is contained in:
Родитель
c5999e857d
Коммит
f40f7742bd
|
@ -337,27 +337,31 @@ nsresult nsHttpHandler::Init() {
|
|||
Telemetry::ScalarSet(Telemetry::ScalarID::NETWORKING_HTTPS_RR_PREFS_USAGE,
|
||||
static_cast<uint32_t>(usageOfHTTPSRRPrefs.to_ulong()));
|
||||
mActivityDistributor = components::HttpActivityDistributor::Service();
|
||||
|
||||
auto initQLogDir = [&]() {
|
||||
if (!StaticPrefs::network_http_http3_enable_qlog()) {
|
||||
return EmptyCString();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIFile> qlogDir;
|
||||
nsresult rv =
|
||||
NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(qlogDir));
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return EmptyCString();
|
||||
}
|
||||
|
||||
nsAutoCString dirName("qlog_");
|
||||
dirName.AppendInt(mProcessId);
|
||||
rv = qlogDir->AppendNative(dirName);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return EmptyCString();
|
||||
}
|
||||
|
||||
return qlogDir->HumanReadablePath();
|
||||
};
|
||||
mHttp3QlogDir = initQLogDir();
|
||||
}
|
||||
|
||||
auto initQLogDir = [&]() {
|
||||
nsCOMPtr<nsIFile> qlogDir;
|
||||
nsresult rv =
|
||||
NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(qlogDir));
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return EmptyCString();
|
||||
}
|
||||
|
||||
nsAutoCString dirName("qlog_");
|
||||
dirName.AppendInt(mProcessId);
|
||||
rv = qlogDir->AppendNative(dirName);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return EmptyCString();
|
||||
}
|
||||
|
||||
return qlogDir->HumanReadablePath();
|
||||
};
|
||||
mHttp3QlogDir = initQLogDir();
|
||||
|
||||
// monitor some preference changes
|
||||
Preferences::RegisterPrefixCallbacks(nsHttpHandler::PrefsChanged,
|
||||
gCallbackPrefs, this);
|
||||
|
|
Загрузка…
Ссылка в новой задаче