summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/system/syslogs_provider.h
diff options
context:
space:
mode:
authorsatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-10 06:24:52 +0000
committersatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-10 06:24:52 +0000
commitd43970a7ceee5fc5433787b0f28b64234a4039f2 (patch)
tree0cfd2581dc24c226cab75da6b683458dac540199 /chrome/browser/chromeos/system/syslogs_provider.h
parent7237bfcc6ded653b4ae2defaee6f1303b1744ede (diff)
downloadchromium_src-d43970a7ceee5fc5433787b0f28b64234a4039f2.zip
chromium_src-d43970a7ceee5fc5433787b0f28b64234a4039f2.tar.gz
chromium_src-d43970a7ceee5fc5433787b0f28b64234a4039f2.tar.bz2
Split SystemAccess into TimezoneSettings, StatisticsProvider, and SyslogsProvider.
SystemAccess contained three separate things: timezone settings, statistics provider, and syslogs provider. We should have them in separate classes. This patch touches many files but changes are mechanical. No logic changes introduced. BUG=none TEST=chrome builds and try bots pass Review URL: http://codereview.chromium.org/7324017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91971 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/system/syslogs_provider.h')
-rw-r--r--chrome/browser/chromeos/system/syslogs_provider.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/chrome/browser/chromeos/system/syslogs_provider.h b/chrome/browser/chromeos/system/syslogs_provider.h
new file mode 100644
index 0000000..ecb92b6
--- /dev/null
+++ b/chrome/browser/chromeos/system/syslogs_provider.h
@@ -0,0 +1,56 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_SYSLOGS_PROVIDER_H_
+#define CHROME_BROWSER_CHROMEOS_SYSTEM_SYSLOGS_PROVIDER_H_
+#pragma once
+
+#include <string>
+
+#include "base/callback_old.h"
+#include "content/browser/cancelable_request.h"
+
+class CancelableRequestConsumerBase;
+
+namespace chromeos {
+namespace system {
+
+typedef std::map<std::string, std::string> LogDictionaryType;
+
+// This interface provides access to Chrome OS syslogs.
+class SyslogsProvider : public CancelableRequestProvider {
+ public:
+ static SyslogsProvider* GetInstance();
+
+ // The callback type used with RequestSyslogs().
+ typedef Callback2<LogDictionaryType*,
+ std::string*>::Type ReadCompleteCallback;
+
+ // Used to specify the syslogs context with RequestSyslogs().
+ enum SyslogsContext {
+ SYSLOGS_FEEDBACK,
+ SYSLOGS_SYSINFO,
+ SYSLOGS_NETWORK,
+ SYSLOGS_DEFAULT
+ };
+
+ // Request system logs. Read happens on the FILE thread and callback is
+ // called on the thread this is called from (via ForwardResult).
+ // Logs are owned by callback function (use delete when done with them).
+ // Returns the request handle. Call CancelRequest(Handle) to cancel
+ // the request before the callback gets called.
+ virtual Handle RequestSyslogs(
+ bool compress_logs,
+ SyslogsContext context,
+ CancelableRequestConsumerBase* consumer,
+ ReadCompleteCallback* callback) = 0;
+
+ protected:
+ virtual ~SyslogsProvider() {}
+};
+
+} // namespace system
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_SYSTEM_SYSLOGS_PROVIDER_H_