@@ -19,7 +19,7 @@ import { handleGlobalEventListener } from './coreHandlers/handleGlobalEvent';
19
19
import { handleHistorySpanListener } from './coreHandlers/handleHistory' ;
20
20
import { handleXhrSpanListener } from './coreHandlers/handleXhr' ;
21
21
import { setupPerformanceObserver } from './coreHandlers/performanceObserver' ;
22
- import { createMemoryEntry , createPerformanceEntries } from './createPerformanceEntry' ;
22
+ import { createPerformanceEntries } from './createPerformanceEntry' ;
23
23
import { createEventBuffer , EventBuffer } from './eventBuffer' ;
24
24
import { deleteSession } from './session/deleteSession' ;
25
25
import { getSession } from './session/getSession' ;
@@ -36,6 +36,7 @@ import type {
36
36
SendReplay ,
37
37
} from './types' ;
38
38
import { addEvent } from './util/addEvent' ;
39
+ import { addMemoryEntry } from './util/addMemoryEntry' ;
39
40
import { captureInternalException } from './util/captureInternalException' ;
40
41
import { createBreadcrumb } from './util/createBreadcrumb' ;
41
42
import { createPayload } from './util/createPayload' ;
@@ -699,23 +700,6 @@ export class ReplayContainer {
699
700
return createPerformanceSpans ( this , createPerformanceEntries ( entries ) ) ;
700
701
}
701
702
702
- /**
703
- * Create a "span" for the total amount of memory being used by JS objects
704
- * (including v8 internal objects).
705
- */
706
- addMemoryEntry ( ) : Promise < void [ ] > | undefined {
707
- // window.performance.memory is a non-standard API and doesn't work on all browsers
708
- // so we check before creating the event.
709
- if ( ! ( 'memory' in WINDOW . performance ) ) {
710
- return ;
711
- }
712
-
713
- return createPerformanceSpans ( this , [
714
- // @ts -ignore memory doesn't exist on type Performance as the API is non-standard (we check that it exists above)
715
- createMemoryEntry ( WINDOW . performance . memory ) ,
716
- ] ) ;
717
- }
718
-
719
703
/**
720
704
* Checks if recording should be stopped due to user inactivity. Otherwise
721
705
* check if session is expired and create a new session if so. Triggers a new
@@ -817,7 +801,7 @@ export class ReplayContainer {
817
801
}
818
802
819
803
// Only attach memory event if eventBuffer is not empty
820
- await this . addMemoryEntry ( ) ;
804
+ await addMemoryEntry ( this ) ;
821
805
822
806
try {
823
807
// Note this empties the event buffer regardless of outcome of sending replay
0 commit comments