Index: chrome/browser/chromeos/cros/syslogs_library.cc |
diff --git a/chrome/browser/chromeos/cros/syslogs_library.cc b/chrome/browser/chromeos/cros/syslogs_library.cc |
index 365e9fe8523a8b2ac4a74e1351773abeb42dad5c..7c5f4fa0173102375ec6aca86159eac5d5b10840 100644 |
--- a/chrome/browser/chromeos/cros/syslogs_library.cc |
+++ b/chrome/browser/chromeos/cros/syslogs_library.cc |
@@ -10,11 +10,38 @@ |
namespace chromeos { |
-LogDictionaryType* SyslogsLibraryImpl::GetSyslogs(FilePath* tmpfilename) { |
- if (CrosLibrary::Get()->EnsureLoaded()) { |
- return chromeos::GetSystemLogs(tmpfilename); |
+class SyslogsLibraryImpl : public SyslogsLibrary { |
+ public: |
+ SyslogsLibraryImpl() {} |
+ virtual ~SyslogsLibraryImpl() {} |
+ |
+ LogDictionaryType* GetSyslogs(FilePath* tmpfilename) { |
+ if (CrosLibrary::Get()->EnsureLoaded()) { |
+ return chromeos::GetSystemLogs(tmpfilename); |
+ } |
+ return NULL; |
+ } |
+}; |
+ |
+class SyslogsLibraryStubImpl : public SyslogsLibrary { |
+ public: |
+ SyslogsLibraryStubImpl() {} |
+ virtual ~SyslogsLibraryStubImpl() {} |
+ |
+ LogDictionaryType* GetSyslogs(FilePath* tmpfilename) { |
+ return &log_dictionary_; |
} |
- return NULL; |
+ |
+ private: |
+ LogDictionaryType log_dictionary_; |
+}; |
+ |
+// static |
+SyslogsLibrary* SyslogsLibrary::GetImpl(bool stub) { |
+ if (stub) |
+ return new SyslogsLibraryStubImpl(); |
+ else |
+ return new SyslogsLibraryImpl(); |
} |
} // namespace chromeos |