|
|
Created:
5 years, 11 months ago by robwu Modified:
5 years, 11 months ago Reviewers:
not at google - send to devlin CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionReport unchecked error in lastError.run
And allow callers of sendRequest to set a stack trace.
R=kalman@chromium.org
Committed: https://crrev.com/5cd3d599fc05bdfbb2779c09ff3dde5fd11e130e
Cr-Commit-Position: refs/heads/master@{#312864}
Patch Set 1 #
Total comments: 8
Patch Set 2 : Refactor reportIfUnchecked #Patch Set 3 : s/targetChrome/callerChrome/ #
Messages
Total messages: 19 (5 generated)
Split off https://codereview.chromium.org/855813002/. I've incorporated the changes that followed from the discussion at https://codereview.chromium.org/855813002/patch/1/10003. The new optional .stack property is not used in this patch, but it is used by the other CL to show a complete stack trace when an asynchronous error occurs.
lgtm https://codereview.chromium.org/865083003/diff/1/extensions/renderer/resource... File extensions/renderer/resources/last_error.js (right): https://codereview.chromium.org/865083003/diff/1/extensions/renderer/resource... extensions/renderer/resources/last_error.js:130: var error = hasAccessed(targetChrome) && targetChrome.runtime.lastError; targetChrome.runtime.lastError --> hasError(targetChrome) I'd also call this variable "hasUncheckedError".
https://codereview.chromium.org/865083003/diff/1/extensions/renderer/resource... File extensions/renderer/resources/send_request.js (right): https://codereview.chromium.org/865083003/diff/1/extensions/renderer/resource... extensions/renderer/resources/send_request.js:76: if (error && !lastError.hasAccessed(chrome)) { The second part of this condition is unnecessary given reportIfUnchecked (well named) checks it.
https://codereview.chromium.org/865083003/diff/1/extensions/renderer/resource... File extensions/renderer/resources/last_error.js (right): https://codereview.chromium.org/865083003/diff/1/extensions/renderer/resource... extensions/renderer/resources/last_error.js:130: var error = hasAccessed(targetChrome) && targetChrome.runtime.lastError; On 2015/01/22 17:59:59, kalman wrote: > targetChrome.runtime.lastError --> hasError(targetChrome) > > I'd also call this variable "hasUncheckedError". |error| is used below as |error.message| to get the error message out of it. https://codereview.chromium.org/865083003/diff/1/extensions/renderer/resource... File extensions/renderer/resources/send_request.js (right): https://codereview.chromium.org/865083003/diff/1/extensions/renderer/resource... extensions/renderer/resources/send_request.js:76: if (error && !lastError.hasAccessed(chrome)) { On 2015/01/22 18:01:33, kalman wrote: > The second part of this condition is unnecessary given reportIfUnchecked (well > named) checks it. Look at the original code, there is a check for |chrome| and |callerChrome|.
https://codereview.chromium.org/865083003/diff/1/extensions/renderer/resource... File extensions/renderer/resources/last_error.js (right): https://codereview.chromium.org/865083003/diff/1/extensions/renderer/resource... extensions/renderer/resources/last_error.js:130: var error = hasAccessed(targetChrome) && targetChrome.runtime.lastError; On 2015/01/22 18:07:22, robwu wrote: > On 2015/01/22 17:59:59, kalman wrote: > > targetChrome.runtime.lastError --> hasError(targetChrome) > > > > I'd also call this variable "hasUncheckedError". > > |error| is used below as |error.message| to get the error message out of it. Alright. Well use that as a reason to not overload a type as both boolean + string. Please write in a different way. https://codereview.chromium.org/865083003/diff/1/extensions/renderer/resource... File extensions/renderer/resources/send_request.js (right): https://codereview.chromium.org/865083003/diff/1/extensions/renderer/resource... extensions/renderer/resources/send_request.js:76: if (error && !lastError.hasAccessed(chrome)) { On 2015/01/22 18:07:22, robwu wrote: > On 2015/01/22 18:01:33, kalman wrote: > > The second part of this condition is unnecessary given reportIfUnchecked (well > > named) checks it. > > Look at the original code, there is a check for |chrome| and |callerChrome|. Ok, add a comment.
https://codereview.chromium.org/865083003/diff/1/extensions/renderer/resource... File extensions/renderer/resources/last_error.js (right): https://codereview.chromium.org/865083003/diff/1/extensions/renderer/resource... extensions/renderer/resources/last_error.js:130: var error = hasAccessed(targetChrome) && targetChrome.runtime.lastError; On 2015/01/22 18:12:53, kalman wrote: > On 2015/01/22 18:07:22, robwu wrote: > > On 2015/01/22 17:59:59, kalman wrote: > > > targetChrome.runtime.lastError --> hasError(targetChrome) > > > > > > I'd also call this variable "hasUncheckedError". > > > > |error| is used below as |error.message| to get the error message out of it. > > Alright. Well use that as a reason to not overload a type as both boolean + > string. Please write in a different way. Done. https://codereview.chromium.org/865083003/diff/1/extensions/renderer/resource... File extensions/renderer/resources/send_request.js (right): https://codereview.chromium.org/865083003/diff/1/extensions/renderer/resource... extensions/renderer/resources/send_request.js:76: if (error && !lastError.hasAccessed(chrome)) { On 2015/01/22 18:12:53, kalman wrote: > On 2015/01/22 18:07:22, robwu wrote: > > On 2015/01/22 18:01:33, kalman wrote: > > > The second part of this condition is unnecessary given reportIfUnchecked > (well > > > named) checks it. > > > > Look at the original code, there is a check for |chrome| and |callerChrome|. > > Ok, add a comment. The purpose of |chrome| and |callerChrome| is already explained in a comment at the top of the function (about twice, actually).
lgtm
The CQ bit was checked by rob@robwu.nl
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/865083003/20001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by rob@robwu.nl
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/865083003/40001
The CQ bit was unchecked by commit-bot@chromium.org
Exceeded time limit waiting for builds to trigger.
The CQ bit was checked by rob@robwu.nl
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/865083003/40001
Message was sent while issue was closed.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/5cd3d599fc05bdfbb2779c09ff3dde5fd11e130e Cr-Commit-Position: refs/heads/master@{#312864} |