| Index: third_party/grpc/src/cpp/common/secure_auth_context.h
|
| diff --git a/third_party/tcmalloc/vendor/src/base/spinlock_internal.h b/third_party/grpc/src/cpp/common/secure_auth_context.h
|
| similarity index 57%
|
| copy from third_party/tcmalloc/vendor/src/base/spinlock_internal.h
|
| copy to third_party/grpc/src/cpp/common/secure_auth_context.h
|
| index 44942609f40a87492a7aeed0068a5e27bf9cd157..c9f1dad1319f8f8f5a2be031fce66d69842a67b0 100644
|
| --- a/third_party/tcmalloc/vendor/src/base/spinlock_internal.h
|
| +++ b/third_party/grpc/src/cpp/common/secure_auth_context.h
|
| @@ -1,4 +1,6 @@
|
| -/* Copyright (c) 2010, Google Inc.
|
| +/*
|
| + *
|
| + * Copyright 2015, Google Inc.
|
| * All rights reserved.
|
| *
|
| * Redistribution and use in source and binary forms, with or without
|
| @@ -27,38 +29,47 @@
|
| * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| *
|
| - * ---
|
| - * This file is an internal part spinlock.cc and once.cc
|
| - * It may not be used directly by code outside of //base.
|
| */
|
|
|
| -#ifndef BASE_SPINLOCK_INTERNAL_H_
|
| -#define BASE_SPINLOCK_INTERNAL_H_
|
| +#ifndef GRPC_INTERNAL_CPP_COMMON_SECURE_AUTH_CONTEXT_H
|
| +#define GRPC_INTERNAL_CPP_COMMON_SECURE_AUTH_CONTEXT_H
|
| +
|
| +#include <grpc++/security/auth_context.h>
|
| +
|
| +struct grpc_auth_context;
|
| +
|
| +namespace grpc {
|
| +
|
| +class SecureAuthContext GRPC_FINAL : public AuthContext {
|
| + public:
|
| + SecureAuthContext(grpc_auth_context* ctx, bool take_ownership);
|
| +
|
| + ~SecureAuthContext() GRPC_OVERRIDE;
|
| +
|
| + bool IsPeerAuthenticated() const GRPC_OVERRIDE;
|
|
|
| -#include <config.h>
|
| -#include "base/basictypes.h"
|
| -#include "base/atomicops.h"
|
| + std::vector<grpc::string_ref> GetPeerIdentity() const GRPC_OVERRIDE;
|
|
|
| -namespace base {
|
| -namespace internal {
|
| + grpc::string GetPeerIdentityPropertyName() const GRPC_OVERRIDE;
|
|
|
| -// SpinLockWait() waits until it can perform one of several transitions from
|
| -// "from" to "to". It returns when it performs a transition where done==true.
|
| -struct SpinLockWaitTransition {
|
| - int32 from;
|
| - int32 to;
|
| - bool done;
|
| + std::vector<grpc::string_ref> FindPropertyValues(
|
| + const grpc::string& name) const GRPC_OVERRIDE;
|
| +
|
| + AuthPropertyIterator begin() const GRPC_OVERRIDE;
|
| +
|
| + AuthPropertyIterator end() const GRPC_OVERRIDE;
|
| +
|
| + void AddProperty(const grpc::string& key,
|
| + const grpc::string_ref& value) GRPC_OVERRIDE;
|
| +
|
| + virtual bool SetPeerIdentityPropertyName(const grpc::string& name)
|
| + GRPC_OVERRIDE;
|
| +
|
| + private:
|
| + grpc_auth_context* ctx_;
|
| + bool take_ownership_;
|
| };
|
|
|
| -// Wait until *w can transition from trans[i].from to trans[i].to for some i
|
| -// satisfying 0<=i<n && trans[i].done, atomically make the transition,
|
| -// then return the old value of *w. Make any other atomic tranistions
|
| -// where !trans[i].done, but continue waiting.
|
| -int32 SpinLockWait(volatile Atomic32 *w, int n,
|
| - const SpinLockWaitTransition trans[]);
|
| -void SpinLockWake(volatile Atomic32 *w, bool all);
|
| -void SpinLockDelay(volatile Atomic32 *w, int32 value, int loop);
|
| -
|
| -} // namespace internal
|
| -} // namespace base
|
| -#endif
|
| +} // namespace grpc
|
| +
|
| +#endif // GRPC_INTERNAL_CPP_COMMON_SECURE_AUTH_CONTEXT_H
|
|
|