| 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.
|
| + 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.
|
| + // 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_|.
|
| + int in_use_;
|
| + int used_count_;
|
| + base::Time last_access_time_;
|
| + base::Time last_modified_time_;
|
| +};
|
| +
|
| +typedef std::map<std::string, std::string> Statistics;
|
| +} // quota_internals
|
| +
|
| +#endif // CHROME_BROWSER_UI_WEBUI_QUOTA_INTERNALS_TYPES_H_
|
|
|