@@ -13,6 +13,7 @@ import {
1313 getLocalTracksByPid ,
1414 getHasPreferenceMarkers ,
1515 getContainsPrivateBrowsingInformation ,
16+ getHasJSTracingArgumentValues ,
1617 getThreads ,
1718 getMarkerSchemaByName ,
1819} from './profile' ;
@@ -80,6 +81,7 @@ export const getRemoveProfileInformation: Selector<RemoveProfileInformation | nu
8081 getLocalTracksByPid ,
8182 getHasPreferenceMarkers ,
8283 getContainsPrivateBrowsingInformation ,
84+ getHasJSTracingArgumentValues ,
8385 (
8486 checkedSharingOptions ,
8587 profile ,
@@ -89,14 +91,15 @@ export const getRemoveProfileInformation: Selector<RemoveProfileInformation | nu
8991 globalTracks ,
9092 localTracksByPid ,
9193 hasPreferenceMarkers ,
92- containsPrivateBrowsingInformation
94+ containsPrivateBrowsingInformation ,
95+ hasArgumentValues
9396 ) => {
9497 let isIncludingEverything = true ;
9598 for ( const [ prop , value ] of Object . entries ( checkedSharingOptions ) ) {
96- // Do not include preference values or private browsing checkboxes if
97- // they're hidden. Even though `includePreferenceValues` is not taken
98- // into account, it is false, if the profile updateChannel is not
99- // nightly or custom build.
99+ // Do not include preference values, private browsing, or argument
100+ // values checkboxes if they're hidden. Even though
101+ // `includePreferenceValues` is not taken into account, it is false, if
102+ // the profile updateChannel is not nightly or custom build.
100103 if ( prop === 'includePreferenceValues' && ! hasPreferenceMarkers ) {
101104 continue ;
102105 }
@@ -106,6 +109,9 @@ export const getRemoveProfileInformation: Selector<RemoveProfileInformation | nu
106109 ) {
107110 continue ;
108111 }
112+ if ( prop === 'includeArgumentValues' && ! hasArgumentValues ) {
113+ continue ;
114+ }
109115 isIncludingEverything = isIncludingEverything && value ;
110116 }
111117 if ( isIncludingEverything ) {
@@ -177,6 +183,8 @@ export const getRemoveProfileInformation: Selector<RemoveProfileInformation | nu
177183 ! checkedSharingOptions . includePreferenceValues ,
178184 shouldRemovePrivateBrowsingData :
179185 ! checkedSharingOptions . includePrivateBrowsingData ,
186+ shouldRemoveArgumentValues :
187+ ! checkedSharingOptions . includeArgumentValues ,
180188 } ;
181189 }
182190 ) ;
@@ -202,6 +210,25 @@ function getDerivedMarkerInfoForAllThreads(state: State): DerivedMarkerInfo[] {
202210 return _derivedMarkerInfo ;
203211}
204212
213+ /**
214+ * The traced values buffers are needed for profile sanitization when filtering
215+ * argument values to a time range. Similar memoization approach as above.
216+ */
217+ let _threadsForBuffers : any = null ;
218+ let _tracedValuesBuffers : Array < ArrayBuffer | undefined > | null = null ;
219+ function getTracedValuesBuffersForAllThreads (
220+ state : State
221+ ) : Array < ArrayBuffer | undefined > {
222+ const threads = getThreads ( state ) ;
223+ if ( _threadsForBuffers !== threads || _tracedValuesBuffers === null ) {
224+ _threadsForBuffers = threads ;
225+ _tracedValuesBuffers = threads . map ( ( _ : any , threadIndex : ThreadIndex ) =>
226+ getThreadSelectors ( threadIndex ) . getTracedValuesBuffer ( state )
227+ ) ;
228+ }
229+ return _tracedValuesBuffers ;
230+ }
231+
205232/**
206233 * Run the profile sanitization step, and also get information about how any
207234 * UrlState needs to be updated, with things like mapping thread indexes,
@@ -211,6 +238,7 @@ export const getSanitizedProfile: Selector<SanitizeProfileResult> =
211238 createSelector (
212239 getProfile ,
213240 getDerivedMarkerInfoForAllThreads ,
241+ getTracedValuesBuffersForAllThreads ,
214242 getRemoveProfileInformation ,
215243 getMarkerSchemaByName ,
216244 sanitizePII
0 commit comments