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

Unified Diff: ppapi/proxy/ppb_message_loop_proxy.cc

Issue 600553002: PPAPI: Disallow blocking callbacks while handling a blocking message (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: try to improve comment Created 6 years, 3 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/proxy/ppb_message_loop_proxy.h ('k') | ppapi/shared_impl/ppb_message_loop_shared.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_message_loop_proxy.cc
diff --git a/ppapi/proxy/ppb_message_loop_proxy.cc b/ppapi/proxy/ppb_message_loop_proxy.cc
index 2bc9694ab5d4deeed91c5461763a9022058916d3..555c008d523209eacd8535323d54f62b1bb6b8a1 100644
--- a/ppapi/proxy/ppb_message_loop_proxy.cc
+++ b/ppapi/proxy/ppb_message_loop_proxy.cc
@@ -31,7 +31,8 @@ MessageLoopResource::MessageLoopResource(PP_Instance instance)
nested_invocations_(0),
destroyed_(false),
should_destroy_(false),
- is_main_thread_loop_(false) {
+ is_main_thread_loop_(false),
+ currently_handling_blocking_message_(false) {
}
MessageLoopResource::MessageLoopResource(ForMainThread for_main_thread)
@@ -39,7 +40,8 @@ MessageLoopResource::MessageLoopResource(ForMainThread for_main_thread)
nested_invocations_(0),
destroyed_(false),
should_destroy_(false),
- is_main_thread_loop_(true) {
+ is_main_thread_loop_(true),
+ currently_handling_blocking_message_(false) {
// We attach the main thread immediately. We can't use AttachToCurrentThread,
// because the MessageLoop already exists.
@@ -193,6 +195,10 @@ base::MessageLoopProxy* MessageLoopResource::GetMessageLoopProxy() {
return loop_proxy_.get();
}
+bool MessageLoopResource::CurrentlyHandlingBlockingMessage() {
+ return currently_handling_blocking_message_;
+}
+
// static
void MessageLoopResource::ReleaseMessageLoop(void* value) {
static_cast<MessageLoopResource*>(value)->DetachFromThread();
« no previous file with comments | « ppapi/proxy/ppb_message_loop_proxy.h ('k') | ppapi/shared_impl/ppb_message_loop_shared.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698