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

Side by Side Diff: cc/resources/scoped_ui_resource.cc

Issue 18191020: UI Resource Manager (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Added DCHECK of resource queue size to PushPropertiesTo Created 7 years, 4 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 | « cc/resources/scoped_ui_resource.h ('k') | cc/resources/ui_resource_bitmap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "cc/resources/scoped_ui_resource.h"
6
7 #include "base/basictypes.h"
8 #include "base/bind.h"
9 #include "cc/trees/layer_tree_host.h"
10
11 namespace cc {
12
13 scoped_ptr<ScopedUIResource> ScopedUIResource::Create(
14 LayerTreeHost* host,
15 scoped_refptr<UIResourceBitmap> bitmap) {
16 return make_scoped_ptr(new ScopedUIResource(host, bitmap));
17 }
18
19 ScopedUIResource::ScopedUIResource(LayerTreeHost* host,
20 scoped_refptr<UIResourceBitmap> bitmap)
21 : bitmap_(bitmap), host_(host) {
22 DCHECK(host_);
23 id_ = host_->CreateUIResource(this);
24 }
25
26 // User must make sure that host is still valid before this object goes out of
27 // scope.
28 ScopedUIResource::~ScopedUIResource() {
29 if (id_) {
30 DCHECK(host_);
31 host_->DeleteUIResource(id_);
32 }
33 }
34
35 scoped_refptr<UIResourceBitmap> ScopedUIResource::GetBitmap(
36 UIResourceId uid,
37 bool resource_lost) {
38 return bitmap_;
39 }
40
41 ScopedUIResource::ScopedUIResource() {}
42
43 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/scoped_ui_resource.h ('k') | cc/resources/ui_resource_bitmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698