Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(498)

Unified Diff: ppapi/api/dev/ppb_testing_dev.idl

Issue 8586031: Convert a few ppapi dev interfaces to IDL. NaCl has tests for these (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up a bit more Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/api/dev/ppb_memory_dev.idl ('k') | ppapi/api/dev/ppp_printing_dev.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/api/dev/ppb_testing_dev.idl
diff --git a/ppapi/api/dev/ppb_testing_dev.idl b/ppapi/api/dev/ppb_testing_dev.idl
new file mode 100644
index 0000000000000000000000000000000000000000..87d4541a086639c3e2034bd5603f3b37a47e1bbe
--- /dev/null
+++ b/ppapi/api/dev/ppb_testing_dev.idl
@@ -0,0 +1,80 @@
+/* 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.
+ */
+
+/**
+ * This file contains interface functions used for unit testing. Do not use in
+ * production code. They are not guaranteed to be available in normal plugin
+ * environments so you should not depend on them.
+ */
+
+label Chrome {
+ M14 = 0.7
+};
+
+interface PPB_Testing_Dev {
+ /**
+ * Reads the bitmap data out of the backing store for the given
+ * DeviceContext2D and into the given image. If the data was successfully
+ * read, it will return PP_TRUE.
+ *
+ * This function should not generally be necessary for normal plugin
+ * operation. If you want to update portions of a device, the expectation is
+ * that you will either regenerate the data, or maintain a backing store
+ * pushing updates to the device from your backing store via PaintImageData.
+ * Using this function will introduce an extra copy which will make your
+ * plugin slower. In some cases, this may be a very expensive operation (it
+ * may require slow cross-process transitions or graphics card readbacks).
+ *
+ * Data will be read into the image starting at |top_left| in the device
+ * context, and proceeding down and to the right for as many pixels as the
+ * image is large. If any part of the image bound would fall outside of the
+ * backing store of the device if positioned at |top_left|, this function
+ * will fail and return PP_FALSE.
+ *
+ * The image format must be of the format
+ * PPB_ImageData.GetNativeImageDataFormat() or this function will fail and
+ * return PP_FALSE.
+ *
+ * The returned image data will represent the current status of the backing
+ * store. This will not include any paint, scroll, or replace operations
+ * that have not yet been flushed; these operations are only reflected in
+ * the backing store (and hence ReadImageData) until after a Flush()
+ * operation has completed.
+ */
+ PP_Bool ReadImageData([in] PP_Resource device_context_2d,
+ [in] PP_Resource image,
+ [in] PP_Point top_left);
+
+ /**
+ * Runs a nested message loop. The plugin will be reentered from this call.
+ * This function is used for unit testing the API. The normal pattern is to
+ * issue some asynchronous call that has a callback. Then you call
+ * RunMessageLoop which will suspend the plugin and go back to processing
+ * messages, giving the asynchronous operation time to complete. In your
+ * callback, you save the data and call QuitMessageLoop, which will then
+ * pop back up and continue with the test. This avoids having to write a
+ * complicated state machine for simple tests for asynchronous APIs.
+ */
+ void RunMessageLoop([in] PP_Instance instance);
+
+ /**
+ * Posts a quit message for the outermost nested message loop. Use this to
+ * exit and return back to the caller after you call RunMessageLoop.
+ */
+ void QuitMessageLoop([in] PP_Instance instance);
+
+ /**
+ * Returns the number of live objects (resources + strings + objects)
+ * associated with this plugin instance. Used for detecting leaks. Returns
+ * (uint32_t)-1 on failure.
+ */
+ uint32_t GetLiveObjectsForInstance([in] PP_Instance instance);
+
+ /**
+ * Returns PP_TRUE if the plugin is running out-of-process, PP_FALSE
+ * otherwise.
+ */
+ PP_Bool IsOutOfProcess();
+};
« no previous file with comments | « ppapi/api/dev/ppb_memory_dev.idl ('k') | ppapi/api/dev/ppp_printing_dev.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698