| OLD | NEW |
| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 // and Wait for it on the main thread, the task would not run at all because | 36 // and Wait for it on the main thread, the task would not run at all because |
| 37 // the main thread would be blocked on the Wait call, resulting in a deadlock. | 37 // the main thread would be blocked on the Wait call, resulting in a deadlock. |
| 38 | 38 |
| 39 // A task to be scheduled on the history backend thread. | 39 // A task to be scheduled on the history backend thread. |
| 40 // Notifies the main thread after all history backend thread tasks have run. | 40 // Notifies the main thread after all history backend thread tasks have run. |
| 41 class WaitForHistoryTask : public HistoryDBTask { | 41 class WaitForHistoryTask : public HistoryDBTask { |
| 42 public: | 42 public: |
| 43 WaitForHistoryTask() {} | 43 WaitForHistoryTask() {} |
| 44 | 44 |
| 45 virtual bool RunOnDBThread(history::HistoryBackend* backend, | 45 virtual bool RunOnDBThread(history::HistoryBackend* backend, |
| 46 history::HistoryDatabase* db) { | 46 history::HistoryDatabase* db) OVERRIDE { |
| 47 return true; | 47 return true; |
| 48 } | 48 } |
| 49 | 49 |
| 50 virtual void DoneRunOnMainThread() { | 50 virtual void DoneRunOnMainThread() OVERRIDE { |
| 51 MessageLoop::current()->Quit(); | 51 MessageLoop::current()->Quit(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 virtual ~WaitForHistoryTask() {} | 55 virtual ~WaitForHistoryTask() {} |
| 56 | 56 |
| 57 DISALLOW_COPY_AND_ASSIGN(WaitForHistoryTask); | 57 DISALLOW_COPY_AND_ASSIGN(WaitForHistoryTask); |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 } // namespace | 60 } // namespace |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 | 499 |
| 500 content::WebContents* active_web_contents = | 500 content::WebContents* active_web_contents = |
| 501 browser()->tab_strip_model()->GetActiveWebContents(); | 501 browser()->tab_strip_model()->GetActiveWebContents(); |
| 502 ASSERT_EQ(web_contents, active_web_contents); | 502 ASSERT_EQ(web_contents, active_web_contents); |
| 503 ASSERT_EQ(history_url, active_web_contents->GetURL()); | 503 ASSERT_EQ(history_url, active_web_contents->GetURL()); |
| 504 | 504 |
| 505 content::WebContents* second_tab = | 505 content::WebContents* second_tab = |
| 506 browser()->tab_strip_model()->GetWebContentsAt(1); | 506 browser()->tab_strip_model()->GetWebContentsAt(1); |
| 507 ASSERT_NE(history_url, second_tab->GetURL()); | 507 ASSERT_NE(history_url, second_tab->GetURL()); |
| 508 } | 508 } |
| OLD | NEW |