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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/android/resources/resource.cc
diff --git a/ui/android/resources/resource.cc b/ui/android/resources/resource.cc
new file mode 100644
index 0000000000000000000000000000000000000000..91fb44f14a45a22bbad569cfbe6d15f04e19bc06
--- /dev/null
+++ b/ui/android/resources/resource.cc
@@ -0,0 +1,32 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/android/resources/resource.h"
+
+#include "base/memory/ptr_util.h"
+#include "base/trace_event/memory_usage_estimator.h"
+
+namespace ui {
+
+Resource::Resource() : Resource(Type::BITMAP) {}
+
+Resource::Resource(Type type) : type_(type) {}
+
+Resource::~Resource() = default;
+
+void Resource::SetUIResource(std::unique_ptr<cc::ScopedUIResource> ui_resource,
+ const gfx::Size& size) {
+ ui_resource_ = std::move(ui_resource);
+ size_ = size;
+}
+
+std::unique_ptr<Resource> Resource::CreateForCopy() {
+ return base::MakeUnique<Resource>();
+}
+
+size_t Resource::EstimateMemoryUsage() const {
+ return base::trace_event::EstimateMemoryUsage(ui_resource_);
+}
+
+} // namespace ui
« 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