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

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

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 | « webkit/media/active_loader.h ('k') | webkit/media/buffered_data_source_unittest.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 #include "webkit/media/active_loader.h"
6
7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLLoader.h"
8 #include "webkit/media/buffered_resource_loader.h"
9
10 namespace webkit_media {
11
12 ActiveLoader::ActiveLoader(
13 const scoped_refptr<BufferedResourceLoader>& parent,
14 WebKit::WebURLLoader* loader)
15 : parent_(parent),
16 loader_(loader),
17 deferred_(false) {
18 }
19
20 ActiveLoader::~ActiveLoader() {
21 if (parent_)
22 Cancel();
23 }
24
25 void ActiveLoader::SetDeferred(bool deferred) {
26 deferred_ = deferred;
27 loader_->setDefersLoading(deferred);
28 }
29
30 void ActiveLoader::Cancel() {
31 // We only need to maintain a reference to our parent while the loader is
32 // still active. Failing to do so can result in circular refcounts.
33 loader_->cancel();
34 parent_ = NULL;
35 }
36
37 } // namespace webkit_media
OLDNEW
« no previous file with comments | « webkit/media/active_loader.h ('k') | webkit/media/buffered_data_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698