chromium/third_party/blink/renderer/platform/heap/thread_state.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/platform/heap/thread_state.h"

#include <fstream>
#include <iostream>

#include "base/functional/callback.h"
#include "base/notreached.h"
#include "gin/public/v8_platform.h"
#include "third_party/blink/renderer/platform/bindings/dom_data_store.h"
#include "third_party/blink/renderer/platform/bindings/dom_wrapper_world.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/bindings/wrapper_type_info.h"
#include "third_party/blink/renderer/platform/heap/custom_spaces.h"
#include "third_party/blink/renderer/platform/heap/thread_state_storage.h"
#include "third_party/blink/renderer/platform/wtf/hash_set.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
#include "v8/include/cppgc/heap-consistency.h"
#include "v8/include/v8-cppgc.h"
#include "v8/include/v8-embedder-heap.h"
#include "v8/include/v8-isolate.h"
#include "v8/include/v8-object.h"
#include "v8/include/v8-profiler.h"
#include "v8/include/v8-traced-handle.h"

namespace blink {

namespace {

// Handler allowing for dropping V8 wrapper objects that can be recreated
// lazily.
class BlinkRootsHandler final : public v8::EmbedderRootsHandler {};

}  // namespace

// static
ThreadState* ThreadState::AttachMainThread() {}

// static
ThreadState* ThreadState::AttachMainThreadForTesting(v8::Platform* platform) {}

// static
ThreadState* ThreadState::AttachCurrentThread() {}

// static
ThreadState* ThreadState::AttachCurrentThreadForTesting(
    v8::Platform* platform) {}

// static
void ThreadState::DetachCurrentThread() {}

void ThreadState::AttachToIsolate(v8::Isolate* isolate,
                                  V8BuildEmbedderGraphCallback) {}

void ThreadState::DetachFromIsolate() {}

ThreadState::ThreadState(v8::Platform* platform)
    :{}

ThreadState::~ThreadState() {}

void ThreadState::CollectAllGarbageForTesting(StackState stack_state) {}

void ThreadState::CollectGarbageInYoungGenerationForTesting(
    StackState stack_state) {}

namespace {

class CustomSpaceStatisticsReceiverImpl final
    : public v8::CustomSpaceStatisticsReceiver {};

}  // anonymous namespace

void ThreadState::CollectNodeAndCssStatistics(
    base::OnceCallback<void(size_t allocated_node_bytes,
                            size_t allocated_css_bytes)> callback) {}

void ThreadState::EnableDetachedGarbageCollectionsForTesting() {}

bool ThreadState::IsIncrementalMarking() {}

namespace {

class BufferedStream final : public v8::OutputStream {};

}  // namespace

void ThreadState::TakeHeapSnapshotForTesting(const char* filename) const {}

bool ThreadState::IsTakingHeapSnapshot() const {}

const char* ThreadState::CopyNameForHeapSnapshot(const char* name) const {}

}  // namespace blink