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 "config.h" | 5 #include "config.h" |
6 #include "modules/beacon/NavigatorBeacon.h" | 6 #include "modules/beacon/NavigatorBeacon.h" |
7 | 7 |
8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
9 #include "core/dom/ExceptionCode.h" | 9 #include "core/dom/ExceptionCode.h" |
10 #include "core/dom/ExecutionContext.h" | 10 #include "core/dom/ExecutionContext.h" |
11 #include "core/fileapi/Blob.h" | 11 #include "core/fileapi/Blob.h" |
12 #include "core/frame/LocalFrame.h" | 12 #include "core/frame/LocalFrame.h" |
13 #include "core/frame/Settings.h" | 13 #include "core/frame/Settings.h" |
14 #include "core/frame/csp/ContentSecurityPolicy.h" | 14 #include "core/frame/csp/ContentSecurityPolicy.h" |
15 #include "core/html/DOMFormData.h" | 15 #include "core/html/DOMFormData.h" |
16 #include "core/loader/BeaconLoader.h" | 16 #include "core/loader/BeaconLoader.h" |
17 #include "wtf/ArrayBufferView.h" | 17 #include "wtf/ArrayBufferView.h" |
18 | 18 |
19 namespace WebCore { | 19 namespace blink { |
20 | 20 |
21 NavigatorBeacon::NavigatorBeacon(Navigator& navigator) | 21 NavigatorBeacon::NavigatorBeacon(Navigator& navigator) |
22 : m_transmittedBytes(0) | 22 : m_transmittedBytes(0) |
23 , m_navigator(navigator) | 23 , m_navigator(navigator) |
24 { | 24 { |
25 } | 25 } |
26 | 26 |
27 const char* NavigatorBeacon::supplementName() | 27 const char* NavigatorBeacon::supplementName() |
28 { | 28 { |
29 return "NavigatorBeacon"; | 29 return "NavigatorBeacon"; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 return false; | 151 return false; |
152 | 152 |
153 int bytes = 0; | 153 int bytes = 0; |
154 bool result = BeaconLoader::sendBeacon(m_navigator.frame(), maxAllowance(),
url, data, bytes); | 154 bool result = BeaconLoader::sendBeacon(m_navigator.frame(), maxAllowance(),
url, data, bytes); |
155 if (result) | 155 if (result) |
156 updateTransmittedBytes(bytes); | 156 updateTransmittedBytes(bytes); |
157 | 157 |
158 return result; | 158 return result; |
159 } | 159 } |
160 | 160 |
161 } // namespace WebCore | 161 } // namespace blink |
OLD | NEW |