Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm

Issue 1221173003: [Mac] Inform reference counted objects that hold a weak Browser* when the Browser is being destroye… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove dealloc override. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" 5 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "chrome/browser/extensions/extension_message_bubble_controller.h" 10 #include "chrome/browser/extensions/extension_message_bubble_controller.h"
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 name:kBrowserActionsContainerMouseEntered 386 name:kBrowserActionsContainerMouseEntered
387 object:containerView_]; 387 object:containerView_];
388 } 388 }
389 389
390 focusedViewIndex_ = -1; 390 focusedViewIndex_ = -1;
391 } 391 }
392 392
393 return self; 393 return self;
394 } 394 }
395 395
396 - (void)browserWillBeDestroyed {
tapted 2015/07/06 07:26:18 after dealloc
jackhou1 2015/07/07 03:27:27 Done.
397 browser_ = nullptr;
398 }
tapted 2015/07/06 07:26:18 hm - toolbarActionsBar_ has a weak reference to Br
jackhou1 2015/07/07 03:27:27 Done in patch set 7.
399
396 - (void)dealloc { 400 - (void)dealloc {
397 // Explicitly destroy the ToolbarActionsBar so all buttons get removed with a 401 // Explicitly destroy the ToolbarActionsBar so all buttons get removed with a
398 // valid BrowserActionsController, and so we can verify state before 402 // valid BrowserActionsController, and so we can verify state before
399 // destruction. 403 // destruction.
400 toolbarActionsBar_->DeleteActions(); 404 toolbarActionsBar_->DeleteActions();
401 toolbarActionsBar_.reset(); 405 toolbarActionsBar_.reset();
402 DCHECK_EQ(0u, [buttons_ count]); 406 DCHECK_EQ(0u, [buttons_ count]);
403 [[NSNotificationCenter defaultCenter] removeObserver:self]; 407 [[NSNotificationCenter defaultCenter] removeObserver:self];
404 [super dealloc]; 408 [super dealloc];
405 } 409 }
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 } 1031 }
1028 1032
1029 #pragma mark - 1033 #pragma mark -
1030 #pragma mark Testing Methods 1034 #pragma mark Testing Methods
1031 1035
1032 - (BrowserActionButton*)buttonWithIndex:(NSUInteger)index { 1036 - (BrowserActionButton*)buttonWithIndex:(NSUInteger)index {
1033 return index < [buttons_ count] ? [buttons_ objectAtIndex:index] : nil; 1037 return index < [buttons_ count] ? [buttons_ objectAtIndex:index] : nil;
1034 } 1038 }
1035 1039
1036 @end 1040 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698