gecko-dev/devtools/client/performance
Nicholas Nethercote 9373d7166c Bug 1335595 (part 4) - Merge ThreadProfile into ThreadInfo. r=mstange.
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
2017-02-02 11:07:13 +11:00
..
components Bug 1315923 - Make devtools/client/performance pass ESLint's "react/prop-types" rule. r=jdescottes 2016-11-18 20:12:48 +01:00
docs Bug 1211839 - Don't allow off the main thread markers to nest under main thread markers, r=smaug, jsantell 2015-10-24 17:10:22 +02:00
legacy Bug 1333296 (part 5) - Remove SPS references in devtools/ and dom/. r=mstange. 2017-01-25 09:08:15 +11:00
modules Bug 1335595 (part 4) - Merge ThreadProfile into ThreadInfo. r=mstange. 2017-02-02 11:07:13 +11:00
test Bug 503613 - Remove old 'tail =' lines from xpcshell.ini files; r=gps 2017-01-18 10:30:39 +00:00
views Bug 1326479 - Fix 'indent' eslint errors now that eslint scans multiline array and object definitions. r=Gijs 2017-01-03 10:07:50 -05:00
events.js Bug 1245886 - Refactor performance tests, r=jsantell 2016-03-16 09:39:39 +01:00
moz.build Bug 1330325 - add BUG_COMPONENT to devtools/* files. r=jryans 2017-01-13 08:40:35 -05:00
panel.js Bug 1288830 - Start to lint parts of the performance tool. r=jsantell 2016-07-22 13:55:00 -04:00
performance-controller.js Bug 1316630 - don't emit pref-changed event on gDevTools; r=jdescottes 2016-11-21 08:47:10 -07:00
performance-view.js Bug 1315923 - Make devtools/client/performance pass ESLint's "react/prop-types" rule. r=jdescottes 2016-11-18 20:12:48 +01:00
performance.xul Bug 1302062 - Use React on performance recording list; r=jsantell 2016-09-20 09:47:59 -05:00