Chromium Code Reviews| 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 7f2fc337849720be301957626cfdaeb472f288f0..21ccf0cf68d85a9a6ab1d0df503c4a1d9699d847 100644 |
| --- a/ppapi/proxy/ppb_message_loop_proxy.cc |
| +++ b/ppapi/proxy/ppb_message_loop_proxy.cc |
| @@ -10,7 +10,6 @@ |
| #include "base/bind.h" |
| #include "base/compiler_specific.h" |
| -#include "base/location.h" |
| #include "base/threading/thread_task_runner_handle.h" |
| #include "ppapi/c/pp_errors.h" |
| #include "ppapi/c/ppb_message_loop.h" |
| @@ -109,11 +108,17 @@ int32_t MessageLoopResource::Run() { |
| if (is_main_thread_loop_) |
| return PP_ERROR_INPROGRESS; |
| + base::RunLoop* previous_run_loop = run_loop_; |
| + base::RunLoop run_loop; |
| + run_loop_ = &run_loop; |
| + |
| nested_invocations_++; |
| CallWhileUnlocked( |
| - base::Bind(&base::MessageLoop::Run, base::Unretained(loop_.get()))); |
| + base::Bind(&base::RunLoop::Run, base::Unretained(run_loop_))); |
| nested_invocations_--; |
| + run_loop_ = previous_run_loop; |
|
gab
2016/07/08 18:36:08
Why does |run_loop_| need to be a member if it's o
fdoray
2016/07/08 20:21:10
I planned to use run_loop_ to quit the messageloop
|
| + |
| if (should_destroy_ && nested_invocations_ == 0) { |
| task_runner_ = NULL; |
| loop_.reset(); |