The CQ bit was checked by sczs@chromium.org
Created Revert of [ObjC ARC] Converts ios/chrome/browser/ui/toolbar:toolbar to ARC.
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Failed to apply patch for ios/chrome/browser/ui/toolbar/toolbar_controller.mm: While running git apply --index -3 -p1; error: patch failed: ios/chrome/browser/ui/toolbar/toolbar_controller.mm:76 error: repository lacks the necessary blob to fall back on 3-way merge. error: ios/chrome/browser/ui/toolbar/toolbar_controller.mm: patch does not apply Patch: ios/chrome/browser/ui/toolbar/toolbar_controller.mm Index: ios/chrome/browser/ui/toolbar/toolbar_controller.mm diff --git a/ios/chrome/browser/ui/toolbar/toolbar_controller.mm b/ios/chrome/browser/ui/toolbar/toolbar_controller.mm index 7dd27ef31e01929f573355fa5d96ff80b22d4021..3eb51c61eca69a187f4aed516de3ddd5dea89ae4 100644 --- a/ios/chrome/browser/ui/toolbar/toolbar_controller.mm +++ b/ios/chrome/browser/ui/toolbar/toolbar_controller.mm @@ -76,10 +76,6 @@ // Makes a two-element C array of CGRects as described above, one for each // device idiom. #define FRAME_PAIR(H) { IPHONE_FRAME(H), IPAD_FRAME(H) } - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif // clang-format on const CGRect kToolbarFrame[INTERFACE_IDIOM_COUNT] = FRAME_PAIR(56); @@ -204,21 +200,26 @@ @end @interface ToolbarController () { - // The shadow view. Only used on iPhone. - UIImageView* fullBleedShadowView_; + // The top-level toolbar view. + base::scoped_nsobject<ToolbarView> view_; + // The view for the toolbar background image. + base::scoped_nsobject<UIImageView> backgroundView_; + base::scoped_nsobject<UIImageView> shadowView_; + base::scoped_nsobject<UIImageView> fullBleedShadowView_; // The backing object for |self.transitionLayers|. - NSMutableArray* transitionLayers_; - - ToolbarToolsMenuButton* toolsMenuButton_; - UIButton* stackButton_; - UIButton* shareButton_; - NSArray* standardButtons_; - ToolsMenuButtonObserverBridge* toolsMenuButtonObserverBridge_; + base::scoped_nsobject<NSMutableArray> transitionLayers_; + + base::scoped_nsobject<ToolbarToolsMenuButton> toolsMenuButton_; + base::scoped_nsobject<UIButton> stackButton_; + base::scoped_nsobject<UIButton> shareButton_; + base::scoped_nsobject<NSArray> standardButtons_; + base::scoped_nsobject<ToolsMenuButtonObserverBridge> + toolsMenuButtonObserverBridge_; ToolbarControllerStyle style_; // The following is nil if not visible. - ToolsPopupController* toolsPopupController_; + base::scoped_nsobject<ToolsPopupController> toolsPopupController_; } // Returns the background image that should be used for |style|. @@ -244,18 +245,15 @@ @implementation ToolbarController @synthesize readingListModel = readingListModel_; -@synthesize view = view_; -@synthesize backgroundView = backgroundView_; -@synthesize shadowView = shadowView_; -@synthesize toolsPopupController = toolsPopupController_; + @synthesize style = style_; - (void)setReadingListModel:(ReadingListModel*)readingListModel { readingListModel_ = readingListModel; if (readingListModel_) { - toolsMenuButtonObserverBridge_ = - [[ToolsMenuButtonObserverBridge alloc] initWithModel:readingListModel_ - toolbarButton:toolsMenuButton_]; + toolsMenuButtonObserverBridge_.reset([[ToolsMenuButtonObserverBridge alloc] + initWithModel:readingListModel_ + toolbarButton:toolsMenuButton_]); } } @@ -280,11 +278,11 @@ toolsMenuButtonFrame.origin.y += statusBarOffset; } - view_ = [[ToolbarView alloc] initWithFrame:viewFrame]; - backgroundView_ = [[UIImageView alloc] initWithFrame:backgroundFrame]; - toolsMenuButton_ = - [[ToolbarToolsMenuButton alloc] initWithFrame:toolsMenuButtonFrame - style:style_]; + view_.reset([[ToolbarView alloc] initWithFrame:viewFrame]); + backgroundView_.reset([[UIImageView alloc] initWithFrame:backgroundFrame]); + toolsMenuButton_.reset([[ToolbarToolsMenuButton alloc] + initWithFrame:toolsMenuButtonFrame + style:style_]); [toolsMenuButton_ setTag:IDC_SHOW_TOOLS_MENU]; [toolsMenuButton_ setAutoresizingMask:UIViewAutoresizingFlexibleLeadingMargin() | @@ -298,7 +296,7 @@ if (idiom == IPAD_IDIOM) { CGRect shareButtonFrame = LayoutRectGetRect(kShareMenuButtonFrame); - shareButton_ = [[UIButton alloc] initWithFrame:shareButtonFrame]; + shareButton_.reset([[UIButton alloc] initWithFrame:shareButtonFrame]); [shareButton_ setTag:IDC_SHARE_PAGE]; [shareButton_ setAutoresizingMask:UIViewAutoresizingFlexibleLeadingMargin() | @@ -315,7 +313,7 @@ CGRect shadowFrame = kShadowViewFrame[idiom]; shadowFrame.origin.y = CGRectGetMaxY(backgroundFrame); - shadowView_ = [[UIImageView alloc] initWithFrame:shadowFrame]; + shadowView_.reset([[UIImageView alloc] initWithFrame:shadowFrame]); [shadowView_ setAutoresizingMask:UIViewAutoresizingFlexibleWidth]; [shadowView_ setUserInteractionEnabled:NO]; [view_ addSubview:shadowView_]; @@ -325,8 +323,8 @@ // iPad omnibox does not expand to full bleed. CGRect fullBleedShadowFrame = kFullBleedShadowViewFrame; fullBleedShadowFrame.origin.y = shadowFrame.origin.y; - fullBleedShadowView_ = - [[UIImageView alloc] initWithFrame:fullBleedShadowFrame]; + fullBleedShadowView_.reset( + [[UIImageView alloc] initWithFrame:fullBleedShadowFrame]); [fullBleedShadowView_ setAutoresizingMask:UIViewAutoresizingFlexibleWidth]; [fullBleedShadowView_ setUserInteractionEnabled:NO]; @@ -336,8 +334,8 @@ setImage:NativeImage(IDR_IOS_TOOLBAR_SHADOW_FULL_BLEED)]; } - transitionLayers_ = - [[NSMutableArray alloc] initWithCapacity:kTransitionLayerCapacity]; + transitionLayers_.reset( + [[NSMutableArray alloc] initWithCapacity:kTransitionLayerCapacity]); // UIImageViews do not default to userInteractionEnabled:YES. [view_ setUserInteractionEnabled:YES]; @@ -348,8 +346,8 @@ setImage:StretchableImageFromUIImage(tile, 0.0, 3.0)]; if (idiom == IPHONE_IDIOM) { - stackButton_ = - [[ToolbarCenteredButton alloc] initWithFrame:stackButtonFrame]; + stackButton_.reset( + [[ToolbarCenteredButton alloc] initWithFrame:stackButtonFrame]); [stackButton_ setTag:IDC_TOGGLE_TAB_SWITCHER]; [[stackButton_ titleLabel] setFont:[self fontForSize:kFontSizeFewerThanTenTabs]]; @@ -409,14 +407,27 @@ - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; [toolsPopupController_ setDelegate:nil]; + [super dealloc]; +} + +- (UIImageView*)view { + return view_.get(); +} + +- (UIImageView*)backgroundView { + return backgroundView_.get(); } - (CGFloat)statusBarOffset { return StatusBarHeight(); } +- (UIImageView*)shadowView { + return shadowView_.get(); +} + - (NSMutableArray*)transitionLayers { - return transitionLayers_; + return transitionLayers_.get(); } - (BOOL)imageShouldFlipForRightToLeftLayoutDirection:(int)imageEnum { @@ -433,18 +444,22 @@ [standardButtons addObject:stackButton_]; if (shareButtonShouldBeVisible) [standardButtons addObject:shareButton_]; - standardButtons_ = standardButtons; + standardButtons_.reset([standardButtons retain]); } - (void)traitCollectionDidChange:(UITraitCollection*)previousTraitCollection { [self updateStandardButtons]; } +- (ToolsPopupController*)toolsPopupController { + return toolsPopupController_.get(); +} + - (void)applicationDidEnterBackground:(NSNotification*)notify { - if (toolsPopupController_) { + if (toolsPopupController_.get()) { // Dismiss the tools popup menu without animation. [toolsMenuButton_ setToolsMenuIsVisible:NO]; - toolsPopupController_ = nil; + toolsPopupController_.reset(nil); [[NSNotificationCenter defaultCenter] postNotificationName:kMenuWillHideNotification object:nil]; @@ -475,7 +490,7 @@ } - (int)imageEnumForButton:(UIButton*)button { - if (button == stackButton_) + if (button == stackButton_.get()) return ToolbarButtonNameStack; return NumberOfToolbarButtonNames; } @@ -548,7 +563,7 @@ } - (void)registerEventsForButton:(UIButton*)button { - if (button != toolsMenuButton_) { + if (button != toolsMenuButton_.get()) { // |target| must be |self| (as opposed to |nil|) because |self| isn't in the // responder chain. [button addTarget:self @@ -570,7 +585,7 @@ } - (UIView*)shareButtonView { - return shareButton_; + return shareButton_.get(); } - (void)showToolsMenuPopupWithConfiguration: @@ -587,8 +602,8 @@ [toolsMenuButton_ setToolsMenuIsVisible:YES]; [configuration setToolsMenuButton:toolsMenuButton_]; - toolsPopupController_ = - [[ToolsPopupController alloc] initWithConfiguration:configuration]; + toolsPopupController_.reset( + [[ToolsPopupController alloc] initWithConfiguration:configuration]); [toolsPopupController_ setDelegate:self]; @@ -598,9 +613,9 @@ } - (void)dismissToolsMenuPopup { - if (!toolsPopupController_) + if (!toolsPopupController_.get()) return; - ToolsPopupController* tempTPC = toolsPopupController_; + ToolsPopupController* tempTPC = toolsPopupController_.get(); [tempTPC containerView].userInteractionEnabled = NO; [tempTPC dismissAnimatedWithCompletion:^{ // Unpress the tools menu button by restoring the normal and @@ -611,7 +626,7 @@ }]; // reset tabHistoryPopupController_ to prevent -applicationDidEnterBackground // from posting another kMenuWillHideNotification. - toolsPopupController_ = nil; + toolsPopupController_.reset(); [[NSNotificationCenter defaultCenter] postNotificationName:kMenuWillHideNotification @@ -670,7 +685,7 @@ fadeButtons.fromValue = @1; fadeButtons.toValue = @0; - for (UIButton* button in standardButtons_) { + for (UIButton* button… (message too large)
CQ is committing da patch. Bot data: {"patchset_id": 1, "attempt_start_ts": 1493386444002860, "parent_rev": "394a4f2f148ad91c04bacb5df265248898844a3b", "commit_rev": "42dd78c534edf6e6f7318c37dcd64f5b06709f30"}
Description was changed from ========== Revert of [ObjC ARC] Converts ios/chrome/browser/ui/toolbar:toolbar to ARC. (patchset #3 id:40001 of https://codereview.chromium.org/2808873002/ ) Reason for revert: Reverting since ios_chrome_smoke_egtests its failing and it broke the autoroller. https://uberchromegw.corp.google.com/i/internal.bling.main/builders/chromium-... Original issue's description: > [ObjC ARC] Converts ios/chrome/browser/ui/toolbar:toolbar to ARC. > > Automatically generated ARCMigrate commit > Notable issues:None > BUG=624363 > TEST=None > > Review-Url: https://codereview.chromium.org/2808873002 > Cr-Commit-Position: refs/heads/master@{#467947} > Committed: https://chromium.googlesource.com/chromium/src/+/8b6e180812e904c59ff0d72a3b2d... TBR=stkhapugin@chromium.org,sdefresne@chromium.org,gambard@chromium.org,olivi... # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=624363 ========== to ========== Revert of [ObjC ARC] Converts ios/chrome/browser/ui/toolbar:toolbar to ARC. (patchset #3 id:40001 of https://codereview.chromium.org/2808873002/ ) Reason for revert: Reverting since ios_chrome_smoke_egtests its failing and it broke the autoroller. https://uberchromegw.corp.google.com/i/internal.bling.main/builders/chromium-... Original issue's description: > [ObjC ARC] Converts ios/chrome/browser/ui/toolbar:toolbar to ARC. > > Automatically generated ARCMigrate commit > Notable issues:None > BUG=624363 > TEST=None > > Review-Url: https://codereview.chromium.org/2808873002 > Cr-Commit-Position: refs/heads/master@{#467947} > Committed: https://chromium.googlesource.com/chromium/src/+/8b6e180812e904c59ff0d72a3b2d... TBR=stkhapugin@chromium.org,sdefresne@chromium.org,gambard@chromium.org,olivi... # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=624363 Review-Url: https://codereview.chromium.org/2852713002 Cr-Commit-Position: refs/heads/master@{#467981} Committed: https://chromium.googlesource.com/chromium/src/+/42dd78c534edf6e6f7318c37dcd6... ==========
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/src/+/42dd78c534edf6e6f7318c37dcd6...