| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/net/predictor.h" | 5 #include "chrome/browser/net/predictor.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <sstream> | 10 #include <sstream> |
| (...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 SaveDnsPrefetchStateForNextStartupAndTrimOnIOThread( | 794 SaveDnsPrefetchStateForNextStartupAndTrimOnIOThread( |
| 795 update_startup_list.Get(), | 795 update_startup_list.Get(), |
| 796 update_referral_list.Get(), | 796 update_referral_list.Get(), |
| 797 &completion, | 797 &completion, |
| 798 this); | 798 this); |
| 799 } else { | 799 } else { |
| 800 bool posted = BrowserThread::PostTask( | 800 bool posted = BrowserThread::PostTask( |
| 801 BrowserThread::IO, | 801 BrowserThread::IO, |
| 802 FROM_HERE, | 802 FROM_HERE, |
| 803 base::Bind( | 803 base::Bind( |
| 804 SaveDnsPrefetchStateForNextStartupAndTrimOnIOThread, | 804 &SaveDnsPrefetchStateForNextStartupAndTrimOnIOThread, |
| 805 update_startup_list.Get(), | 805 update_startup_list.Get(), |
| 806 update_referral_list.Get(), | 806 update_referral_list.Get(), |
| 807 &completion, | 807 &completion, |
| 808 this)); | 808 this)); |
| 809 | 809 |
| 810 // TODO(jar): Synchronous waiting for the IO thread is a potential source | 810 // TODO(jar): Synchronous waiting for the IO thread is a potential source |
| 811 // to deadlocks and should be investigated. See http://crbug.com/78451. | 811 // to deadlocks and should be investigated. See http://crbug.com/78451. |
| 812 DCHECK(posted); | 812 DCHECK(posted); |
| 813 if (posted) | 813 if (posted) |
| 814 completion.Wait(); | 814 completion.Wait(); |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 PrefService* local_state, | 1207 PrefService* local_state, |
| 1208 IOThread* io_thread) { | 1208 IOThread* io_thread) { |
| 1209 // Empty function for unittests. | 1209 // Empty function for unittests. |
| 1210 } | 1210 } |
| 1211 | 1211 |
| 1212 void SimplePredictor::ShutdownOnUIThread(PrefService* user_prefs) { | 1212 void SimplePredictor::ShutdownOnUIThread(PrefService* user_prefs) { |
| 1213 SetShutdown(true); | 1213 SetShutdown(true); |
| 1214 } | 1214 } |
| 1215 | 1215 |
| 1216 } // namespace chrome_browser_net | 1216 } // namespace chrome_browser_net |
| OLD | NEW |