Skip to content

Commit

Permalink
3675465: Update NetLog network service API to use mojom::DictionaryVa…
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Jun 3, 2022
1 parent 40c6295 commit 55a5841
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions shell/browser/api/electron_api_net_log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,8 @@ v8::Local<v8::Promise> NetLog::StartLogging(base::FilePath log_path,
auto command_line_string =
base::CommandLine::ForCurrentProcess()->GetCommandLineString();
auto channel_string = std::string("Electron " ELECTRON_VERSION);
base::Value custom_constants =
base::Value::FromUniquePtrValue(net_log::GetPlatformConstantsForNetLog(
command_line_string, channel_string));
base::Value::Dict custom_constants = net_log::GetPlatformConstantsForNetLog(
command_line_string, channel_string);

auto* network_context =
browser_context_->GetDefaultStoragePartition()->GetNetworkContext();
Expand All @@ -156,7 +155,7 @@ v8::Local<v8::Promise> NetLog::StartLogging(base::FilePath log_path,

void NetLog::StartNetLogAfterCreateFile(net::NetLogCaptureMode capture_mode,
uint64_t max_file_size,
base::Value custom_constants,
base::Value::Dict custom_constants,
base::File output_file) {
if (!net_log_exporter_) {
// Theoretically the mojo pipe could have been closed by the time we get
Expand Down Expand Up @@ -204,7 +203,7 @@ v8::Local<v8::Promise> NetLog::StopLogging(gin::Arguments* args) {
// pointer lives long enough to resolve the promise. Moving it into the
// callback will cause the instance variable to become empty.
net_log_exporter_->Stop(
base::Value(base::Value::Type::DICTIONARY),
base::Value::Dict(),
base::BindOnce(
[](mojo::Remote<network::mojom::NetLogExporter>,
gin_helper::Promise<void> promise, int32_t error) {
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/api/electron_api_net_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class NetLog : public gin::Wrappable<NetLog> {

void StartNetLogAfterCreateFile(net::NetLogCaptureMode capture_mode,
uint64_t max_file_size,
base::Value custom_constants,
base::Value::Dict custom_constants,
base::File output_file);
void NetLogStarted(int32_t error);

Expand Down

0 comments on commit 55a5841

Please sign in to comment.