media/omx-plugin/include/gb/binder/Binder.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /*
michael@0 2 * Copyright (C) 2008 The Android Open Source Project
michael@0 3 *
michael@0 4 * Licensed under the Apache License, Version 2.0 (the "License");
michael@0 5 * you may not use this file except in compliance with the License.
michael@0 6 * You may obtain a copy of the License at
michael@0 7 *
michael@0 8 * http://www.apache.org/licenses/LICENSE-2.0
michael@0 9 *
michael@0 10 * Unless required by applicable law or agreed to in writing, software
michael@0 11 * distributed under the License is distributed on an "AS IS" BASIS,
michael@0 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
michael@0 13 * See the License for the specific language governing permissions and
michael@0 14 * limitations under the License.
michael@0 15 */
michael@0 16
michael@0 17 #ifndef ANDROID_BINDER_H
michael@0 18 #define ANDROID_BINDER_H
michael@0 19
michael@0 20 #include <binder/IBinder.h>
michael@0 21
michael@0 22 // ---------------------------------------------------------------------------
michael@0 23 namespace android {
michael@0 24
michael@0 25 class BBinder : public IBinder
michael@0 26 {
michael@0 27 public:
michael@0 28 BBinder();
michael@0 29
michael@0 30 virtual const String16& getInterfaceDescriptor() const;
michael@0 31 virtual bool isBinderAlive() const;
michael@0 32 virtual status_t pingBinder();
michael@0 33 virtual status_t dump(int fd, const Vector<String16>& args);
michael@0 34
michael@0 35 virtual status_t transact( uint32_t code,
michael@0 36 const Parcel& data,
michael@0 37 Parcel* reply,
michael@0 38 uint32_t flags = 0);
michael@0 39
michael@0 40 virtual status_t linkToDeath(const sp<DeathRecipient>& recipient,
michael@0 41 void* cookie = NULL,
michael@0 42 uint32_t flags = 0);
michael@0 43
michael@0 44 virtual status_t unlinkToDeath( const wp<DeathRecipient>& recipient,
michael@0 45 void* cookie = NULL,
michael@0 46 uint32_t flags = 0,
michael@0 47 wp<DeathRecipient>* outRecipient = NULL);
michael@0 48
michael@0 49 virtual void attachObject( const void* objectID,
michael@0 50 void* object,
michael@0 51 void* cleanupCookie,
michael@0 52 object_cleanup_func func);
michael@0 53 virtual void* findObject(const void* objectID) const;
michael@0 54 virtual void detachObject(const void* objectID);
michael@0 55
michael@0 56 virtual BBinder* localBinder();
michael@0 57
michael@0 58 protected:
michael@0 59 virtual ~BBinder();
michael@0 60
michael@0 61 virtual status_t onTransact( uint32_t code,
michael@0 62 const Parcel& data,
michael@0 63 Parcel* reply,
michael@0 64 uint32_t flags = 0);
michael@0 65
michael@0 66 private:
michael@0 67 BBinder(const BBinder& o);
michael@0 68 BBinder& operator=(const BBinder& o);
michael@0 69
michael@0 70 class Extras;
michael@0 71
michael@0 72 Extras* mExtras;
michael@0 73 void* mReserved0;
michael@0 74 };
michael@0 75
michael@0 76 // ---------------------------------------------------------------------------
michael@0 77
michael@0 78 class BpRefBase : public virtual RefBase
michael@0 79 {
michael@0 80 protected:
michael@0 81 BpRefBase(const sp<IBinder>& o);
michael@0 82 virtual ~BpRefBase();
michael@0 83 virtual void onFirstRef();
michael@0 84 virtual void onLastStrongRef(const void* id);
michael@0 85 virtual bool onIncStrongAttempted(uint32_t flags, const void* id);
michael@0 86
michael@0 87 inline IBinder* remote() { return mRemote; }
michael@0 88 inline IBinder* remote() const { return mRemote; }
michael@0 89
michael@0 90 private:
michael@0 91 BpRefBase(const BpRefBase& o);
michael@0 92 BpRefBase& operator=(const BpRefBase& o);
michael@0 93
michael@0 94 IBinder* const mRemote;
michael@0 95 RefBase::weakref_type* mRefs;
michael@0 96 volatile int32_t mState;
michael@0 97 };
michael@0 98
michael@0 99 }; // namespace android
michael@0 100
michael@0 101 // ---------------------------------------------------------------------------
michael@0 102
michael@0 103 #endif // ANDROID_BINDER_H

mercurial