diff options
author | maf@google.com <maf@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-10 23:29:56 +0000 |
---|---|---|
committer | maf@google.com <maf@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-10 23:29:56 +0000 |
commit | 61bb70de5b746df2e7f274f0b8f6deee3eea3c5f (patch) | |
tree | e6a0d64e27e424f351a33992263bb7f29075d978 /o3d/plugin/mac | |
parent | 080d1873cc4e05488e3c61fd4e0403f7d027416a (diff) | |
download | chromium_src-61bb70de5b746df2e7f274f0b8f6deee3eea3c5f.zip chromium_src-61bb70de5b746df2e7f274f0b8f6deee3eea3c5f.tar.gz chromium_src-61bb70de5b746df2e7f274f0b8f6deee3eea3c5f.tar.bz2 |
Don't screw up the retain count on the original WindowRef referenced by the copy we make of the browser NSWindow.
We were accidentally disposing the dummy window in the plugin process that Chrome makes.
Review URL: http://codereview.chromium.org/486021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34303 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/plugin/mac')
-rw-r--r-- | o3d/plugin/mac/plugin_mac.mm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/o3d/plugin/mac/plugin_mac.mm b/o3d/plugin/mac/plugin_mac.mm index 7b89b32..74354a1 100644 --- a/o3d/plugin/mac/plugin_mac.mm +++ b/o3d/plugin/mac/plugin_mac.mm @@ -114,6 +114,9 @@ bool GetBrowserVersionInfo(int *returned_major, void ReleaseSafariBrowserWindow(void* browserWindow) { NSWindow* cocoaWindow = (NSWindow*) browserWindow; + // Retain the WindowRef so it doesn't go away when we release the + // NSWindow copy we made. + CFRetain([cocoaWindow windowRef]); [cocoaWindow release]; } @@ -124,6 +127,9 @@ void* SafariBrowserWindowForWindowRef(WindowRef theWindow) { if (strcmp(object_getClassName(cocoaWindow), "BrowserWindow") == 0) { return cocoaWindow; } else { + // Retain the WindowRef so it doesn't go away when we release the + // NSWindow copy we made. + CFRetain(theWindow); [cocoaWindow release]; } } @@ -150,6 +156,11 @@ void* SelectedTabForSafariBrowserWindow(void* browserWindow) { // ie DetectTabHiding is now returning false, it restores the surface to the // previous state. void ManageSafariTabSwitching(PluginObject* obj) { + // This is only needed when we are using an AGL context and need to hide + // and show it. + if (!obj->mac_agl_context_) + return; + if (obj->DetectTabHiding()) { if (!obj->mac_surface_hidden_) { obj->mac_surface_hidden_ = true; |