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

Side by Side Diff: content/renderer/pepper/pepper_graphics_2d_host.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/renderer/pepper/pepper_graphics_2d_host.h" 5 #include "content/renderer/pepper/pepper_graphics_2d_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 718
719 // We must clear this flag before issuing the callback. It will be 719 // We must clear this flag before issuing the callback. It will be
720 // common for the plugin to issue another invalidate in response to a flush 720 // common for the plugin to issue another invalidate in response to a flush
721 // callback, and we don't want to think that a callback is already pending. 721 // callback, and we don't want to think that a callback is already pending.
722 offscreen_flush_pending_ = false; 722 offscreen_flush_pending_ = false;
723 SendFlushAck(); 723 SendFlushAck();
724 } 724 }
725 725
726 void PepperGraphics2DHost::ScheduleOffscreenFlushAck() { 726 void PepperGraphics2DHost::ScheduleOffscreenFlushAck() {
727 offscreen_flush_pending_ = true; 727 offscreen_flush_pending_ = true;
728 MessageLoop::current()->PostDelayedTask( 728 base::MessageLoop::current()->PostDelayedTask(
729 FROM_HERE, 729 FROM_HERE,
730 base::Bind(&PepperGraphics2DHost::SendOffscreenFlushAck, 730 base::Bind(&PepperGraphics2DHost::SendOffscreenFlushAck,
731 weak_ptr_factory_.GetWeakPtr()), 731 weak_ptr_factory_.GetWeakPtr()),
732 base::TimeDelta::FromMilliseconds(kOffscreenCallbackDelayMs)); 732 base::TimeDelta::FromMilliseconds(kOffscreenCallbackDelayMs));
733 } 733 }
734 734
735 bool PepperGraphics2DHost::HasPendingFlush() const { 735 bool PepperGraphics2DHost::HasPendingFlush() const {
736 return need_flush_ack_ || offscreen_flush_pending_; 736 return need_flush_ack_ || offscreen_flush_pending_;
737 } 737 }
738 738
(...skipping 21 matching lines...) Expand all
760 gfx::Point inverse_scaled_point = 760 gfx::Point inverse_scaled_point =
761 gfx::ToFlooredPoint(gfx::ScalePoint(*delta, inverse_scale)); 761 gfx::ToFlooredPoint(gfx::ScalePoint(*delta, inverse_scale));
762 if (original_delta != inverse_scaled_point) 762 if (original_delta != inverse_scaled_point)
763 return false; 763 return false;
764 } 764 }
765 765
766 return true; 766 return true;
767 } 767 }
768 768
769 } // namespace content 769 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_device_enumeration_host_helper.cc ('k') | content/renderer/pepper/pepper_in_process_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698