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