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

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

Issue 57483002: Implement File constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased against master, updated patch. Created 7 years, 1 month 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.
kinuko 2013/11/14 05:41:06 'Only true for File instances that is backed by a
pwnall-personal 2013/11/14 14:31:19 Done.
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698