| 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 "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "media/base/limits.h" | 10 #include "media/base/limits.h" |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 922 // | 922 // |
| 923 // Be careful to post a task to avoid reentering the plugin. | 923 // Be careful to post a task to avoid reentering the plugin. |
| 924 | 924 |
| 925 InstanceData* data = | 925 InstanceData* data = |
| 926 static_cast<PluginDispatcher*>(dispatcher())->GetInstanceData(instance); | 926 static_cast<PluginDispatcher*>(dispatcher())->GetInstanceData(instance); |
| 927 if (!data) | 927 if (!data) |
| 928 return; | 928 return; |
| 929 data->should_do_request_surrounding_text = true; | 929 data->should_do_request_surrounding_text = true; |
| 930 | 930 |
| 931 if (!data->is_request_surrounding_text_pending) { | 931 if (!data->is_request_surrounding_text_pending) { |
| 932 base::MessageLoop::current()->PostTask( | 932 PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( |
| 933 FROM_HERE, | 933 FROM_HERE, |
| 934 RunWhileLocked(base::Bind(&RequestSurroundingText, instance))); | 934 RunWhileLocked(base::Bind(&RequestSurroundingText, instance))); |
| 935 data->is_request_surrounding_text_pending = true; | 935 data->is_request_surrounding_text_pending = true; |
| 936 } | 936 } |
| 937 } | 937 } |
| 938 | 938 |
| 939 void PPB_Instance_Proxy::UpdateSurroundingText(PP_Instance instance, | 939 void PPB_Instance_Proxy::UpdateSurroundingText(PP_Instance instance, |
| 940 const char* text, | 940 const char* text, |
| 941 uint32_t caret, | 941 uint32_t caret, |
| 942 uint32_t anchor) { | 942 uint32_t anchor) { |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1511 PP_Instance instance) { | 1511 PP_Instance instance) { |
| 1512 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 1512 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
| 1513 GetInstanceData(instance); | 1513 GetInstanceData(instance); |
| 1514 if (!data) | 1514 if (!data) |
| 1515 return; // Instance was probably deleted. | 1515 return; // Instance was probably deleted. |
| 1516 data->should_do_request_surrounding_text = false; | 1516 data->should_do_request_surrounding_text = false; |
| 1517 } | 1517 } |
| 1518 | 1518 |
| 1519 } // namespace proxy | 1519 } // namespace proxy |
| 1520 } // namespace ppapi | 1520 } // namespace ppapi |
| OLD | NEW |