clang-format atom files
This commit is contained in:
parent
717f55b012
commit
53bdf22c85
128 changed files with 771 additions and 753 deletions
|
@ -68,6 +68,6 @@ class AtomCertVerifier : public net::CertVerifier {
|
|||
DISALLOW_COPY_AND_ASSIGN(AtomCertVerifier);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace atom
|
||||
|
||||
#endif // ATOM_BROWSER_NET_ATOM_CERT_VERIFIER_H_
|
||||
|
|
|
@ -95,11 +95,11 @@ class AtomNetworkDelegate : public brightray::NetworkDelegate {
|
|||
private:
|
||||
void OnErrorOccurred(net::URLRequest* request, bool started);
|
||||
|
||||
template<typename...Args>
|
||||
template <typename... Args>
|
||||
void HandleSimpleEvent(SimpleEvent type,
|
||||
net::URLRequest* request,
|
||||
Args... args);
|
||||
template<typename Out, typename... Args>
|
||||
template <typename Out, typename... Args>
|
||||
int HandleResponseEvent(ResponseEvent type,
|
||||
net::URLRequest* request,
|
||||
const net::CompletionCallback& callback,
|
||||
|
@ -107,12 +107,14 @@ class AtomNetworkDelegate : public brightray::NetworkDelegate {
|
|||
Args... args);
|
||||
|
||||
// Deal with the results of Listener.
|
||||
template<typename T>
|
||||
void OnListenerResultInIO(
|
||||
uint64_t id, T out, std::unique_ptr<base::DictionaryValue> response);
|
||||
template<typename T>
|
||||
void OnListenerResultInUI(
|
||||
uint64_t id, T out, const base::DictionaryValue& response);
|
||||
template <typename T>
|
||||
void OnListenerResultInIO(uint64_t id,
|
||||
T out,
|
||||
std::unique_ptr<base::DictionaryValue> response);
|
||||
template <typename T>
|
||||
void OnListenerResultInUI(uint64_t id,
|
||||
T out,
|
||||
const base::DictionaryValue& response);
|
||||
|
||||
std::map<SimpleEvent, SimpleListenerInfo> simple_listeners_;
|
||||
std::map<ResponseEvent, ResponseListenerInfo> response_listeners_;
|
||||
|
@ -124,6 +126,6 @@ class AtomNetworkDelegate : public brightray::NetworkDelegate {
|
|||
DISALLOW_COPY_AND_ASSIGN(AtomNetworkDelegate);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace atom
|
||||
|
||||
#endif // ATOM_BROWSER_NET_ATOM_NETWORK_DELEGATE_H_
|
||||
|
|
|
@ -30,9 +30,8 @@ class AtomURLRequestJobFactory : public net::URLRequestJobFactory {
|
|||
std::unique_ptr<ProtocolHandler> protocol_handler);
|
||||
|
||||
// Intercepts the ProtocolHandler for a scheme.
|
||||
bool InterceptProtocol(
|
||||
const std::string& scheme,
|
||||
std::unique_ptr<ProtocolHandler> protocol_handler);
|
||||
bool InterceptProtocol(const std::string& scheme,
|
||||
std::unique_ptr<ProtocolHandler> protocol_handler);
|
||||
bool UninterceptProtocol(const std::string& scheme);
|
||||
|
||||
// Returns the protocol handler registered with scheme.
|
||||
|
@ -65,8 +64,8 @@ class AtomURLRequestJobFactory : public net::URLRequestJobFactory {
|
|||
ProtocolHandlerMap protocol_handler_map_;
|
||||
|
||||
// Map that stores the original protocols of schemes.
|
||||
using OriginalProtocolsMap = std::unordered_map<
|
||||
std::string, std::unique_ptr<ProtocolHandler>>;
|
||||
using OriginalProtocolsMap =
|
||||
std::unordered_map<std::string, std::unique_ptr<ProtocolHandler>>;
|
||||
// Can only be accessed in IO thread.
|
||||
OriginalProtocolsMap original_protocols_;
|
||||
|
||||
|
|
|
@ -42,17 +42,16 @@ bool IsErrorOptions(base::Value* value, int* error);
|
|||
|
||||
} // namespace internal
|
||||
|
||||
template<typename RequestJob>
|
||||
template <typename RequestJob>
|
||||
class JsAsker : public RequestJob {
|
||||
public:
|
||||
JsAsker(net::URLRequest* request, net::NetworkDelegate* network_delegate)
|
||||
: RequestJob(request, network_delegate), weak_factory_(this) {}
|
||||
|
||||
// Called by |CustomProtocolHandler| to store handler related information.
|
||||
void SetHandlerInfo(
|
||||
v8::Isolate* isolate,
|
||||
net::URLRequestContextGetter* request_context_getter,
|
||||
const JavaScriptHandler& handler) {
|
||||
void SetHandlerInfo(v8::Isolate* isolate,
|
||||
net::URLRequestContextGetter* request_context_getter,
|
||||
const JavaScriptHandler& handler) {
|
||||
isolate_ = isolate;
|
||||
request_context_getter_ = request_context_getter;
|
||||
handler_ = handler;
|
||||
|
@ -75,14 +74,11 @@ class JsAsker : public RequestJob {
|
|||
FillRequestDetails(request_details.get(), RequestJob::request());
|
||||
content::BrowserThread::PostTask(
|
||||
content::BrowserThread::UI, FROM_HERE,
|
||||
base::Bind(&internal::AskForOptions,
|
||||
isolate_,
|
||||
handler_,
|
||||
base::Passed(&request_details),
|
||||
base::Bind(&JsAsker::BeforeStartInUI,
|
||||
weak_factory_.GetWeakPtr()),
|
||||
base::Bind(&JsAsker::OnResponse,
|
||||
weak_factory_.GetWeakPtr())));
|
||||
base::Bind(
|
||||
&internal::AskForOptions, isolate_, handler_,
|
||||
base::Passed(&request_details),
|
||||
base::Bind(&JsAsker::BeforeStartInUI, weak_factory_.GetWeakPtr()),
|
||||
base::Bind(&JsAsker::OnResponse, weak_factory_.GetWeakPtr())));
|
||||
}
|
||||
|
||||
int GetResponseCode() const override { return net::HTTP_OK; }
|
||||
|
|
|
@ -43,8 +43,10 @@ class URLRequestFetchJob : public JsAsker<net::URLRequestJob>,
|
|||
void OnURLFetchComplete(const net::URLFetcher* source) override;
|
||||
|
||||
private:
|
||||
int BufferCopy(net::IOBuffer* source, int num_bytes,
|
||||
net::IOBuffer* target, int target_size);
|
||||
int BufferCopy(net::IOBuffer* source,
|
||||
int num_bytes,
|
||||
net::IOBuffer* target,
|
||||
int target_size);
|
||||
void ClearPendingBuffer();
|
||||
void ClearWriteBuffer();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue