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

Side by Side Diff: ui/android/resources/resource.cc

Issue 2746483003: ui/android: Fix Resource meta-data sharing with ResourceManager. (Closed)
Patch Set: jni Created 3 years, 9 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 | « ui/android/resources/resource.h ('k') | ui/android/resources/resource_factory.h » ('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 2017 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 "ui/android/resources/resource.h"
6
7 #include "base/memory/ptr_util.h"
8 #include "base/trace_event/memory_usage_estimator.h"
9
10 namespace ui {
11
12 Resource::Resource() : Resource(Type::BITMAP) {}
13
14 Resource::Resource(Type type) : type_(type) {}
15
16 Resource::~Resource() = default;
17
18 void Resource::SetUIResource(std::unique_ptr<cc::ScopedUIResource> ui_resource,
19 const gfx::Size& size) {
20 ui_resource_ = std::move(ui_resource);
21 size_ = size;
22 }
23
24 std::unique_ptr<Resource> Resource::CreateForCopy() {
25 return base::MakeUnique<Resource>();
26 }
27
28 size_t Resource::EstimateMemoryUsage() const {
29 return base::trace_event::EstimateMemoryUsage(ui_resource_);
30 }
31
32 } // namespace ui
OLDNEW
« no previous file with comments | « ui/android/resources/resource.h ('k') | ui/android/resources/resource_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698