Commit 3c02f795 authored by courage's avatar courage Committed by Commit bot

Fix crash in tracing for chrome.identity.getAuthToken

A trace statement in the IdentityGetAuthTokenFunction constructor was
trying to use the app ID, which is not available until later. Moving
the statement to RunAsync fixes the crash.

BUG=411396

Review URL: https://codereview.chromium.org/588343002

Cr-Commit-Position: refs/heads/master@{#296073}
parent d9b817cc
...@@ -288,11 +288,6 @@ IdentityGetAuthTokenFunction::IdentityGetAuthTokenFunction() ...@@ -288,11 +288,6 @@ IdentityGetAuthTokenFunction::IdentityGetAuthTokenFunction()
: OAuth2TokenService::Consumer("extensions_identity_api"), : OAuth2TokenService::Consumer("extensions_identity_api"),
should_prompt_for_scopes_(false), should_prompt_for_scopes_(false),
should_prompt_for_signin_(false) { should_prompt_for_signin_(false) {
TRACE_EVENT_ASYNC_BEGIN1("identity",
"IdentityGetAuthTokenFunction",
this,
"extension",
extension()->id());
} }
IdentityGetAuthTokenFunction::~IdentityGetAuthTokenFunction() { IdentityGetAuthTokenFunction::~IdentityGetAuthTokenFunction() {
...@@ -300,6 +295,12 @@ IdentityGetAuthTokenFunction::~IdentityGetAuthTokenFunction() { ...@@ -300,6 +295,12 @@ IdentityGetAuthTokenFunction::~IdentityGetAuthTokenFunction() {
} }
bool IdentityGetAuthTokenFunction::RunAsync() { bool IdentityGetAuthTokenFunction::RunAsync() {
TRACE_EVENT_ASYNC_BEGIN1("identity",
"IdentityGetAuthTokenFunction",
this,
"extension",
extension()->id());
if (GetProfile()->IsOffTheRecord()) { if (GetProfile()->IsOffTheRecord()) {
error_ = identity_constants::kOffTheRecord; error_ = identity_constants::kOffTheRecord;
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment