]> khamidou — GitHub mirrors - electron.git/commitdiff
EventType can not be OR'ed
authorCheng Zhao <zcbenz@gmail.com>
Fri, 11 Dec 2015 13:22:23 +0000 (21:22 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 11 Dec 2015 13:22:23 +0000 (21:22 +0800)
atom/browser/net/atom_network_delegate.h

index 72a69b1656bf91fa8f3a1f3536584c2e65731ef2..671ef82018367a43956ad66595786a8013f2ea0d 100644 (file)
@@ -31,15 +31,14 @@ class AtomNetworkDelegate : public brightray::NetworkDelegate {
       base::Callback<BlockingResponse(const base::DictionaryValue&)>;
 
   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<EventType, ListenerInfo> event_listener_map_;