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

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

Issue 938843002: PPAPI: Don't use MessageLoop::current in the plugin process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « ppapi/proxy/ppb_image_data_proxy.cc ('k') | ppapi/proxy/ppb_var_deprecated_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
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
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_image_data_proxy.cc ('k') | ppapi/proxy/ppb_var_deprecated_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698