chore: tune-up electron::api::NetLog (#29534)

This commit is contained in:
David Sanders 2021-06-20 18:52:28 -07:00 committed by GitHub
parent aca14bf7dd
commit 8844034fa8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 5 deletions

View file

@ -6,9 +6,14 @@
#define SHELL_BROWSER_API_ELECTRON_API_NET_LOG_H_
#include "base/callback.h"
#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/values.h"
#include "gin/handle.h"
#include "gin/wrappable.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "net/log/net_log_capture_mode.h"
#include "services/network/public/mojom/net_log.mojom.h"
#include "shell/common/gin_helper/promise.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
@ -23,6 +28,7 @@ class ElectronBrowserContext;
namespace api {
// The code is referenced from the net_log::NetExportFileWriter class.
class NetLog : public gin::Wrappable<NetLog> {
public:
static gin::Handle<NetLog> Create(v8::Isolate* isolate,
@ -55,7 +61,7 @@ class NetLog : public gin::Wrappable<NetLog> {
private:
ElectronBrowserContext* browser_context_;
network::mojom::NetLogExporterPtr net_log_exporter_;
mojo::Remote<network::mojom::NetLogExporter> net_log_exporter_;
absl::optional<gin_helper::Promise<void>> pending_start_promise_;