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..3d70e6820848893378811700839fc74fa180c388 |
| --- /dev/null |
| +++ b/Source/modules/beacon/NavigatorBeacon.h |
| @@ -0,0 +1,60 @@ |
| +// 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; |
| +} |
| + |
| +#define BLINK_MAX |
|
abarth-chromium
2014/05/08 13:15:25
???
sof
2014/05/08 20:47:07
Sorry, that shouldn't have made into this patch. R
|
| + |
| +namespace WebCore { |
| + |
| +class Blob; |
| +class DOMFormData; |
| +class ExceptionState; |
| +class ExecutionContext; |
| +class KURL; |
| + |
| +class NavigatorBeacon FINAL : public NoBaseWillBeGarbageCollectedFinalized<NavigatorBeacon>, public WillBeHeapSupplement<Navigator> { |
|
abarth-chromium
2014/05/08 13:15:25
Are you use this class needs to be finalized?
sof
2014/05/08 20:47:07
No, nothing needs to be finalized from this class
|
| + WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorBeacon); |
| +public: |
| + virtual ~NavigatorBeacon() { } |
| + |
| + 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&); |
| + |
| + void trace(Visitor*) { } |
| + |
| +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 isAllowedAccess(ExecutionContext*, const KURL&, ExceptionState&); |
| + int maxAllowance() const; |
| + void updateTransmittedBytes(int); |
| + |
| + int m_transmittedBytes; |
| + Navigator& m_navigator; |
| +}; |
| + |
| +} // namespace WebCore |
| + |
| +#endif // NavigatorBeacon_h |