| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ppapi/proxy/ppb_instance_proxy.h" | 5 #include "ppapi/proxy/ppb_instance_proxy.h" |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
| 10 #include "ppapi/c/pp_time.h" | 10 #include "ppapi/c/pp_time.h" |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 // | 780 // |
| 781 // Be careful to post a task to avoid reentering the plugin. | 781 // Be careful to post a task to avoid reentering the plugin. |
| 782 | 782 |
| 783 InstanceData* data = | 783 InstanceData* data = |
| 784 static_cast<PluginDispatcher*>(dispatcher())->GetInstanceData(instance); | 784 static_cast<PluginDispatcher*>(dispatcher())->GetInstanceData(instance); |
| 785 if (!data) | 785 if (!data) |
| 786 return; | 786 return; |
| 787 data->should_do_request_surrounding_text = true; | 787 data->should_do_request_surrounding_text = true; |
| 788 | 788 |
| 789 if (!data->is_request_surrounding_text_pending) { | 789 if (!data->is_request_surrounding_text_pending) { |
| 790 MessageLoop::current()->PostTask( | 790 base::MessageLoop::current()->PostTask( |
| 791 FROM_HERE, | 791 FROM_HERE, |
| 792 RunWhileLocked(base::Bind(&RequestSurroundingText, instance))); | 792 RunWhileLocked(base::Bind(&RequestSurroundingText, instance))); |
| 793 data->is_request_surrounding_text_pending = true; | 793 data->is_request_surrounding_text_pending = true; |
| 794 } | 794 } |
| 795 } | 795 } |
| 796 | 796 |
| 797 void PPB_Instance_Proxy::UpdateSurroundingText(PP_Instance instance, | 797 void PPB_Instance_Proxy::UpdateSurroundingText(PP_Instance instance, |
| 798 const char* text, | 798 const char* text, |
| 799 uint32_t caret, | 799 uint32_t caret, |
| 800 uint32_t anchor) { | 800 uint32_t anchor) { |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1250 PP_Instance instance) { | 1250 PP_Instance instance) { |
| 1251 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 1251 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
| 1252 GetInstanceData(instance); | 1252 GetInstanceData(instance); |
| 1253 if (!data) | 1253 if (!data) |
| 1254 return; // Instance was probably deleted. | 1254 return; // Instance was probably deleted. |
| 1255 data->should_do_request_surrounding_text = false; | 1255 data->should_do_request_surrounding_text = false; |
| 1256 } | 1256 } |
| 1257 | 1257 |
| 1258 } // namespace proxy | 1258 } // namespace proxy |
| 1259 } // namespace ppapi | 1259 } // namespace ppapi |
| OLD | NEW |