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

Side by Side Diff: content/plugin/webplugin_proxy.cc

Issue 14335017: content: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 "content/plugin/webplugin_proxy.h" 5 #include "content/plugin/webplugin_proxy.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 if (damaged_rect_.IsEmpty() || 192 if (damaged_rect_.IsEmpty() ||
193 !delegate_->GetClipRect().Intersects(damaged_rect_)) 193 !delegate_->GetClipRect().Intersects(damaged_rect_))
194 return; 194 return;
195 195
196 // Only send a single InvalidateRect message at a time. From DidPaint we 196 // Only send a single InvalidateRect message at a time. From DidPaint we
197 // will dispatch an additional InvalidateRect message if necessary. 197 // will dispatch an additional InvalidateRect message if necessary.
198 if (!waiting_for_paint_) { 198 if (!waiting_for_paint_) {
199 waiting_for_paint_ = true; 199 waiting_for_paint_ = true;
200 // Invalidates caused by calls to NPN_InvalidateRect/NPN_InvalidateRgn 200 // Invalidates caused by calls to NPN_InvalidateRect/NPN_InvalidateRgn
201 // need to be painted asynchronously as per the NPAPI spec. 201 // need to be painted asynchronously as per the NPAPI spec.
202 MessageLoop::current()->PostTask(FROM_HERE, 202 base::MessageLoop::current()->PostTask(
203 base::Bind(&WebPluginProxy::OnPaint, weak_factory_.GetWeakPtr(), 203 FROM_HERE,
204 damaged_rect_)); 204 base::Bind(&WebPluginProxy::OnPaint,
205 weak_factory_.GetWeakPtr(),
206 damaged_rect_));
205 damaged_rect_ = gfx::Rect(); 207 damaged_rect_ = gfx::Rect();
206 } 208 }
207 } 209 }
208 210
209 NPObject* WebPluginProxy::GetWindowScriptNPObject() { 211 NPObject* WebPluginProxy::GetWindowScriptNPObject() {
210 if (window_npobject_) 212 if (window_npobject_)
211 return window_npobject_; 213 return window_npobject_;
212 214
213 int npobject_route_id = channel_->GenerateRouteID(); 215 int npobject_route_id = channel_->GenerateRouteID();
214 bool success = false; 216 bool success = false;
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 int input_type; 690 int input_type;
689 gfx::Rect caret_rect; 691 gfx::Rect caret_rect;
690 if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) 692 if (!delegate_->GetIMEStatus(&input_type, &caret_rect))
691 return; 693 return;
692 694
693 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); 695 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect));
694 } 696 }
695 #endif 697 #endif
696 698
697 } // namespace content 699 } // namespace content
OLDNEW
« no previous file with comments | « content/plugin/webplugin_delegate_stub.cc ('k') | content/ppapi_plugin/broker_process_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698