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

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

Issue 8667002: Split a portion of BufferedResourceLoader into a separate class ActiveLoader. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef WEBKIT_MEDIA_ACTIVE_LOADER_H_
6 #define WEBKIT_MEDIA_ACTIVE_LOADER_H_
7
8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11
12 namespace WebKit {
13 class WebURLLoader;
14 }
15
16 namespace webkit_media {
17
18 class BufferedResourceLoader;
19
20 // Wraps an active WebURLLoader with some additional state and maintains a
21 // reference to its parent.
22 //
23 // Handles deferring and cancellation of loaders upon deletion.
24 class ActiveLoader {
25 public:
26 // Creates an ActiveLoader with a reference to its parent. The initial state
27 // assumes that the loader has started loading and has not been deferred.
28 ActiveLoader(const scoped_refptr<BufferedResourceLoader>& parent,
29 WebKit::WebURLLoader* loader);
Ami GONE FROM CHROMIUM 2011/11/29 18:55:49 Doco taking ownership.
scherkus (not reviewing) 2011/11/29 21:43:51 Done.
30 ~ActiveLoader();
31
32 // Starts or stops deferring the resource load.
33 void SetDeferred(bool deferred);
34
35 bool deferred() { return deferred_; }
36
37 private:
38 friend class BufferedDataSourceTest;
39
40 scoped_refptr<BufferedResourceLoader> parent_;
41 scoped_ptr<WebKit::WebURLLoader> loader_;
42 bool deferred_;
43
44 DISALLOW_IMPLICIT_CONSTRUCTORS(ActiveLoader);
45 };
46
47 } // namespace webkit_media
48
49 #endif // WEBKIT_MEDIA_ACTIVE_LOADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698