Add debugging data in PrintingContext::UpdatePrintSettings()
Record the input dictionary as a JSON string for a condition that should be not reachable. Bug: 40897743 Change-Id: I3024d319c344911e4a20df35d13028185bd526a8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6393942 Reviewed-by: Alan Screen <awscreen@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org> Cr-Commit-Position: refs/heads/main@{#1437915}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
c64d1fb9c5
commit
07604651e3
@ -7,6 +7,8 @@
|
||||
#include <utility>
|
||||
|
||||
#include "base/check_op.h"
|
||||
#include "base/debug/alias.h"
|
||||
#include "base/json/json_writer.h"
|
||||
#include "base/notreached.h"
|
||||
#include "build/build_config.h"
|
||||
#include "printing/buildflags/buildflags.h"
|
||||
@ -159,6 +161,13 @@ mojom::ResultCode PrintingContext::UpdatePrintSettings(
|
||||
std::unique_ptr<PrintSettings> settings =
|
||||
PrintSettingsFromJobSettings(job_settings);
|
||||
if (!settings) {
|
||||
// TODO(crbug.com/40897743): Investigate and remove.
|
||||
std::optional<std::string> job_settings_json =
|
||||
base::WriteJson(job_settings);
|
||||
if (job_settings_json.has_value()) {
|
||||
DEBUG_ALIAS_FOR_CSTR(job_settings_json_copy,
|
||||
job_settings_json.value().c_str(), 1024);
|
||||
}
|
||||
DUMP_WILL_BE_NOTREACHED();
|
||||
return OnError();
|
||||
}
|
||||
|
Reference in New Issue
Block a user