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

Side by Side Diff: third_party/WebKit/Source/core/fileapi/Blob.h

Issue 1362963003: Blob/File constructors/slice method shouldn't throw on invalid types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated win expectation Created 3 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 explicit Blob(PassRefPtr<BlobDataHandle>); 125 explicit Blob(PassRefPtr<BlobDataHandle>);
126 126
127 static void populateBlobData( 127 static void populateBlobData(
128 BlobData*, 128 BlobData*,
129 const HeapVector<ArrayBufferOrArrayBufferViewOrBlobOrUSVString>& parts, 129 const HeapVector<ArrayBufferOrArrayBufferViewOrBlobOrUSVString>& parts,
130 bool normalizeLineEndingsToNative); 130 bool normalizeLineEndingsToNative);
131 static void clampSliceOffsets(long long size, 131 static void clampSliceOffsets(long long size,
132 long long& start, 132 long long& start,
133 long long& end); 133 long long& end);
134 134
135 // Called by the Blob and File constructors when processing the 'type'
136 // option per the FileAPI standard. Returns "" if |type| contains any
137 // character outside U+0020...U+007E, or |type| ASCII-lowercased otherwise.
138 static String normalizeType(const String& type);
139
135 private: 140 private:
136 Blob(); 141 Blob();
137 142
138 RefPtr<BlobDataHandle> m_blobDataHandle; 143 RefPtr<BlobDataHandle> m_blobDataHandle;
139 bool m_isClosed; 144 bool m_isClosed;
140 }; 145 };
141 146
142 } // namespace blink 147 } // namespace blink
143 148
144 #endif // Blob_h 149 #endif // Blob_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698