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

Side by Side Diff: ppapi/proxy/ppb_instance_proxy.cc

Issue 14273043: ppapi: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 // 772 //
773 // Be careful to post a task to avoid reentering the plugin. 773 // Be careful to post a task to avoid reentering the plugin.
774 774
775 InstanceData* data = 775 InstanceData* data =
776 static_cast<PluginDispatcher*>(dispatcher())->GetInstanceData(instance); 776 static_cast<PluginDispatcher*>(dispatcher())->GetInstanceData(instance);
777 if (!data) 777 if (!data)
778 return; 778 return;
779 data->should_do_request_surrounding_text = true; 779 data->should_do_request_surrounding_text = true;
780 780
781 if (!data->is_request_surrounding_text_pending) { 781 if (!data->is_request_surrounding_text_pending) {
782 MessageLoop::current()->PostTask( 782 base::MessageLoop::current()->PostTask(
783 FROM_HERE, 783 FROM_HERE,
784 RunWhileLocked(base::Bind(&RequestSurroundingText, instance))); 784 RunWhileLocked(base::Bind(&RequestSurroundingText, instance)));
785 data->is_request_surrounding_text_pending = true; 785 data->is_request_surrounding_text_pending = true;
786 } 786 }
787 } 787 }
788 788
789 void PPB_Instance_Proxy::UpdateSurroundingText(PP_Instance instance, 789 void PPB_Instance_Proxy::UpdateSurroundingText(PP_Instance instance,
790 const char* text, 790 const char* text,
791 uint32_t caret, 791 uint32_t caret,
792 uint32_t anchor) { 792 uint32_t anchor) {
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 PP_Instance instance) { 1242 PP_Instance instance) {
1243 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> 1243 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
1244 GetInstanceData(instance); 1244 GetInstanceData(instance);
1245 if (!data) 1245 if (!data)
1246 return; // Instance was probably deleted. 1246 return; // Instance was probably deleted.
1247 data->should_do_request_surrounding_text = false; 1247 data->should_do_request_surrounding_text = false;
1248 } 1248 }
1249 1249
1250 } // namespace proxy 1250 } // namespace proxy
1251 } // namespace ppapi 1251 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698