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

Unified Diff: ppapi/tests/test_utils.h

Issue 1440423003: Add support for HandleBlockingMessage to NaClMessageScanner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge with mseaborn's changes Created 4 years, 11 months 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/tests/test_post_message.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_utils.h
diff --git a/ppapi/tests/test_utils.h b/ppapi/tests/test_utils.h
index c913f7608bca1eb524bc703289a259d111d9194b..f4ecb7105285e290e256f00d869d77cc57aa1d5f 100644
--- a/ppapi/tests/test_utils.h
+++ b/ppapi/tests/test_utils.h
@@ -296,4 +296,25 @@ do { \
#define PPAPI_POSIX 1
#endif
+// By default, ArrayBuffers over a certain size are sent via shared memory. In
+// order to test for this without sending huge buffers, tests can use this
+// class to set the minimum array buffer size used for shared memory temporarily
+// lower.
+class ScopedArrayBufferSizeSetter {
+ public:
+ ScopedArrayBufferSizeSetter(const PPB_Testing_Private* interface,
+ PP_Instance instance,
+ uint32_t threshold)
+ : interface_(interface),
+ instance_(instance) {
+ interface_->SetMinimumArrayBufferSizeForShmem(instance_, threshold);
+ }
+ ~ScopedArrayBufferSizeSetter() {
+ interface_->SetMinimumArrayBufferSizeForShmem(instance_, 0);
+ }
+ private:
+ const PPB_Testing_Private* interface_;
+ PP_Instance instance_;
+};
+
#endif // PPAPI_TESTS_TEST_UTILS_H_
« no previous file with comments | « ppapi/tests/test_post_message.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698