// Copyright 2015 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef EXTENSIONS_RENDERER_GC_CALLBACK_H_ #define EXTENSIONS_RENDERER_GC_CALLBACK_H_ #include "base/functional/callback.h" #include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" #include "base/memory/weak_ptr.h" #include "base/task/single_thread_task_runner.h" #include "v8/include/v8-forward.h" #include "v8/include/v8-persistent-handle.h" namespace extensions { class ScriptContext; // Runs |callback| when v8 garbage collects |object|, or |fallback| if // |context| is invalidated first. Exactly one of |callback| or |fallback| will // be called, after which it deletes itself. // This object manages its own lifetime. // TODO(devlin): Cleanup. "callback" and "fallback" are odd names here, and // we should use OnceCallbacks. class GCCallback { … }; } // namespace extensions #endif // EXTENSIONS_RENDERER_GC_CALLBACK_H_