Commit 167850c4 authored by Sasha Bermeister's avatar Sasha Bermeister Committed by Commit Bot

Remove subclasses and outstanding_requests_ from QuotaDispatcherHost

Remove outstanding_requests_ from QuotaDispatcherHost and associated
subclasses to address TODO. These subclasses existed to carry the
request_id around. Now that the request_id has been removed from the
QuotaDispatcherHost system, these subclasses are no longer needed.

Also change the design of QuotaDispatcherHost slightly; instead of
creating a separate object to hold all the request parameters, curry
the parameters into the various async callbacks.

Bug: 781643
Change-Id: Ia85ed5a8f6e75a424767faa632e0f1f831a32ddf
Reviewed-on: https://chromium-review.googlesource.com/799573Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Reviewed-by: default avatarSam McNally <sammc@chromium.org>
Commit-Queue: Sasha Morrissey <sashab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521919}
parent e12cfcc1
This diff is collapsed.
......@@ -5,10 +5,10 @@
#ifndef CONTENT_BROWSER_QUOTA_DISPATCHER_HOST_H_
#define CONTENT_BROWSER_QUOTA_DISPATCHER_HOST_H_
#include "base/containers/id_map.h"
#include "base/macros.h"
#include "content/common/quota_dispatcher_host.mojom.h"
#include "content/public/browser/browser_message_filter.h"
#include "content/public/browser/quota_permission_context.h"
#include "storage/common/quota/quota_status_code.h"
class GURL;
......@@ -44,9 +44,34 @@ class QuotaDispatcherHost : public mojom::QuotaDispatcherHost {
RequestStorageQuotaCallback callback) override;
private:
class RequestDispatcher;
class QueryUsageAndQuotaDispatcher;
class RequestQuotaDispatcher;
void DidQueryStorageUsageAndQuota(RequestStorageQuotaCallback callback,
storage::QuotaStatusCode status,
int64_t usage,
int64_t quota);
void DidGetPersistentUsageAndQuota(int64_t render_frame_id,
const GURL& origin_url,
storage::StorageType storage_type,
uint64_t requested_quota,
RequestStorageQuotaCallback callback,
storage::QuotaStatusCode status,
int64_t usage,
int64_t quota);
void DidGetPermissionResponse(
const GURL& origin_url,
uint64_t requested_quota,
int64_t current_usage,
int64_t current_quota,
RequestStorageQuotaCallback callback,
QuotaPermissionContext::QuotaPermissionResponse response);
void DidSetHostQuota(int64_t current_usage,
RequestStorageQuotaCallback callback,
storage::QuotaStatusCode status,
int64_t new_quota);
void DidGetTemporaryUsageAndQuota(int64_t requested_quota,
RequestStorageQuotaCallback callback,
storage::QuotaStatusCode status,
int64_t usage,
int64_t quota);
// The ID of this process.
int process_id_;
......@@ -54,8 +79,6 @@ class QuotaDispatcherHost : public mojom::QuotaDispatcherHost {
storage::QuotaManager* quota_manager_;
scoped_refptr<QuotaPermissionContext> permission_context_;
base::IDMap<std::unique_ptr<RequestDispatcher>> outstanding_requests_;
base::WeakPtrFactory<QuotaDispatcherHost> weak_factory_;
DISALLOW_IMPLICIT_CONSTRUCTORS(QuotaDispatcherHost);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment