| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BeaconLoader_h | 5 #ifndef BeaconLoader_h |
| 6 #define BeaconLoader_h | 6 #define BeaconLoader_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/loader/PingLoader.h" | 9 #include "core/loader/PingLoader.h" |
| 10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| 11 #include "public/platform/WebURLLoaderClient.h" | 11 #include "public/platform/WebURLLoaderClient.h" |
| 12 #include "wtf/Forward.h" | 12 #include "wtf/Forward.h" |
| 13 #include "wtf/Noncopyable.h" | 13 #include "wtf/Noncopyable.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 class Blob; | 17 class Blob; |
| 18 class DOMArrayBufferView; | 18 class DOMArrayBufferView; |
| 19 class FormData; | 19 class FormData; |
| 20 class KURL; | 20 class KURL; |
| 21 class LocalFrame; | 21 class LocalFrame; |
| 22 class SecurityOrigin; | 22 class SecurityOrigin; |
| 23 | 23 |
| 24 // Issue asynchronous beacon transmission loads independent of LocalFrame | 24 // Issue asynchronous beacon transmission loads independent of LocalFrame |
| 25 // staying alive. PingLoader providing the service. | 25 // staying alive. PingLoader providing the service. |
| 26 class CORE_EXPORT BeaconLoader final : public PingLoader { | 26 class CORE_EXPORT BeaconLoader final : public PingLoader { |
| 27 WTF_MAKE_NONCOPYABLE(BeaconLoader); | 27 WTF_MAKE_NONCOPYABLE(BeaconLoader); |
| 28 USING_FAST_MALLOC_WILL_BE_REMOVED(BeaconLoader); | |
| 29 public: | 28 public: |
| 30 ~BeaconLoader() override { } | 29 ~BeaconLoader() override { } |
| 31 | 30 |
| 32 static bool sendBeacon(LocalFrame*, int, const KURL&, const String&, int&); | 31 static bool sendBeacon(LocalFrame*, int, const KURL&, const String&, int&); |
| 33 static bool sendBeacon(LocalFrame*, int, const KURL&, PassRefPtr<DOMArrayBuf
ferView>, int&); | 32 static bool sendBeacon(LocalFrame*, int, const KURL&, PassRefPtr<DOMArrayBuf
ferView>, int&); |
| 34 static bool sendBeacon(LocalFrame*, int, const KURL&, Blob*, int&); | 33 static bool sendBeacon(LocalFrame*, int, const KURL&, Blob*, int&); |
| 35 static bool sendBeacon(LocalFrame*, int, const KURL&, FormData*, int&); | 34 static bool sendBeacon(LocalFrame*, int, const KURL&, FormData*, int&); |
| 36 | 35 |
| 37 private: | 36 private: |
| 38 class Sender; | 37 class Sender; |
| 39 | 38 |
| 40 BeaconLoader(LocalFrame*, ResourceRequest&, const FetchInitiatorInfo&, Store
dCredentials); | 39 BeaconLoader(LocalFrame*, ResourceRequest&, const FetchInitiatorInfo&, Store
dCredentials); |
| 41 | 40 |
| 42 RefPtr<SecurityOrigin> m_beaconOrigin; | 41 RefPtr<SecurityOrigin> m_beaconOrigin; |
| 43 | 42 |
| 44 // WebURLLoaderClient | 43 // WebURLLoaderClient |
| 45 void willFollowRedirect(WebURLLoader*, WebURLRequest&, const WebURLResponse&
) override; | 44 void willFollowRedirect(WebURLLoader*, WebURLRequest&, const WebURLResponse&
) override; |
| 46 }; | 45 }; |
| 47 | 46 |
| 48 } // namespace blink | 47 } // namespace blink |
| 49 | 48 |
| 50 #endif // BeaconLoader_h | 49 #endif // BeaconLoader_h |
| OLD | NEW |