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

Side by Side Diff: media/blink/active_loader.h

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 | « no previous file | media/blink/active_loader.cc » ('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 #ifndef MEDIA_BLINK_ACTIVE_LOADER_H_ 5 #ifndef MEDIA_BLINK_ACTIVE_LOADER_H_
6 #define MEDIA_BLINK_ACTIVE_LOADER_H_ 6 #define MEDIA_BLINK_ACTIVE_LOADER_H_
7 7
8 #include <memory>
9
8 #include "base/macros.h" 10 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "media/blink/media_blink_export.h" 11 #include "media/blink/media_blink_export.h"
11 12
12 namespace blink { 13 namespace blink {
13 class WebURLLoader; 14 class WebURLLoader;
14 } 15 }
15 16
16 namespace media { 17 namespace media {
17 18
18 // Wraps an active WebURLLoader with some additional state. 19 // Wraps an active WebURLLoader with some additional state.
19 // 20 //
20 // Handles deferring and deletion of loaders. 21 // Handles deferring and deletion of loaders.
21 class MEDIA_BLINK_EXPORT ActiveLoader { 22 class MEDIA_BLINK_EXPORT ActiveLoader {
22 public: 23 public:
23 // Creates an ActiveLoader with the given loader. It is assumed that the 24 // Creates an ActiveLoader with the given loader. It is assumed that the
24 // initial state of |loader| is loading and not deferred. 25 // initial state of |loader| is loading and not deferred.
25 explicit ActiveLoader(scoped_ptr<blink::WebURLLoader> loader); 26 explicit ActiveLoader(std::unique_ptr<blink::WebURLLoader> loader);
26 ~ActiveLoader(); 27 ~ActiveLoader();
27 28
28 // Starts or stops deferring the resource load. 29 // Starts or stops deferring the resource load.
29 void SetDeferred(bool deferred); 30 void SetDeferred(bool deferred);
30 bool deferred() { return deferred_; } 31 bool deferred() { return deferred_; }
31 32
32 private: 33 private:
33 friend class BufferedDataSourceTest; 34 friend class BufferedDataSourceTest;
34 friend class MultibufferDataSourceTest; 35 friend class MultibufferDataSourceTest;
35 36
36 scoped_ptr<blink::WebURLLoader> loader_; 37 std::unique_ptr<blink::WebURLLoader> loader_;
37 bool deferred_; 38 bool deferred_;
38 39
39 DISALLOW_IMPLICIT_CONSTRUCTORS(ActiveLoader); 40 DISALLOW_IMPLICIT_CONSTRUCTORS(ActiveLoader);
40 }; 41 };
41 42
42 } // namespace media 43 } // namespace media
43 44
44 #endif // MEDIA_BLINK_ACTIVE_LOADER_H_ 45 #endif // MEDIA_BLINK_ACTIVE_LOADER_H_
OLDNEW
« no previous file with comments | « no previous file | media/blink/active_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698