blob: fbb60d5376d9d44c56de9de75c97065199092503 [file] [log] [blame]
[email protected]4a29a112013-07-24 19:20:181// Copyright 2013 The Chromium Authors. All rights reserved.
[email protected]10e5cf12011-04-13 04:10:402// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]4a29a112013-07-24 19:20:185#ifndef CONTENT_BROWSER_QUOTA_DISPATCHER_HOST_H_
6#define CONTENT_BROWSER_QUOTA_DISPATCHER_HOST_H_
[email protected]10e5cf12011-04-13 04:10:407
[email protected]595765c2011-04-27 13:20:148#include "base/id_map.h"
avib7348942015-12-25 20:57:109#include "base/macros.h"
[email protected]57a96ba2011-12-16 03:00:0910#include "content/public/browser/browser_message_filter.h"
pilgrim16330552014-09-10 01:32:2211#include "storage/common/quota/quota_types.h"
[email protected]10e5cf12011-04-13 04:10:4012
13class GURL;
14
[email protected]595765c2011-04-27 13:20:1415namespace IPC {
16class Message;
17}
18
[email protected]cd501a72014-08-22 19:58:3119namespace storage {
[email protected]595765c2011-04-27 13:20:1420class QuotaManager;
21}
22
[email protected]09b361bb2012-10-19 03:26:3123namespace content {
24class QuotaPermissionContext;
[email protected]f78aa7722014-04-04 00:04:2525struct StorageQuotaParams;
[email protected]09b361bb2012-10-19 03:26:3126
27class QuotaDispatcherHost : public BrowserMessageFilter {
[email protected]10e5cf12011-04-13 04:10:4028 public:
[email protected]317f96c92011-05-31 06:53:4129 QuotaDispatcherHost(int process_id,
[email protected]cd501a72014-08-22 19:58:3130 storage::QuotaManager* quota_manager,
[email protected]09b361bb2012-10-19 03:26:3131 QuotaPermissionContext* permission_context);
[email protected]fb90c942012-04-27 23:40:5032
[email protected]09b361bb2012-10-19 03:26:3133 // BrowserMessageFilter:
dchengc2282aa2014-10-21 12:07:5834 bool OnMessageReceived(const IPC::Message& message) override;
[email protected]10e5cf12011-04-13 04:10:4035
[email protected]fb90c942012-04-27 23:40:5036 protected:
dchengc2282aa2014-10-21 12:07:5837 ~QuotaDispatcherHost() override;
[email protected]fb90c942012-04-27 23:40:5038
[email protected]10e5cf12011-04-13 04:10:4039 private:
[email protected]317f96c92011-05-31 06:53:4140 class RequestDispatcher;
41 class QueryUsageAndQuotaDispatcher;
42 class RequestQuotaDispatcher;
43
[email protected]cd501a72014-08-22 19:58:3144 void OnQueryStorageUsageAndQuota(int request_id,
45 const GURL& origin_url,
46 storage::StorageType type);
[email protected]f78aa7722014-04-04 00:04:2547 void OnRequestStorageQuota(const StorageQuotaParams& params);
[email protected]595765c2011-04-27 13:20:1448
[email protected]317f96c92011-05-31 06:53:4149 // The ID of this process.
50 int process_id_;
[email protected]595765c2011-04-27 13:20:1451
[email protected]cd501a72014-08-22 19:58:3152 storage::QuotaManager* quota_manager_;
[email protected]09b361bb2012-10-19 03:26:3153 scoped_refptr<QuotaPermissionContext> permission_context_;
[email protected]317f96c92011-05-31 06:53:4154
rlandayde24c6d2016-12-01 03:05:4055 IDMap<std::unique_ptr<RequestDispatcher>> outstanding_requests_;
[email protected]317f96c92011-05-31 06:53:4156
[email protected]596cfef2013-09-09 14:45:5157 base::WeakPtrFactory<QuotaDispatcherHost> weak_factory_;
58
[email protected]317f96c92011-05-31 06:53:4159 DISALLOW_IMPLICIT_CONSTRUCTORS(QuotaDispatcherHost);
[email protected]10e5cf12011-04-13 04:10:4060};
61
[email protected]09b361bb2012-10-19 03:26:3162} // namespace content
63
[email protected]4a29a112013-07-24 19:20:1864#endif // CONTENT_BROWSER_QUOTA_DISPATCHER_HOST_H_