Commit fa378828 authored by Maksim Ivanov's avatar Maksim Ivanov Committed by Commit Bot

s/VLOG/LOG(WARNING)/ for certificateProvider logs

Switch the temporary verbose logging in the certificateProvider API
implementation to use LOG(WARNING) instead of VLOG, since the latter
was recently disabled for most of modules due to performance penalty
(see https://b/77729987).

These logs will be removed once we finish stabilizing the smart card
user login feature and collecting feedback from the early customers.

Bug: 1046860
Change-Id: I96223be406c267043d1995ccc8d905718dc465ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2327930
Auto-Submit: Maksim Ivanov <emaxx@chromium.org>
Commit-Queue: Fabian Sommer <fabiansommer@chromium.org>
Reviewed-by: default avatarFabian Sommer <fabiansommer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#793101}
parent 380e37ec
...@@ -250,8 +250,9 @@ bool CertificateProviderService::ReplyToSignRequest( ...@@ -250,8 +250,9 @@ bool CertificateProviderService::ReplyToSignRequest(
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// TODO(crbug.com/1046860): Remove logging after stabilizing the feature. // TODO(crbug.com/1046860): Remove logging after stabilizing the feature.
VLOG(1) << "Extension " << extension_id << " replied to signature request " LOG(WARNING) << "Extension " << extension_id
<< sign_request_id << ", size " << signature.size(); << " replied to signature request " << sign_request_id
<< ", size " << signature.size();
scoped_refptr<net::X509Certificate> certificate; scoped_refptr<net::X509Certificate> certificate;
net::SSLPrivateKey::SignCallback callback; net::SSLPrivateKey::SignCallback callback;
...@@ -367,8 +368,8 @@ void CertificateProviderService::AbortSignatureRequestsForAuthenticatingUser( ...@@ -367,8 +368,8 @@ void CertificateProviderService::AbortSignatureRequestsForAuthenticatingUser(
const int sign_request_id = sign_request.second; const int sign_request_id = sign_request.second;
// TODO(crbug.com/1046860): Remove logging after stabilizing the feature. // TODO(crbug.com/1046860): Remove logging after stabilizing the feature.
VLOG(1) << "Aborting user login signature request from extension " LOG(WARNING) << "Aborting user login signature request from extension "
<< extension_id << " id " << sign_request_id; << extension_id << " id " << sign_request_id;
pin_dialog_manager_.AbortSignRequest(extension_id, sign_request_id); pin_dialog_manager_.AbortSignRequest(extension_id, sign_request_id);
...@@ -448,16 +449,16 @@ void CertificateProviderService::RequestSignatureFromExtension( ...@@ -448,16 +449,16 @@ void CertificateProviderService::RequestSignatureFromExtension(
std::move(callback)); std::move(callback));
// TODO(crbug.com/1046860): Remove logging after stabilizing the feature. // TODO(crbug.com/1046860): Remove logging after stabilizing the feature.
VLOG(1) << "Starting signature request to extension " << extension_id LOG(WARNING) << "Starting signature request to extension " << extension_id
<< " id " << sign_request_id; << " id " << sign_request_id;
pin_dialog_manager_.AddSignRequestId(extension_id, sign_request_id, pin_dialog_manager_.AddSignRequestId(extension_id, sign_request_id,
authenticating_user_account_id); authenticating_user_account_id);
if (!delegate_->DispatchSignRequestToExtension( if (!delegate_->DispatchSignRequestToExtension(
extension_id, sign_request_id, algorithm, certificate, input)) { extension_id, sign_request_id, algorithm, certificate, input)) {
// TODO(crbug.com/1046860): Remove logging after stabilizing the feature. // TODO(crbug.com/1046860): Remove logging after stabilizing the feature.
VLOG(1) << "Failed to dispatch signature request to extension " LOG(WARNING) << "Failed to dispatch signature request to extension "
<< extension_id << " id " << sign_request_id; << extension_id << " id " << sign_request_id;
scoped_refptr<net::X509Certificate> local_certificate; scoped_refptr<net::X509Certificate> local_certificate;
sign_requests_.RemoveRequest(extension_id, sign_request_id, sign_requests_.RemoveRequest(extension_id, sign_request_id,
&local_certificate, &callback); &local_certificate, &callback);
......
...@@ -296,8 +296,9 @@ CertificateProviderInternalReportCertificatesFunction::Run() { ...@@ -296,8 +296,9 @@ CertificateProviderInternalReportCertificatesFunction::Run() {
} }
// TODO(crbug.com/1046860): Remove logging after stabilizing the feature. // TODO(crbug.com/1046860): Remove logging after stabilizing the feature.
VLOG(1) << "Certificates provided by extension " << extension()->id() << ": " LOG(WARNING) << "Certificates provided by extension " << extension()->id()
<< cert_infos.size() << ", rejected " << rejected_certificates.size(); << ": " << cert_infos.size() << ", rejected "
<< rejected_certificates.size();
service->SetCertificatesProvidedByExtension(extension_id(), cert_infos); service->SetCertificatesProvidedByExtension(extension_id(), cert_infos);
...@@ -322,8 +323,8 @@ CertificateProviderStopPinRequestFunction::Run() { ...@@ -322,8 +323,8 @@ CertificateProviderStopPinRequestFunction::Run() {
EXTENSION_FUNCTION_VALIDATE(params); EXTENSION_FUNCTION_VALIDATE(params);
// TODO(crbug.com/1046860): Remove logging after stabilizing the feature. // TODO(crbug.com/1046860): Remove logging after stabilizing the feature.
VLOG(1) << "Handling PIN stop request from extension " << extension()->id() LOG(WARNING) << "Handling PIN stop request from extension "
<< " error " << params->details.error_type; << extension()->id() << " error " << params->details.error_type;
chromeos::CertificateProviderService* const service = chromeos::CertificateProviderService* const service =
chromeos::CertificateProviderServiceFactory::GetForBrowserContext( chromeos::CertificateProviderServiceFactory::GetForBrowserContext(
...@@ -337,13 +338,13 @@ CertificateProviderStopPinRequestFunction::Run() { ...@@ -337,13 +338,13 @@ CertificateProviderStopPinRequestFunction::Run() {
// This might happen if the user closed the dialog while extension was // This might happen if the user closed the dialog while extension was
// processing the input. // processing the input.
// TODO(crbug.com/1046860): Remove logging after stabilizing the feature. // TODO(crbug.com/1046860): Remove logging after stabilizing the feature.
VLOG(1) << "PIN stop request failed: " LOG(WARNING) << "PIN stop request failed: "
<< kCertificateProviderNoActiveDialog; << kCertificateProviderNoActiveDialog;
return RespondNow(Error(kCertificateProviderNoActiveDialog)); return RespondNow(Error(kCertificateProviderNoActiveDialog));
} }
// TODO(crbug.com/1046860): Remove logging after stabilizing the feature. // TODO(crbug.com/1046860): Remove logging after stabilizing the feature.
VLOG(1) << "PIN stop request succeeded"; LOG(WARNING) << "PIN stop request succeeded";
return RespondNow(NoArguments()); return RespondNow(NoArguments());
} }
...@@ -369,12 +370,13 @@ CertificateProviderStopPinRequestFunction::Run() { ...@@ -369,12 +370,13 @@ CertificateProviderStopPinRequestFunction::Run() {
return RespondLater(); return RespondLater();
} }
// TODO(crbug.com/1046860): Remove logging after stabilizing the feature. // TODO(crbug.com/1046860): Remove logging after stabilizing the feature.
VLOG(1) << "PIN stop request failed: " << error_result; LOG(WARNING) << "PIN stop request failed: " << error_result;
return RespondNow(Error(std::move(error_result))); return RespondNow(Error(std::move(error_result)));
} }
void CertificateProviderStopPinRequestFunction::OnPinRequestStopped() { void CertificateProviderStopPinRequestFunction::OnPinRequestStopped() {
VLOG(1) << "PIN stop request succeeded"; // TODO(crbug.com/1046860): Remove logging after stabilizing the feature.
LOG(WARNING) << "PIN stop request succeeded";
Respond(NoArguments()); Respond(NoArguments());
} }
...@@ -447,10 +449,10 @@ ExtensionFunction::ResponseAction CertificateProviderRequestPinFunction::Run() { ...@@ -447,10 +449,10 @@ ExtensionFunction::ResponseAction CertificateProviderRequestPinFunction::Run() {
} }
// TODO(crbug.com/1046860): Remove logging after stabilizing the feature. // TODO(crbug.com/1046860): Remove logging after stabilizing the feature.
VLOG(1) << "Starting PIN request from extension " << extension()->id() LOG(WARNING) << "Starting PIN request from extension " << extension()->id()
<< " signRequestId " << params->details.sign_request_id << " type " << " signRequestId " << params->details.sign_request_id
<< params->details.request_type << " error " << " type " << params->details.request_type << " error "
<< params->details.error_type << " attempts " << attempts_left; << params->details.error_type << " attempts " << attempts_left;
const chromeos::PinDialogManager::RequestPinResult result = const chromeos::PinDialogManager::RequestPinResult result =
service->pin_dialog_manager()->RequestPin( service->pin_dialog_manager()->RequestPin(
...@@ -474,7 +476,7 @@ ExtensionFunction::ResponseAction CertificateProviderRequestPinFunction::Run() { ...@@ -474,7 +476,7 @@ ExtensionFunction::ResponseAction CertificateProviderRequestPinFunction::Run() {
break; break;
} }
// TODO(crbug.com/1046860): Remove logging after stabilizing the feature. // TODO(crbug.com/1046860): Remove logging after stabilizing the feature.
VLOG(1) << "PIN request failed: " << error_result; LOG(WARNING) << "PIN request failed: " << error_result;
return RespondNow(Error(std::move(error_result))); return RespondNow(Error(std::move(error_result)));
} }
...@@ -487,13 +489,13 @@ void CertificateProviderRequestPinFunction::OnInputReceived( ...@@ -487,13 +489,13 @@ void CertificateProviderRequestPinFunction::OnInputReceived(
DCHECK(service); DCHECK(service);
if (!value.empty()) { if (!value.empty()) {
// TODO(crbug.com/1046860): Remove logging after stabilizing the feature. // TODO(crbug.com/1046860): Remove logging after stabilizing the feature.
VLOG(1) << "PIN request succeeded"; LOG(WARNING) << "PIN request succeeded";
api::certificate_provider::PinResponseDetails details; api::certificate_provider::PinResponseDetails details;
details.user_input = std::make_unique<std::string>(value); details.user_input = std::make_unique<std::string>(value);
create_results->Append(details.ToValue()); create_results->Append(details.ToValue());
} else { } else {
// TODO(crbug.com/1046860): Remove logging after stabilizing the feature. // TODO(crbug.com/1046860): Remove logging after stabilizing the feature.
VLOG(1) << "PIN request canceled"; LOG(WARNING) << "PIN request canceled";
} }
Respond(ArgumentList(std::move(create_results))); Respond(ArgumentList(std::move(create_results)));
...@@ -529,9 +531,9 @@ CertificateProviderSetCertificatesFunction::Run() { ...@@ -529,9 +531,9 @@ CertificateProviderSetCertificatesFunction::Run() {
} }
// TODO(crbug.com/1046860): Remove logging after stabilizing the feature. // TODO(crbug.com/1046860): Remove logging after stabilizing the feature.
VLOG(1) << "Certificates provided by extension " << extension()->id() << ": " LOG(WARNING) << "Certificates provided by extension " << extension()->id()
<< accepted_certificates.size() << ", rejected " << ": " << accepted_certificates.size() << ", rejected "
<< rejected_certificates_count; << rejected_certificates_count;
chromeos::CertificateProviderService* const service = chromeos::CertificateProviderService* const service =
chromeos::CertificateProviderServiceFactory::GetForBrowserContext( chromeos::CertificateProviderServiceFactory::GetForBrowserContext(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment