| 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 "chrome/browser/enumerate_modules_model_win.h" | 5 #include "chrome/browser/enumerate_modules_model_win.h" |
| 6 | 6 |
| 7 #include <Tlhelp32.h> | 7 #include <Tlhelp32.h> |
| 8 #include <wintrust.h> | 8 #include <wintrust.h> |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 ModuleEnumerator::~ModuleEnumerator() { | 434 ModuleEnumerator::~ModuleEnumerator() { |
| 435 } | 435 } |
| 436 | 436 |
| 437 void ModuleEnumerator::ScanNow(ModulesVector* list, bool limited_mode) { | 437 void ModuleEnumerator::ScanNow(ModulesVector* list, bool limited_mode) { |
| 438 enumerated_modules_ = list; | 438 enumerated_modules_ = list; |
| 439 | 439 |
| 440 limited_mode_ = limited_mode; | 440 limited_mode_ = limited_mode; |
| 441 | 441 |
| 442 if (!limited_mode_) { | 442 if (!limited_mode_) { |
| 443 CHECK(BrowserThread::GetCurrentThreadIdentifier(&callback_thread_id_)); | 443 CHECK(BrowserThread::GetCurrentThreadIdentifier(&callback_thread_id_)); |
| 444 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::FILE)); | |
| 445 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 444 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| 446 base::Bind(&ModuleEnumerator::ScanImpl, this)); | 445 base::Bind(&ModuleEnumerator::ScanImpl, this)); |
| 447 } else { | 446 } else { |
| 448 // Run it synchronously. | 447 // Run it synchronously. |
| 449 ScanImpl(); | 448 ScanImpl(); |
| 450 } | 449 } |
| 451 } | 450 } |
| 452 | 451 |
| 453 void ModuleEnumerator::ScanImpl() { | 452 void ModuleEnumerator::ScanImpl() { |
| 454 base::TimeTicks start_time = base::TimeTicks::Now(); | 453 base::TimeTicks start_time = base::TimeTicks::Now(); |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1059 GenerateHash(WideToUTF8(module.name), &filename); | 1058 GenerateHash(WideToUTF8(module.name), &filename); |
| 1060 GenerateHash(WideToUTF8(module.location), &location); | 1059 GenerateHash(WideToUTF8(module.location), &location); |
| 1061 GenerateHash(WideToUTF8(module.description), &description); | 1060 GenerateHash(WideToUTF8(module.description), &description); |
| 1062 GenerateHash(WideToUTF8(module.digital_signer), &signer); | 1061 GenerateHash(WideToUTF8(module.digital_signer), &signer); |
| 1063 | 1062 |
| 1064 string16 url = l10n_util::GetStringFUTF16(IDS_HELP_CENTER_VIEW_CONFLICTS, | 1063 string16 url = l10n_util::GetStringFUTF16(IDS_HELP_CENTER_VIEW_CONFLICTS, |
| 1065 ASCIIToUTF16(filename), ASCIIToUTF16(location), | 1064 ASCIIToUTF16(filename), ASCIIToUTF16(location), |
| 1066 ASCIIToUTF16(description), ASCIIToUTF16(signer)); | 1065 ASCIIToUTF16(description), ASCIIToUTF16(signer)); |
| 1067 return GURL(UTF16ToUTF8(url)); | 1066 return GURL(UTF16ToUTF8(url)); |
| 1068 } | 1067 } |
| OLD | NEW |