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/diagnostics/recon_diagnostics.h" | 5 #include "chrome/browser/diagnostics/recon_diagnostics.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 public: | 75 public: |
76 ConflictingDllsTest() : DiagnosticTest(ASCIIToUTF16("Conflicting modules")) {} | 76 ConflictingDllsTest() : DiagnosticTest(ASCIIToUTF16("Conflicting modules")) {} |
77 | 77 |
78 virtual int GetId() { return 0; } | 78 virtual int GetId() { return 0; } |
79 | 79 |
80 virtual bool ExecuteImpl(DiagnosticsModel::Observer* observer) { | 80 virtual bool ExecuteImpl(DiagnosticsModel::Observer* observer) { |
81 #if defined(OS_WIN) | 81 #if defined(OS_WIN) |
82 EnumerateModulesModel* model = EnumerateModulesModel::GetInstance(); | 82 EnumerateModulesModel* model = EnumerateModulesModel::GetInstance(); |
83 model->set_limited_mode(true); | 83 model->set_limited_mode(true); |
84 model->ScanNow(); | 84 model->ScanNow(); |
85 ListValue* list = model->GetModuleList(); | 85 scoped_ptr<ListValue> list(model->GetModuleList()); |
86 if (!model->confirmed_bad_modules_detected() && | 86 if (!model->confirmed_bad_modules_detected() && |
87 !model->suspected_bad_modules_detected()) { | 87 !model->suspected_bad_modules_detected()) { |
88 RecordSuccess(ASCIIToUTF16("No conflicting modules found")); | 88 RecordSuccess(ASCIIToUTF16("No conflicting modules found")); |
89 return true; | 89 return true; |
90 } | 90 } |
91 | 91 |
92 string16 failures = ASCIIToUTF16("Possibly conflicting modules:"); | 92 string16 failures = ASCIIToUTF16("Possibly conflicting modules:"); |
93 DictionaryValue* dictionary; | 93 DictionaryValue* dictionary; |
94 for (size_t i = 0; i < list->GetSize(); ++i) { | 94 for (size_t i = 0; i < list->GetSize(); ++i) { |
95 if (!list->GetDictionary(i, &dictionary)) | 95 if (!list->GetDictionary(i, &dictionary)) |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 path = path.Append(chrome::kBookmarksFileName); | 415 path = path.Append(chrome::kBookmarksFileName); |
416 return new JSONTest(path, ASCIIToUTF16("BookMarks JSON"), 2 * kOneMeg); | 416 return new JSONTest(path, ASCIIToUTF16("BookMarks JSON"), 2 * kOneMeg); |
417 } | 417 } |
418 | 418 |
419 DiagnosticTest* MakeLocalStateTest() { | 419 DiagnosticTest* MakeLocalStateTest() { |
420 FilePath path; | 420 FilePath path; |
421 PathService::Get(chrome::DIR_USER_DATA, &path); | 421 PathService::Get(chrome::DIR_USER_DATA, &path); |
422 path = path.Append(chrome::kLocalStateFilename); | 422 path = path.Append(chrome::kLocalStateFilename); |
423 return new JSONTest(path, ASCIIToUTF16("Local State JSON"), 50 * kOneKilo); | 423 return new JSONTest(path, ASCIIToUTF16("Local State JSON"), 50 * kOneKilo); |
424 } | 424 } |
OLD | NEW |