Chromium Code Reviews| 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..a2e43c352af8356e54c71737dcf18cd04ff30da7 |
| --- /dev/null |
| +++ b/Source/modules/beacon/NavigatorBeacon.h |
| @@ -0,0 +1,47 @@ |
| +// 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 NoBaseWillBeGarbageCollectedFinalized<NavigatorBeacon>, public WillBeHeapSupplement<Navigator> { |
|
abarth-chromium
2014/04/10 18:25:14
You shouldn't need to instantiate this object at a
|
| + WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorBeacon); |
| +public: |
| + virtual ~NavigatorBeacon() { } |
| + |
| + static NavigatorBeacon& from(Navigator&); |
|
abarth-chromium
2014/04/10 18:25:14
You should be able to drop this function too.
|
| + |
| + 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&); |
| + |
| + void trace(Visitor*) { } |
| + |
| +private: |
| + NavigatorBeacon() { } |
| + static const char* supplementName(); |
| + |
| + static bool isAllowedAccess(ExecutionContext*, const KURL&, ExceptionState&); |
| +}; |
| + |
| +} // namespace WebCore |
| + |
| +#endif // NavigatorBeacon_h |