代码拉取完成,页面将自动刷新
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PDF_POST_MESSAGE_SENDER_H_
#define PDF_POST_MESSAGE_SENDER_H_
#include <memory>
namespace base {
class Value;
} // namespace base
namespace blink {
class WebPluginContainer;
} // namespace blink
namespace content {
class V8ValueConverter;
} // namespace content
namespace v8 {
class Isolate;
} // namespace v8
namespace chrome_pdf {
// Manages messages sent from the plugin to its embedder.
class PostMessageSender final {
public:
PostMessageSender();
PostMessageSender(const PostMessageSender&) = delete;
PostMessageSender& operator=(const PostMessageSender&) = delete;
~PostMessageSender();
// Enqueues a "message" event carrying `message` to the plugin embedder.
// Nothing is enqueued if `container_` is null.
void Post(base::Value message);
// Sets the plugin container that enqueues the messages. This method should be
// called by the owning plugin whenever its container is set or unset to
// mirror the initialized lifetime of the plugin.
void set_container(blink::WebPluginContainer* container) {
container_ = container;
}
private:
std::unique_ptr<content::V8ValueConverter> v8_value_converter_;
v8::Isolate* isolate_;
blink::WebPluginContainer* container_ = nullptr;
};
} // namespace chrome_pdf
#endif // PDF_POST_MESSAGE_SENDER_H_
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。