Formatting C++ code using ClangFormat.

This commit is contained in:
ali.ibrahim 2016-10-14 11:51:45 +02:00
parent 4347ce4a53
commit c0c9e3ac3d

View file

@ -94,8 +94,7 @@ class URLRequest : public mate::EventEmitter<URLRequest> {
public:
static mate::WrappableBase* New(mate::Arguments* args);
static void BuildPrototype(
v8::Isolate* isolate,
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype);
// Methods for reporting events into JavaScript.
@ -109,8 +108,7 @@ class URLRequest : public mate::EventEmitter<URLRequest> {
void OnResponseError(const std::string& error);
protected:
explicit URLRequest(v8::Isolate* isolate,
v8::Local<v8::Object> wrapper);
explicit URLRequest(v8::Isolate* isolate, v8::Local<v8::Object> wrapper);
~URLRequest() override;
private:
@ -118,10 +116,12 @@ class URLRequest : public mate::EventEmitter<URLRequest> {
class StateBase {
public:
void SetFlag(Flags flag);
protected:
explicit StateBase(Flags initialState);
bool operator==(Flags flag) const;
bool IsFlagSet(Flags flag) const;
private:
Flags state_;
};
@ -168,8 +168,7 @@ class URLRequest : public mate::EventEmitter<URLRequest> {
bool Finished() const;
bool Canceled() const;
bool Failed() const;
bool Write(scoped_refptr<const net::IOBufferWithSize> buffer,
bool is_last);
bool Write(scoped_refptr<const net::IOBufferWithSize> buffer, bool is_last);
void Cancel();
bool SetExtraHeader(const std::string& name, const std::string& value);
void RemoveExtraHeader(const std::string& name);
@ -182,8 +181,8 @@ class URLRequest : public mate::EventEmitter<URLRequest> {
uint32_t ResponseHttpVersionMinor() const;
template <typename... ArgTypes>
std::array<v8::Local<v8::Value>, sizeof...(ArgTypes)>
BuildArgsArray(ArgTypes... args) const;
std::array<v8::Local<v8::Value>, sizeof...(ArgTypes)> BuildArgsArray(
ArgTypes... args) const;
template <typename... ArgTypes>
void EmitRequestEvent(ArgTypes... args);
@ -204,15 +203,14 @@ class URLRequest : public mate::EventEmitter<URLRequest> {
scoped_refptr<net::HttpResponseHeaders> response_headers_;
base::WeakPtrFactory<URLRequest> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(URLRequest);
};
template <typename... ArgTypes>
std::array<v8::Local<v8::Value>, sizeof...(ArgTypes)>
URLRequest::BuildArgsArray(ArgTypes... args) const {
std::array<v8::Local<v8::Value>, sizeof...(ArgTypes)> result
= { { mate::ConvertToV8(isolate(), args)... } };
std::array<v8::Local<v8::Value>, sizeof...(ArgTypes)> result = {
{mate::ConvertToV8(isolate(), args)...}};
return result;
}