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

Side by Side Diff: webkit/glue/plugins/webplugin_delegate_impl.cc

Issue 18637: More speedup of scrolling when many windowed plugins in a page. Scrolling is... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: 'spell Created 11 years, 11 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "webkit/glue/plugins/webplugin_delegate_impl.h" 5 #include "webkit/glue/plugins/webplugin_delegate_impl.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/file_util.h" 10 #include "base/file_util.h"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/stats_counters.h" 12 #include "base/stats_counters.h"
13 #include "base/string_util.h" 13 #include "base/string_util.h"
14 #include "webkit/default_plugin/plugin_impl.h" 14 #include "webkit/default_plugin/plugin_impl.h"
15 #include "webkit/glue/glue_util.h" 15 #include "webkit/glue/glue_util.h"
16 #include "webkit/glue/webplugin.h" 16 #include "webkit/glue/webplugin.h"
17 #include "webkit/glue/plugins/plugin_constants_win.h"
17 #include "webkit/glue/plugins/plugin_instance.h" 18 #include "webkit/glue/plugins/plugin_instance.h"
18 #include "webkit/glue/plugins/plugin_lib.h" 19 #include "webkit/glue/plugins/plugin_lib.h"
19 #include "webkit/glue/plugins/plugin_list.h" 20 #include "webkit/glue/plugins/plugin_list.h"
20 #include "webkit/glue/plugins/plugin_stream_url.h" 21 #include "webkit/glue/plugins/plugin_stream_url.h"
21 #include "webkit/glue/webkit_glue.h" 22 #include "webkit/glue/webkit_glue.h"
22 23
23 static StatsCounter windowless_queue("Plugin.ThrottleQueue"); 24 static StatsCounter windowless_queue("Plugin.ThrottleQueue");
24 25
25 static const wchar_t kNativeWindowClassName[] = L"NativeWindowClass";
26 static const wchar_t kWebPluginDelegateProperty[] = 26 static const wchar_t kWebPluginDelegateProperty[] =
27 L"WebPluginDelegateProperty"; 27 L"WebPluginDelegateProperty";
28 static const wchar_t kPluginNameAtomProperty[] = L"PluginNameAtom"; 28 static const wchar_t kPluginNameAtomProperty[] = L"PluginNameAtom";
29 static const wchar_t kDummyActivationWindowName[] = L"DummyWindowForActivation"; 29 static const wchar_t kDummyActivationWindowName[] = L"DummyWindowForActivation";
30 static const wchar_t kPluginOrigProc[] = L"OriginalPtr"; 30 static const wchar_t kPluginOrigProc[] = L"OriginalPtr";
31 static const wchar_t kPluginFlashThrottle[] = L"FlashThrottle"; 31 static const wchar_t kPluginFlashThrottle[] = L"FlashThrottle";
32 32
33 // The fastest we are willing to process WM_USER+1 events for Flash. 33 // The fastest we are willing to process WM_USER+1 events for Flash.
34 // Flash can easily exceed the limits of our CPU if we don't throttle it. 34 // Flash can easily exceed the limits of our CPU if we don't throttle it.
35 // The throttle has been chosen by testing various delays and compromising 35 // The throttle has been chosen by testing various delays and compromising
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 delegate->quirks() & PLUGIN_QUIRK_DONT_CALL_WND_PROC_RECURSIVELY && 786 delegate->quirks() & PLUGIN_QUIRK_DONT_CALL_WND_PROC_RECURSIVELY &&
787 delegate->is_calling_wndproc) { 787 delegate->is_calling_wndproc) {
788 // Real may go into a state where it recursively dispatches the same event 788 // Real may go into a state where it recursively dispatches the same event
789 // when subclassed. See https://bugzilla.mozilla.org/show_bug.cgi?id=192914 789 // when subclassed. See https://bugzilla.mozilla.org/show_bug.cgi?id=192914
790 // We only do the recursive check for Real because it's possible and valid 790 // We only do the recursive check for Real because it's possible and valid
791 // for a plugin to synchronously dispatch a message to itself such that it 791 // for a plugin to synchronously dispatch a message to itself such that it
792 // looks like it's in recursion. 792 // looks like it's in recursion.
793 return TRUE; 793 return TRUE;
794 } 794 }
795 795
796 static UINT custom_msg = RegisterWindowMessage(kPaintMessageName);
797 if (message == custom_msg) {
798 // Get the invalid rect which is in screen coordinates and convert to
799 // window coordinates.
800 gfx::Rect invalid_rect;
801 invalid_rect.set_x(wparam >> 16);
802 invalid_rect.set_y(wparam & 0xFFFF);
803 invalid_rect.set_width(lparam >> 16);
804 invalid_rect.set_height(lparam & 0xFFFF);
805
806 RECT window_rect;
807 GetWindowRect(hwnd, &window_rect);
808 invalid_rect.Offset(-window_rect.left, -window_rect.top);
809
810 // The plugin window might have non-client area. If we don't pass in
811 // RDW_FRAME then the children don't receive WM_NCPAINT messages while
812 // scrolling, which causes painting problems (http://b/issue?id=923945).
813 RedrawWindow(hwnd, &invalid_rect.ToRECT(), NULL,
814 RDW_UPDATENOW | RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_FRAME);
815 return FALSE;
816 }
817
796 current_plugin_instance_ = delegate; 818 current_plugin_instance_ = delegate;
797 819
798 switch (message) { 820 switch (message) {
799 case WM_NCDESTROY: { 821 case WM_NCDESTROY: {
800 RemoveProp(hwnd, kWebPluginDelegateProperty); 822 RemoveProp(hwnd, kWebPluginDelegateProperty);
801 ATOM plugin_name_atom = reinterpret_cast <ATOM>( 823 ATOM plugin_name_atom = reinterpret_cast <ATOM>(
802 RemoveProp(hwnd, kPluginNameAtomProperty)); 824 RemoveProp(hwnd, kPluginNameAtomProperty));
803 if (plugin_name_atom != 0) 825 if (plugin_name_atom != 0)
804 GlobalDeleteAtom(plugin_name_atom); 826 GlobalDeleteAtom(plugin_name_atom);
805 ClearThrottleQueueForWindow(hwnd); 827 ClearThrottleQueueForWindow(hwnd);
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1130 1152
1131 // It is ok to pass NULL here to GetCursor as we are not looking for cursor 1153 // It is ok to pass NULL here to GetCursor as we are not looking for cursor
1132 // types defined by Webkit. 1154 // types defined by Webkit.
1133 HCURSOR previous_cursor = 1155 HCURSOR previous_cursor =
1134 current_plugin_instance_->current_windowless_cursor_.GetCursor(NULL); 1156 current_plugin_instance_->current_windowless_cursor_.GetCursor(NULL);
1135 1157
1136 current_plugin_instance_->current_windowless_cursor_.InitFromExternalCursor( 1158 current_plugin_instance_->current_windowless_cursor_.InitFromExternalCursor(
1137 cursor); 1159 cursor);
1138 return previous_cursor; 1160 return previous_cursor;
1139 } 1161 }
OLDNEW
« chrome/browser/render_widget_host_view_win.cc ('K') | « webkit/glue/plugins/plugin_constants_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698