| Index: third_party/grpc/src/php/ext/grpc/call.h
|
| diff --git a/third_party/tcmalloc/chromium/src/base/thread_lister.c b/third_party/grpc/src/php/ext/grpc/call.h
|
| similarity index 58%
|
| copy from third_party/tcmalloc/chromium/src/base/thread_lister.c
|
| copy to third_party/grpc/src/php/ext/grpc/call.h
|
| index bc180dba7a9f2ba3b8261009c8af85f0b1d4a023..73efadae3512be7046d9a559f76b71c7340373c9 100644
|
| --- a/third_party/tcmalloc/chromium/src/base/thread_lister.c
|
| +++ b/third_party/grpc/src/php/ext/grpc/call.h
|
| @@ -1,4 +1,6 @@
|
| -/* Copyright (c) 2005-2007, Google Inc.
|
| +/*
|
| + *
|
| + * Copyright 2015, Google Inc.
|
| * All rights reserved.
|
| *
|
| * Redistribution and use in source and binary forms, with or without
|
| @@ -27,51 +29,45 @@
|
| * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| *
|
| - * ---
|
| - * Author: Markus Gutschke
|
| */
|
|
|
| +#ifndef NET_GRPC_PHP_GRPC_CALL_H_
|
| +#define NET_GRPC_PHP_GRPC_CALL_H_
|
| +
|
| +#ifdef HAVE_CONFIG_H
|
| #include "config.h"
|
| -#include <stdio.h> /* needed for NULL on some powerpc platforms (?!) */
|
| -#ifdef HAVE_SYS_PRCTL
|
| -# include <sys/prctl.h>
|
| #endif
|
| -#include "base/thread_lister.h"
|
| -#include "base/linuxthreads.h"
|
| -/* Include other thread listers here that define THREADS macro
|
| - * only when they can provide a good implementation.
|
| - */
|
|
|
| -#ifndef THREADS
|
| +#include <php.h>
|
| +#include <php_ini.h>
|
| +#include <ext/standard/info.h>
|
| +#include "php_grpc.h"
|
|
|
| -/* Default trivial thread lister for single-threaded applications,
|
| - * or if the multi-threading code has not been ported, yet.
|
| - */
|
| +#include <grpc/grpc.h>
|
|
|
| -int ListAllProcessThreads(void *parameter,
|
| - ListAllProcessThreadsCallBack callback, ...) {
|
| - int rc;
|
| - va_list ap;
|
| - pid_t pid;
|
| +/* Class entry for the Call PHP class */
|
| +extern zend_class_entry *grpc_ce_call;
|
|
|
| -#ifdef HAVE_SYS_PRCTL
|
| - int dumpable = prctl(PR_GET_DUMPABLE, 0);
|
| - if (!dumpable)
|
| - prctl(PR_SET_DUMPABLE, 1);
|
| -#endif
|
| - va_start(ap, callback);
|
| - pid = getpid();
|
| - rc = callback(parameter, 1, &pid, ap);
|
| - va_end(ap);
|
| -#ifdef HAVE_SYS_PRCTL
|
| - if (!dumpable)
|
| - prctl(PR_SET_DUMPABLE, 0);
|
| -#endif
|
| - return rc;
|
| -}
|
| +/* Wrapper struct for grpc_call that can be associated with a PHP object */
|
| +typedef struct wrapped_grpc_call {
|
| + zend_object std;
|
| +
|
| + bool owned;
|
| + grpc_call *wrapped;
|
| +} wrapped_grpc_call;
|
| +
|
| +/* Initializes the Call PHP class */
|
| +void grpc_init_call(TSRMLS_D);
|
| +
|
| +/* Creates a Call object that wraps the given grpc_call struct */
|
| +zval *grpc_php_wrap_call(grpc_call *wrapped, bool owned);
|
| +
|
| +/* Creates and returns a PHP associative array of metadata from a C array of
|
| + * call metadata */
|
| +zval *grpc_parse_metadata_array(grpc_metadata_array *metadata_array);
|
|
|
| -int ResumeAllProcessThreads(int num_threads, pid_t *thread_pids) {
|
| - return 1;
|
| -}
|
| +/* Populates a grpc_metadata_array with the data in a PHP array object.
|
| + Returns true on success and false on failure */
|
| +bool create_metadata_array(zval *array, grpc_metadata_array *metadata);
|
|
|
| -#endif /* ifndef THREADS */
|
| +#endif /* NET_GRPC_PHP_GRPC_CHANNEL_H_ */
|
|
|