2585e6d5fa
* chore: bump chromium in DEPS to 93.0.4562.0 * chore: update patches * [base] Made Value::Take{Dict,List}() rvalue ref-qualified. https://chromium-review.googlesource.com/c/chromium/src/+/2988105 * Revert "Reland "Roll src/buildtools/third_party/libc++/trunk/ 8fa879467..79a2e924d (426 commits)"" https://chromium-review.googlesource.com/c/chromium/src/+/2995482 This reverts commit 9691d6c265f010791c37d374248559969980ec65 and 797723ec838709ddeba0c104e30727ee0b7ac8ca * Pass gfx::Insets to GetHTComponentForFrame https://chromium-review.googlesource.com/c/chromium/src/+/2984243 * chore: bump chromium in DEPS to 93.0.4563.0 * [Clipboard API] Clipboard Custom Formats implementation Part 2. https://chromium-review.googlesource.com/c/chromium/src/+/2967649 * chore: update patches * chore: bump chromium in DEPS to 93.0.4564.0 * chore: bump chromium in DEPS to 93.0.4565.0 * chore: update patches * Prevent use of base::NoDestructor for trivially-destructible types https://chromium-review.googlesource.com/c/chromium/src/+/2998672 * chore: update patches * fixup! [Clipboard API] Clipboard Custom Formats implementation Part 2. * chore: bump chromium in DEPS to 93.0.4566.0 * chore: update patches * chore: add missing header * ci: do not run clipboard tests on WOA Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
47 lines
1.3 KiB
C++
47 lines
1.3 KiB
C++
// Copyright (c) 2020 Slack Technologies, Inc.
|
|
// Use of this source code is governed by the MIT license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef SHELL_RENDERER_API_CONTEXT_BRIDGE_OBJECT_CACHE_H_
|
|
#define SHELL_RENDERER_API_CONTEXT_BRIDGE_OBJECT_CACHE_H_
|
|
|
|
#include <forward_list>
|
|
#include <unordered_map>
|
|
#include <utility>
|
|
|
|
#include "base/containers/linked_list.h"
|
|
#include "content/public/renderer/render_frame.h"
|
|
#include "content/public/renderer/render_frame_observer.h"
|
|
#include "shell/renderer/electron_render_frame_observer.h"
|
|
#include "third_party/blink/public/web/web_local_frame.h"
|
|
|
|
namespace electron {
|
|
|
|
namespace api {
|
|
|
|
namespace context_bridge {
|
|
|
|
using ObjectCachePair = std::pair<v8::Local<v8::Value>, v8::Local<v8::Value>>;
|
|
|
|
class ObjectCache final {
|
|
public:
|
|
ObjectCache();
|
|
~ObjectCache();
|
|
|
|
void CacheProxiedObject(v8::Local<v8::Value> from,
|
|
v8::Local<v8::Value> proxy_value);
|
|
v8::MaybeLocal<v8::Value> GetCachedProxiedObject(
|
|
v8::Local<v8::Value> from) const;
|
|
|
|
private:
|
|
// object_identity ==> [from_value, proxy_value]
|
|
std::unordered_map<int, std::forward_list<ObjectCachePair>> proxy_map_;
|
|
};
|
|
|
|
} // namespace context_bridge
|
|
|
|
} // namespace api
|
|
|
|
} // namespace electron
|
|
|
|
#endif // SHELL_RENDERER_API_CONTEXT_BRIDGE_OBJECT_CACHE_H_
|