Skip to content

Commit

Permalink
chore: remove unused ConvertableToTraceFormatWrapper (#43356)
Browse files Browse the repository at this point in the history
* chore: remove unused ConvertableToTraceFormatWrapper

Last use removed in Apr 2024 (39bf441, #41880)

* fixup! chore: remove unused ConvertableToTraceFormatWrapper

remove now-unused trace_event.h header, too
  • Loading branch information
ckerr committed Aug 20, 2024
1 parent 2cc14c6 commit 069c923
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions shell/browser/javascript_environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "base/task/current_thread.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/thread_pool/initialization_util.h"
#include "base/trace_event/trace_event.h"
#include "gin/array_buffer.h"
#include "gin/v8_initializer.h"
#include "shell/browser/microtasks_runner.h"
Expand All @@ -31,48 +30,6 @@ namespace {
v8::Isolate* g_isolate;
}

namespace gin {

class ConvertableToTraceFormatWrapper final
: public base::trace_event::ConvertableToTraceFormat {
public:
explicit ConvertableToTraceFormatWrapper(
std::unique_ptr<v8::ConvertableToTraceFormat> inner)
: inner_(std::move(inner)) {}
~ConvertableToTraceFormatWrapper() override = default;

// disable copy
ConvertableToTraceFormatWrapper(const ConvertableToTraceFormatWrapper&) =
delete;
ConvertableToTraceFormatWrapper& operator=(
const ConvertableToTraceFormatWrapper&) = delete;

void AppendAsTraceFormat(std::string* out) const final {
inner_->AppendAsTraceFormat(out);
}

private:
std::unique_ptr<v8::ConvertableToTraceFormat> inner_;
};

} // namespace gin

// Allow std::unique_ptr<v8::ConvertableToTraceFormat> to be a valid
// initialization value for trace macros.
template <>
struct base::trace_event::TraceValue::Helper<
std::unique_ptr<v8::ConvertableToTraceFormat>> {
static constexpr unsigned char kType = TRACE_VALUE_TYPE_CONVERTABLE;
static inline void SetValue(
TraceValue* v,
std::unique_ptr<v8::ConvertableToTraceFormat> value) {
// NOTE: |as_convertable| is an owning pointer, so using new here
// is acceptable.
v->as_convertable =
new gin::ConvertableToTraceFormatWrapper(std::move(value));
}
};

namespace electron {

namespace {
Expand Down

0 comments on commit 069c923

Please sign in to comment.