New issue
Advanced search Search tips

Issue 839528 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 1
Type: Bug



Sign in to add a comment

Extension Native Bindings: No runtime.lastErrors are logged without including a callback

Project Member Reported by rdevlin....@chromium.org, May 3 2018

Issue description

Forked from https://bugs.chromium.org/p/chromium/issues/detail?id=836370#c2.  Native bindings don't log an error when the extension didn't include a callback.
 
Project Member

Comment 1 by bugdroid1@chromium.org, May 3 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5625d718f35355f73513f4c7649962d4a326cf6a

commit 5625d718f35355f73513f4c7649962d4a326cf6a
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Thu May 03 21:03:05 2018

[Extensions Bindings] Report runtime.lastError without a callback

If an API is called without a callback, that API may still result in
an error. For instance:
chrome.foo.doBar();  // May fail asynchronously!

In this case, we should log the error to the console, in the same way
we would for an unchecked error in the callback.

This implements this for APIs invoked and resolved through the
APIRequestHandler, and adds a ReportUncheckedError() to the
APILastError object. This requires adding a pending request for
all requests through APIRequestHandler, instead of just those with
an associated callback.

Also add unittests for both the new APILastError method and the full
flow of logging the last error from the APIRequestHandler when a
callback isn't provided.

Bug:  839528 
Change-Id: I42418bb968e06d27e34e3f8981468229343dc5c9
Reviewed-on: https://chromium-review.googlesource.com/1028357
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555868}
[modify] https://crrev.com/5625d718f35355f73513f4c7649962d4a326cf6a/extensions/renderer/bindings/api_last_error.cc
[modify] https://crrev.com/5625d718f35355f73513f4c7649962d4a326cf6a/extensions/renderer/bindings/api_last_error.h
[modify] https://crrev.com/5625d718f35355f73513f4c7649962d4a326cf6a/extensions/renderer/bindings/api_last_error_unittest.cc
[modify] https://crrev.com/5625d718f35355f73513f4c7649962d4a326cf6a/extensions/renderer/bindings/api_request_handler.cc
[modify] https://crrev.com/5625d718f35355f73513f4c7649962d4a326cf6a/extensions/renderer/bindings/api_request_handler.h
[modify] https://crrev.com/5625d718f35355f73513f4c7649962d4a326cf6a/extensions/renderer/bindings/api_request_handler_unittest.cc

Status: Fixed (was: Started)
Should be fixed.

Sign in to add a comment