Commit 3ea2a52d authored by Lucas Gadani's avatar Lucas Gadani Committed by Commit Bot

Reland "Remove CacheStorage mojom typemaps."

This is a reland of 7a5a390d

Original change's description:
> Remove CacheStorage mojom typemaps.
> 
> This CL removes the typemaps for CacheStorage and converts the browser usage of
> CacheStorage types to mojo types.
> 
> Bug: 612287
> Change-Id: Ied68ed00f2cc7af71cc33660544be9894cbb2eb1
> Reviewed-on: https://chromium-review.googlesource.com/1058334
> Reviewed-by: Joshua Bell <jsbell@chromium.org>
> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
> Commit-Queue: Lucas Gadani <lfg@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#559058}

Bug: 612287
Change-Id: Iea6d8ef4f67616be7350edec7705d71b2b1ac126
Reviewed-on: https://chromium-review.googlesource.com/1061986Reviewed-by: default avatarJoshua Bell <jsbell@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Lucas Gadani <lfg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559406}
parent 96aa7670
......@@ -668,7 +668,7 @@ void CacheStorage::EnumerateCaches(IndexCallback callback) {
void CacheStorage::MatchCache(
const std::string& cache_name,
std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCacheQueryParams& match_params,
blink::mojom::QueryParamsPtr match_params,
CacheStorageCache::ResponseCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
......@@ -681,13 +681,13 @@ void CacheStorage::MatchCache(
scheduler_->ScheduleOperation(
base::BindOnce(&CacheStorage::MatchCacheImpl, weak_factory_.GetWeakPtr(),
cache_name, std::move(request), match_params,
cache_name, std::move(request), std::move(match_params),
scheduler_->WrapCallbackToRunNext(std::move(callback))));
}
void CacheStorage::MatchAllCaches(
std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCacheQueryParams& match_params,
blink::mojom::QueryParamsPtr match_params,
CacheStorageCache::ResponseCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
......@@ -700,7 +700,7 @@ void CacheStorage::MatchAllCaches(
scheduler_->ScheduleOperation(base::BindOnce(
&CacheStorage::MatchAllCachesImpl, weak_factory_.GetWeakPtr(),
std::move(request), match_params,
std::move(request), std::move(match_params),
scheduler_->WrapCallbackToRunNext(std::move(callback))));
}
......@@ -983,7 +983,7 @@ void CacheStorage::EnumerateCachesImpl(IndexCallback callback) {
void CacheStorage::MatchCacheImpl(
const std::string& cache_name,
std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCacheQueryParams& match_params,
blink::mojom::QueryParamsPtr match_params,
CacheStorageCache::ResponseCallback callback) {
CacheStorageCacheHandle cache_handle = GetLoadedCache(cache_name);
......@@ -997,7 +997,7 @@ void CacheStorage::MatchCacheImpl(
// match is done.
CacheStorageCache* cache_ptr = cache_handle.value();
cache_ptr->Match(
std::move(request), match_params,
std::move(request), std::move(match_params),
base::BindOnce(&CacheStorage::MatchCacheDidMatch,
weak_factory_.GetWeakPtr(), std::move(cache_handle),
std::move(callback)));
......@@ -1013,7 +1013,7 @@ void CacheStorage::MatchCacheDidMatch(
void CacheStorage::MatchAllCachesImpl(
std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCacheQueryParams& match_params,
blink::mojom::QueryParamsPtr match_params,
CacheStorageCache::ResponseCallback callback) {
std::vector<CacheMatchResponse>* match_responses =
new std::vector<CacheMatchResponse>(cache_index_->num_entries());
......@@ -1031,7 +1031,8 @@ void CacheStorage::MatchAllCachesImpl(
CacheStorageCache* cache_ptr = cache_handle.value();
cache_ptr->Match(
std::make_unique<ServiceWorkerFetchRequest>(*request), match_params,
std::make_unique<ServiceWorkerFetchRequest>(*request),
match_params ? match_params->Clone() : nullptr,
base::BindOnce(&CacheStorage::MatchAllCachesDidMatch,
weak_factory_.GetWeakPtr(), std::move(cache_handle),
&match_responses->at(idx), barrier_closure));
......
......@@ -105,7 +105,7 @@ class CONTENT_EXPORT CacheStorage : public CacheStorageCacheObserver {
// Calls match on the cache with the given |cache_name|.
void MatchCache(const std::string& cache_name,
std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCacheQueryParams& match_params,
blink::mojom::QueryParamsPtr match_params,
CacheStorageCache::ResponseCallback callback);
// Calls match on all of the caches in parallel, calling |callback| with the
......@@ -113,7 +113,7 @@ class CONTENT_EXPORT CacheStorage : public CacheStorageCacheObserver {
// entry. If no response is found then |callback| is called with
// blink::mojom::CacheStorageError::kErrorNotFound.
void MatchAllCaches(std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCacheQueryParams& match_params,
blink::mojom::QueryParamsPtr match_params,
CacheStorageCache::ResponseCallback callback);
// Sums the sizes of each cache and closes them. Runs |callback| with the
......@@ -201,7 +201,7 @@ class CONTENT_EXPORT CacheStorage : public CacheStorageCacheObserver {
// The MatchCache callbacks are below.
void MatchCacheImpl(const std::string& cache_name,
std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCacheQueryParams& match_params,
blink::mojom::QueryParamsPtr match_params,
CacheStorageCache::ResponseCallback callback);
void MatchCacheDidMatch(CacheStorageCacheHandle cache_handle,
CacheStorageCache::ResponseCallback callback,
......@@ -210,7 +210,7 @@ class CONTENT_EXPORT CacheStorage : public CacheStorageCacheObserver {
// The MatchAllCaches callbacks are below.
void MatchAllCachesImpl(std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCacheQueryParams& match_params,
blink::mojom::QueryParamsPtr match_params,
CacheStorageCache::ResponseCallback callback);
void MatchAllCachesDidMatch(
CacheStorageCacheHandle cache_handle,
......
......@@ -16,7 +16,6 @@
#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "content/common/cache_storage/cache_storage_types.h"
#include "content/common/service_worker/service_worker_types.h"
#include "net/base/io_buffer.h"
#include "net/disk_cache/disk_cache.h"
......@@ -106,14 +105,14 @@ class CONTENT_EXPORT CacheStorageCache {
// Returns ERROR_TYPE_NOT_FOUND if not found.
void Match(std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCacheQueryParams& match_params,
blink::mojom::QueryParamsPtr match_params,
ResponseCallback callback);
// Returns blink::mojom::CacheStorageError::kSuccess and matched
// responses in this cache. If there are no responses, returns
// blink::mojom::CacheStorageError::kSuccess and an empty vector.
void MatchAll(std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCacheQueryParams& match_params,
blink::mojom::QueryParamsPtr match_params,
ResponsesCallback callback);
// Writes the side data (ex: V8 code cache) for the specified cache entry.
......@@ -141,11 +140,11 @@ class CONTENT_EXPORT CacheStorageCache {
//
// TODO(nhiroki): This function should run all operations atomically.
// http://crbug.com/486637
void BatchOperation(const std::vector<CacheStorageBatchOperation>& operations,
void BatchOperation(std::vector<blink::mojom::BatchOperationPtr> operations,
ErrorCallback callback,
BadMessageCallback bad_message_callback);
void BatchDidGetUsageAndQuota(
const std::vector<CacheStorageBatchOperation>& operations,
std::vector<blink::mojom::BatchOperationPtr> operations,
ErrorCallback callback,
BadMessageCallback bad_message_callback,
uint64_t space_required,
......@@ -166,7 +165,7 @@ class CONTENT_EXPORT CacheStorageCache {
// Returns blink::mojom::CacheStorageError::kSuccess and a vector of
// requests if there are no errors.
void Keys(std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCacheQueryParams& options,
blink::mojom::QueryParamsPtr options,
RequestsCallback callback);
// Closes the backend. Future operations that require the backend
......@@ -260,7 +259,7 @@ class CONTENT_EXPORT CacheStorageCache {
// REQUESTS_AND_RESPONSES then only out_requests, out_responses, and
// out_blob_data_handles are valid.
void QueryCache(std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCacheQueryParams& options,
blink::mojom::QueryParamsPtr options,
QueryTypes query_types,
QueryCacheCallback callback);
void QueryCacheDidOpenFastPath(
......@@ -280,7 +279,7 @@ class CONTENT_EXPORT CacheStorageCache {
// Match callbacks
void MatchImpl(std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCacheQueryParams& match_params,
blink::mojom::QueryParamsPtr match_params,
ResponseCallback callback);
void MatchDidMatchAll(ResponseCallback callback,
blink::mojom::CacheStorageError match_all_error,
......@@ -288,7 +287,7 @@ class CONTENT_EXPORT CacheStorageCache {
// MatchAll callbacks
void MatchAllImpl(std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCacheQueryParams& options,
blink::mojom::QueryParamsPtr options,
ResponsesCallback callback);
void MatchAllDidQueryCache(
ResponsesCallback callback,
......@@ -343,7 +342,7 @@ class CONTENT_EXPORT CacheStorageCache {
// Puts the request and response object in the cache. The response body (if
// present) is stored in the cache, but not the request body. Returns OK on
// success.
void Put(const CacheStorageBatchOperation& operation, ErrorCallback callback);
void Put(blink::mojom::BatchOperationPtr operation, ErrorCallback callback);
void PutImpl(std::unique_ptr<PutContext> put_context);
void PutDidDeleteEntry(std::unique_ptr<PutContext> put_context,
blink::mojom::CacheStorageError error);
......@@ -373,10 +372,10 @@ class CONTENT_EXPORT CacheStorageCache {
int current_cache_size);
// Returns ERROR_NOT_FOUND if not found. Otherwise deletes and returns OK.
void Delete(const CacheStorageBatchOperation& operation,
void Delete(blink::mojom::BatchOperationPtr operation,
ErrorCallback callback);
void DeleteImpl(std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCacheQueryParams& match_params,
blink::mojom::QueryParamsPtr match_params,
ErrorCallback callback);
void DeleteDidQueryCache(
ErrorCallback callback,
......@@ -385,7 +384,7 @@ class CONTENT_EXPORT CacheStorageCache {
// Keys callbacks.
void KeysImpl(std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCacheQueryParams& options,
blink::mojom::QueryParamsPtr options,
RequestsCallback callback);
void KeysDidQueryCache(
RequestsCallback callback,
......
......@@ -61,7 +61,7 @@ class CacheStorageDispatcherHost::CacheImpl
// blink::mojom::CacheStorageCache implementation:
void Match(const ServiceWorkerFetchRequest& request,
const CacheStorageCacheQueryParams& match_params,
blink::mojom::QueryParamsPtr match_params,
MatchCallback callback) override {
content::CacheStorageCache* cache = cache_handle_.value();
if (!cache) {
......@@ -75,7 +75,7 @@ class CacheStorageDispatcherHost::CacheImpl
request.is_reload);
cache->Match(
std::move(scoped_request), match_params,
std::move(scoped_request), std::move(match_params),
base::BindOnce(&CacheImpl::OnCacheMatchCallback,
weak_factory_.GetWeakPtr(), std::move(callback)));
}
......@@ -93,7 +93,7 @@ class CacheStorageDispatcherHost::CacheImpl
}
void MatchAll(const ServiceWorkerFetchRequest& request,
const CacheStorageCacheQueryParams& match_params,
blink::mojom::QueryParamsPtr match_params,
MatchAllCallback callback) override {
content::CacheStorageCache* cache = cache_handle_.value();
if (!cache) {
......@@ -104,7 +104,7 @@ class CacheStorageDispatcherHost::CacheImpl
if (request.url.is_empty()) {
cache->MatchAll(
nullptr, match_params,
nullptr, std::move(match_params),
base::BindOnce(&CacheImpl::OnCacheMatchAllCallback,
weak_factory_.GetWeakPtr(), std::move(callback)));
return;
......@@ -113,16 +113,16 @@ class CacheStorageDispatcherHost::CacheImpl
auto scoped_request = std::make_unique<ServiceWorkerFetchRequest>(
request.url, request.method, request.headers, request.referrer,
request.is_reload);
if (match_params.ignore_search) {
if (match_params->ignore_search) {
cache->MatchAll(
std::move(scoped_request), match_params,
std::move(scoped_request), std::move(match_params),
base::BindOnce(&CacheImpl::OnCacheMatchAllCallback,
weak_factory_.GetWeakPtr(), std::move(callback)));
return;
}
cache->Match(
std::move(scoped_request), match_params,
std::move(scoped_request), std::move(match_params),
base::BindOnce(&CacheImpl::OnCacheMatchAllCallbackAdapter,
weak_factory_.GetWeakPtr(), std::move(callback)));
}
......@@ -154,7 +154,7 @@ class CacheStorageDispatcherHost::CacheImpl
}
void Keys(const ServiceWorkerFetchRequest& request,
const CacheStorageCacheQueryParams& match_params,
blink::mojom::QueryParamsPtr match_params,
KeysCallback callback) override {
content::CacheStorageCache* cache = cache_handle_.value();
if (!cache) {
......@@ -167,7 +167,7 @@ class CacheStorageDispatcherHost::CacheImpl
request.url, request.method, request.headers, request.referrer,
request.is_reload);
cache->Keys(
std::move(request_ptr), match_params,
std::move(request_ptr), std::move(match_params),
base::BindOnce(&CacheImpl::OnCacheKeysCallback,
weak_factory_.GetWeakPtr(), std::move(callback)));
}
......@@ -184,7 +184,7 @@ class CacheStorageDispatcherHost::CacheImpl
std::move(callback).Run(blink::mojom::CacheKeysResult::NewKeys(*requests));
}
void Batch(const std::vector<CacheStorageBatchOperation>& batch_operations,
void Batch(std::vector<blink::mojom::BatchOperationPtr> batch_operations,
BatchCallback callback) override {
content::CacheStorageCache* cache = cache_handle_.value();
if (!cache) {
......@@ -192,7 +192,7 @@ class CacheStorageDispatcherHost::CacheImpl
return;
}
cache->BatchOperation(
batch_operations,
std::move(batch_operations),
base::BindOnce(&CacheImpl::OnCacheBatchCallback,
weak_factory_.GetWeakPtr(), std::move(callback)),
base::BindOnce(&CacheImpl::OnBadMessage, weak_factory_.GetWeakPtr(),
......@@ -310,7 +310,7 @@ void CacheStorageDispatcherHost::Keys(
void CacheStorageDispatcherHost::Match(
const content::ServiceWorkerFetchRequest& request,
const content::CacheStorageCacheQueryParams& match_params,
blink::mojom::QueryParamsPtr match_params,
blink::mojom::CacheStorage::MatchCallback callback) {
TRACE_EVENT0("CacheStorage",
"CacheStorageDispatcherHost::OnCacheStorageMatch");
......@@ -325,7 +325,7 @@ void CacheStorageDispatcherHost::Match(
request.url, request.method, request.headers, request.referrer,
request.is_reload);
if (match_params.cache_name.is_null()) {
if (!match_params->cache_name) {
context_->cache_manager()->MatchAllCaches(
origin, CacheStorageOwner::kCacheAPI, std::move(scoped_request),
std::move(match_params),
......@@ -333,11 +333,10 @@ void CacheStorageDispatcherHost::Match(
std::move(callback)));
return;
}
std::string cache_name = base::UTF16ToUTF8(*match_params->cache_name);
context_->cache_manager()->MatchCache(
origin, CacheStorageOwner::kCacheAPI,
base::UTF16ToUTF8(match_params.cache_name.string()),
origin, CacheStorageOwner::kCacheAPI, std::move(cache_name),
std::move(scoped_request), std::move(match_params),
base::BindOnce(&CacheStorageDispatcherHost::OnMatchCallback, this,
std::move(callback)));
}
......
......@@ -70,7 +70,7 @@ class CONTENT_EXPORT CacheStorageDispatcherHost
void Has(const base::string16& cache_name,
blink::mojom::CacheStorage::HasCallback callback) override;
void Match(const content::ServiceWorkerFetchRequest& request,
const content::CacheStorageCacheQueryParams& match_params,
blink::mojom::QueryParamsPtr match_params,
blink::mojom::CacheStorage::MatchCallback callback) override;
void Open(const base::string16& cache_name,
blink::mojom::CacheStorage::OpenCallback callback) override;
......
......@@ -230,23 +230,23 @@ void CacheStorageManager::MatchCache(
CacheStorageOwner owner,
const std::string& cache_name,
std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCacheQueryParams& match_params,
blink::mojom::QueryParamsPtr match_params,
CacheStorageCache::ResponseCallback callback) {
CacheStorage* cache_storage = FindOrCreateCacheStorage(origin, owner);
cache_storage->MatchCache(cache_name, std::move(request), match_params,
std::move(callback));
cache_storage->MatchCache(cache_name, std::move(request),
std::move(match_params), std::move(callback));
}
void CacheStorageManager::MatchAllCaches(
const url::Origin& origin,
CacheStorageOwner owner,
std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCacheQueryParams& match_params,
blink::mojom::QueryParamsPtr match_params,
CacheStorageCache::ResponseCallback callback) {
CacheStorage* cache_storage = FindOrCreateCacheStorage(origin, owner);
cache_storage->MatchAllCaches(std::move(request), match_params,
cache_storage->MatchAllCaches(std::move(request), std::move(match_params),
std::move(callback));
}
......
......@@ -95,12 +95,12 @@ class CONTENT_EXPORT CacheStorageManager {
CacheStorageOwner owner,
const std::string& cache_name,
std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCacheQueryParams& match_params,
blink::mojom::QueryParamsPtr match_params,
CacheStorageCache::ResponseCallback callback);
void MatchAllCaches(const url::Origin& origin,
CacheStorageOwner owner,
std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCacheQueryParams& match_params,
blink::mojom::QueryParamsPtr match_params,
CacheStorageCache::ResponseCallback callback);
// This must be called before creating any of the public *Cache functions
......
......@@ -40,7 +40,6 @@
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/browser/renderer_host/render_widget_helper.h"
#include "content/browser/resource_context_impl.h"
#include "content/common/cache_storage/cache_storage_types.h"
#include "content/common/content_constants_internal.h"
#include "content/common/render_message_filter.mojom.h"
#include "content/common/view_messages.h"
......
......@@ -19,7 +19,6 @@
#include "base/strings/string16.h"
#include "build/build_config.h"
#include "components/viz/common/resources/shared_bitmap_manager.h"
#include "content/common/cache_storage/cache_storage_types.h"
#include "content/common/render_message_filter.mojom.h"
#include "content/public/browser/browser_associated_interface.h"
#include "content/public/browser/browser_message_filter.h"
......
......@@ -2815,7 +2815,7 @@ class CacheStorageSideDataSizeChecker
new ServiceWorkerFetchRequest());
scoped_request->url = url_;
CacheStorageCache* cache = cache_handle.value();
cache->Match(std::move(scoped_request), CacheStorageCacheQueryParams(),
cache->Match(std::move(scoped_request), nullptr,
base::BindOnce(&self::OnCacheStorageCacheMatchCallback, this,
result, continuation, std::move(cache_handle)));
}
......
......@@ -64,8 +64,6 @@ source_set("common") {
"browser_plugin/browser_plugin_constants.cc",
"browser_plugin/browser_plugin_constants.h",
"browser_plugin/browser_plugin_messages.h",
"cache_storage/cache_storage_types.cc",
"cache_storage/cache_storage_types.h",
"child_process_host_impl.cc",
"child_process_host_impl.h",
"common_sandbox_support_linux.cc",
......
# Copyright 2018 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.
mojom = "//third_party/blink/public/platform/modules/cache_storage/cache_storage.mojom"
public_headers = [
"//content/common/cache_storage/cache_storage_types.h",
"//content/common/service_worker/service_worker_types.h",
]
traits_headers =
[ "//content/common/cache_storage/cache_storage_mojom_traits.h" ]
sources = [
"//content/common/cache_storage/cache_storage_mojom_traits.cc",
]
type_mappings = [
"blink.mojom.BatchOperation=content::CacheStorageBatchOperation",
"blink.mojom.OperationType=content::CacheStorageCacheOperationType",
"blink.mojom.QueryParams=content::CacheStorageCacheQueryParams",
]
// Copyright 2018 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.
#include "content/common/cache_storage/cache_storage_mojom_traits.h"
#include "base/logging.h"
#include "content/public/common/referrer_struct_traits.h"
namespace mojo {
using blink::mojom::CacheStorageError;
using blink::mojom::OperationType;
OperationType
EnumTraits<OperationType, content::CacheStorageCacheOperationType>::ToMojom(
content::CacheStorageCacheOperationType input) {
switch (input) {
case content::CACHE_STORAGE_CACHE_OPERATION_TYPE_UNDEFINED:
return OperationType::kUndefined;
case content::CACHE_STORAGE_CACHE_OPERATION_TYPE_PUT:
return OperationType::kPut;
case content::CACHE_STORAGE_CACHE_OPERATION_TYPE_DELETE:
return OperationType::kDelete;
}
NOTREACHED();
return OperationType::kUndefined;
}
bool EnumTraits<OperationType, content::CacheStorageCacheOperationType>::
FromMojom(OperationType input,
content::CacheStorageCacheOperationType* out) {
switch (input) {
case OperationType::kUndefined:
*out = content::CACHE_STORAGE_CACHE_OPERATION_TYPE_UNDEFINED;
return true;
case OperationType::kPut:
*out = content::CACHE_STORAGE_CACHE_OPERATION_TYPE_PUT;
return true;
case OperationType::kDelete:
*out = content::CACHE_STORAGE_CACHE_OPERATION_TYPE_DELETE;
return true;
}
return false;
}
bool StructTraits<blink::mojom::QueryParamsDataView,
content::CacheStorageCacheQueryParams>::
Read(blink::mojom::QueryParamsDataView data,
content::CacheStorageCacheQueryParams* out) {
base::Optional<base::string16> cache_name;
if (!data.ReadCacheName(&cache_name))
return false;
out->cache_name = base::NullableString16(std::move(cache_name));
out->ignore_search = data.ignore_search();
out->ignore_method = data.ignore_method();
out->ignore_vary = data.ignore_vary();
return true;
}
bool StructTraits<blink::mojom::BatchOperationDataView,
content::CacheStorageBatchOperation>::
Read(blink::mojom::BatchOperationDataView data,
content::CacheStorageBatchOperation* out) {
base::Optional<content::ServiceWorkerResponse> response;
base::Optional<content::CacheStorageCacheQueryParams> match_params;
if (!data.ReadOperationType(&out->operation_type))
return false;
if (!data.ReadRequest(&out->request))
return false;
if (!data.ReadResponse(&response))
return false;
if (!data.ReadMatchParams(&match_params))
return false;
if (response)
out->response = *response;
if (match_params)
out->match_params = *match_params;
return true;
}
} // namespace mojo
// Copyright 2015 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.
#include "content/common/cache_storage/cache_storage_types.h"
namespace content {
CacheStorageCacheQueryParams::CacheStorageCacheQueryParams()
: ignore_search(false), ignore_method(false), ignore_vary(false) {
}
CacheStorageBatchOperation::CacheStorageBatchOperation() {
}
CacheStorageBatchOperation::CacheStorageBatchOperation(
const CacheStorageBatchOperation& other) = default;
} // namespace content
// Copyright 2015 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 CONTENT_COMMON_CACHE_STORAGE_CACHE_STORAGE_TYPES_H_
#define CONTENT_COMMON_CACHE_STORAGE_CACHE_STORAGE_TYPES_H_
#include <map>
#include <string>
#include "base/strings/nullable_string16.h"
#include "content/common/content_export.h"
#include "content/common/service_worker/service_worker_types.h"
// This file is to have common definitions that are to be shared by
// browser and child process.
namespace content {
// Controls how requests are matched in the Cache API.
struct CONTENT_EXPORT CacheStorageCacheQueryParams {
CacheStorageCacheQueryParams();
bool ignore_search = false;
bool ignore_method = false;
bool ignore_vary = false;
base::NullableString16 cache_name;
};
// The type of a single batch operation in the Cache API.
enum CacheStorageCacheOperationType {
CACHE_STORAGE_CACHE_OPERATION_TYPE_UNDEFINED,
CACHE_STORAGE_CACHE_OPERATION_TYPE_PUT,
CACHE_STORAGE_CACHE_OPERATION_TYPE_DELETE,
CACHE_STORAGE_CACHE_OPERATION_TYPE_LAST =
CACHE_STORAGE_CACHE_OPERATION_TYPE_DELETE
};
// A single batch operation for the Cache API.
struct CONTENT_EXPORT CacheStorageBatchOperation {
CacheStorageBatchOperation();
CacheStorageBatchOperation(const CacheStorageBatchOperation& other);
CacheStorageCacheOperationType operation_type;
ServiceWorkerFetchRequest request;
ServiceWorkerResponse response;
CacheStorageCacheQueryParams match_params;
};
} // namespace content
#endif // CONTENT_COMMON_CACHE_STORAGE_CACHE_STORAGE_TYPES_H_
......@@ -4,7 +4,6 @@
typemaps = [
"//content/common/background_fetch/background_fetch_types.typemap",
"//content/common/cache_storage/cache_storage.typemap",
"//content/common/frame.typemap",
"//content/common/frame_messages.typemap",
"//content/common/input/synchronous_compositor.typemap",
......
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