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

Side by Side Diff: media/blink/texttrack_impl.cc

Issue 1904253002: Convert //media/blink from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « media/blink/texttrack_impl.h ('k') | media/blink/url_index.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/blink/texttrack_impl.h" 5 #include "media/blink/texttrack_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
11 #include "base/single_thread_task_runner.h" 11 #include "base/single_thread_task_runner.h"
12 #include "media/base/bind_to_current_loop.h" 12 #include "media/base/bind_to_current_loop.h"
13 #include "media/blink/webinbandtexttrack_impl.h" 13 #include "media/blink/webinbandtexttrack_impl.h"
14 #include "third_party/WebKit/public/platform/WebInbandTextTrackClient.h" 14 #include "third_party/WebKit/public/platform/WebInbandTextTrackClient.h"
15 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" 15 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h"
16 16
17 namespace media { 17 namespace media {
18 18
19 TextTrackImpl::TextTrackImpl( 19 TextTrackImpl::TextTrackImpl(
20 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, 20 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
21 blink::WebMediaPlayerClient* client, 21 blink::WebMediaPlayerClient* client,
22 scoped_ptr<WebInbandTextTrackImpl> text_track) 22 std::unique_ptr<WebInbandTextTrackImpl> text_track)
23 : task_runner_(task_runner), 23 : task_runner_(task_runner),
24 client_(client), 24 client_(client),
25 text_track_(std::move(text_track)) { 25 text_track_(std::move(text_track)) {
26 client_->addTextTrack(text_track_.get()); 26 client_->addTextTrack(text_track_.get());
27 } 27 }
28 28
29 TextTrackImpl::~TextTrackImpl() { 29 TextTrackImpl::~TextTrackImpl() {
30 task_runner_->PostTask( 30 task_runner_->PostTask(
31 FROM_HERE, 31 FROM_HERE,
32 base::Bind(&TextTrackImpl::OnRemoveTrack, 32 base::Bind(&TextTrackImpl::OnRemoveTrack,
(...skipping 24 matching lines...) Expand all
57 client->addWebVTTCue(start.InSecondsF(), 57 client->addWebVTTCue(start.InSecondsF(),
58 end.InSecondsF(), 58 end.InSecondsF(),
59 blink::WebString::fromUTF8(id), 59 blink::WebString::fromUTF8(id),
60 blink::WebString::fromUTF8(content), 60 blink::WebString::fromUTF8(content),
61 blink::WebString::fromUTF8(settings)); 61 blink::WebString::fromUTF8(settings));
62 } 62 }
63 } 63 }
64 64
65 void TextTrackImpl::OnRemoveTrack( 65 void TextTrackImpl::OnRemoveTrack(
66 blink::WebMediaPlayerClient* client, 66 blink::WebMediaPlayerClient* client,
67 scoped_ptr<WebInbandTextTrackImpl> text_track) { 67 std::unique_ptr<WebInbandTextTrackImpl> text_track) {
68 if (text_track->client()) 68 if (text_track->client())
69 client->removeTextTrack(text_track.get()); 69 client->removeTextTrack(text_track.get());
70 } 70 }
71 71
72 } // namespace media 72 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/texttrack_impl.h ('k') | media/blink/url_index.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698