VirtualBox

Changeset 39711 in vbox


Ignore:
Timestamp:
Jan 6, 2012 5:58:41 PM (13 years ago)
Author:
vboxsync
Message:

Disabled the mCallbackData cache until it's purpose has been found.

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r39493 r39711  
    790790    ComObjPtr<Progress> mptrCancelableProgress;
    791791
     792    /* The purpose of caching of some events is probably in order to
     793       automatically fire them at new event listeners.  However, there is no
     794       (longer?) any code making use of this... */
     795#ifdef CONSOLE_WITH_EVENT_CACHE
    792796    struct
    793797    {
     
    803807            uint32_t height;
    804808            com::SafeArray<BYTE> shape;
    805         }
    806         mpsc;
     809        } mpsc;
    807810
    808811        /** OnMouseCapabilityChange() cache */
     
    813816            BOOL supportsRelative;
    814817            BOOL needsHostCursor;
    815         }
    816         mcc;
     818        } mcc;
    817819
    818820        /** OnKeyboardLedsChange() cache */
     
    823825            bool capsLock;
    824826            bool scrollLock;
    825         }
    826         klc;
     827        } klc;
    827828
    828829        void clear()
    829830        {
    830             /* We cannot do memset() on mpsc to avoid cleaning shape's vtable */
     831            RT_ZERO(mcc);
     832            RT_ZERO(klc);
     833
     834            /* We cannot RT_ZERO mpsc because of shape's vtable. */
    831835            mpsc.shape.setNull();
    832836            mpsc.valid = mpsc.visible = mpsc.alpha = false;
    833837            mpsc.xHot = mpsc.yHot = mpsc.width = mpsc.height = 0;
    834             ::memset(&mcc, 0, sizeof mcc);
    835             ::memset(&klc, 0, sizeof klc);
    836838        }
    837     }
    838     mCallbackData;
     839    } mCallbackData;
     840#endif
    839841    ComPtr<IEventListener> mVmListener;
    840842
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r39647 r39711  
    699699    unconst(mEventSource).setNull();
    700700
     701#ifdef CONSOLE_WITH_EVENT_CACHE
    701702    mCallbackData.clear();
     703#endif
    702704
    703705    LogFlowThisFuncLeave();
     
    57005702    AssertComRCReturnVoid(autoCaller.rc());
    57015703
     5704#ifndef CONSOLE_WITH_EVENT_CACHE
     5705    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     5706#else
    57025707    /* We need a write lock because we alter the cached callback data */
    57035708    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    57215726        mCallbackData.mpsc.shape.resize(0);
    57225727    mCallbackData.mpsc.valid = true;
     5728#endif
    57235729
    57245730    fireMousePointerShapeChangedEvent(mEventSource, fVisible, fAlpha, xHot, yHot, width, height, ComSafeArrayInArg(pShape));
     
    57405746    AssertComRCReturnVoid(autoCaller.rc());
    57415747
     5748#ifndef CONSOLE_WITH_EVENT_CACHE
     5749    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     5750#else
    57425751    /* We need a write lock because we alter the cached callback data */
    57435752    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    57485757    mCallbackData.mcc.needsHostCursor = needsHostCursor;
    57495758    mCallbackData.mcc.valid = true;
     5759#endif
    57505760
    57515761    fireMouseCapabilityChangedEvent(mEventSource, supportsAbsolute, supportsRelative, needsHostCursor);
     
    58005810    AssertComRCReturnVoid(autoCaller.rc());
    58015811
     5812#ifndef CONSOLE_WITH_EVENT_CACHE
     5813    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     5814#else
    58025815    /* We need a write lock because we alter the cached callback data */
    58035816    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    58085821    mCallbackData.klc.scrollLock = fScrollLock;
    58095822    mCallbackData.klc.valid = true;
     5823#endif
    58105824
    58115825    fireKeyboardLedsChangedEvent(mEventSource, fNumLock, fCapsLock, fScrollLock);
     
    69256939        mVMDestroying = false;
    69266940
     6941#ifdef CONSOLE_WITH_EVENT_CACHE
    69276942    if (SUCCEEDED(rc))
    69286943        mCallbackData.clear();
     6944#endif
    69296945
    69306946    LogFlowThisFuncLeave();
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette