Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: Source/WebCore/inspector/front-end/DebuggerPresentationModel.js

Issue 7051034: Merge 86963 - 2011-05-20 Pavel Podivilov <podivilov@chromium.org> (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/742/
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 BreakpointAdded: "breakpoint-added", 56 BreakpointAdded: "breakpoint-added",
57 BreakpointRemoved: "breakpoint-removed", 57 BreakpointRemoved: "breakpoint-removed",
58 DebuggerPaused: "debugger-paused", 58 DebuggerPaused: "debugger-paused",
59 DebuggerResumed: "debugger-resumed", 59 DebuggerResumed: "debugger-resumed",
60 CallFrameSelected: "call-frame-selected" 60 CallFrameSelected: "call-frame-selected"
61 } 61 }
62 62
63 WebInspector.DebuggerPresentationModel.prototype = { 63 WebInspector.DebuggerPresentationModel.prototype = {
64 _debuggerWasEnabled: function() 64 _debuggerWasEnabled: function()
65 { 65 {
66 if (this._breakpointsRestored)
67 return;
66 this._restoreBreakpointsFromSettings(); 68 this._restoreBreakpointsFromSettings();
69 this._breakpointsRestored = true;
67 }, 70 },
68 71
69 sourceFile: function(sourceFileId) 72 sourceFile: function(sourceFileId)
70 { 73 {
71 return this._sourceFiles[sourceFileId]; 74 return this._sourceFiles[sourceFileId];
72 }, 75 },
73 76
74 sourceFileForScriptURL: function(scriptURL) 77 sourceFileForScriptURL: function(scriptURL)
75 { 78 {
76 return this._sourceFiles[scriptURL]; 79 return this._sourceFiles[scriptURL];
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 493
491 for (var lineNumber in sourceFile.breakpoints) 494 for (var lineNumber in sourceFile.breakpoints)
492 serializedBreakpoints.push(sourceFile.breakpoints[lineNumber].se rialize()); 495 serializedBreakpoints.push(sourceFile.breakpoints[lineNumber].se rialize());
493 } 496 }
494 497
495 // Store not added breakpoints. 498 // Store not added breakpoints.
496 for (var sourceFileId in this._breakpointsWithoutSourceFile) 499 for (var sourceFileId in this._breakpointsWithoutSourceFile)
497 serializedBreakpoints = serializedBreakpoints.concat(this._breakpoin tsWithoutSourceFile[sourceFileId]); 500 serializedBreakpoints = serializedBreakpoints.concat(this._breakpoin tsWithoutSourceFile[sourceFileId]);
498 501
499 // Sanitize debugger ids. 502 // Sanitize debugger ids.
500 for (var i = 0; i < serializedBreakpoints.length; ++i) 503 for (var i = 0; i < serializedBreakpoints.length; ++i) {
501 delete serializedBreakpoints[i].debuggerId; 504 var breakpoint = serializedBreakpoints[i];
505 var breakpointCopy = {};
506 for (var property in breakpoint) {
507 if (property !== "debuggerId")
508 breakpointCopy[property] = breakpoint[property];
509 }
510 serializedBreakpoints[i] = breakpointCopy;
511 }
502 512
503 WebInspector.settings.breakpoints = serializedBreakpoints; 513 WebInspector.settings.breakpoints = serializedBreakpoints;
504 }, 514 },
505 515
506 _debuggerPaused: function() 516 _debuggerPaused: function()
507 { 517 {
508 var callFrames = WebInspector.debuggerModel.callFrames; 518 var callFrames = WebInspector.debuggerModel.callFrames;
509 this._presentationCallFrames = []; 519 this._presentationCallFrames = [];
510 for (var i = 0; i < callFrames.length; ++i) { 520 for (var i = 0; i < callFrames.length; ++i) {
511 var callFrame = callFrames[i]; 521 var callFrame = callFrames[i];
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 if (!error) { 756 if (!error) {
747 this._presentationModel._updateBreakpointsAfterLiveEdit(sourceFi le.id, oldContent, content); 757 this._presentationModel._updateBreakpointsAfterLiveEdit(sourceFi le.id, oldContent, content);
748 sourceFile.reload(); 758 sourceFile.reload();
749 } 759 }
750 } 760 }
751 this._presentationModel.editScriptSource(sourceFile.id, content, callbac k.bind(this)); 761 this._presentationModel.editScriptSource(sourceFile.id, content, callbac k.bind(this));
752 } 762 }
753 } 763 }
754 764
755 WebInspector.DebuggerPresentationModelResourceBinding.prototype.__proto__ = WebI nspector.ResourceDomainModelBinding.prototype; 765 WebInspector.DebuggerPresentationModelResourceBinding.prototype.__proto__ = WebI nspector.ResourceDomainModelBinding.prototype;
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698