Pass a std::unique_ptr<T> for ChromeBrowserMainParts::AddParts()
Chromium change: https://chromium.googlesource.com/chromium/src/+/42e9330687356ecfaaa63e41e9ace81226fef8b7 commit 42e9330687356ecfaaa63e41e9ace81226fef8b7 Author: James Cook <jamescook@chromium.org> Date: Mon Jul 6 20:56:12 2020 +0000 Make ChromeBrowserMainParts::AddParts() take a std::unique_ptr The function takes ownership of its argument, so change to unique_ptr to make that clear. Also remove "virtual" from the function because nothing overrides it. No behavior changes - I just happened to notice this while adding a new ExtraParts class in a different CL.
This commit is contained in:
committed by
Max Karolinskiy
parent
cef105f6a9
commit
c71e5beb11
@@ -156,7 +156,7 @@ BraveContentBrowserClient::CreateBrowserMainParts(
|
||||
ChromeContentBrowserClient::CreateBrowserMainParts(parameters);
|
||||
ChromeBrowserMainParts* chrome_main_parts =
|
||||
static_cast<ChromeBrowserMainParts*>(main_parts.get());
|
||||
chrome_main_parts->AddParts(new BraveBrowserMainExtraParts());
|
||||
chrome_main_parts->AddParts(std::make_unique<BraveBrowserMainExtraParts>());
|
||||
return main_parts;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ class BraveBrowserMainExtraPartsProfiles
|
||||
namespace chrome {
|
||||
|
||||
void AddProfilesExtraParts(ChromeBrowserMainParts* main_parts) {
|
||||
main_parts->AddParts(new BraveBrowserMainExtraPartsProfiles());
|
||||
main_parts->AddParts(std::make_unique<BraveBrowserMainExtraPartsProfiles>());
|
||||
}
|
||||
|
||||
} // namespace chrome
|
||||
|
||||
Reference in New Issue
Block a user