Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: Source/platform/network/FormData.cpp

Issue 232053005: Implement navigator.sendBeacon() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Revert CSP checking on redirects Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/platform/network/FormData.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved.
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } 155 }
156 } 156 }
157 157
158 String FormData::flattenToString() const 158 String FormData::flattenToString() const
159 { 159 {
160 Vector<char> bytes; 160 Vector<char> bytes;
161 flatten(bytes); 161 flatten(bytes);
162 return Latin1Encoding().decode(reinterpret_cast<const char*>(bytes.data()), bytes.size()); 162 return Latin1Encoding().decode(reinterpret_cast<const char*>(bytes.data()), bytes.size());
163 } 163 }
164 164
165 unsigned long long FormData::sizeInBytes() const
166 {
167 unsigned size = 0;
168 size_t n = m_elements.size();
169 for (size_t i = 0; i < n; ++i) {
170 const FormDataElement& e = m_elements[i];
171 switch (e.m_type) {
172 case FormDataElement::data:
173 size += e.m_data.size();
174 break;
175 case FormDataElement::encodedFile:
176 size += e.m_fileLength - e.m_fileStart;
177 break;
178 case FormDataElement::encodedBlob:
179 if (e.m_optionalBlobDataHandle)
180 size += e.m_optionalBlobDataHandle->size();
181 break;
182 case FormDataElement::encodedFileSystemURL:
183 size += e.m_fileLength - e.m_fileStart;
184 break;
185 }
186 }
187 return size;
188 }
189
165 } // namespace WebCore 190 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/platform/network/FormData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698