Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 return new Blob(BlobDataHandle::create()); | 58 return new Blob(BlobDataHandle::create()); |
| 59 } | 59 } |
| 60 | 60 |
| 61 static Blob* create(const HeapVector<ArrayBufferOrArrayBufferViewOrBlobOrStr ing>&, const BlobPropertyBag&, ExceptionState&); | 61 static Blob* create(const HeapVector<ArrayBufferOrArrayBufferViewOrBlobOrStr ing>&, const BlobPropertyBag&, ExceptionState&); |
| 62 | 62 |
| 63 static Blob* create(PassRefPtr<BlobDataHandle> blobDataHandle) | 63 static Blob* create(PassRefPtr<BlobDataHandle> blobDataHandle) |
| 64 { | 64 { |
| 65 return new Blob(blobDataHandle); | 65 return new Blob(blobDataHandle); |
| 66 } | 66 } |
| 67 | 67 |
| 68 static Blob* create(const unsigned char* data, size_t bytes, const String& m imeType); | |
|
philipj_slow
2016/01/19 22:28:14
s/mimeType/contentType/ to match other bits of Blo
| |
| 69 | |
| 68 ~Blob() override; | 70 ~Blob() override; |
| 69 | 71 |
| 70 virtual unsigned long long size() const { return m_blobDataHandle->size(); } | 72 virtual unsigned long long size() const { return m_blobDataHandle->size(); } |
| 71 virtual Blob* slice(long long start, long long end, const String& contentTyp e, ExceptionState&) const; | 73 virtual Blob* slice(long long start, long long end, const String& contentTyp e, ExceptionState&) const; |
| 72 | 74 |
| 73 // To allow ExceptionState to be passed in last, manually enumerate the opti onal argument overloads. | 75 // To allow ExceptionState to be passed in last, manually enumerate the opti onal argument overloads. |
| 74 Blob* slice(ExceptionState& exceptionState) const | 76 Blob* slice(ExceptionState& exceptionState) const |
| 75 { | 77 { |
| 76 return slice(0, std::numeric_limits<long long>::max(), String(), excepti onState); | 78 return slice(0, std::numeric_limits<long long>::max(), String(), excepti onState); |
| 77 } | 79 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 134 private: | 136 private: |
| 135 Blob(); | 137 Blob(); |
| 136 | 138 |
| 137 RefPtr<BlobDataHandle> m_blobDataHandle; | 139 RefPtr<BlobDataHandle> m_blobDataHandle; |
| 138 bool m_hasBeenClosed; | 140 bool m_hasBeenClosed; |
| 139 }; | 141 }; |
| 140 | 142 |
| 141 } // namespace blink | 143 } // namespace blink |
| 142 | 144 |
| 143 #endif // Blob_h | 145 #endif // Blob_h |
| OLD | NEW |