OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NavigatorBeacon_h | 5 #ifndef NavigatorBeacon_h |
6 #define NavigatorBeacon_h | 6 #define NavigatorBeacon_h |
7 | 7 |
8 #include "core/frame/Navigator.h" | 8 #include "core/frame/Navigator.h" |
9 #include "platform/Supplementable.h" | 9 #include "platform/Supplementable.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class Blob; | 14 class Blob; |
15 class ExceptionState; | 15 class ExceptionState; |
16 class ExecutionContext; | 16 class ExecutionContext; |
17 class KURL; | 17 class KURL; |
18 class ArrayBufferViewOrBlobOrStringOrFormData; | 18 class ArrayBufferViewOrBlobOrStringOrFormData; |
19 | 19 |
20 class NavigatorBeacon final : public NoBaseWillBeGarbageCollected<NavigatorBeaco n>, public WillBeHeapSupplement<Navigator> { | 20 class NavigatorBeacon final : public GarbageCollected<NavigatorBeacon>, public H eapSupplement<Navigator> { |
21 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorBeacon); | 21 USING_GARBAGE_COLLECTED_MIXIN(NavigatorBeacon); |
22 public: | 22 public: |
23 static NavigatorBeacon& from(Navigator&); | 23 static NavigatorBeacon& from(Navigator&); |
24 | 24 |
25 static bool sendBeacon(ExecutionContext*, Navigator&, const String&, const A rrayBufferViewOrBlobOrStringOrFormData&, ExceptionState&); | 25 static bool sendBeacon(ExecutionContext*, Navigator&, const String&, const A rrayBufferViewOrBlobOrStringOrFormData&, ExceptionState&); |
26 | 26 |
27 DECLARE_VIRTUAL_TRACE(); | 27 DECLARE_VIRTUAL_TRACE(); |
28 | 28 |
29 private: | 29 private: |
30 explicit NavigatorBeacon(Navigator&); | 30 explicit NavigatorBeacon(Navigator&); |
31 | 31 |
32 static const char* supplementName(); | 32 static const char* supplementName(); |
33 | 33 |
34 bool canSendBeacon(ExecutionContext*, const KURL&, ExceptionState&); | 34 bool canSendBeacon(ExecutionContext*, const KURL&, ExceptionState&); |
35 int maxAllowance() const; | 35 int maxAllowance() const; |
36 bool beaconResult(ExecutionContext*, bool allowed, int sentBytes); | 36 bool beaconResult(ExecutionContext*, bool allowed, int sentBytes); |
37 | 37 |
38 int m_transmittedBytes; | 38 int m_transmittedBytes; |
39 Navigator& m_navigator; | 39 Navigator& m_navigator; |
haraken
2015/04/24 15:32:35
This should be Member<Navigator>.
yutak@: I think
sof
2015/04/24 21:25:08
A convenience, Navigator would live as long as the
| |
40 }; | 40 }; |
41 | 41 |
42 } // namespace blink | 42 } // namespace blink |
43 | 43 |
44 #endif // NavigatorBeacon_h | 44 #endif // NavigatorBeacon_h |
OLD | NEW |