OLD | NEW |
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 13 matching lines...) Expand all Loading... |
24 | 24 |
25 #include "platform/FileMetadata.h" | 25 #include "platform/FileMetadata.h" |
26 #include "platform/network/FormDataBuilder.h" | 26 #include "platform/network/FormDataBuilder.h" |
27 #include "wtf/text/CString.h" | 27 #include "wtf/text/CString.h" |
28 #include "wtf/text/TextEncoding.h" | 28 #include "wtf/text/TextEncoding.h" |
29 | 29 |
30 namespace blink { | 30 namespace blink { |
31 | 31 |
32 inline FormData::FormData() | 32 inline FormData::FormData() |
33 : m_identifier(0) | 33 : m_identifier(0) |
34 , m_alwaysStream(false) | |
35 , m_containsPasswordData(false) | 34 , m_containsPasswordData(false) |
36 { | 35 { |
37 } | 36 } |
38 | 37 |
39 inline FormData::FormData(const FormData& data) | 38 inline FormData::FormData(const FormData& data) |
40 : RefCounted<FormData>() | 39 : RefCounted<FormData>() |
41 , m_elements(data.m_elements) | 40 , m_elements(data.m_elements) |
42 , m_identifier(data.m_identifier) | 41 , m_identifier(data.m_identifier) |
43 , m_alwaysStream(false) | |
44 , m_containsPasswordData(data.m_containsPasswordData) | 42 , m_containsPasswordData(data.m_containsPasswordData) |
45 { | 43 { |
46 } | 44 } |
47 | 45 |
48 FormData::~FormData() | 46 FormData::~FormData() |
49 { | 47 { |
50 } | 48 } |
51 | 49 |
52 PassRefPtr<FormData> FormData::create() | 50 PassRefPtr<FormData> FormData::create() |
53 { | 51 { |
(...skipping 23 matching lines...) Expand all Loading... |
77 | 75 |
78 PassRefPtr<FormData> FormData::copy() const | 76 PassRefPtr<FormData> FormData::copy() const |
79 { | 77 { |
80 return adoptRef(new FormData(*this)); | 78 return adoptRef(new FormData(*this)); |
81 } | 79 } |
82 | 80 |
83 PassRefPtr<FormData> FormData::deepCopy() const | 81 PassRefPtr<FormData> FormData::deepCopy() const |
84 { | 82 { |
85 RefPtr<FormData> formData(create()); | 83 RefPtr<FormData> formData(create()); |
86 | 84 |
87 formData->m_alwaysStream = m_alwaysStream; | |
88 | |
89 size_t n = m_elements.size(); | 85 size_t n = m_elements.size(); |
90 formData->m_elements.reserveInitialCapacity(n); | 86 formData->m_elements.reserveInitialCapacity(n); |
91 for (size_t i = 0; i < n; ++i) { | 87 for (size_t i = 0; i < n; ++i) { |
92 const FormDataElement& e = m_elements[i]; | 88 const FormDataElement& e = m_elements[i]; |
93 switch (e.m_type) { | 89 switch (e.m_type) { |
94 case FormDataElement::data: | 90 case FormDataElement::data: |
95 formData->m_elements.uncheckedAppend(FormDataElement(e.m_data)); | 91 formData->m_elements.uncheckedAppend(FormDataElement(e.m_data)); |
96 break; | 92 break; |
97 case FormDataElement::encodedFile: | 93 case FormDataElement::encodedFile: |
98 formData->m_elements.uncheckedAppend(FormDataElement(e.m_filename.is
olatedCopy(), e.m_fileStart, e.m_fileLength, e.m_expectedFileModificationTime)); | 94 formData->m_elements.uncheckedAppend(FormDataElement(e.m_filename.is
olatedCopy(), e.m_fileStart, e.m_fileLength, e.m_expectedFileModificationTime)); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 break; | 177 break; |
182 case FormDataElement::encodedFileSystemURL: | 178 case FormDataElement::encodedFileSystemURL: |
183 size += e.m_fileLength - e.m_fileStart; | 179 size += e.m_fileLength - e.m_fileStart; |
184 break; | 180 break; |
185 } | 181 } |
186 } | 182 } |
187 return size; | 183 return size; |
188 } | 184 } |
189 | 185 |
190 } // namespace blink | 186 } // namespace blink |
OLD | NEW |