Commit fdc1f3db authored by anand.ratn's avatar anand.ratn Committed by Commit bot

Declaring the weak_ptr_factory in proper order.

Cleaning up weak_ptr_factory destruction order in "src/chrome/browser/ui"
module. WeakPtrFactory should remain the last member so it'll be destroyed and
invalidate its weak pointers before any other members are destroyed.

BUG=303818

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

Cr-Commit-Position: refs/heads/master@{#296898}
parent 0cb8306a
......@@ -131,8 +131,8 @@ class TestAutofillDialogController : public AutofillDialogControllerImpl {
GetRequestContext(), this, form_data.origin),
message_loop_runner_(runner),
use_validation_(false),
weak_ptr_factory_(this),
sign_in_user_index_(0U) {
sign_in_user_index_(0U),
weak_ptr_factory_(this) {
test_manager_.Init(
NULL,
Profile::FromBrowserContext(contents->GetBrowserContext())->GetPrefs(),
......@@ -261,12 +261,12 @@ class TestAutofillDialogController : public AutofillDialogControllerImpl {
// This is used to control what |CurrentNotifications()| returns for testing.
std::vector<DialogNotification> notifications_;
// Allows generation of WeakPtrs, so controller liveness can be tested.
base::WeakPtrFactory<TestAutofillDialogController> weak_ptr_factory_;
// The user index that is assigned in IsSignInContinueUrl().
size_t sign_in_user_index_;
// Allows generation of WeakPtrs, so controller liveness can be tested.
base::WeakPtrFactory<TestAutofillDialogController> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(TestAutofillDialogController);
};
......
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