From 0ee45cfde322a90bb3369823e9cd6c192abe8070 Mon Sep 17 00:00:00 2001 From: "mseaborn@chromium.org" Date: Tue, 11 Feb 2014 03:55:18 +0000 Subject: NaCl: Move irt_ppapi.{c,h} to the Chromium repo from the NaCl repo This will allow irt_ppapi.{c,h} to be dropped from the NaCl side. Until then, there are two copies, and which copy gets linked in will depend on library search order. This creates a new directory, ppapi/nacl_irt/, for irt_ppapi.h since it defines structs that are part of NaCl's stable ABI. This new directory is therefore similar to ppapi/c/, but covers how PPAPI is hooked up in NaCl. This also avoids any checkdeps problems with #including from ppapi/proxy/. I made the following changes to irt_ppapi.{c,h} when moving them: * Changed "*" spacing to follow Chromium style. * Added a comment for the assignment to "g_is_main_thread". BUG= https://code.google.com/p/nativeclient/issues/detail?id=3787 TEST= tested browser_tests with irt_ppapi.c removed from the NaCl side Review URL: https://codereview.chromium.org/136333013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250319 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/nacl_irt/irt_ppapi.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 ppapi/nacl_irt/irt_ppapi.h (limited to 'ppapi/nacl_irt') diff --git a/ppapi/nacl_irt/irt_ppapi.h b/ppapi/nacl_irt/irt_ppapi.h new file mode 100644 index 0000000..23fbabe --- /dev/null +++ b/ppapi/nacl_irt/irt_ppapi.h @@ -0,0 +1,41 @@ +/* + * Copyright 2014 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. + */ + +/* + * TODO(mseaborn): Change this to match the filename when NaCl's copy + * of irt_ppapi.h is removed. For now it is needed to avoid a + * duplicate definition. + */ +#ifndef NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_PPAPI_H_ +#define NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_PPAPI_H_ 1 + +#include + +#include "ppapi/c/ppp.h" + +struct PP_StartFunctions { + int32_t (*PPP_InitializeModule)(PP_Module module_id, + PPB_GetInterface get_browser_interface); + void (*PPP_ShutdownModule)(); + const void* (*PPP_GetInterface)(const char* interface_name); +}; + +struct PP_ThreadFunctions { + /* + * This is a cut-down version of pthread_create()/pthread_join(). + * We omit thread creation attributes and the thread's return value. + * + * We use uintptr_t as the thread ID type because pthread_t is not + * part of the stable ABI; a user thread library might choose an + * arbitrary size for its own pthread_t. + */ + int (*thread_create)(uintptr_t* tid, + void (*func)(void* thread_argument), + void* thread_argument); + int (*thread_join)(uintptr_t tid); +}; + +#endif -- cgit v1.1