chore: add native_mate to lint:cpp (#18100)
This commit is contained in:
parent
d507ba68a7
commit
8785e9007c
14 changed files with 147 additions and 136 deletions
|
@ -2,8 +2,11 @@
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE.chromium file.
|
// found in the LICENSE.chromium file.
|
||||||
|
|
||||||
#ifndef NATIVE_MATE_ARGUMENTS_H_
|
#ifndef NATIVE_MATE_NATIVE_MATE_ARGUMENTS_H_
|
||||||
#define NATIVE_MATE_ARGUMENTS_H_
|
#define NATIVE_MATE_NATIVE_MATE_ARGUMENTS_H_
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
#include "native_mate/converter.h"
|
#include "native_mate/converter.h"
|
||||||
|
@ -88,4 +91,4 @@ class Arguments {
|
||||||
|
|
||||||
} // namespace mate
|
} // namespace mate
|
||||||
|
|
||||||
#endif // NATIVE_MATE_ARGUMENTS_H_
|
#endif // NATIVE_MATE_NATIVE_MATE_ARGUMENTS_H_
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE.chromium file.
|
// found in the LICENSE.chromium file.
|
||||||
|
|
||||||
#ifndef NATIVE_MATE_WRAPPABLE_CLASS_H_
|
#ifndef NATIVE_MATE_NATIVE_MATE_CONSTRUCTOR_H_
|
||||||
#define NATIVE_MATE_WRAPPABLE_CLASS_H_
|
#define NATIVE_MATE_NATIVE_MATE_CONSTRUCTOR_H_
|
||||||
|
|
||||||
#include "base/bind.h"
|
#include "base/bind.h"
|
||||||
#include "native_mate/function_template.h"
|
#include "native_mate/function_template.h"
|
||||||
|
@ -150,4 +150,4 @@ void InvokeNew(const base::Callback<Sig>& factory,
|
||||||
|
|
||||||
} // namespace mate
|
} // namespace mate
|
||||||
|
|
||||||
#endif // NATIVE_MATE_WRAPPABLE_CLASS_H_
|
#endif // NATIVE_MATE_NATIVE_MATE_CONSTRUCTOR_H_
|
||||||
|
|
|
@ -6,29 +6,12 @@
|
||||||
|
|
||||||
#include "v8/include/v8.h"
|
#include "v8/include/v8.h"
|
||||||
|
|
||||||
using v8::Array;
|
|
||||||
using v8::Boolean;
|
|
||||||
using v8::External;
|
|
||||||
using v8::Function;
|
|
||||||
using v8::Int32;
|
|
||||||
using v8::Integer;
|
|
||||||
using v8::Isolate;
|
|
||||||
using v8::Local;
|
|
||||||
using v8::Maybe;
|
|
||||||
using v8::MaybeLocal;
|
|
||||||
using v8::Number;
|
|
||||||
using v8::Object;
|
|
||||||
using v8::Promise;
|
|
||||||
using v8::String;
|
|
||||||
using v8::Uint32;
|
|
||||||
using v8::Value;
|
|
||||||
|
|
||||||
namespace mate {
|
namespace mate {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
template <typename T, typename U>
|
template <typename T, typename U>
|
||||||
bool FromMaybe(Maybe<T> maybe, U* out) {
|
bool FromMaybe(v8::Maybe<T> maybe, U* out) {
|
||||||
if (maybe.IsNothing())
|
if (maybe.IsNothing())
|
||||||
return false;
|
return false;
|
||||||
*out = static_cast<U>(maybe.FromJust());
|
*out = static_cast<U>(maybe.FromJust());
|
||||||
|
@ -37,64 +20,71 @@ bool FromMaybe(Maybe<T> maybe, U* out) {
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
Local<Value> Converter<bool>::ToV8(Isolate* isolate, bool val) {
|
v8::Local<v8::Value> Converter<bool>::ToV8(v8::Isolate* isolate, bool val) {
|
||||||
return v8::Boolean::New(isolate, val);
|
return v8::Boolean::New(isolate, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Converter<bool>::FromV8(Isolate* isolate, Local<Value> val, bool* out) {
|
bool Converter<bool>::FromV8(v8::Isolate* isolate,
|
||||||
|
v8::Local<v8::Value> val,
|
||||||
|
bool* out) {
|
||||||
if (!val->IsBoolean())
|
if (!val->IsBoolean())
|
||||||
return false;
|
return false;
|
||||||
*out = val.As<Boolean>()->Value();
|
*out = val.As<v8::Boolean>()->Value();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(OS_LINUX) && !defined(OS_FREEBSD)
|
#if !defined(OS_LINUX) && !defined(OS_FREEBSD)
|
||||||
Local<Value> Converter<unsigned long>::ToV8(Isolate* isolate,
|
v8::Local<v8::Value> Converter<unsigned long>::ToV8( // NOLINT(runtime/int)
|
||||||
unsigned long val) {
|
v8::Isolate* isolate,
|
||||||
|
unsigned long val) { // NOLINT(runtime/int)
|
||||||
return v8::Integer::New(isolate, val);
|
return v8::Integer::New(isolate, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Converter<unsigned long>::FromV8(Isolate* isolate,
|
bool Converter<unsigned long>::FromV8( // NOLINT(runtime/int)
|
||||||
Local<Value> val,
|
v8::Isolate* isolate,
|
||||||
unsigned long* out) {
|
v8::Local<v8::Value> val,
|
||||||
|
unsigned long* out) { // NOLINT(runtime/int)
|
||||||
if (!val->IsNumber())
|
if (!val->IsNumber())
|
||||||
return false;
|
return false;
|
||||||
return FromMaybe(val->IntegerValue(isolate->GetCurrentContext()), out);
|
return FromMaybe(val->IntegerValue(isolate->GetCurrentContext()), out);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Local<Value> Converter<int32_t>::ToV8(Isolate* isolate, int32_t val) {
|
v8::Local<v8::Value> Converter<int32_t>::ToV8(v8::Isolate* isolate,
|
||||||
|
int32_t val) {
|
||||||
return v8::Integer::New(isolate, val);
|
return v8::Integer::New(isolate, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Converter<int32_t>::FromV8(Isolate* isolate,
|
bool Converter<int32_t>::FromV8(v8::Isolate* isolate,
|
||||||
Local<Value> val,
|
v8::Local<v8::Value> val,
|
||||||
int32_t* out) {
|
int32_t* out) {
|
||||||
if (!val->IsInt32())
|
if (!val->IsInt32())
|
||||||
return false;
|
return false;
|
||||||
*out = val.As<Int32>()->Value();
|
*out = val.As<v8::Int32>()->Value();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Local<Value> Converter<uint32_t>::ToV8(Isolate* isolate, uint32_t val) {
|
v8::Local<v8::Value> Converter<uint32_t>::ToV8(v8::Isolate* isolate,
|
||||||
|
uint32_t val) {
|
||||||
return v8::Integer::NewFromUnsigned(isolate, val);
|
return v8::Integer::NewFromUnsigned(isolate, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Converter<uint32_t>::FromV8(Isolate* isolate,
|
bool Converter<uint32_t>::FromV8(v8::Isolate* isolate,
|
||||||
Local<Value> val,
|
v8::Local<v8::Value> val,
|
||||||
uint32_t* out) {
|
uint32_t* out) {
|
||||||
if (!val->IsUint32())
|
if (!val->IsUint32())
|
||||||
return false;
|
return false;
|
||||||
*out = val.As<Uint32>()->Value();
|
*out = val.As<v8::Uint32>()->Value();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Local<Value> Converter<int64_t>::ToV8(Isolate* isolate, int64_t val) {
|
v8::Local<v8::Value> Converter<int64_t>::ToV8(v8::Isolate* isolate,
|
||||||
|
int64_t val) {
|
||||||
return v8::Number::New(isolate, static_cast<double>(val));
|
return v8::Number::New(isolate, static_cast<double>(val));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Converter<int64_t>::FromV8(Isolate* isolate,
|
bool Converter<int64_t>::FromV8(v8::Isolate* isolate,
|
||||||
Local<Value> val,
|
v8::Local<v8::Value> val,
|
||||||
int64_t* out) {
|
int64_t* out) {
|
||||||
if (!val->IsNumber())
|
if (!val->IsNumber())
|
||||||
return false;
|
return false;
|
||||||
|
@ -103,154 +93,168 @@ bool Converter<int64_t>::FromV8(Isolate* isolate,
|
||||||
return FromMaybe(val->IntegerValue(isolate->GetCurrentContext()), out);
|
return FromMaybe(val->IntegerValue(isolate->GetCurrentContext()), out);
|
||||||
}
|
}
|
||||||
|
|
||||||
Local<Value> Converter<uint64_t>::ToV8(Isolate* isolate, uint64_t val) {
|
v8::Local<v8::Value> Converter<uint64_t>::ToV8(v8::Isolate* isolate,
|
||||||
|
uint64_t val) {
|
||||||
return v8::Number::New(isolate, static_cast<double>(val));
|
return v8::Number::New(isolate, static_cast<double>(val));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Converter<uint64_t>::FromV8(Isolate* isolate,
|
bool Converter<uint64_t>::FromV8(v8::Isolate* isolate,
|
||||||
Local<Value> val,
|
v8::Local<v8::Value> val,
|
||||||
uint64_t* out) {
|
uint64_t* out) {
|
||||||
if (!val->IsNumber())
|
if (!val->IsNumber())
|
||||||
return false;
|
return false;
|
||||||
return FromMaybe(val->IntegerValue(isolate->GetCurrentContext()), out);
|
return FromMaybe(val->IntegerValue(isolate->GetCurrentContext()), out);
|
||||||
}
|
}
|
||||||
|
|
||||||
Local<Value> Converter<float>::ToV8(Isolate* isolate, float val) {
|
v8::Local<v8::Value> Converter<float>::ToV8(v8::Isolate* isolate, float val) {
|
||||||
return v8::Number::New(isolate, val);
|
return v8::Number::New(isolate, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Converter<float>::FromV8(Isolate* isolate, Local<Value> val, float* out) {
|
bool Converter<float>::FromV8(v8::Isolate* isolate,
|
||||||
|
v8::Local<v8::Value> val,
|
||||||
|
float* out) {
|
||||||
if (!val->IsNumber())
|
if (!val->IsNumber())
|
||||||
return false;
|
return false;
|
||||||
*out = static_cast<float>(val.As<Number>()->Value());
|
*out = static_cast<float>(val.As<v8::Number>()->Value());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Local<Value> Converter<double>::ToV8(Isolate* isolate, double val) {
|
v8::Local<v8::Value> Converter<double>::ToV8(v8::Isolate* isolate, double val) {
|
||||||
return v8::Number::New(isolate, val);
|
return v8::Number::New(isolate, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Converter<double>::FromV8(Isolate* isolate,
|
bool Converter<double>::FromV8(v8::Isolate* isolate,
|
||||||
Local<Value> val,
|
v8::Local<v8::Value> val,
|
||||||
double* out) {
|
double* out) {
|
||||||
if (!val->IsNumber())
|
if (!val->IsNumber())
|
||||||
return false;
|
return false;
|
||||||
*out = val.As<Number>()->Value();
|
*out = val.As<v8::Number>()->Value();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Local<Value> Converter<const char*>::ToV8(Isolate* isolate, const char* val) {
|
v8::Local<v8::Value> Converter<const char*>::ToV8(v8::Isolate* isolate,
|
||||||
|
const char* val) {
|
||||||
return v8::String::NewFromUtf8(isolate, val, v8::NewStringType::kNormal)
|
return v8::String::NewFromUtf8(isolate, val, v8::NewStringType::kNormal)
|
||||||
.ToLocalChecked();
|
.ToLocalChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
Local<Value> Converter<base::StringPiece>::ToV8(Isolate* isolate,
|
v8::Local<v8::Value> Converter<base::StringPiece>::ToV8(
|
||||||
const base::StringPiece& val) {
|
v8::Isolate* isolate,
|
||||||
|
const base::StringPiece& val) {
|
||||||
return v8::String::NewFromUtf8(isolate, val.data(),
|
return v8::String::NewFromUtf8(isolate, val.data(),
|
||||||
v8::NewStringType::kNormal,
|
v8::NewStringType::kNormal,
|
||||||
static_cast<uint32_t>(val.length()))
|
static_cast<uint32_t>(val.length()))
|
||||||
.ToLocalChecked();
|
.ToLocalChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
Local<Value> Converter<std::string>::ToV8(Isolate* isolate,
|
v8::Local<v8::Value> Converter<std::string>::ToV8(v8::Isolate* isolate,
|
||||||
const std::string& val) {
|
const std::string& val) {
|
||||||
return Converter<base::StringPiece>::ToV8(isolate, val);
|
return Converter<base::StringPiece>::ToV8(isolate, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Converter<std::string>::FromV8(Isolate* isolate,
|
bool Converter<std::string>::FromV8(v8::Isolate* isolate,
|
||||||
Local<Value> val,
|
v8::Local<v8::Value> val,
|
||||||
std::string* out) {
|
std::string* out) {
|
||||||
if (!val->IsString())
|
if (!val->IsString())
|
||||||
return false;
|
return false;
|
||||||
Local<String> str = Local<String>::Cast(val);
|
v8::Local<v8::String> str = v8::Local<v8::String>::Cast(val);
|
||||||
int length = str->Utf8Length(isolate);
|
int length = str->Utf8Length(isolate);
|
||||||
out->resize(length);
|
out->resize(length);
|
||||||
str->WriteUtf8(isolate, &(*out)[0], length, NULL,
|
str->WriteUtf8(isolate, &(*out)[0], length, NULL,
|
||||||
String::NO_NULL_TERMINATION);
|
v8::String::NO_NULL_TERMINATION);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Local<Value> Converter<Local<Function>>::ToV8(Isolate* isolate,
|
v8::Local<v8::Value> Converter<v8::Local<v8::Function>>::ToV8(
|
||||||
Local<Function> val) {
|
v8::Isolate* isolate,
|
||||||
|
v8::Local<v8::Function> val) {
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Converter<Local<Function>>::FromV8(Isolate* isolate,
|
bool Converter<v8::Local<v8::Function>>::FromV8(v8::Isolate* isolate,
|
||||||
Local<Value> val,
|
v8::Local<v8::Value> val,
|
||||||
Local<Function>* out) {
|
v8::Local<v8::Function>* out) {
|
||||||
if (!val->IsFunction())
|
if (!val->IsFunction())
|
||||||
return false;
|
return false;
|
||||||
*out = Local<Function>::Cast(val);
|
*out = v8::Local<v8::Function>::Cast(val);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Local<Value> Converter<Local<Object>>::ToV8(Isolate* isolate,
|
v8::Local<v8::Value> Converter<v8::Local<v8::Object>>::ToV8(
|
||||||
Local<Object> val) {
|
v8::Isolate* isolate,
|
||||||
|
v8::Local<v8::Object> val) {
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Converter<Local<Object>>::FromV8(Isolate* isolate,
|
bool Converter<v8::Local<v8::Object>>::FromV8(v8::Isolate* isolate,
|
||||||
Local<Value> val,
|
v8::Local<v8::Value> val,
|
||||||
Local<Object>* out) {
|
v8::Local<v8::Object>* out) {
|
||||||
if (!val->IsObject())
|
if (!val->IsObject())
|
||||||
return false;
|
return false;
|
||||||
*out = Local<Object>::Cast(val);
|
*out = v8::Local<v8::Object>::Cast(val);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Local<Value> Converter<Local<String>>::ToV8(Isolate* isolate,
|
v8::Local<v8::Value> Converter<v8::Local<v8::String>>::ToV8(
|
||||||
Local<String> val) {
|
v8::Isolate* isolate,
|
||||||
|
v8::Local<v8::String> val) {
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Converter<Local<String>>::FromV8(Isolate* isolate,
|
bool Converter<v8::Local<v8::String>>::FromV8(v8::Isolate* isolate,
|
||||||
Local<Value> val,
|
v8::Local<v8::Value> val,
|
||||||
Local<String>* out) {
|
v8::Local<v8::String>* out) {
|
||||||
if (!val->IsString())
|
if (!val->IsString())
|
||||||
return false;
|
return false;
|
||||||
*out = Local<String>::Cast(val);
|
*out = v8::Local<v8::String>::Cast(val);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Local<Value> Converter<Local<External>>::ToV8(Isolate* isolate,
|
v8::Local<v8::Value> Converter<v8::Local<v8::External>>::ToV8(
|
||||||
Local<External> val) {
|
v8::Isolate* isolate,
|
||||||
|
v8::Local<v8::External> val) {
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Converter<Local<External>>::FromV8(Isolate* isolate,
|
bool Converter<v8::Local<v8::External>>::FromV8(v8::Isolate* isolate,
|
||||||
v8::Local<Value> val,
|
v8::Local<v8::Value> val,
|
||||||
Local<External>* out) {
|
v8::Local<v8::External>* out) {
|
||||||
if (!val->IsExternal())
|
if (!val->IsExternal())
|
||||||
return false;
|
return false;
|
||||||
*out = Local<External>::Cast(val);
|
*out = v8::Local<v8::External>::Cast(val);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Local<Value> Converter<Local<Array>>::ToV8(Isolate* isolate, Local<Array> val) {
|
v8::Local<v8::Value> Converter<v8::Local<v8::Array>>::ToV8(
|
||||||
|
v8::Isolate* isolate,
|
||||||
|
v8::Local<v8::Array> val) {
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Converter<Local<Array>>::FromV8(Isolate* isolate,
|
bool Converter<v8::Local<v8::Array>>::FromV8(v8::Isolate* isolate,
|
||||||
v8::Local<Value> val,
|
v8::Local<v8::Value> val,
|
||||||
Local<Array>* out) {
|
v8::Local<v8::Array>* out) {
|
||||||
if (!val->IsArray())
|
if (!val->IsArray())
|
||||||
return false;
|
return false;
|
||||||
*out = Local<Array>::Cast(val);
|
*out = v8::Local<v8::Array>::Cast(val);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Local<Value> Converter<Local<Value>>::ToV8(Isolate* isolate, Local<Value> val) {
|
v8::Local<v8::Value> Converter<v8::Local<v8::Value>>::ToV8(
|
||||||
|
v8::Isolate* isolate,
|
||||||
|
v8::Local<v8::Value> val) {
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
Local<Promise> Converter<Local<Promise>>::ToV8(Isolate* isolate,
|
v8::Local<v8::Promise> Converter<v8::Local<v8::Promise>>::ToV8(
|
||||||
Local<Promise> val) {
|
v8::Isolate* isolate,
|
||||||
|
v8::Local<v8::Promise> val) {
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Converter<Local<Value>>::FromV8(Isolate* isolate,
|
bool Converter<v8::Local<v8::Value>>::FromV8(v8::Isolate* isolate,
|
||||||
Local<Value> val,
|
v8::Local<v8::Value> val,
|
||||||
Local<Value>* out) {
|
v8::Local<v8::Value>* out) {
|
||||||
*out = val;
|
*out = val;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,13 +2,14 @@
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE.chromium file.
|
// found in the LICENSE.chromium file.
|
||||||
|
|
||||||
#ifndef NATIVE_MATE_CONVERTER_H_
|
#ifndef NATIVE_MATE_NATIVE_MATE_CONVERTER_H_
|
||||||
#define NATIVE_MATE_CONVERTER_H_
|
#define NATIVE_MATE_NATIVE_MATE_CONVERTER_H_
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/strings/string_piece.h"
|
#include "base/strings/string_piece.h"
|
||||||
|
@ -56,11 +57,12 @@ struct Converter<bool> {
|
||||||
|
|
||||||
#if !defined(OS_LINUX) && !defined(OS_FREEBSD)
|
#if !defined(OS_LINUX) && !defined(OS_FREEBSD)
|
||||||
template <>
|
template <>
|
||||||
struct Converter<unsigned long> {
|
struct Converter<unsigned long> { // NOLINT(runtime/int)
|
||||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, unsigned long val);
|
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
||||||
|
unsigned long val); // NOLINT(runtime/int)
|
||||||
static bool FromV8(v8::Isolate* isolate,
|
static bool FromV8(v8::Isolate* isolate,
|
||||||
v8::Local<v8::Value> val,
|
v8::Local<v8::Value> val,
|
||||||
unsigned long* out);
|
unsigned long* out); // NOLINT(runtime/int)
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -347,4 +349,4 @@ inline v8::Local<v8::String> StringToV8(v8::Isolate* isolate,
|
||||||
|
|
||||||
} // namespace mate
|
} // namespace mate
|
||||||
|
|
||||||
#endif // NATIVE_MATE_CONVERTER_H_
|
#endif // NATIVE_MATE_NATIVE_MATE_CONVERTER_H_
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE.chromium file.
|
// found in the LICENSE.chromium file.
|
||||||
|
|
||||||
#ifndef NATIVE_MATE_DICTIONARY_H_
|
#ifndef NATIVE_MATE_NATIVE_MATE_DICTIONARY_H_
|
||||||
#define NATIVE_MATE_DICTIONARY_H_
|
#define NATIVE_MATE_NATIVE_MATE_DICTIONARY_H_
|
||||||
|
|
||||||
#include "native_mate/converter.h"
|
#include "native_mate/converter.h"
|
||||||
#include "native_mate/object_template_builder.h"
|
#include "native_mate/object_template_builder.h"
|
||||||
|
@ -141,4 +141,4 @@ struct Converter<Dictionary> {
|
||||||
|
|
||||||
} // namespace mate
|
} // namespace mate
|
||||||
|
|
||||||
#endif // NATIVE_MATE_DICTIONARY_H_
|
#endif // NATIVE_MATE_NATIVE_MATE_DICTIONARY_H_
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE.chromium file.
|
// found in the LICENSE.chromium file.
|
||||||
|
|
||||||
#ifndef NATIVE_MATE_FUNCTION_TEMPLATE_H_
|
#ifndef NATIVE_MATE_NATIVE_MATE_FUNCTION_TEMPLATE_H_
|
||||||
#define NATIVE_MATE_FUNCTION_TEMPLATE_H_
|
#define NATIVE_MATE_NATIVE_MATE_FUNCTION_TEMPLATE_H_
|
||||||
|
|
||||||
#include "base/callback.h"
|
#include "base/callback.h"
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
|
@ -285,4 +285,4 @@ void CreateFunctionHandler(v8::Isolate* isolate,
|
||||||
|
|
||||||
} // namespace mate
|
} // namespace mate
|
||||||
|
|
||||||
#endif // NATIVE_MATE_FUNCTION_TEMPLATE_H_
|
#endif // NATIVE_MATE_NATIVE_MATE_FUNCTION_TEMPLATE_H_
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE.chromium file.
|
// found in the LICENSE.chromium file.
|
||||||
|
|
||||||
#ifndef NATIVE_MATE_HANDLE_H_
|
#ifndef NATIVE_MATE_NATIVE_MATE_HANDLE_H_
|
||||||
#define NATIVE_MATE_HANDLE_H_
|
#define NATIVE_MATE_NATIVE_MATE_HANDLE_H_
|
||||||
|
|
||||||
#include "native_mate/converter.h"
|
#include "native_mate/converter.h"
|
||||||
|
|
||||||
|
@ -69,4 +69,4 @@ mate::Handle<T> CreateHandle(v8::Isolate* isolate, T* object) {
|
||||||
|
|
||||||
} // namespace mate
|
} // namespace mate
|
||||||
|
|
||||||
#endif // NATIVE_MATE_HANDLE_H_
|
#endif // NATIVE_MATE_NATIVE_MATE_HANDLE_H_
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE.chromium file.
|
// found in the LICENSE.chromium file.
|
||||||
|
|
||||||
#ifndef NATIVE_MATE_OBJECT_TEMPLATE_BUILDER_H_
|
#ifndef NATIVE_MATE_NATIVE_MATE_OBJECT_TEMPLATE_BUILDER_H_
|
||||||
#define NATIVE_MATE_OBJECT_TEMPLATE_BUILDER_H_
|
#define NATIVE_MATE_NATIVE_MATE_OBJECT_TEMPLATE_BUILDER_H_
|
||||||
|
|
||||||
#include "base/bind.h"
|
#include "base/bind.h"
|
||||||
#include "base/callback.h"
|
#include "base/callback.h"
|
||||||
|
@ -14,8 +14,6 @@
|
||||||
|
|
||||||
namespace mate {
|
namespace mate {
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
// Base template - used only for non-member function pointers. Other types
|
// Base template - used only for non-member function pointers. Other types
|
||||||
// either go to one of the below specializations, or go here and fail to compile
|
// either go to one of the below specializations, or go here and fail to compile
|
||||||
// because of base::Bind().
|
// because of base::Bind().
|
||||||
|
@ -62,8 +60,6 @@ struct CallbackTraits<v8::Local<v8::FunctionTemplate>> {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
// ObjectTemplateBuilder provides a handy interface to creating
|
// ObjectTemplateBuilder provides a handy interface to creating
|
||||||
// v8::ObjectTemplate instances with various sorts of properties.
|
// v8::ObjectTemplate instances with various sorts of properties.
|
||||||
class ObjectTemplateBuilder {
|
class ObjectTemplateBuilder {
|
||||||
|
@ -124,4 +120,4 @@ class ObjectTemplateBuilder {
|
||||||
|
|
||||||
} // namespace mate
|
} // namespace mate
|
||||||
|
|
||||||
#endif // NATIVE_MATE_OBJECT_TEMPLATE_BUILDER_H_
|
#endif // NATIVE_MATE_NATIVE_MATE_OBJECT_TEMPLATE_BUILDER_H_
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
// Use of this source code is governed by MIT license that can be found in the
|
// Use of this source code is governed by MIT license that can be found in the
|
||||||
// LICENSE file.
|
// LICENSE file.
|
||||||
|
|
||||||
#ifndef NATIVE_MATE_PERSISTENT_DICTIONARY_H_
|
#ifndef NATIVE_MATE_NATIVE_MATE_PERSISTENT_DICTIONARY_H_
|
||||||
#define NATIVE_MATE_PERSISTENT_DICTIONARY_H_
|
#define NATIVE_MATE_NATIVE_MATE_PERSISTENT_DICTIONARY_H_
|
||||||
|
|
||||||
#include "native_mate/dictionary.h"
|
#include "native_mate/dictionary.h"
|
||||||
#include "native_mate/scoped_persistent.h"
|
#include "native_mate/scoped_persistent.h"
|
||||||
|
@ -34,4 +34,4 @@ struct Converter<PersistentDictionary> {
|
||||||
|
|
||||||
} // namespace mate
|
} // namespace mate
|
||||||
|
|
||||||
#endif // NATIVE_MATE_PERSISTENT_DICTIONARY_H_
|
#endif // NATIVE_MATE_NATIVE_MATE_PERSISTENT_DICTIONARY_H_
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
// Use of this source code is governed by the MIT license that can be
|
// Use of this source code is governed by the MIT license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#ifndef NATIVE_MATE_PROMISE_H_
|
#ifndef NATIVE_MATE_NATIVE_MATE_PROMISE_H_
|
||||||
#define NATIVE_MATE_PROMISE_H_
|
#define NATIVE_MATE_NATIVE_MATE_PROMISE_H_
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "native_mate/converter.h"
|
#include "native_mate/converter.h"
|
||||||
|
|
||||||
|
@ -12,7 +14,7 @@ namespace mate {
|
||||||
class Promise {
|
class Promise {
|
||||||
public:
|
public:
|
||||||
Promise();
|
Promise();
|
||||||
Promise(v8::Isolate* isolate);
|
explicit Promise(v8::Isolate* isolate);
|
||||||
virtual ~Promise();
|
virtual ~Promise();
|
||||||
|
|
||||||
static Promise Create(v8::Isolate* isolate);
|
static Promise Create(v8::Isolate* isolate);
|
||||||
|
@ -53,4 +55,4 @@ struct Converter<Promise> {
|
||||||
|
|
||||||
} // namespace mate
|
} // namespace mate
|
||||||
|
|
||||||
#endif // NATIVE_MATE_PROMISE_H_
|
#endif // NATIVE_MATE_NATIVE_MATE_PROMISE_H_
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
// Use of this source code is governed by MIT license that can be found in the
|
// Use of this source code is governed by MIT license that can be found in the
|
||||||
// LICENSE file.
|
// LICENSE file.
|
||||||
|
|
||||||
#ifndef NATIVE_MATE_SCOPED_PERSISTENT_H_
|
#ifndef NATIVE_MATE_NATIVE_MATE_SCOPED_PERSISTENT_H_
|
||||||
#define NATIVE_MATE_SCOPED_PERSISTENT_H_
|
#define NATIVE_MATE_NATIVE_MATE_SCOPED_PERSISTENT_H_
|
||||||
|
|
||||||
#include "base/memory/ref_counted.h"
|
#include "base/memory/ref_counted.h"
|
||||||
#include "native_mate/converter.h"
|
#include "native_mate/converter.h"
|
||||||
|
@ -99,4 +99,4 @@ struct Converter<ScopedPersistent<T>> {
|
||||||
|
|
||||||
} // namespace mate
|
} // namespace mate
|
||||||
|
|
||||||
#endif // NATIVE_MATE_SCOPED_PERSISTENT_H_
|
#endif // NATIVE_MATE_NATIVE_MATE_SCOPED_PERSISTENT_H_
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE.chromium file.
|
// found in the LICENSE.chromium file.
|
||||||
|
|
||||||
#ifndef NATIVE_MATE_WRAPPABLE_H_
|
#ifndef NATIVE_MATE_NATIVE_MATE_WRAPPABLE_H_
|
||||||
#define NATIVE_MATE_WRAPPABLE_H_
|
#define NATIVE_MATE_NATIVE_MATE_WRAPPABLE_H_
|
||||||
|
|
||||||
#include "base/bind.h"
|
#include "base/bind.h"
|
||||||
#include "gin/per_isolate_data.h"
|
#include "gin/per_isolate_data.h"
|
||||||
|
@ -97,4 +97,4 @@ struct Converter<T*,
|
||||||
|
|
||||||
} // namespace mate
|
} // namespace mate
|
||||||
|
|
||||||
#endif // NATIVE_MATE_WRAPPABLE_H_
|
#endif // NATIVE_MATE_NATIVE_MATE_WRAPPABLE_H_
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#ifndef NATIVE_MATE_WRAPPABLE_BASE_H_
|
// Copyright 2013 The Chromium Authors. All rights reserved.
|
||||||
#define NATIVE_MATE_WRAPPABLE_BASE_H_
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
|
// found in the LICENSE.chromium file.
|
||||||
|
|
||||||
|
#ifndef NATIVE_MATE_NATIVE_MATE_WRAPPABLE_BASE_H_
|
||||||
|
#define NATIVE_MATE_NATIVE_MATE_WRAPPABLE_BASE_H_
|
||||||
|
|
||||||
namespace mate {
|
namespace mate {
|
||||||
|
|
||||||
|
@ -59,4 +63,4 @@ class WrappableBase {
|
||||||
|
|
||||||
} // namespace mate
|
} // namespace mate
|
||||||
|
|
||||||
#endif // NATIVE_MATE_WRAPPABLE_BASE_H_
|
#endif // NATIVE_MATE_NATIVE_MATE_WRAPPABLE_BASE_H_
|
||||||
|
|
|
@ -43,7 +43,7 @@ function spawnAndCheckExitCode (cmd, args, opts) {
|
||||||
|
|
||||||
const LINTERS = [ {
|
const LINTERS = [ {
|
||||||
key: 'c++',
|
key: 'c++',
|
||||||
roots: ['atom'],
|
roots: ['atom', 'native_mate'],
|
||||||
test: filename => filename.endsWith('.cc') || filename.endsWith('.h'),
|
test: filename => filename.endsWith('.cc') || filename.endsWith('.h'),
|
||||||
run: (opts, filenames) => {
|
run: (opts, filenames) => {
|
||||||
if (opts.fix) {
|
if (opts.fix) {
|
||||||
|
|
Loading…
Reference in a new issue