| 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 #ifndef CHROME_BROWSER_DIAGNOSTICS_DIAGNOSTICS_MODEL_H_ | 5 #ifndef CHROME_BROWSER_DIAGNOSTICS_DIAGNOSTICS_MODEL_H_ |
| 6 #define CHROME_BROWSER_DIAGNOSTICS_DIAGNOSTICS_MODEL_H_ | 6 #define CHROME_BROWSER_DIAGNOSTICS_DIAGNOSTICS_MODEL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 | 10 |
| 11 namespace base { |
| 11 class CommandLine; | 12 class CommandLine; |
| 13 } |
| 12 | 14 |
| 13 namespace diagnostics { | 15 namespace diagnostics { |
| 14 | 16 |
| 15 // The chrome diagnostics system is a model-view-controller system. The Model | 17 // The chrome diagnostics system is a model-view-controller system. The Model |
| 16 // responsible for holding and running the individual tests and providing a | 18 // responsible for holding and running the individual tests and providing a |
| 17 // uniform interface for querying the outcome. | 19 // uniform interface for querying the outcome. |
| 18 class DiagnosticsModel { | 20 class DiagnosticsModel { |
| 19 public: | 21 public: |
| 20 // A particular test can be in one of the following states. | 22 // A particular test can be in one of the following states. |
| 21 enum TestResult { | 23 enum TestResult { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // limited to the lifetime of this model. | 95 // limited to the lifetime of this model. |
| 94 virtual const TestInfo& GetTest(size_t index) const = 0; | 96 virtual const TestInfo& GetTest(size_t index) const = 0; |
| 95 // Get the information for a test with given numerical |id|. Lifetime of | 97 // Get the information for a test with given numerical |id|. Lifetime of |
| 96 // returned object is limited to the lifetime of this model. Returns false if | 98 // returned object is limited to the lifetime of this model. Returns false if |
| 97 // there is no such id. |result| may not be NULL. | 99 // there is no such id. |result| may not be NULL. |
| 98 virtual bool GetTestInfo(int id, const TestInfo** result) const = 0; | 100 virtual bool GetTestInfo(int id, const TestInfo** result) const = 0; |
| 99 }; | 101 }; |
| 100 | 102 |
| 101 // The factory for the model. The main purpose is to hide the creation of | 103 // The factory for the model. The main purpose is to hide the creation of |
| 102 // different models for different platforms. | 104 // different models for different platforms. |
| 103 DiagnosticsModel* MakeDiagnosticsModel(const CommandLine& cmdline); | 105 DiagnosticsModel* MakeDiagnosticsModel(const base::CommandLine& cmdline); |
| 104 | 106 |
| 105 } // namespace diagnostics | 107 } // namespace diagnostics |
| 106 | 108 |
| 107 #endif // CHROME_BROWSER_DIAGNOSTICS_DIAGNOSTICS_MODEL_H_ | 109 #endif // CHROME_BROWSER_DIAGNOSTICS_DIAGNOSTICS_MODEL_H_ |
| OLD | NEW |