Chromium Code Reviews| Index: chrome/browser/ui/browser_instant_controller.cc |
| diff --git a/chrome/browser/ui/browser_instant_controller.cc b/chrome/browser/ui/browser_instant_controller.cc |
| index 4cdc6d43f3b1187fdb4951010b9f1c4cf0e258e3..a562fcf496b0ce8f8f3c1ab9398b32a166bb5286 100644 |
| --- a/chrome/browser/ui/browser_instant_controller.cc |
| +++ b/chrome/browser/ui/browser_instant_controller.cc |
| @@ -173,13 +173,10 @@ void BrowserInstantController::ReplaceWebContentsAt( |
| DCHECK_NE(TabStripModel::kNoTab, index); |
| content::WebContents* old_contents = |
|
Jered
2013/02/13 23:25:48
I think this should be a scoped_ptr and the call s
sreeram
2013/02/13 23:41:27
Done. Added a comment for clarity too.
sreeram
2013/02/13 23:53:11
Patchset #3 does this correctly now, without any c
|
| browser_->tab_strip_model()->GetWebContentsAt(index); |
| - // TabStripModel takes ownership of |new_contents|. |
| - browser_->tab_strip_model()->ReplaceWebContentsAt( |
| - index, new_contents.release()); |
| - // TODO(samarth): use scoped_ptr instead of comments to document ownership |
| - // transfer. |
| - // InstantUnloadHandler takes ownership of |old_contents|. |
| - instant_unload_handler_.RunUnloadListenersOrDestroy(old_contents, index); |
| + browser_->tab_strip_model()->ReplaceWebContentsAt(index, |
| + new_contents.release()); |
| + instant_unload_handler_.RunUnloadListenersOrDestroy( |
| + scoped_ptr<content::WebContents>(old_contents), index); |
| } |
| void BrowserInstantController::SetInstantSuggestion( |