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

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: fixes Created 9 years 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
« no previous file with comments | « tools/valgrind/memcheck/suppressions.txt ('k') | webkit/media/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
(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 deletion of loaders.
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 //
29 // ActiveLoader takes ownership of |loader|.
30 ActiveLoader(const scoped_refptr<BufferedResourceLoader>& parent,
31 WebKit::WebURLLoader* loader);
32 ~ActiveLoader();
33
34 // Starts or stops deferring the resource load.
35 void SetDeferred(bool deferred);
36 bool deferred() { return deferred_; }
37
38 // Cancels the URL loader associated with this object.
39 void Cancel();
40
41 private:
42 friend class BufferedDataSourceTest;
43
44 scoped_refptr<BufferedResourceLoader> parent_;
45 scoped_ptr<WebKit::WebURLLoader> loader_;
46 bool deferred_;
47
48 DISALLOW_IMPLICIT_CONSTRUCTORS(ActiveLoader);
49 };
50
51 } // namespace webkit_media
52
53 #endif // WEBKIT_MEDIA_ACTIVE_LOADER_H_
OLDNEW
« no previous file with comments | « tools/valgrind/memcheck/suppressions.txt ('k') | webkit/media/active_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698