| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 static PassRefPtr<Blob> create(PassRefPtr<BlobDataHandle> blobDataHandle) | 53 static PassRefPtr<Blob> create(PassRefPtr<BlobDataHandle> blobDataHandle) |
| 54 { | 54 { |
| 55 return adoptRef(new Blob(blobDataHandle)); | 55 return adoptRef(new Blob(blobDataHandle)); |
| 56 } | 56 } |
| 57 | 57 |
| 58 virtual ~Blob(); | 58 virtual ~Blob(); |
| 59 | 59 |
| 60 String uuid() const { return m_blobDataHandle->uuid(); } | 60 String uuid() const { return m_blobDataHandle->uuid(); } |
| 61 String type() const { return m_blobDataHandle->type(); } | 61 String type() const { return m_blobDataHandle->type(); } |
| 62 virtual unsigned long long size() const { return m_blobDataHandle->size(); } | 62 virtual unsigned long long size() const { return m_blobDataHandle->size(); } |
| 63 // True for all File instances, including the user-built ones. |
| 63 virtual bool isFile() const { return false; } | 64 virtual bool isFile() const { return false; } |
| 65 // Only true for File instances sourced from the filesystem. |
| 66 virtual bool hasBackingFile() const { return false; } |
| 64 PassRefPtr<BlobDataHandle> blobDataHandle() const { return m_blobDataHandle;
} | 67 PassRefPtr<BlobDataHandle> blobDataHandle() const { return m_blobDataHandle;
} |
| 65 PassRefPtr<Blob> slice(long long start = 0, long long end = std::numeric_lim
its<long long>::max(), const String& contentType = String()) const; | 68 PassRefPtr<Blob> slice(long long start = 0, long long end = std::numeric_lim
its<long long>::max(), const String& contentType = String()) const; |
| 66 | 69 |
| 67 // URLRegistrable to support PublicURLs. | 70 // URLRegistrable to support PublicURLs. |
| 68 virtual URLRegistry& registry() const OVERRIDE; | 71 virtual URLRegistry& registry() const OVERRIDE; |
| 69 | 72 |
| 70 protected: | 73 protected: |
| 71 explicit Blob(PassRefPtr<BlobDataHandle>); | 74 explicit Blob(PassRefPtr<BlobDataHandle>); |
| 72 | 75 |
| 73 private: | 76 private: |
| 74 Blob(); | 77 Blob(); |
| 75 RefPtr<BlobDataHandle> m_blobDataHandle; | 78 RefPtr<BlobDataHandle> m_blobDataHandle; |
| 76 }; | 79 }; |
| 77 | 80 |
| 78 } // namespace WebCore | 81 } // namespace WebCore |
| 79 | 82 |
| 80 #endif // Blob_h | 83 #endif // Blob_h |
| OLD | NEW |