| 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 #include "modules/beacon/NavigatorBeacon.h" | 5 #include "modules/beacon/NavigatorBeacon.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
| 8 #include "bindings/modules/v8/ArrayBufferViewOrBlobOrStringOrFormData.h" | 8 #include "bindings/modules/v8/ArrayBufferViewOrBlobOrStringOrFormData.h" |
| 9 #include "core/dom/DOMArrayBufferView.h" | 9 #include "core/dom/DOMArrayBufferView.h" |
| 10 #include "core/dom/ExceptionCode.h" | 10 #include "core/dom/ExceptionCode.h" |
| 11 #include "core/dom/ExecutionContext.h" | 11 #include "core/dom/ExecutionContext.h" |
| 12 #include "core/fetch/FetchUtils.h" | 12 #include "core/fetch/FetchUtils.h" |
| 13 #include "core/fileapi/Blob.h" | 13 #include "core/fileapi/Blob.h" |
| 14 #include "core/frame/LocalFrame.h" | 14 #include "core/frame/LocalFrame.h" |
| 15 #include "core/frame/Settings.h" | 15 #include "core/frame/Settings.h" |
| 16 #include "core/frame/UseCounter.h" | 16 #include "core/frame/UseCounter.h" |
| 17 #include "core/frame/csp/ContentSecurityPolicy.h" | 17 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 18 #include "core/html/FormData.h" | 18 #include "core/html/FormData.h" |
| 19 #include "core/loader/PingLoader.h" | 19 #include "core/loader/PingLoader.h" |
| 20 | 20 |
| 21 namespace blink { | 21 namespace blink { |
| 22 | 22 |
| 23 NavigatorBeacon::NavigatorBeacon(Navigator& navigator) | 23 NavigatorBeacon::NavigatorBeacon(Navigator& navigator) |
| 24 : DOMWindowProperty(navigator.frame()), m_transmittedBytes(0) {} | 24 : ContextClient(navigator.frame()), m_transmittedBytes(0) {} |
| 25 | 25 |
| 26 NavigatorBeacon::~NavigatorBeacon() {} | 26 NavigatorBeacon::~NavigatorBeacon() {} |
| 27 | 27 |
| 28 DEFINE_TRACE(NavigatorBeacon) { | 28 DEFINE_TRACE(NavigatorBeacon) { |
| 29 DOMWindowProperty::trace(visitor); | 29 ContextClient::trace(visitor); |
| 30 Supplement<Navigator>::trace(visitor); | 30 Supplement<Navigator>::trace(visitor); |
| 31 } | 31 } |
| 32 | 32 |
| 33 const char* NavigatorBeacon::supplementName() { | 33 const char* NavigatorBeacon::supplementName() { |
| 34 return "NavigatorBeacon"; | 34 return "NavigatorBeacon"; |
| 35 } | 35 } |
| 36 | 36 |
| 37 NavigatorBeacon& NavigatorBeacon::from(Navigator& navigator) { | 37 NavigatorBeacon& NavigatorBeacon::from(Navigator& navigator) { |
| 38 NavigatorBeacon* supplement = static_cast<NavigatorBeacon*>( | 38 NavigatorBeacon* supplement = static_cast<NavigatorBeacon*>( |
| 39 Supplement<Navigator>::from(navigator, supplementName())); | 39 Supplement<Navigator>::from(navigator, supplementName())); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 if (allowed) { | 141 if (allowed) { |
| 142 impl.addTransmittedBytes(bytes); | 142 impl.addTransmittedBytes(bytes); |
| 143 return true; | 143 return true; |
| 144 } | 144 } |
| 145 | 145 |
| 146 UseCounter::count(context, UseCounter::SendBeaconQuotaExceeded); | 146 UseCounter::count(context, UseCounter::SendBeaconQuotaExceeded); |
| 147 return false; | 147 return false; |
| 148 } | 148 } |
| 149 | 149 |
| 150 } // namespace blink | 150 } // namespace blink |
| OLD | NEW |