From d3c8363450ab271e3e7708a62e28e2ce144837b3 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 11 Dec 2015 21:22:23 +0800 Subject: [PATCH] EventType can not be OR'ed --- atom/browser/net/atom_network_delegate.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/atom/browser/net/atom_network_delegate.h b/atom/browser/net/atom_network_delegate.h index 72a69b1656bf..671ef8201836 100644 --- a/atom/browser/net/atom_network_delegate.h +++ b/atom/browser/net/atom_network_delegate.h @@ -31,15 +31,14 @@ class AtomNetworkDelegate : public brightray::NetworkDelegate { base::Callback; enum EventType { - kInvalidEvent = 0, - kOnBeforeRequest = 1 << 0, - kOnBeforeSendHeaders = 1 << 1, - kOnSendHeaders = 1 << 2, - kOnHeadersReceived = 1 << 3, - kOnBeforeRedirect = 1 << 4, - kOnResponseStarted = 1 << 5, - kOnCompleted = 1 << 6, - kOnErrorOccurred = 1 << 7, + kOnBeforeRequest, + kOnBeforeSendHeaders, + kOnSendHeaders, + kOnHeadersReceived, + kOnBeforeRedirect, + kOnResponseStarted, + kOnCompleted, + kOnErrorOccurred, }; struct ListenerInfo { @@ -69,8 +68,6 @@ class AtomNetworkDelegate : public brightray::NetworkDelegate { const Listener& callback); protected: - void OnErrorOccurred(net::URLRequest* request); - // net::NetworkDelegate: int OnBeforeURLRequest(net::URLRequest* request, const net::CompletionCallback& callback, @@ -91,6 +88,8 @@ class AtomNetworkDelegate : public brightray::NetworkDelegate { void OnResponseStarted(net::URLRequest* request) override; void OnCompleted(net::URLRequest* request, bool started) override; + void OnErrorOccurred(net::URLRequest* request); + private: std::map event_listener_map_;