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

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: Rebased 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 explicit Blob(PassRefPtr<BlobDataHandle>); 124 explicit Blob(PassRefPtr<BlobDataHandle>);
125 125
126 static void populateBlobData( 126 static void populateBlobData(
127 BlobData*, 127 BlobData*,
128 const HeapVector<ArrayBufferOrArrayBufferViewOrBlobOrUSVString>& parts, 128 const HeapVector<ArrayBufferOrArrayBufferViewOrBlobOrUSVString>& parts,
129 bool normalizeLineEndingsToNative); 129 bool normalizeLineEndingsToNative);
130 static void clampSliceOffsets(long long size, 130 static void clampSliceOffsets(long long size,
131 long long& start, 131 long long& start,
132 long long& end); 132 long long& end);
133 133
134 // Returns "" if |type| contains any character outside U+0020...U+007E, or
135 // |type| ASCII-lowercased otherwise.
kinuko 2017/03/08 06:13:39 Could we make this comment a little clearer why we
jsbell 2017/03/10 01:04:35 Done. Well, I referenced the spec, since this is u
136 static String normalizeType(const String& type);
137
134 private: 138 private:
135 Blob(); 139 Blob();
136 140
137 RefPtr<BlobDataHandle> m_blobDataHandle; 141 RefPtr<BlobDataHandle> m_blobDataHandle;
138 bool m_isClosed; 142 bool m_isClosed;
139 }; 143 };
140 144
141 } // namespace blink 145 } // namespace blink
142 146
143 #endif // Blob_h 147 #endif // Blob_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698