
This CL is part of a larger cleanup effort to triage dangling pointers and ensure they aren't the cause of memory issues in Chrome. See: https://docs.google.com/document/d/164SnySRX6MZgFkX8qLLLClTnZ0S8s5wLiNFWNyQ8f4E/edit. This change replaces raw_ptr<ResourceContext> in MojoSafeBrowsingImpl with WeakPtr. Bug: 1407653, 1412056 Change-Id: If35a2349734762c1cd34e342432a249336bb6c38 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4250602 Reviewed-by: Xinghui Lu <xinghuilu@chromium.org> Commit-Queue: Oksana Zhuravlova <oksamyt@chromium.org> Reviewed-by: Robert Sesek <rsesek@chromium.org> Reviewed-by: John Abd-El-Malek <jam@chromium.org> Cr-Commit-Position: refs/heads/main@{#1105835}
29 lines
696 B
C++
29 lines
696 B
C++
// Copyright 2012 The Chromium Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "content/browser/resource_context_impl.h"
|
|
|
|
#include "content/public/browser/browser_context.h"
|
|
|
|
using base::UserDataAdapter;
|
|
|
|
namespace content {
|
|
|
|
ResourceContext::ResourceContext() {}
|
|
|
|
ResourceContext::~ResourceContext() {
|
|
}
|
|
|
|
base::WeakPtr<ResourceContext> ResourceContext::GetWeakPtr() {
|
|
return weak_factory_.GetWeakPtr();
|
|
}
|
|
|
|
void InitializeResourceContext(BrowserContext* browser_context) {
|
|
ResourceContext* resource_context = browser_context->GetResourceContext();
|
|
|
|
resource_context->DetachFromSequence();
|
|
}
|
|
|
|
} // namespace content
|