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

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

Issue 157363003: Implement Blob.close(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 10 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
« no previous file with comments | « Source/core/dom/DOMURL.cpp ('k') | Source/core/fileapi/Blob.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
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 virtual unsigned long long size() const { return m_blobDataHandle->size(); } 60 virtual unsigned long long size() const { return m_blobDataHandle->size(); }
61 virtual PassRefPtr<Blob> slice(long long start = 0, long long end = std::num eric_limits<long long>::max(), const String& contentType = String()) const; 61 virtual PassRefPtr<Blob> slice(long long start = 0, long long end = std::num eric_limits<long long>::max(), const String& contentType = String()) const;
62 virtual void close(ExecutionContext*);
62 63
63 String type() const { return m_blobDataHandle->type(); } 64 String type() const { return m_blobDataHandle->type(); }
64 String uuid() const { return m_blobDataHandle->uuid(); } 65 String uuid() const { return m_blobDataHandle->uuid(); }
65 PassRefPtr<BlobDataHandle> blobDataHandle() const { return m_blobDataHandle; } 66 PassRefPtr<BlobDataHandle> blobDataHandle() const { return m_blobDataHandle; }
66 // True for all File instances, including the user-built ones. 67 // True for all File instances, including the user-built ones.
67 virtual bool isFile() const { return false; } 68 virtual bool isFile() const { return false; }
68 // Only true for File instances that are backed by platform files. 69 // Only true for File instances that are backed by platform files.
69 virtual bool hasBackingFile() const { return false; } 70 virtual bool hasBackingFile() const { return false; }
71 bool hasBeenClosed() const { return m_hasBeenClosed; }
70 72
71 // Used by the JavaScript Blob and File constructors. 73 // Used by the JavaScript Blob and File constructors.
72 virtual void appendTo(BlobData&) const; 74 virtual void appendTo(BlobData&) const;
73 75
74 // URLRegistrable to support PublicURLs. 76 // URLRegistrable to support PublicURLs.
75 virtual URLRegistry& registry() const OVERRIDE FINAL; 77 virtual URLRegistry& registry() const OVERRIDE FINAL;
76 78
77 static void clampSliceOffsets(long long size, long long& start, long long& e nd);
78 protected: 79 protected:
79 explicit Blob(PassRefPtr<BlobDataHandle>); 80 explicit Blob(PassRefPtr<BlobDataHandle>);
80 81
82 static void clampSliceOffsets(long long size, long long& start, long long& e nd);
81 private: 83 private:
82 Blob(); 84 Blob();
85
83 RefPtr<BlobDataHandle> m_blobDataHandle; 86 RefPtr<BlobDataHandle> m_blobDataHandle;
87 bool m_hasBeenClosed;
84 }; 88 };
85 89
86 } // namespace WebCore 90 } // namespace WebCore
87 91
88 #endif // Blob_h 92 #endif // Blob_h
OLDNEW
« no previous file with comments | « Source/core/dom/DOMURL.cpp ('k') | Source/core/fileapi/Blob.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698