| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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> |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 // We probably shouldn't be loading this from the UI thread, | 254 // We probably shouldn't be loading this from the UI thread, |
| 255 // but it does need to happen early on in startup. | 255 // but it does need to happen early on in startup. |
| 256 // http://code.google.com/p/chromium/issues/detail?id=24163 | 256 // http://code.google.com/p/chromium/issues/detail?id=24163 |
| 257 base::ThreadRestrictions::ScopedAllowIO allow_io; | 257 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 258 if (!InitFromFile()) | 258 if (!InitFromFile()) |
| 259 return InitFromScratch(suppress_rebuild_); | 259 return InitFromScratch(suppress_rebuild_); |
| 260 return true; | 260 return true; |
| 261 } | 261 } |
| 262 | 262 |
| 263 VisitedLinkMaster::Hash VisitedLinkMaster::TryToAddURL(const GURL& url) { | 263 VisitedLinkMaster::Hash VisitedLinkMaster::TryToAddURL(const GURL& url) { |
| 264 // Extra check that we are not off the record. This should not happen. | 264 // Extra check that we are not incognito. This should not happen. |
| 265 if (profile_ && profile_->IsOffTheRecord()) { | 265 if (profile_ && profile_->IsOffTheRecord()) { |
| 266 NOTREACHED(); | 266 NOTREACHED(); |
| 267 return null_hash_; | 267 return null_hash_; |
| 268 } | 268 } |
| 269 | 269 |
| 270 if (!url.is_valid()) | 270 if (!url.is_valid()) |
| 271 return null_hash_; // Don't add invalid URLs. | 271 return null_hash_; // Don't add invalid URLs. |
| 272 | 272 |
| 273 Fingerprint fingerprint = ComputeURLFingerprint(url.spec().data(), | 273 Fingerprint fingerprint = ComputeURLFingerprint(url.spec().data(), |
| 274 url.spec().size(), | 274 url.spec().size(), |
| (...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 993 } | 993 } |
| 994 | 994 |
| 995 void VisitedLinkMaster::TableBuilder::OnCompleteMainThread() { | 995 void VisitedLinkMaster::TableBuilder::OnCompleteMainThread() { |
| 996 if (master_) | 996 if (master_) |
| 997 master_->OnTableRebuildComplete(success_, fingerprints_); | 997 master_->OnTableRebuildComplete(success_, fingerprints_); |
| 998 | 998 |
| 999 // WILL (generally) DELETE THIS! This balances the AddRef in | 999 // WILL (generally) DELETE THIS! This balances the AddRef in |
| 1000 // VisitedLinkMaster::RebuildTableFromHistory. | 1000 // VisitedLinkMaster::RebuildTableFromHistory. |
| 1001 Release(); | 1001 Release(); |
| 1002 } | 1002 } |
| OLD | NEW |