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

Unified Diff: Source/core/fileapi/File.cpp

Issue 337343002: IDL: make optional arguments (without default) explicit sometimes Base URL: https://chromium.googlesource.com/chromium/blink.git@idl-default-arguments-next
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/fileapi/File.h ('k') | Source/core/frame/ConsoleBase.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fileapi/File.cpp
diff --git a/Source/core/fileapi/File.cpp b/Source/core/fileapi/File.cpp
index a7d1d80359339c3866edd8099b67c00f7eca0857..5963b41e9e0dd56ca90d5785ea5bffcef8e1e0e9 100644
--- a/Source/core/fileapi/File.cpp
+++ b/Source/core/fileapi/File.cpp
@@ -216,7 +216,7 @@ unsigned long long File::size() const
return static_cast<unsigned long long>(size);
}
-PassRefPtrWillBeRawPtr<Blob> File::slice(long long start, long long end, const String& contentType, ExceptionState& exceptionState) const
+PassRefPtrWillBeRawPtr<Blob> File::slice(long long start, Optional<long long> optionalEnd, const String& contentType, ExceptionState& exceptionState) const
{
if (hasBeenClosed()) {
exceptionState.throwDOMException(InvalidStateError, "File has been closed.");
@@ -224,7 +224,9 @@ PassRefPtrWillBeRawPtr<Blob> File::slice(long long start, long long end, const S
}
if (!m_hasBackingFile)
- return Blob::slice(start, end, contentType, exceptionState);
+ return Blob::slice(start, optionalEnd, contentType, exceptionState);
+
+ long long end = optionalEnd.isMissing() ? std::numeric_limits<long long>::max() : optionalEnd.get();
// FIXME: This involves synchronous file operation. We need to figure out how to make it asynchronous.
long long size;
« no previous file with comments | « Source/core/fileapi/File.h ('k') | Source/core/frame/ConsoleBase.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698