11cb0ef41Sopenharmony_ci// Copyright 2020 the V8 project authors. All rights reserved.
21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be
31cb0ef41Sopenharmony_ci// found in the LICENSE file.
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ci#ifndef V8_TOOLS_V8WINDBG_SRC_LOCAL_VARIABLES_H_
61cb0ef41Sopenharmony_ci#define V8_TOOLS_V8WINDBG_SRC_LOCAL_VARIABLES_H_
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ci#include <comutil.h>
91cb0ef41Sopenharmony_ci#include <wrl/implements.h>
101cb0ef41Sopenharmony_ci
111cb0ef41Sopenharmony_ci#include "tools/v8windbg/base/dbgext.h"
121cb0ef41Sopenharmony_ci
131cb0ef41Sopenharmony_ci// An implementation of the property accessor for the "LocalVariables" or
141cb0ef41Sopenharmony_ci// "Parameters" property on Debugger.Models.StackFrame. This allows us to modify
151cb0ef41Sopenharmony_ci// the variables shown in each frame.
161cb0ef41Sopenharmony_ciclass V8LocalVariables
171cb0ef41Sopenharmony_ci    : public WRL::RuntimeClass<
181cb0ef41Sopenharmony_ci          WRL::RuntimeClassFlags<WRL::RuntimeClassType::ClassicCom>,
191cb0ef41Sopenharmony_ci          IModelPropertyAccessor> {
201cb0ef41Sopenharmony_ci public:
211cb0ef41Sopenharmony_ci  V8LocalVariables(WRL::ComPtr<IModelPropertyAccessor> original,
221cb0ef41Sopenharmony_ci                   bool is_parameters);
231cb0ef41Sopenharmony_ci  ~V8LocalVariables() override;
241cb0ef41Sopenharmony_ci
251cb0ef41Sopenharmony_ci  IFACEMETHOD(GetValue)
261cb0ef41Sopenharmony_ci  (PCWSTR key, IModelObject* context, IModelObject** value);
271cb0ef41Sopenharmony_ci  IFACEMETHOD(SetValue)(PCWSTR key, IModelObject* context, IModelObject* value);
281cb0ef41Sopenharmony_ci
291cb0ef41Sopenharmony_ci private:
301cb0ef41Sopenharmony_ci  // The built-in accessor which we are overriding.
311cb0ef41Sopenharmony_ci  WRL::ComPtr<IModelPropertyAccessor> original_;
321cb0ef41Sopenharmony_ci  // Whether this is for Parameters rather than LocalVariables.
331cb0ef41Sopenharmony_ci  bool is_parameters_;
341cb0ef41Sopenharmony_ci};
351cb0ef41Sopenharmony_ci
361cb0ef41Sopenharmony_ci#endif  // V8_TOOLS_V8WINDBG_SRC_LOCAL_VARIABLES_H_
37