Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(465)

Unified Diff: Source/core/loader/BeaconLoader.h

Issue 232053005: Implement navigator.sendBeacon() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Revert CSP checking on redirects Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLAnchorElement.cpp ('k') | Source/core/loader/BeaconLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/BeaconLoader.h
diff --git a/Source/core/loader/BeaconLoader.h b/Source/core/loader/BeaconLoader.h
new file mode 100644
index 0000000000000000000000000000000000000000..9c403ae7641cdac67f8765134b85f1fc1f1f773a
--- /dev/null
+++ b/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
« no previous file with comments | « Source/core/html/HTMLAnchorElement.cpp ('k') | Source/core/loader/BeaconLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698