chromium/extensions/renderer/safe_builtins.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "extensions/renderer/safe_builtins.h"

#include "base/check.h"
#include "base/notreached.h"
#include "base/strings/stringprintf.h"
#include "extensions/renderer/script_context.h"
#include "extensions/renderer/v8_helpers.h"
#include "v8/include/v8-context.h"
#include "v8/include/v8-exception.h"
#include "v8/include/v8-extension.h"
#include "v8/include/v8-function.h"
#include "v8/include/v8-isolate.h"
#include "v8/include/v8-microtask-queue.h"
#include "v8/include/v8-object.h"
#include "v8/include/v8-primitive-object.h"
#include "v8/include/v8-primitive.h"
#include "v8/include/v8-template.h"

namespace extensions {

namespace {

const char kClassName[] =;

// Documentation for makeCallback in the JavaScript, out here to reduce the
// (very small) amount of effort that the v8 parser needs to do:
//
// Returns a new object with every function on |obj| configured to call()
// itself with the given arguments.
// E.g. given
//    var result = makeCallable(Function.prototype)
// |result| will be a object including 'bind' such that
//    result.bind(foo, 1, 2, 3);
// is equivalent to Function.prototype.bind.call(foo, 1, 2, 3), and so on.
// This is a convenient way to save functions that user scripts may clobber.
const char kScript[] =;

v8::Local<v8::Private> MakeKey(const char* name, v8::Isolate* isolate) {}

void SaveImpl(const char* name,
              v8::Local<v8::Value> value,
              v8::Local<v8::Context> context) {}

v8::Local<v8::Object> Load(const char* name, v8::Local<v8::Context> context) {}

class ExtensionImpl : public v8::Extension {};

}  // namespace

// static
std::unique_ptr<v8::Extension> SafeBuiltins::CreateV8Extension() {}

SafeBuiltins::SafeBuiltins(ScriptContext* context) :{}

SafeBuiltins::~SafeBuiltins() = default;

v8::Local<v8::Object> SafeBuiltins::GetArray() const {}

v8::Local<v8::Object> SafeBuiltins::GetFunction() const {}

v8::Local<v8::Object> SafeBuiltins::GetJSON() const {}

v8::Local<v8::Object> SafeBuiltins::GetObjekt() const {}

v8::Local<v8::Object> SafeBuiltins::GetRegExp() const {}

v8::Local<v8::Object> SafeBuiltins::GetString() const {}

v8::Local<v8::Object> SafeBuiltins::GetError() const {}

v8::Local<v8::Object> SafeBuiltins::GetPromise() const {}

}  //  namespace extensions