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

Unified Diff: ppapi/proxy/ppb_message_loop_proxy.h

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/message_handler.cc ('k') | ppapi/proxy/ppb_message_loop_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_message_loop_proxy.h
diff --git a/ppapi/proxy/ppb_message_loop_proxy.h b/ppapi/proxy/ppb_message_loop_proxy.h
index f6cc25227bc3ccfd1219cb984e95751c5e90a3de..20569f76e14c356e331f0bb8229a6258c051a072 100644
--- a/ppapi/proxy/ppb_message_loop_proxy.h
+++ b/ppapi/proxy/ppb_message_loop_proxy.h
@@ -48,6 +48,10 @@ class PPAPI_PROXY_EXPORT MessageLoopResource : public MessageLoopShared {
return loop_proxy_;
}
+ void set_currently_handling_blocking_message(bool handling_blocking_message) {
+ currently_handling_blocking_message_ = handling_blocking_message;
+ }
+
private:
struct TaskInfo {
tracked_objects::Location from_here;
@@ -58,6 +62,8 @@ class PPAPI_PROXY_EXPORT MessageLoopResource : public MessageLoopShared {
// Returns true if the object is associated with the current thread.
bool IsCurrent() const;
+ // MessageLoopShared implementation.
+ //
// Handles posting to the message loop if there is one, or the pending queue
// if there isn't.
// NOTE: The given closure will be run *WITHOUT* acquiring the Proxy lock.
@@ -66,8 +72,8 @@ class PPAPI_PROXY_EXPORT MessageLoopResource : public MessageLoopShared {
virtual void PostClosure(const tracked_objects::Location& from_here,
const base::Closure& closure,
int64 delay_ms) OVERRIDE;
-
virtual base::MessageLoopProxy* GetMessageLoopProxy() OVERRIDE;
+ virtual bool CurrentlyHandlingBlockingMessage() OVERRIDE;
// TLS destructor function.
static void ReleaseMessageLoop(void* value);
@@ -92,6 +98,8 @@ class PPAPI_PROXY_EXPORT MessageLoopResource : public MessageLoopShared {
bool is_main_thread_loop_;
+ bool currently_handling_blocking_message_;
+
// Since we allow tasks to be posted before the message loop is actually
// created (when it's associated with a thread), we keep tasks posted here
// until that happens. Once the loop_ is created, this is unused.
« no previous file with comments | « ppapi/proxy/message_handler.cc ('k') | ppapi/proxy/ppb_message_loop_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698