summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/WebKit/Source/core/loader/BeaconLoader.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/WebKit/Source/core/loader/BeaconLoader.h')
-rw-r--r--chromium/third_party/WebKit/Source/core/loader/BeaconLoader.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/chromium/third_party/WebKit/Source/core/loader/BeaconLoader.h b/chromium/third_party/WebKit/Source/core/loader/BeaconLoader.h
new file mode 100644
index 00000000000..9c403ae7641
--- /dev/null
+++ b/chromium/third_party/WebKit/Source/core/loader/BeaconLoader.h
@@ -0,0 +1,43 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BeaconLoader_h
+#define BeaconLoader_h
+
+#include "core/loader/PingLoader.h"
+#include "platform/heap/Handle.h"
+#include "wtf/Noncopyable.h"
+
+namespace WTF {
+class ArrayBufferView;
+}
+
+namespace WebCore {
+
+class Blob;
+class DOMFormData;
+class KURL;
+class LocalFrame;
+
+// Issue asynchronous beacon transmission loads independent of LocalFrame
+// staying alive. PingLoader providing the service.
+class BeaconLoader FINAL : public PingLoader {
+ WTF_MAKE_NONCOPYABLE(BeaconLoader);
+ WTF_MAKE_FAST_ALLOCATED;
+public:
+ virtual ~BeaconLoader() { }
+
+ static bool sendBeacon(LocalFrame*, int, const KURL&, const String&, int&);
+ static bool sendBeacon(LocalFrame*, int, const KURL&, PassRefPtr<WTF::ArrayBufferView>&, int&);
+ static bool sendBeacon(LocalFrame*, int, const KURL&, PassRefPtrWillBeRawPtr<Blob>&, int&);
+ static bool sendBeacon(LocalFrame*, int, const KURL&, PassRefPtrWillBeRawPtr<DOMFormData>&, int&);
+
+private:
+ static void prepareRequest(LocalFrame*, ResourceRequest&);
+ static void issueRequest(LocalFrame*, ResourceRequest&);
+};
+
+} // namespace WebCore
+
+#endif // BeaconLoader_h