Update style of ResourceHandleInternal
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Jan 2017 22:49:51 +0000 (22:49 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Jan 2017 22:49:51 +0000 (22:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=166952

Patch by Alex Christensen <achristensen@webkit.org> on 2017-01-12
Reviewed by Andreas Kling.

No change in behavior.  Just un-indent and use initializer lists.

* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
(WebCore::ResourceHandleInternal::client):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210681 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/network/ResourceHandleInternal.h

index ee4f905..94c812b 100644 (file)
@@ -1,3 +1,16 @@
+2017-01-12  Alex Christensen  <achristensen@webkit.org>
+
+        Update style of ResourceHandleInternal
+        https://bugs.webkit.org/show_bug.cgi?id=166952
+
+        Reviewed by Andreas Kling.
+
+        No change in behavior.  Just un-indent and use initializer lists.
+
+        * platform/network/ResourceHandleInternal.h:
+        (WebCore::ResourceHandleInternal::ResourceHandleInternal):
+        (WebCore::ResourceHandleInternal::client):
+
 2017-01-12  Jer Noble  <jer.noble@apple.com>
 
         Use GenericEventQueue rather than callOnMainThread to schedule events in AudioScheduledSourceNode.
index dc166d3..3754c35 100644 (file)
@@ -23,8 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef ResourceHandleInternal_h
-#define ResourceHandleInternal_h
+#pragma once
 
 #include "NetworkingContext.h"
 #include "ResourceHandle.h"
@@ -71,130 +70,116 @@ typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
 
 namespace WebCore {
 
-    class ResourceHandleInternal {
-        WTF_MAKE_NONCOPYABLE(ResourceHandleInternal); WTF_MAKE_FAST_ALLOCATED;
-    public:
-        ResourceHandleInternal(ResourceHandle* loader, NetworkingContext* context, const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading, bool shouldContentSniff)
-            : m_context(context)
-            , m_client(client)
-            , m_firstRequest(request)
-            , m_lastHTTPMethod(request.httpMethod())
-            , status(0)
-            , m_defersLoading(defersLoading)
-            , m_shouldContentSniff(shouldContentSniff)
-            , m_usesAsyncCallbacks(client && client->usesAsyncCallbacks())
+class ResourceHandleInternal {
+    WTF_MAKE_NONCOPYABLE(ResourceHandleInternal); WTF_MAKE_FAST_ALLOCATED;
+public:
+    ResourceHandleInternal(ResourceHandle* loader, NetworkingContext* context, const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading, bool shouldContentSniff)
+        : m_context(context)
+        , m_client(client)
+        , m_firstRequest(request)
+        , m_lastHTTPMethod(request.httpMethod())
+        , m_defersLoading(defersLoading)
+        , m_shouldContentSniff(shouldContentSniff)
+        , m_usesAsyncCallbacks(client && client->usesAsyncCallbacks())
 #if USE(CFURLCONNECTION)
-            , m_currentRequest(request)
+        , m_currentRequest(request)
 #endif
 #if USE(CURL)
-            , m_formDataStream(loader)
+        , m_formDataStream(loader)
 #endif
 #if USE(SOUP)
-            , m_cancelled(false)
-            , m_timeoutSource(RunLoop::main(), loader, &ResourceHandle::timeoutFired)
-            , m_bodySize(0)
-            , m_bodyDataSent(0)
-            , m_redirectCount(0)
-            , m_previousPosition(0)
-            , m_useAuthenticationManager(true)
-#endif
-#if PLATFORM(COCOA)
-            , m_startWhenScheduled(false)
-            , m_currentMacChallenge(nil)
-#endif
-            , m_scheduledFailureType(ResourceHandle::NoFailure)
-            , m_failureTimer(*loader, &ResourceHandle::failureTimerFired)
-        {
-            const URL& url = m_firstRequest.url();
-            m_user = url.user();
-            m_pass = url.pass();
-            m_firstRequest.removeCredentials();
-        }
-        
-        ~ResourceHandleInternal();
-
-        ResourceHandleClient* client() { return m_client; }
-
-        RefPtr<NetworkingContext> m_context;
-        ResourceHandleClient* m_client;
-        ResourceRequest m_firstRequest;
-        String m_lastHTTPMethod;
-
-        // Suggested credentials for the current redirection step.
-        String m_user;
-        String m_pass;
-        
-        Credential m_initialCredential;
-        
-        int status;
-
-        bool m_defersLoading;
-        bool m_shouldContentSniff;
-        bool m_usesAsyncCallbacks;
+        , m_timeoutSource(RunLoop::main(), loader, &ResourceHandle::timeoutFired)
+#endif
+        , m_failureTimer(*loader, &ResourceHandle::failureTimerFired)
+    {
+        const URL& url = m_firstRequest.url();
+        m_user = url.user();
+        m_pass = url.pass();
+        m_firstRequest.removeCredentials();
+    }
+    
+    ~ResourceHandleInternal();
+
+    ResourceHandleClient* client() { return m_client; }
+
+    RefPtr<NetworkingContext> m_context;
+    ResourceHandleClient* m_client;
+    ResourceRequest m_firstRequest;
+    String m_lastHTTPMethod;
+
+    // Suggested credentials for the current redirection step.
+    String m_user;
+    String m_pass;
+    
+    Credential m_initialCredential;
+    
+    int status { 0 };
+
+    bool m_defersLoading;
+    bool m_shouldContentSniff;
+    bool m_usesAsyncCallbacks;
 #if USE(CFURLCONNECTION)
-        RetainPtr<CFURLConnectionRef> m_connection;
-        ResourceRequest m_currentRequest;
-        RefPtr<ResourceHandleCFURLConnectionDelegate> m_connectionDelegate;
+    RetainPtr<CFURLConnectionRef> m_connection;
+    ResourceRequest m_currentRequest;
+    RefPtr<ResourceHandleCFURLConnectionDelegate> m_connectionDelegate;
 #endif
 #if PLATFORM(COCOA) && !USE(CFURLCONNECTION)
-        RetainPtr<NSURLConnection> m_connection;
-        RetainPtr<id> m_delegate;
+    RetainPtr<NSURLConnection> m_connection;
+    RetainPtr<id> m_delegate;
 #endif
 #if PLATFORM(COCOA)
-        bool m_startWhenScheduled;
+    bool m_startWhenScheduled { false };
 #endif
 #if PLATFORM(COCOA) || USE(CFURLCONNECTION)
-        RetainPtr<CFURLStorageSessionRef> m_storageSession;
+    RetainPtr<CFURLStorageSessionRef> m_storageSession;
 #endif
 #if USE(CURL)
-        CURL* m_handle { nullptr };
-        char* m_url { nullptr };
-        struct curl_slist* m_customHeaders { nullptr };
-        ResourceResponse m_response;
-        bool m_cancelled { false };
-        unsigned short m_authFailureCount { 0 };
+    CURL* m_handle { nullptr };
+    char* m_url { nullptr };
+    struct curl_slist* m_customHeaders { nullptr };
+    ResourceResponse m_response;
+    bool m_cancelled { false };
+    unsigned short m_authFailureCount { 0 };
 
-        FormDataStream m_formDataStream;
-        unsigned m_sslErrors { 0 };
-        Vector<char> m_postBytes;
+    FormDataStream m_formDataStream;
+    unsigned m_sslErrors { 0 };
+    Vector<char> m_postBytes;
 
-        std::unique_ptr<MultipartHandle> m_multipartHandle;
-        bool m_addedCacheValidationHeaders { false };
+    std::unique_ptr<MultipartHandle> m_multipartHandle;
+    bool m_addedCacheValidationHeaders { false };
 #endif
 #if USE(SOUP)
-        GRefPtr<SoupMessage> m_soupMessage;
-        ResourceResponse m_response;
-        bool m_cancelled;
-        GRefPtr<SoupRequest> m_soupRequest;
-        GRefPtr<GInputStream> m_inputStream;
-        GRefPtr<SoupMultipartInputStream> m_multipartInputStream;
-        GRefPtr<GCancellable> m_cancellable;
-        GRefPtr<GAsyncResult> m_deferredResult;
-        RunLoop::Timer<ResourceHandle> m_timeoutSource;
-        GUniquePtr<SoupBuffer> m_soupBuffer;
-        unsigned long m_bodySize;
-        unsigned long m_bodyDataSent;
-        SoupSession* soupSession();
-        int m_redirectCount;
-        size_t m_previousPosition;
-        bool m_useAuthenticationManager;
-        struct {
-            Credential credential;
-            ProtectionSpace protectionSpace;
-        } m_credentialDataToSaveInPersistentStore;
+    GRefPtr<SoupMessage> m_soupMessage;
+    ResourceResponse m_response;
+    bool m_cancelled { false };
+    GRefPtr<SoupRequest> m_soupRequest;
+    GRefPtr<GInputStream> m_inputStream;
+    GRefPtr<SoupMultipartInputStream> m_multipartInputStream;
+    GRefPtr<GCancellable> m_cancellable;
+    GRefPtr<GAsyncResult> m_deferredResult;
+    RunLoop::Timer<ResourceHandle> m_timeoutSource;
+    GUniquePtr<SoupBuffer> m_soupBuffer;
+    unsigned long m_bodySize { 0 };
+    unsigned long m_bodyDataSent { 0 };
+    SoupSession* soupSession();
+    int m_redirectCount { 0 };
+    size_t m_previousPosition { 0 };
+    bool m_useAuthenticationManager { true };
+    struct {
+        Credential credential;
+        ProtectionSpace protectionSpace;
+    } m_credentialDataToSaveInPersistentStore;
 #endif
 
 #if PLATFORM(COCOA)
-        // We need to keep a reference to the original challenge to be able to cancel it.
-        // It is almost identical to m_currentWebChallenge.nsURLAuthenticationChallenge(), but has a different sender.
-        NSURLAuthenticationChallenge *m_currentMacChallenge;
+    // We need to keep a reference to the original challenge to be able to cancel it.
+    // It is almost identical to m_currentWebChallenge.nsURLAuthenticationChallenge(), but has a different sender.
+    NSURLAuthenticationChallenge *m_currentMacChallenge { nil };
 #endif
 
-        AuthenticationChallenge m_currentWebChallenge;
-        ResourceHandle::FailureType m_scheduledFailureType;
-        Timer m_failureTimer;
-    };
+    AuthenticationChallenge m_currentWebChallenge;
+    ResourceHandle::FailureType m_scheduledFailureType { ResourceHandle::NoFailure };
+    Timer m_failureTimer;
+};
 
 } // namespace WebCore
-
-#endif // ResourceHandleInternal_h