Commit 7f4aed4a authored by sammc's avatar sammc Committed by Commit bot

Revert of Unload the ScopedGaiaAuthExtension asynchronously. (patchset #2...

Revert of Unload the ScopedGaiaAuthExtension asynchronously. (patchset #2 id:20001 of https://codereview.chromium.org/961443003/)

Reason for revert:
Broke BookmarkSyncPromoControllerTest.SignInLink on Mac ASan 64: https://build.chromium.org/p/chromium.memory/builders/Mac%20ASan%2064%20Tests%20%281%29/builds/7363

Original issue's description:
> Unload the ScopedGaiaAuthExtension asynchronously.
>
> If we don't do this, then we have a race condition between unloading
> this extension, and trying to use it because we have manually
> navigated to it.
>
> BUG=460431
>
> Committed: https://crrev.com/1805c4c5c4b5292cca51a54f379cde498db7238b
> Cr-Commit-Position: refs/heads/master@{#318140}

TBR=xiyuan@chromium.org,noms@google.com,noms@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=460431

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

Cr-Commit-Position: refs/heads/master@{#318176}
parent f29d7834
......@@ -4,10 +4,6 @@
#include "chrome/browser/extensions/signin/scoped_gaia_auth_extension.h"
#include "base/bind.h"
#include "base/location.h"
#include "base/single_thread_task_runner.h"
#include "base/thread_task_runner_handle.h"
#include "chrome/browser/extensions/signin/gaia_auth_extension_loader.h"
#include "content/public/browser/browser_context.h"
......@@ -23,15 +19,6 @@ ScopedGaiaAuthExtension::ScopedGaiaAuthExtension(
ScopedGaiaAuthExtension::~ScopedGaiaAuthExtension() {
extensions::GaiaAuthExtensionLoader* loader =
extensions::GaiaAuthExtensionLoader::Get(browser_context_);
if (loader) {
// Post this instead of calling it directly, to ensure that the
// RenderFrameHost is not used after being destroyed. This would happen,
// for example, if we tried to manually navigate to the extension while
// the <webview> containing the Gaia sign in page (and therefore the
// extension) was the active tab. See crbug.com/460431.
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(&extensions::GaiaAuthExtensionLoader::UnloadIfNeeded,
base::Unretained(loader)));
}
if (loader)
loader->UnloadIfNeeded();
}
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