Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.97 KB | None | 0 0
  1. diff --git a/devtools/client/debugger/src/actions/navigation.js b/devtools/client/debugger/src/actions/navigation.js
  2. index a6ed37c7b03d..3e519cd071c2 100644
  3. --- a/devtools/client/debugger/src/actions/navigation.js
  4. +++ b/devtools/client/debugger/src/actions/navigation.js
  5. @@ -48,7 +48,7 @@ export function willNavigate(event: Object) {
  6. export function connect(
  7. url: string,
  8. actor: string,
  9. - canRewind: boolean,
  10. + traits,
  11. isWebExtension: boolean
  12. ) {
  13. return async function({ dispatch }: ThunkArgs) {
  14. @@ -62,7 +62,7 @@ export function connect(
  15. type: "mainThread",
  16. name: L10N.getStr("mainThread"),
  17. },
  18. - canRewind,
  19. + traits,
  20. isWebExtension,
  21. }: Action)
  22. );
  23. diff --git a/devtools/client/debugger/src/client/firefox.js b/devtools/client/debugger/src/client/firefox.js
  24. index d79c76f2b797..0f53ca9bebec 100644
  25. --- a/devtools/client/debugger/src/client/firefox.js
  26. +++ b/devtools/client/debugger/src/client/firefox.js
  27. @@ -59,7 +59,7 @@ export async function onConnect(connection: any, actions: Object) {
  28. await actions.connect(
  29. tabTarget.url,
  30. threadFront.actor,
  31. - traits && traits.canRewind,
  32. + traits,
  33. tabTarget.isWebExtension
  34. );
  35.  
  36. diff --git a/devtools/client/debugger/src/reducers/pause.js b/devtools/client/debugger/src/reducers/pause.js
  37. index 226e20ca2881..ce271243e89b 100644
  38. --- a/devtools/client/debugger/src/reducers/pause.js
  39. +++ b/devtools/client/debugger/src/reducers/pause.js
  40. @@ -91,7 +91,6 @@ type ThreadPauseState = {
  41. export type PauseState = {
  42. cx: Context,
  43. threadcx: ThreadContext,
  44. - canRewind: boolean,
  45. threads: { [ThreadId]: ThreadPauseState },
  46. skipPausing: boolean,
  47. mapScopes: boolean,
  48. @@ -113,7 +112,6 @@ function createPauseState(thread: ThreadId = "UnknownThread") {
  49. },
  50. previewLocation: null,
  51. threads: {},
  52. - canRewind: false,
  53. skipPausing: prefs.skipPausing,
  54. mapScopes: prefs.mapScopes,
  55. shouldPauseOnExceptions: prefs.pauseOnExceptions,
  56. @@ -136,7 +134,6 @@ const resumedPauseState = {
  57. const createInitialPauseState = () => ({
  58. ...resumedPauseState,
  59. isWaitingOnBreak: false,
  60. - canRewind: false,
  61. command: null,
  62. lastCommand: null,
  63. previousLocation: null,
  64. @@ -279,7 +276,6 @@ function update(
  65. case "CONNECT":
  66. return {
  67. ...createPauseState(action.mainThread.actor),
  68. - canRewind: action.canRewind,
  69. };
  70.  
  71. case "PAUSE_ON_EXCEPTIONS": {
  72. @@ -485,10 +481,6 @@ export function getShouldPauseOnCaughtExceptions(state: State) {
  73. return state.pause.shouldPauseOnCaughtExceptions;
  74. }
  75.  
  76. -export function getCanRewind(state: State) {
  77. - return state.pause.canRewind;
  78. -}
  79. -
  80. export function getFrames(state: State, thread: ThreadId) {
  81. return getThreadPauseState(state.pause, thread).frames;
  82. }
  83. diff --git a/devtools/client/debugger/src/reducers/threads.js b/devtools/client/debugger/src/reducers/threads.js
  84. index 4e2ae25635cd..4ffba29ad738 100644
  85. --- a/devtools/client/debugger/src/reducers/threads.js
  86. +++ b/devtools/client/debugger/src/reducers/threads.js
  87. @@ -25,6 +25,7 @@ export type ThreadsState = {
  88. export function initialThreadsState(): ThreadsState {
  89. return {
  90. threads: [],
  91. + traits: {},
  92. mainThread: {
  93. actor: "",
  94. url: "",
  95. @@ -44,6 +45,7 @@ export default function update(
  96. return {
  97. ...state,
  98. mainThread: action.mainThread,
  99. + traits, action.traits,
  100. isWebExtension: action.isWebExtension,
  101. };
  102. case "INSERT_THREADS":
  103. @@ -92,6 +94,12 @@ export const getAllThreads: Selector<Thread[]> = createSelector(
  104. ]
  105. );
  106.  
  107. +
  108. +export function getCanRewind(state: State) {
  109. + return state.threads.traits.canRewind;
  110. +}
  111. +
  112. +
  113. // checks if a path begins with a thread actor
  114. // e.g "server1.conn0.child1/workerTarget22/context1/dbg-workers.glitch.me"
  115. export function startsWithThreadActor(state: State, path: string) {
  116. @@ -101,4 +109,8 @@ export function startsWithThreadActor(state: State, path: string) {
  117. return match && match[1];
  118. }
  119.  
  120. +
  121. +
  122. type OuterState = { threads: ThreadsState };
  123. +
  124. +
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement