Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7839)

Unified Diff: chrome/browser/ui/webui/quota_internals_types.h

Issue 7084024: Add chrome://quota-internals/ (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: '' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/quota_internals_types.h
diff --git a/chrome/browser/ui/webui/quota_internals_types.h b/chrome/browser/ui/webui/quota_internals_types.h
new file mode 100644
index 0000000000000000000000000000000000000000..934f81cbfbc587c7556eb17fd1855a5e48cfe4b3
--- /dev/null
+++ b/chrome/browser/ui/webui/quota_internals_types.h
@@ -0,0 +1,101 @@
+// 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_UI_WEBUI_QUOTA_INTERNALS_TYPES_H_
+#define CHROME_BROWSER_UI_WEBUI_QUOTA_INTERNALS_TYPES_H_
+#pragma once
+
+#include <map>
+#include <string>
+
+#include "base/time.h"
+#include "googleurl/src/gurl.h"
+#include "webkit/quota/quota_types.h"
+
+class Value;
+class ListValue;
+
+namespace quota_internals {
+
+class QuotaInternalsProxy;
+
+// This class represends global usage and quota information for specific type of
+// storage.
+class GlobalData {
+ public:
+ GlobalData(quota::StorageType type,
+ int64 usage,
+ int64 unlimited_usage,
+ int64 quota);
+
+ // Create new Value for passing to WebUI page. Caller is responsible for
+ // deleting the result.
kinuko 2011/07/04 08:58:29 nit: 'deleting the returned pointer' might be bett
tzik 2011/07/06 22:49:04 Done.
+ Value* NewValue() const;
+
+ private:
+ quota::StorageType type_;
+
+ // |usage_|, |unlimited_usage_| and |quota_| can be available only for
+ // temporary storage. Unavailable or not ready values should be set to -1.
+ int64 usage_;
+ int64 unlimited_usage_;
+ int64 quota_;
+};
+
+// This class represents per host usage and quota information for the storage.
+class HostData {
+ public:
+ HostData(const std::string& host,
+ quota::StorageType type,
+ int64 usage,
+ int64 quota);
+
+ // Create new Value for passing to WebUI page. Caller is responsible for
+ // deleting the result.
+ Value* NewValue() const;
+
+ private:
+ std::string host_;
+ quota::StorageType type_;
+
+ // |quota_| can be available only for persistent storage. Unavailable or
+ // not ready values should be set to -1.
+ int64 usage_;
+ int64 quota_;
+};
+
+// This class represendts per origin usage and access time information.
+class OriginData {
+ public:
+ OriginData(const GURL& origin,
+ quota::StorageType type,
+ int in_use,
+ int used_count,
+ base::Time last_access_time,
+ base::Time last_modified_time);
+
+ // Create new Value for passing to WebUI page. Caller is responsible for
+ // deleting the result.
+ Value* NewValue() const;
+
+ private:
+ GURL origin_;
+ quota::StorageType type_;
+ std::string host_;
+
+ // |in_use_|, |used_cound_|, |last_access_time_| and |last_modified_time_| can
+ // be available only for temporary storage for now.
kinuko 2011/07/04 08:58:29 Do we need this comment here (in this file)? I th
tzik 2011/07/06 22:49:04 Done.
+ // Unavailable or not ready values should be set to:
+ // * -1 for |in_use_| and |used_count_|,
+ // * base::Time() for |last_access_time_| and |last_modified_time_|.
kinuko 2011/07/04 08:58:29 Should this be noted at the constructor if the cal
+ int in_use_;
+ int used_count_;
+ base::Time last_access_time_;
+ base::Time last_modified_time_;
+};
+
+typedef std::map<std::string, std::string> Statistics;
kinuko 2011/07/04 08:24:27 Not necessary? (Or it might be worth having this i
tzik 2011/07/06 22:49:04 Done.
+} // quota_internals
+
+#endif // CHROME_BROWSER_UI_WEBUI_QUOTA_INTERNALS_TYPES_H_

Powered by Google App Engine
This is Rietveld 408576698