summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorddorwin@chromium.org <ddorwin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-07 22:37:36 +0000
committerddorwin@chromium.org <ddorwin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-07 22:37:36 +0000
commit6788b080965ee06e7bc329526834cd1490a5b772 (patch)
treef265dd4bd700ef2ecef652dfa38014d3db7ae614 /ppapi
parent1e44a9a4adccf4f31d817177e2ee47b58c93f40d (diff)
downloadchromium_src-6788b080965ee06e7bc329526834cd1490a5b772.zip
chromium_src-6788b080965ee06e7bc329526834cd1490a5b772.tar.gz
chromium_src-6788b080965ee06e7bc329526834cd1490a5b772.tar.bz2
Added PPB_BrokerTrusted interface and a basic Chrome implementation of it.
The broker is not launched or connected yet. BUG=none TEST=none Review URL: http://codereview.chromium.org/6677178 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80858 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/c/trusted/ppb_broker_trusted.h66
-rw-r--r--ppapi/ppapi_cpp.gypi1
2 files changed, 67 insertions, 0 deletions
diff --git a/ppapi/c/trusted/ppb_broker_trusted.h b/ppapi/c/trusted/ppb_broker_trusted.h
new file mode 100644
index 0000000..68f2a97
--- /dev/null
+++ b/ppapi/c/trusted/ppb_broker_trusted.h
@@ -0,0 +1,66 @@
+/* Copyright (c) 2011 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.
+ */
+#ifndef PPAPI_C_PPB_BROKER_TRUSTED_H_
+#define PPAPI_C_PPB_BROKER_TRUSTED_H_
+
+#include "ppapi/c/pp_completion_callback.h"
+#include "ppapi/c/pp_bool.h"
+#include "ppapi/c/pp_instance.h"
+#include "ppapi/c/pp_resource.h"
+
+#define PPB_BROKER_TRUSTED_INTERFACE "PPB_BrokerTrusted;0.1"
+
+/**
+ * @file
+ * This file defines the PPB_BrokerTrusted interface, which provides
+ * access to a trusted broker with greater privileges than the plugin.
+ */
+
+/**
+ * @addtogroup Interfaces
+ * @{
+ */
+
+/**
+ * The PPB_BrokerTrusted interface provides access to a trusted broker
+ * with greater privileges than the plugin. The interface only supports
+ * out-of-process plugins and is to be used by proxy implementations. All
+ * functions should be called from the main thread only.
+ */
+struct PPB_BrokerTrusted {
+ /**
+ * Returns a trusted broker resource.
+ */
+ PP_Resource (*CreateTrusted)(PP_Instance instance);
+
+ /**
+ * Returns true if the resource is a trusted broker.
+ */
+ PP_Bool (*IsBrokerTrusted)(PP_Resource resource);
+
+ /**
+ * Connects to the trusted broker. It may have already
+ * been launched by another plugin instance.
+ * Returns PP_ERROR_WOULD_BLOCK on success, and invokes
+ * the |connect_callback| asynchronously to complete.
+ * As this function should always be invoked from the main thread,
+ * do not use the blocking variant of PP_CompletionCallback.
+ * Returns PP_ERROR_FAILED if called from an in-process plugin.
+ */
+ int32_t (*Connect)(PP_Resource broker,
+ struct PP_CompletionCallback connect_callback);
+
+ /**
+ * Returns the handle to the pipe. Use once Connect has completed.
+ * Returns PP_OK on success.
+ * Each plugin instance has its own pipe.
+ */
+ int32_t (*GetHandle)(PP_Resource broker, int32_t* handle);
+};
+/**
+ * @}
+ */
+
+#endif /* PPAPI_C_PPB_BROKER_TRUSTED_H_ */
diff --git a/ppapi/ppapi_cpp.gypi b/ppapi/ppapi_cpp.gypi
index ecd9fa0..be43504 100644
--- a/ppapi/ppapi_cpp.gypi
+++ b/ppapi/ppapi_cpp.gypi
@@ -102,6 +102,7 @@
# Trusted interfaces.
'c/trusted/ppb_audio_trusted.h',
'c/trusted/ppb_image_data_trusted.h',
+ 'c/trusted/ppb_broker_trusted.h',
'c/trusted/ppb_url_loader_trusted.h',
],
},