| 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/visitedlink/visitedlink_master.h" | 5 #include "chrome/browser/visitedlink/visitedlink_master.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <io.h> | 9 #include <io.h> |
| 10 #include <shlobj.h> | 10 #include <shlobj.h> |
| 11 #endif // defined(OS_WIN) | 11 #endif // defined(OS_WIN) |
| 12 #include <stdio.h> | 12 #include <stdio.h> |
| 13 | 13 |
| 14 #include <algorithm> | 14 #include <algorithm> |
| 15 | 15 |
| 16 #include "base/bind.h" |
| 16 #include "base/file_util.h" | 17 #include "base/file_util.h" |
| 17 #include "base/logging.h" | 18 #include "base/logging.h" |
| 18 #include "base/message_loop.h" | 19 #include "base/message_loop.h" |
| 19 #include "base/path_service.h" | 20 #include "base/path_service.h" |
| 20 #include "base/process_util.h" | 21 #include "base/process_util.h" |
| 21 #include "base/rand_util.h" | 22 #include "base/rand_util.h" |
| 22 #include "base/stack_container.h" | 23 #include "base/stack_container.h" |
| 23 #include "base/string_util.h" | 24 #include "base/string_util.h" |
| 24 #include "base/threading/thread_restrictions.h" | 25 #include "base/threading/thread_restrictions.h" |
| 25 #include "chrome/browser/history/history.h" | 26 #include "chrome/browser/history/history.h" |
| (...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 984 } | 985 } |
| 985 | 986 |
| 986 void VisitedLinkMaster::TableBuilder::OnComplete(bool success) { | 987 void VisitedLinkMaster::TableBuilder::OnComplete(bool success) { |
| 987 success_ = success; | 988 success_ = success; |
| 988 DLOG_IF(WARNING, !success) << "Unable to rebuild visited links"; | 989 DLOG_IF(WARNING, !success) << "Unable to rebuild visited links"; |
| 989 | 990 |
| 990 // Marshal to the main thread to notify the VisitedLinkMaster that the | 991 // Marshal to the main thread to notify the VisitedLinkMaster that the |
| 991 // rebuild is complete. | 992 // rebuild is complete. |
| 992 BrowserThread::PostTask( | 993 BrowserThread::PostTask( |
| 993 BrowserThread::UI, FROM_HERE, | 994 BrowserThread::UI, FROM_HERE, |
| 994 NewRunnableMethod(this, &TableBuilder::OnCompleteMainThread)); | 995 base::Bind(&TableBuilder::OnCompleteMainThread, this)); |
| 995 } | 996 } |
| 996 | 997 |
| 997 void VisitedLinkMaster::TableBuilder::OnCompleteMainThread() { | 998 void VisitedLinkMaster::TableBuilder::OnCompleteMainThread() { |
| 998 if (master_) | 999 if (master_) |
| 999 master_->OnTableRebuildComplete(success_, fingerprints_); | 1000 master_->OnTableRebuildComplete(success_, fingerprints_); |
| 1000 | 1001 |
| 1001 // WILL (generally) DELETE THIS! This balances the AddRef in | 1002 // WILL (generally) DELETE THIS! This balances the AddRef in |
| 1002 // VisitedLinkMaster::RebuildTableFromHistory. | 1003 // VisitedLinkMaster::RebuildTableFromHistory. |
| 1003 Release(); | 1004 Release(); |
| 1004 } | 1005 } |
| OLD | NEW |