| 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 "bindings/modules/v8/UnionTypesModules.h" | 9 #include "bindings/modules/v8/UnionTypesModules.h" |
| 10 #include "core/dom/DOMArrayBufferView.h" | 10 #include "core/dom/DOMArrayBufferView.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 100 |
| 101 KURL url = context->completeURL(urlstring); | 101 KURL url = context->completeURL(urlstring); |
| 102 if (!impl.canSendBeacon(context, url, exceptionState)) | 102 if (!impl.canSendBeacon(context, url, exceptionState)) |
| 103 return false; | 103 return false; |
| 104 | 104 |
| 105 int allowance = impl.maxAllowance(); | 105 int allowance = impl.maxAllowance(); |
| 106 int bytes = 0; | 106 int bytes = 0; |
| 107 bool allowed; | 107 bool allowed; |
| 108 | 108 |
| 109 if (data.isArrayBufferView()) | 109 if (data.isArrayBufferView()) |
| 110 allowed = BeaconLoader::sendBeacon(navigator.frame(), allowance, url, da
ta.getAsArrayBufferView(), bytes); | 110 allowed = BeaconLoader::sendBeacon(navigator.localFrame(), allowance, ur
l, data.getAsArrayBufferView(), bytes); |
| 111 else if (data.isBlob()) | 111 else if (data.isBlob()) |
| 112 allowed = BeaconLoader::sendBeacon(navigator.frame(), allowance, url, da
ta.getAsBlob(), bytes); | 112 allowed = BeaconLoader::sendBeacon(navigator.localFrame(), allowance, ur
l, data.getAsBlob(), bytes); |
| 113 else if (data.isString()) | 113 else if (data.isString()) |
| 114 allowed = BeaconLoader::sendBeacon(navigator.frame(), allowance, url, da
ta.getAsString(), bytes); | 114 allowed = BeaconLoader::sendBeacon(navigator.localFrame(), allowance, ur
l, data.getAsString(), bytes); |
| 115 else if (data.isFormData()) | 115 else if (data.isFormData()) |
| 116 allowed = BeaconLoader::sendBeacon(navigator.frame(), allowance, url, da
ta.getAsFormData(), bytes); | 116 allowed = BeaconLoader::sendBeacon(navigator.localFrame(), allowance, ur
l, data.getAsFormData(), bytes); |
| 117 else | 117 else |
| 118 allowed = BeaconLoader::sendBeacon(navigator.frame(), allowance, url, St
ring(), bytes); | 118 allowed = BeaconLoader::sendBeacon(navigator.localFrame(), allowance, ur
l, String(), bytes); |
| 119 | 119 |
| 120 return impl.beaconResult(context, allowed, bytes); | 120 return impl.beaconResult(context, allowed, bytes); |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace blink | 123 } // namespace blink |
| OLD | NEW |