Skip to content

Commit

Permalink
Fix memory management of VoiceSearchBarView.
Browse files Browse the repository at this point in the history
The VoiceSearchProvider is written in ARC, so the returned value is
autoreleased despite the function having "Created" in the name.  This
CL correctly retains the returned value to prevent over-releasing the
view.

BUG=679719

Review-Url: https://codereview.chromium.org/2644703003
Cr-Commit-Position: refs/heads/master@{#445769}
  • Loading branch information
kkhorimoto authored and Commit bot committed Jan 24, 2017
1 parent d137eeb commit d297fb5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,14 @@ class VoiceSearchProvider {
ios::ChromeBrowserState* browser_state) const;

// Creates a new VoiceSearchBar. The caller assumes ownership.
// TODO(crbug.com/679719): Remove this once downstream provider implementaiton
// switches to BuildVoiceSearchBar().
virtual UIView<VoiceSearchBar>* CreateVoiceSearchBar(CGRect frame) const
NS_RETURNS_RETAINED;

// Creates a new VoiceSearchBar. Returns an autoreleased view.
virtual UIView<VoiceSearchBar>* BuildVoiceSearchBar(CGRect frame) const;

private:
DISALLOW_COPY_AND_ASSIGN(VoiceSearchProvider);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,8 @@
CGRect frame) const {
return nil;
}

UIView<VoiceSearchBar>* VoiceSearchProvider::BuildVoiceSearchBar(
CGRect frame) const {
return nil;
}

0 comments on commit d297fb5

Please sign in to comment.