Chromium Code Reviews| Index: webkit/media/webtexttrack_impl.cc |
| diff --git a/webkit/media/webtexttrack_impl.cc b/webkit/media/webtexttrack_impl.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b6602f87af41efcd9da59159282a77260122a88e |
| --- /dev/null |
| +++ b/webkit/media/webtexttrack_impl.cc |
| @@ -0,0 +1,34 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "webkit/media/webtexttrack_impl.h" |
| +#include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" |
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebInbandTextTrackClient.h" |
| + |
| +namespace webkit_media { |
| + |
| +WebTextTrackImpl::WebTextTrackImpl(WebKit::WebInbandTextTrackClient* client) |
| + : client_(client) { |
| +} |
| + |
| +WebTextTrackImpl::~WebTextTrackImpl() { |
| + // TODO(matthewjheaney): Aaron suggests that this(?) dtor remove the |
| + // text track during destruction of this object. |
| +} |
| + |
| +void WebTextTrackImpl::addWebVTTCue(const base::TimeDelta& start, |
| + const base::TimeDelta& end, |
| + const std::string& id, |
| + const std::string& content, |
| + const std::string& settings) { |
| + const double startF = start.InSecondsF(); |
|
acolwell GONE FROM CHROMIUM
2013/05/10 02:22:08
nit: Inline all of this in the addWebVTTCue() call
Matthew Heaney (Chromium)
2013/05/10 05:21:08
Done.
|
| + const double endF = end.InSecondsF(); |
| + const WebKit::WebString webid = WebKit::WebString::fromUTF8(id); |
| + const WebKit::WebString webcontent = WebKit::WebString::fromUTF8(content); |
| + const WebKit::WebString websettings = WebKit::WebString::fromUTF8(settings); |
| + |
| + client_->addWebVTTCue(startF, endF, webid, webcontent, websettings); |
| +} |
| + |
| +} // namespace webkit_media |