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

Side by Side Diff: chrome/browser/ui/tabs/tab_strip_model_unittest.cc

Issue 257153003: We have a problem in the process on destroying WebContentsImpl because (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Rebased onto origin/master again, resolved conflicts Created 6 years, 7 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 #include "chrome/browser/ui/tabs/tab_strip_model.h" 5 #include "chrome/browser/ui/tabs/tab_strip_model.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // When |source| is deleted both |tab_to_delete| and |tab_strip| are deleted. 51 // When |source| is deleted both |tab_to_delete| and |tab_strip| are deleted.
52 // |tab_to_delete| and |tab_strip| may be NULL. 52 // |tab_to_delete| and |tab_strip| may be NULL.
53 DeleteWebContentsOnDestroyedObserver(WebContents* source, 53 DeleteWebContentsOnDestroyedObserver(WebContents* source,
54 WebContents* tab_to_delete, 54 WebContents* tab_to_delete,
55 TabStripModel* tab_strip) 55 TabStripModel* tab_strip)
56 : WebContentsObserver(source), 56 : WebContentsObserver(source),
57 tab_to_delete_(tab_to_delete), 57 tab_to_delete_(tab_to_delete),
58 tab_strip_(tab_strip) { 58 tab_strip_(tab_strip) {
59 } 59 }
60 60
61 virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE { 61 virtual void WebContentsDestroyed() OVERRIDE {
62 WebContents* tab_to_delete = tab_to_delete_; 62 WebContents* tab_to_delete = tab_to_delete_;
63 tab_to_delete_ = NULL; 63 tab_to_delete_ = NULL;
64 TabStripModel* tab_strip_to_delete = tab_strip_; 64 TabStripModel* tab_strip_to_delete = tab_strip_;
65 tab_strip_ = NULL; 65 tab_strip_ = NULL;
66 delete tab_to_delete; 66 delete tab_to_delete;
67 delete tab_strip_to_delete; 67 delete tab_strip_to_delete;
68 } 68 }
69 69
70 private: 70 private:
71 WebContents* tab_to_delete_; 71 WebContents* tab_to_delete_;
(...skipping 2511 matching lines...) Expand 10 before | Expand all | Expand 10 after
2583 WebContents* moved_contents = strip_src.DetachWebContentsAt(1); 2583 WebContents* moved_contents = strip_src.DetachWebContentsAt(1);
2584 EXPECT_EQ(contents2, moved_contents); 2584 EXPECT_EQ(contents2, moved_contents);
2585 2585
2586 // Attach the tab to the destination tab strip. 2586 // Attach the tab to the destination tab strip.
2587 strip_dst.AppendWebContents(moved_contents, true); 2587 strip_dst.AppendWebContents(moved_contents, true);
2588 EXPECT_TRUE(strip_dst.IsTabBlocked(0)); 2588 EXPECT_TRUE(strip_dst.IsTabBlocked(0));
2589 2589
2590 strip_dst.CloseAllTabs(); 2590 strip_dst.CloseAllTabs();
2591 strip_src.CloseAllTabs(); 2591 strip_src.CloseAllTabs();
2592 } 2592 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tabs/tab_strip_model.cc ('k') | chrome/browser/ui/views/frame/browser_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698