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

Side by Side Diff: chrome/browser/renderer_host/render_widget_host.h

Issue 435002: Optimize the rendering when there are pending key events.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years 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
« no previous file with comments | « no previous file | chrome/browser/renderer_host/render_widget_host.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_
6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_
7 7
8 #include <deque> 8 #include <deque>
9 9
10 #include "app/gfx/native_widget_types.h" 10 #include "app/gfx/native_widget_types.h"
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 440
441 // Scrolls the given |clip_rect| in the backing by the given dx/dy amount. The 441 // Scrolls the given |clip_rect| in the backing by the given dx/dy amount. The
442 // |dib| and its corresponding location |bitmap_rect| in the backing store 442 // |dib| and its corresponding location |bitmap_rect| in the backing store
443 // is the newly painted pixels by the renderer. 443 // is the newly painted pixels by the renderer.
444 void ScrollBackingStoreRect(TransportDIB* dib, 444 void ScrollBackingStoreRect(TransportDIB* dib,
445 const gfx::Rect& bitmap_rect, 445 const gfx::Rect& bitmap_rect,
446 int dx, int dy, 446 int dx, int dy,
447 const gfx::Rect& clip_rect, 447 const gfx::Rect& clip_rect,
448 const gfx::Size& view_size); 448 const gfx::Size& view_size);
449 449
450 // Called by OnMsgInputEventAck() to process a keyboard event ack message.
451 void ProcessKeyboardEventAck(int type, bool processed);
452
450 // The View associated with the RenderViewHost. The lifetime of this object 453 // The View associated with the RenderViewHost. The lifetime of this object
451 // is associated with the lifetime of the Render process. If the Renderer 454 // is associated with the lifetime of the Render process. If the Renderer
452 // crashes, its View is destroyed and this pointer becomes NULL, even though 455 // crashes, its View is destroyed and this pointer becomes NULL, even though
453 // render_view_host_ lives on to load another URL (creating a new View while 456 // render_view_host_ lives on to load another URL (creating a new View while
454 // doing so). 457 // doing so).
455 RenderWidgetHostView* view_; 458 RenderWidgetHostView* view_;
456 459
457 // Created during construction but initialized during Init*(). Therefore, it 460 // Created during construction but initialized during Init*(). Therefore, it
458 // is guaranteed never to be NULL, but its channel may be NULL if the 461 // is guaranteed never to be NULL, but its channel may be NULL if the
459 // renderer crashed, so you must always check that. 462 // renderer crashed, so you must always check that.
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 // shall not send the following sequence of Char events, which was generated 573 // shall not send the following sequence of Char events, which was generated
571 // by this RawKeyDown event, to the renderer. Otherwise the renderer may 574 // by this RawKeyDown event, to the renderer. Otherwise the renderer may
572 // handle the Char events and cause unexpected behavior. 575 // handle the Char events and cause unexpected behavior.
573 // For example, pressing alt-2 may let the browser switch to the second tab, 576 // For example, pressing alt-2 may let the browser switch to the second tab,
574 // but the Char event generated by alt-2 may also activate a HTML element 577 // but the Char event generated by alt-2 may also activate a HTML element
575 // if its accesskey happens to be "2", then the user may get confused when 578 // if its accesskey happens to be "2", then the user may get confused when
576 // switching back to the original tab, because the content may already be 579 // switching back to the original tab, because the content may already be
577 // changed. 580 // changed.
578 bool suppress_next_char_events_; 581 bool suppress_next_char_events_;
579 582
583 // True if the PaintRect_ACK message for the last PaintRect message is still
584 // not sent yet. This is used for optimizing the painting overhead when there
585 // are many pending key events in the queue.
586 bool paint_ack_postponed_;
587
588 // The time when a PaintRect_ACK message is postponed, so that we can send the
589 // message after a certain duration.
590 base::TimeTicks paint_ack_postponed_time_;
591
580 // During the call to some methods, eg. OnMsgInputEventAck, this 592 // During the call to some methods, eg. OnMsgInputEventAck, this
581 // RenderWidgetHost object may be destroyed before executing some code that 593 // RenderWidgetHost object may be destroyed before executing some code that
582 // still want to access this object. To avoid this situation, |death_flag_| 594 // still want to access this object. To avoid this situation, |death_flag_|
583 // shall be pointed to a local variable in the method, and then |*death_flag_| 595 // shall be pointed to a local variable in the method, and then |*death_flag_|
584 // will be set to true when destroying this RenderWidgetHost object, then the 596 // will be set to true when destroying this RenderWidgetHost object, then the
585 // method shall exit immediately when |*death_flag_| becomes true. 597 // method shall exit immediately when |*death_flag_| becomes true.
586 bool* death_flag_; 598 bool* death_flag_;
587 599
588 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); 600 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost);
589 }; 601 };
590 602
591 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ 603 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/renderer_host/render_widget_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698