[BlackBerry] Revert the patch for 82764
authorcharles.wei@torchmobile.com.cn <charles.wei@torchmobile.com.cn@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Apr 2012 14:55:27 +0000 (14:55 +0000)
committercharles.wei@torchmobile.com.cn <charles.wei@torchmobile.com.cn@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Apr 2012 14:55:27 +0000 (14:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83767

Reviewed by Rob Buis.

Revert the patch for 82764, which is causing misfunction.
The internal commit is: 800213f5

* plugins/blackberry/PluginViewBlackBerry.cpp:
(WebCore::PluginView::setNPWindowIfNeeded):
(WebCore::PluginView::platformGetValue):
(WebCore::PluginView::platformDestroy):
* plugins/blackberry/PluginViewPrivateBlackBerry.h:
(PluginViewPrivate):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113976 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/plugins/blackberry/PluginViewBlackBerry.cpp
Source/WebCore/plugins/blackberry/PluginViewPrivateBlackBerry.h

index 97a065d..ee03cfc 100644 (file)
@@ -1,3 +1,20 @@
+2012-04-12  Charles Wei  <charles.wei@torchmobile.com.cn>
+
+        [BlackBerry] Revert the patch for 82764
+        https://bugs.webkit.org/show_bug.cgi?id=83767
+
+        Reviewed by Rob Buis.
+
+        Revert the patch for 82764, which is causing misfunction.
+        The internal commit is: 800213f5
+
+        * plugins/blackberry/PluginViewBlackBerry.cpp:
+        (WebCore::PluginView::setNPWindowIfNeeded):
+        (WebCore::PluginView::platformGetValue):
+        (WebCore::PluginView::platformDestroy):
+        * plugins/blackberry/PluginViewPrivateBlackBerry.h:
+        (PluginViewPrivate):
+
 2012-04-12  Kent Tamura  <tkent@chromium.org>
 
         [Chromium] Enable INPUT_TYPE_DATE
index 9605bda..b62933d 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
  * Copyright (C) 2008 Collabora Ltd. All rights reserved.
  * Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
- * Copyright (C) 2011, 2012 Research In Motion Limited. All rights reserved.
+ * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -966,11 +966,8 @@ void PluginView::setNPWindowIfNeeded()
     m_npWindow.type = NPWindowTypeDrawable;
 
     BlackBerry::Platform::Graphics::Window* window = frameView->hostWindow()->platformPageClient()->platformWindow();
-    if (window) {
-        // Make a local copy of the window group to be sure it doesn't go out of scope while the ws_info struct exists
-        m_private->m_windowGroup = window->windowGroup();
-        ((NPSetWindowCallbackStruct*) m_npWindow.ws_info)->windowGroup = m_private->m_windowGroup.c_str();
-    }
+    if (window)
+        ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->windowGroup = window->windowGroup();
 
     PluginView::setCurrentPluginView(this);
     JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
@@ -1089,12 +1086,8 @@ bool PluginView::platformGetValue(NPNVariable variable, void* value, NPError* re
         if (frameView) {
             BlackBerry::Platform::Graphics::Window *window = frameView->hostWindow()->platformPageClient()->platformWindow();
             if (window) {
-                // Make a copy of the root group to be sure it doesn't go out of scope.
-                m_private->m_rootGroup = window->rootGroup();
-
-                // Store it into value through an indirect pointer.
                 void** tempValue = static_cast<void**>(value);
-                *tempValue = reinterpret_cast<void*>(const_cast<char*>(m_private->m_rootGroup.c_str()));
+                *tempValue = (void*)window->rootGroup();
 
                 if (*tempValue) {
                     *result = NPERR_NO_ERROR;
@@ -1111,12 +1104,8 @@ bool PluginView::platformGetValue(NPNVariable variable, void* value, NPError* re
         if (frameView) {
             BlackBerry::Platform::Graphics::Window* window = frameView->hostWindow()->platformPageClient()->platformWindow();
             if (window) {
-                // Make a copy of the window group to be sure it doesn't go out of scope.
-                m_private->m_windowGroup = window->windowGroup();
-
-                // Store it into value through an indirect pointer.
                 void** tempValue = static_cast<void**>(value);
-                *tempValue = reinterpret_cast<void*>(const_cast<char*>(m_private->m_windowGroup.c_str()));
+                *tempValue = reinterpret_cast<void*>(const_cast<char*>(window->windowGroup()));
 
                 if (*tempValue) {
                     *result = NPERR_NO_ERROR;
@@ -1276,10 +1265,6 @@ void PluginView::platformDestroy()
     if (!m_private)
         return;
 
-    // ws_info->windowGroup points to memory in m_private, which is about to go away (unless it is uninitialized at this point)
-    if (m_npWindow.ws_info)
-        ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->windowGroup = 0;
-
     // This will unlock the idle (if we have locked it).
     m_private->preventIdle(false);
 
index b9dd218..3f2878f 100644 (file)
@@ -83,8 +83,6 @@ private:
     bool m_isBackgroundPlaying;
 
     std::string m_pluginUniquePrefix;
-    std::string m_windowGroup;
-    std::string m_rootGroup;
 
     BlackBerry::Platform::IntRectRegion m_invalidateRegion;
     friend class PluginView;