Merge pull request #8956 from electron/expose-crash-reporter-to-sandbox
Expose crash reporter to sandbox
This commit is contained in:
commit
6a2cdcf32f
10 changed files with 114 additions and 83 deletions
|
@ -115,7 +115,7 @@ class AtomRenderFrameObserver : public content::RenderFrameObserver {
|
|||
// an argument.
|
||||
std::string bundle(node::isolated_bundle_data,
|
||||
node::isolated_bundle_data + sizeof(node::isolated_bundle_data));
|
||||
std::string wrapper = "(function (binding) {\n" + bundle + "\n})";
|
||||
std::string wrapper = "(function (binding, require) {\n" + bundle + "\n})";
|
||||
auto script = v8::Script::Compile(
|
||||
mate::ConvertToV8(isolate, wrapper)->ToString());
|
||||
auto func = v8::Handle<v8::Function>::Cast(
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "atom_natives.h" // NOLINT: This file is generated with js2c
|
||||
|
||||
#include "atom/common/api/api_messages.h"
|
||||
#include "atom/common/api/atom_bindings.h"
|
||||
#include "atom/common/native_mate_converters/string16_converter.h"
|
||||
#include "atom/common/native_mate_converters/v8_value_converter.h"
|
||||
#include "atom/common/native_mate_converters/value_converter.h"
|
||||
|
@ -85,6 +86,7 @@ void InitializeBindings(v8::Local<v8::Object> binding,
|
|||
auto isolate = context->GetIsolate();
|
||||
mate::Dictionary b(isolate, binding);
|
||||
b.SetMethod("get", GetBinding);
|
||||
b.SetMethod("crash", AtomBindings::Crash);
|
||||
}
|
||||
|
||||
class AtomSandboxedRenderFrameObserver : public content::RenderFrameObserver {
|
||||
|
@ -204,7 +206,7 @@ void AtomSandboxedRendererClient::DidCreateScriptContext(
|
|||
std::string preload_bundle_native(node::preload_bundle_data,
|
||||
node::preload_bundle_data + sizeof(node::preload_bundle_data));
|
||||
std::stringstream ss;
|
||||
ss << "(function(binding, preloadPath) {\n";
|
||||
ss << "(function(binding, preloadPath, require) {\n";
|
||||
ss << preload_bundle_native << "\n";
|
||||
ss << "})";
|
||||
std::string preload_wrapper = ss.str();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue