| 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 30 matching lines...) Expand all Loading... |
| 41 #include "platform/blob/BlobData.h" | 41 #include "platform/blob/BlobData.h" |
| 42 #include "platform/heap/Handle.h" | 42 #include "platform/heap/Handle.h" |
| 43 #include "wtf/PassRefPtr.h" | 43 #include "wtf/PassRefPtr.h" |
| 44 #include "wtf/text/WTFString.h" | 44 #include "wtf/text/WTFString.h" |
| 45 | 45 |
| 46 namespace blink { | 46 namespace blink { |
| 47 | 47 |
| 48 class BlobPropertyBag; | 48 class BlobPropertyBag; |
| 49 class ExceptionState; | 49 class ExceptionState; |
| 50 class ExecutionContext; | 50 class ExecutionContext; |
| 51 class ScriptState; |
| 51 | 52 |
| 52 class CORE_EXPORT Blob : public GarbageCollectedFinalized<Blob>, | 53 class CORE_EXPORT Blob : public GarbageCollectedFinalized<Blob>, |
| 53 public ScriptWrappable, | 54 public ScriptWrappable, |
| 54 public URLRegistrable, | 55 public URLRegistrable, |
| 55 public ImageBitmapSource { | 56 public ImageBitmapSource { |
| 56 DEFINE_WRAPPERTYPEINFO(); | 57 DEFINE_WRAPPERTYPEINFO(); |
| 57 | 58 |
| 58 public: | 59 public: |
| 59 static Blob* create(ExecutionContext*, ExceptionState&) { | 60 static Blob* create(ExecutionContext*, ExceptionState&) { |
| 60 return new Blob(BlobDataHandle::create()); | 61 return new Blob(BlobDataHandle::create()); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 91 Blob* slice(long long start, ExceptionState& exceptionState) const { | 92 Blob* slice(long long start, ExceptionState& exceptionState) const { |
| 92 return slice(start, std::numeric_limits<long long>::max(), String(), | 93 return slice(start, std::numeric_limits<long long>::max(), String(), |
| 93 exceptionState); | 94 exceptionState); |
| 94 } | 95 } |
| 95 Blob* slice(long long start, | 96 Blob* slice(long long start, |
| 96 long long end, | 97 long long end, |
| 97 ExceptionState& exceptionState) const { | 98 ExceptionState& exceptionState) const { |
| 98 return slice(start, end, String(), exceptionState); | 99 return slice(start, end, String(), exceptionState); |
| 99 } | 100 } |
| 100 | 101 |
| 101 virtual void close(ExecutionContext*, ExceptionState&); | 102 virtual void close(ScriptState*, ExceptionState&); |
| 102 | 103 |
| 103 String type() const { return m_blobDataHandle->type(); } | 104 String type() const { return m_blobDataHandle->type(); } |
| 104 String uuid() const { return m_blobDataHandle->uuid(); } | 105 String uuid() const { return m_blobDataHandle->uuid(); } |
| 105 PassRefPtr<BlobDataHandle> blobDataHandle() const { return m_blobDataHandle; } | 106 PassRefPtr<BlobDataHandle> blobDataHandle() const { return m_blobDataHandle; } |
| 106 // True for all File instances, including the user-built ones. | 107 // True for all File instances, including the user-built ones. |
| 107 virtual bool isFile() const { return false; } | 108 virtual bool isFile() const { return false; } |
| 108 // Only true for File instances that are backed by platform files. | 109 // Only true for File instances that are backed by platform files. |
| 109 virtual bool hasBackingFile() const { return false; } | 110 virtual bool hasBackingFile() const { return false; } |
| 110 bool isClosed() const { return m_isClosed; } | 111 bool isClosed() const { return m_isClosed; } |
| 111 | 112 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 134 private: | 135 private: |
| 135 Blob(); | 136 Blob(); |
| 136 | 137 |
| 137 RefPtr<BlobDataHandle> m_blobDataHandle; | 138 RefPtr<BlobDataHandle> m_blobDataHandle; |
| 138 bool m_isClosed; | 139 bool m_isClosed; |
| 139 }; | 140 }; |
| 140 | 141 |
| 141 } // namespace blink | 142 } // namespace blink |
| 142 | 143 |
| 143 #endif // Blob_h | 144 #endif // Blob_h |
| OLD | NEW |