Exemplo n.º 1
0
  return async (dispatch, getState) => {
    const perfFront = selectors.getPerfFront(getState());
    dispatch(changeRecordingState(REQUEST_TO_GET_PROFILE_AND_STOP_PROFILER));
    const profile = await perfFront.getProfileAndStopProfiler();

    const debugPathGetter = createDebugPathMapForLibsInProfile(profile);
    async function getSymbolTable(debugName, breakpadId) {
      const debugPath = debugPathGetter(debugName, breakpadId);
      const [addresses, index, buffer] =
        await perfFront.getSymbolTable(debugPath, breakpadId);
      // The protocol transmits these arrays as plain JavaScript arrays of
      // numbers, but we want to pass them on as typed arrays. Convert them now.
      return [
        new Uint32Array(addresses),
        new Uint32Array(index),
        new Uint8Array(buffer),
      ];
    }

    selectors.getReceiveProfileFn(getState())(profile, getSymbolTable);
    dispatch(changeRecordingState(AVAILABLE_TO_RECORD));
  };
Exemplo n.º 2
0
 return async (dispatch, getState) => {
   const perfFront = selectors.getPerfFront(getState());
   dispatch(changeRecordingState(REQUEST_TO_STOP_PROFILER));
   perfFront.stopProfilerAndDiscardProfile();
 };
Exemplo n.º 3
0
 return (dispatch, getState) => {
   const recordingSettings = selectors.getRecordingSettings(getState());
   const perfFront = selectors.getPerfFront(getState());
   perfFront.startProfiler(recordingSettings);
   dispatch(changeRecordingState(REQUEST_TO_START_RECORDING));
 };