зеркало из https://github.com/mozilla/gecko-dev.git
9373d7166c
ThreadInfo and ThreadProfile are hopelessly intertwined. - ThreadInfo has an owning pointer to ThreadProfile. ThreadProfile has a raw back pointer to ThreadInfo. A reference to one is as good as a reference to the other, and references to one frequently reach into the other. - An exception is SyncProfile, a sub-class of ThreadProfile, which instead has an owning pointer to its ThreadInfo. (This makes the SyncProfile's destructor dubious, because it deletes the ThreadInfo, which could conceivably re-call into SyncProfile's destructor.) - ThreadProfile also has copies of five ThreadInfo fields (mThreadId, mIsMainThread, mPlatformData, mStackTop, mPseudoStack) even though it also has direct ThreadInfo access via the back pointer. The only good reason for having the two classes separate is that some ThreadInfo objects have a null ThreadProfile pointer. But this doesn't justify the entanglement. So this patch merges ThreadProfile into ThreadInfo. It visually separates the methods and fields related to profiles to partially preserve the original meaning of the split. The new ThreadInfo::hasProfile() method replaces ThreadInfo::Profile() as the indicator of whether a ThreadInfo has associated profile data. Notable points of simplification: - The five duplicated fields are no longer duplicated. - NewSyncProfile(), RegisterThread() no longer create ThreadProfile objects. - ~SyncProfile() becomes trivial. - ThreadInfo::SetPendingDelete() is simpler. - Overall it removes ~80 lines of code. Much of the rest is just plumbing changes. --HG-- extra : rebase_source : 2e8c4cc46aa15943ffdc1fa19d9c829587267ee9 |
||
---|---|---|
.. | ||
components | ||
docs | ||
legacy | ||
modules | ||
test | ||
views | ||
events.js | ||
moz.build | ||
panel.js | ||
performance-controller.js | ||
performance-view.js | ||
performance.xul |