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

Unified Diff: Source/modules/beacon/NavigatorBeacon.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/loader/PingLoader.cpp ('k') | Source/modules/beacon/NavigatorBeacon.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/beacon/NavigatorBeacon.h
diff --git a/Source/modules/beacon/NavigatorBeacon.h b/Source/modules/beacon/NavigatorBeacon.h
new file mode 100644
index 0000000000000000000000000000000000000000..c0c3f6d0e329973f5f49d233546753100770dede
--- /dev/null
+++ b/Source/modules/beacon/NavigatorBeacon.h
@@ -0,0 +1,54 @@
+// 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 NavigatorBeacon_h
+#define NavigatorBeacon_h
+
+#include "core/frame/Navigator.h"
+#include "platform/Supplementable.h"
+#include "platform/heap/Handle.h"
+
+namespace WTF {
+class ArrayBufferView;
+}
+
+namespace WebCore {
+
+class Blob;
+class DOMFormData;
+class ExceptionState;
+class ExecutionContext;
+class KURL;
+
+class NavigatorBeacon FINAL : public NoBaseWillBeGarbageCollected<NavigatorBeacon>, public WillBeHeapSupplement<Navigator> {
+ WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorBeacon);
+public:
+ static NavigatorBeacon& from(Navigator&);
+
+ static bool sendBeacon(ExecutionContext*, Navigator&, const String&, const String&, ExceptionState&);
+ static bool sendBeacon(ExecutionContext*, Navigator&, const String&, PassRefPtr<WTF::ArrayBufferView>, ExceptionState&);
+ static bool sendBeacon(ExecutionContext*, Navigator&, const String&, PassRefPtrWillBeRawPtr<Blob>, ExceptionState&);
+ static bool sendBeacon(ExecutionContext*, Navigator&, const String&, PassRefPtrWillBeRawPtr<DOMFormData>, ExceptionState&);
+
+private:
+ explicit NavigatorBeacon(Navigator&);
+
+ static const char* supplementName();
+
+ bool sendBeacon(ExecutionContext*, const String&, const String&, ExceptionState&);
+ bool sendBeacon(ExecutionContext*, const String&, PassRefPtr<WTF::ArrayBufferView>, ExceptionState&);
+ bool sendBeacon(ExecutionContext*, const String&, PassRefPtrWillBeRawPtr<Blob>, ExceptionState&);
+ bool sendBeacon(ExecutionContext*, const String&, PassRefPtrWillBeRawPtr<DOMFormData>, ExceptionState&);
+
+ bool canSendBeacon(ExecutionContext*, const KURL&, ExceptionState&);
+ int maxAllowance() const;
+ void updateTransmittedBytes(int);
+
+ int m_transmittedBytes;
+ Navigator& m_navigator;
+};
+
+} // namespace WebCore
+
+#endif // NavigatorBeacon_h
« no previous file with comments | « Source/core/loader/PingLoader.cpp ('k') | Source/modules/beacon/NavigatorBeacon.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698