summaryrefslogtreecommitdiffstats
path: root/o3d/plugin/cross/o3d_glue.h
diff options
context:
space:
mode:
authorapatrick@google.com <apatrick@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-13 20:19:04 +0000
committerapatrick@google.com <apatrick@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-13 20:19:04 +0000
commitcd7b299fd6053afcd625ce36f0e51f94c83b182c (patch)
treec8db33db4106077f2b9c16bc6b5e6822568e411f /o3d/plugin/cross/o3d_glue.h
parent3d2da9c08491d46c0b3f8dcdccbb6d1c84bfbc40 (diff)
downloadchromium_src-cd7b299fd6053afcd625ce36f0e51f94c83b182c.zip
chromium_src-cd7b299fd6053afcd625ce36f0e51f94c83b182c.tar.gz
chromium_src-cd7b299fd6053afcd625ce36f0e51f94c83b182c.tar.bz2
Plugin no longer makes synchronous NPAPI calls from a Windows message handler. This fixes deadlocks and slowdown in Chrome. The approach is strange. It asynchronously opens the url data:, and then invokes Tick from the finish callback. This is the simplest approach I could think of that hide widespread browser support. NPN_PluginThreadAsyncCall would be ideal but it is supported by all browsers we currently support.
Review URL: http://codereview.chromium.org/149415 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20517 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/plugin/cross/o3d_glue.h')
-rw-r--r--o3d/plugin/cross/o3d_glue.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/o3d/plugin/cross/o3d_glue.h b/o3d/plugin/cross/o3d_glue.h
index 016b58b..e67d8e6 100644
--- a/o3d/plugin/cross/o3d_glue.h
+++ b/o3d/plugin/cross/o3d_glue.h
@@ -140,6 +140,8 @@ class PluginObject: public NPObject {
ClientNPObject *client_npobject_;
std::string user_agent_;
Renderer::InitStatus renderer_init_status_;
+ int pending_ticks_;
+
// The current cursor type.
o3d::Cursor::CursorType cursor_type_;
@@ -207,12 +209,6 @@ class PluginObject: public NPObject {
return mac_fullscreen_window_;
}
- // Always returns |true| if RENDERMODE_CONTINUOUS, otherwise
- // only if client->render() has been called and we haven't yet
- // handled it
- bool WantsRedraw();
- void SetWantsRedraw(bool wants) { wants_redraw_ = wants; }
-
bool ScrollIsInProgress() { return scroll_is_in_progress_; }
void SetScrollIsInProgress(bool state) { scroll_is_in_progress_ = state; }
bool scroll_is_in_progress_;
@@ -226,7 +222,6 @@ class PluginObject: public NPObject {
WindowRef mac_window_; // may be NULL in the Chrome case
// these vars needed for the Safari tab switch detection hack
CFDateRef last_mac_event_time_;
- bool wants_redraw_;
void * mac_cocoa_window_;
void* mac_window_selected_tab_;
bool mac_surface_hidden_;
@@ -362,6 +357,13 @@ class PluginObject: public NPObject {
// Sets the cursor to whatever the current cursor is.
void PlatformSpecificSetCursor();
+ // Asynchronously (if possible, synchronously otherwise) invoke Tick. No
+ // operation if an asynchronous tick is already pending.
+ void AsyncTick();
+
+ // Tick the client.
+ void Tick();
+
const std::string& user_agent() const { return user_agent_; }
bool IsFirefox() const {
return user_agent_.find("Firefox") != user_agent_.npos;