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

Unified Diff: Source/core/html/TimeRanges.cpp

Issue 61603006: Remove MediaSourcePrivate/SourceBufferPrivate (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: assert null 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/TimeRanges.h ('k') | Source/core/html/TimeRangesTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/TimeRanges.cpp
diff --git a/Source/core/html/TimeRanges.cpp b/Source/core/html/TimeRanges.cpp
index 71fd4fde32ec606d5c613a3eaee6ec5d8d5dd508..d2672eb0424df8a01b8335db0e071a3a61a32070 100644
--- a/Source/core/html/TimeRanges.cpp
+++ b/Source/core/html/TimeRanges.cpp
@@ -40,6 +40,17 @@ TimeRanges::TimeRanges(double start, double end)
add(start, end);
}
+PassRefPtr<TimeRanges> TimeRanges::create(const blink::WebTimeRanges& webRanges)
+{
+ RefPtr<TimeRanges> ranges = TimeRanges::create();
+
+ unsigned size = webRanges.size();
+ for (unsigned i = 0; i < size; ++i)
+ ranges->add(webRanges[i].start, webRanges[i].end);
+
+ return ranges.release();
+}
+
PassRefPtr<TimeRanges> TimeRanges::copy() const
{
RefPtr<TimeRanges> newSession = TimeRanges::create();
« no previous file with comments | « Source/core/html/TimeRanges.h ('k') | Source/core/html/TimeRangesTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698