2016-08-19 11:47:32 +00:00
|
|
|
// Copyright (c) 2016 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef ATOM_RENDERER_ATOM_SANDBOXED_RENDERER_CLIENT_H_
|
|
|
|
#define ATOM_RENDERER_ATOM_SANDBOXED_RENDERER_CLIENT_H_
|
|
|
|
|
2018-09-13 00:25:56 +00:00
|
|
|
#include <memory>
|
2016-08-21 10:30:21 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2017-03-27 21:31:18 +00:00
|
|
|
#include "atom/renderer/renderer_client_base.h"
|
2018-08-21 18:05:45 +00:00
|
|
|
#include "base/process/process_metrics.h"
|
2016-08-19 11:47:32 +00:00
|
|
|
|
|
|
|
namespace atom {
|
|
|
|
|
2017-03-27 21:31:18 +00:00
|
|
|
class AtomSandboxedRendererClient : public RendererClientBase {
|
2016-08-19 11:47:32 +00:00
|
|
|
public:
|
|
|
|
AtomSandboxedRendererClient();
|
2018-04-17 23:03:51 +00:00
|
|
|
~AtomSandboxedRendererClient() override;
|
2016-08-19 11:47:32 +00:00
|
|
|
|
2018-08-21 18:05:45 +00:00
|
|
|
void InitializeBindings(v8::Local<v8::Object> binding,
|
|
|
|
v8::Local<v8::Context> context);
|
2017-02-20 13:59:39 +00:00
|
|
|
void InvokeIpcCallback(v8::Handle<v8::Context> context,
|
2017-03-29 19:29:52 +00:00
|
|
|
const std::string& callback_name,
|
2017-02-20 13:59:39 +00:00
|
|
|
std::vector<v8::Handle<v8::Value>> args);
|
2017-04-08 13:58:13 +00:00
|
|
|
// atom::RendererClientBase:
|
2018-04-18 01:44:10 +00:00
|
|
|
void DidCreateScriptContext(v8::Handle<v8::Context> context,
|
|
|
|
content::RenderFrame* render_frame) override;
|
|
|
|
void WillReleaseScriptContext(v8::Handle<v8::Context> context,
|
|
|
|
content::RenderFrame* render_frame) override;
|
2018-12-13 21:25:12 +00:00
|
|
|
void SetupMainWorldOverrides(v8::Handle<v8::Context> context,
|
|
|
|
content::RenderFrame* render_frame) override {}
|
2016-08-21 10:30:21 +00:00
|
|
|
// content::ContentRendererClient:
|
|
|
|
void RenderFrameCreated(content::RenderFrame*) override;
|
|
|
|
void RenderViewCreated(content::RenderView*) override;
|
|
|
|
|
2016-08-19 11:47:32 +00:00
|
|
|
private:
|
2018-08-21 18:05:45 +00:00
|
|
|
std::unique_ptr<base::ProcessMetrics> metrics_;
|
|
|
|
|
2016-08-19 11:47:32 +00:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(AtomSandboxedRendererClient);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace atom
|
|
|
|
|
|
|
|
#endif // ATOM_RENDERER_ATOM_SANDBOXED_RENDERER_CLIENT_H_
|