diff options
author | Mathias Agopian <mathias@google.com> | 2013-07-29 21:24:40 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2013-07-30 21:19:02 -0700 |
commit | 1d76781b7aa19611c4045fdf6b848af6c6094e0b (patch) | |
tree | 5893726ba71c52500ae5da3f3ae313f9c67a4d6e /libs/utils | |
parent | 7925b6bdb81bd15f4eacc28b1a6dd3af2c494abb (diff) | |
download | frameworks_native-1d76781b7aa19611c4045fdf6b848af6c6094e0b.zip frameworks_native-1d76781b7aa19611c4045fdf6b848af6c6094e0b.tar.gz frameworks_native-1d76781b7aa19611c4045fdf6b848af6c6094e0b.tar.bz2 |
Make Flattenable not virtual (libutils)
Making an object Flattenable doesn't force it to
become virtual anymore. For instance, Fence and GraphicBuffer
are now non-virtual classes.
Also change Flatennable protocol a bit so that it updates
its parameters (pointers, sizes) to make it easier
to implement a flattenable in terms of other flattenables.
Change-Id: Ie81dc7637180b3c2cfcbaf644f8987ca804eb891
Diffstat (limited to 'libs/utils')
-rw-r--r-- | libs/utils/Android.mk | 1 | ||||
-rw-r--r-- | libs/utils/BlobCache.cpp | 20 | ||||
-rw-r--r-- | libs/utils/Flattenable.cpp | 24 |
3 files changed, 2 insertions, 43 deletions
diff --git a/libs/utils/Android.mk b/libs/utils/Android.mk index abf4b2e..7e6b1be 100644 --- a/libs/utils/Android.mk +++ b/libs/utils/Android.mk @@ -22,7 +22,6 @@ commonSources:= \ BlobCache.cpp \ CallStack.cpp \ FileMap.cpp \ - Flattenable.cpp \ JenkinsHash.cpp \ LinearAllocator.cpp \ LinearTransform.cpp \ diff --git a/libs/utils/BlobCache.cpp b/libs/utils/BlobCache.cpp index be398ee..0fb1d8e 100644 --- a/libs/utils/BlobCache.cpp +++ b/libs/utils/BlobCache.cpp @@ -176,17 +176,7 @@ size_t BlobCache::getFlattenedSize() const { return size; } -size_t BlobCache::getFdCount() const { - return 0; -} - -status_t BlobCache::flatten(void* buffer, size_t size, int fds[], size_t count) - const { - if (count != 0) { - ALOGE("flatten: nonzero fd count: %zu", count); - return BAD_VALUE; - } - +status_t BlobCache::flatten(void* buffer, size_t size) const { // Write the cache header if (size < sizeof(Header)) { ALOGE("flatten: not enough room for cache header"); @@ -228,16 +218,10 @@ status_t BlobCache::flatten(void* buffer, size_t size, int fds[], size_t count) return OK; } -status_t BlobCache::unflatten(void const* buffer, size_t size, int fds[], - size_t count) { +status_t BlobCache::unflatten(void const* buffer, size_t size) { // All errors should result in the BlobCache being in an empty state. mCacheEntries.clear(); - if (count != 0) { - ALOGE("unflatten: nonzero fd count: %zu", count); - return BAD_VALUE; - } - // Read the cache header if (size < sizeof(Header)) { ALOGE("unflatten: not enough room for cache header"); diff --git a/libs/utils/Flattenable.cpp b/libs/utils/Flattenable.cpp deleted file mode 100644 index 1f2ffaa..0000000 --- a/libs/utils/Flattenable.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2006 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <utils/Flattenable.h> - -namespace android { - -Flattenable::~Flattenable() { -} - -}; // namespace android |