Commit 1255f3c5 authored by Victor Costan's avatar Victor Costan Committed by Commit Bot

appcache: Move AppCacheFrontend from content/common to content/browser.

AppCacheFrontend is only used in AppCache's browser-side
implementation. Having it in content/common/appcache_interfaces.h is
misleading, as it suggests that the class is shared with the renderer.

Bug: 611938
Change-Id: I68865d63ee38841d59b61866664716c0ec8c2c39
Reviewed-on: https://chromium-review.googlesource.com/c/1429247
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
Reviewed-by: default avatarMarijn Kruisselbrink <mek@chromium.org>
Auto-Submit: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625399}
parent 30ad9168
......@@ -356,6 +356,7 @@ jumbo_source_set("browser") {
"appcache/appcache_dispatcher_host.cc",
"appcache/appcache_dispatcher_host.h",
"appcache/appcache_entry.h",
"appcache/appcache_frontend.h",
"appcache/appcache_frontend_proxy.cc",
"appcache/appcache_frontend_proxy.h",
"appcache/appcache_group.cc",
......
// Copyright 2019 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_BROWSER_APPCACHE_APPCACHE_FRONTEND_H_
#define CONTENT_BROWSER_APPCACHE_APPCACHE_FRONTEND_H_
#include <string>
#include <vector>
#include "base/files/file_path.h"
#include "content/common/appcache_interfaces.h"
#include "content/common/content_export.h"
#include "content/public/common/appcache_info.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h"
#include "third_party/blink/public/mojom/appcache/appcache.mojom.h"
#include "third_party/blink/public/mojom/appcache/appcache_info.mojom.h"
class GURL;
namespace content {
// Interface used by backend (browser-process) to talk to frontend (renderer).
class CONTENT_EXPORT AppCacheFrontend {
public:
virtual ~AppCacheFrontend() = default;
virtual void OnCacheSelected(int host_id,
const blink::mojom::AppCacheInfo& info) = 0;
virtual void OnStatusChanged(const std::vector<int>& host_ids,
blink::mojom::AppCacheStatus status) = 0;
virtual void OnEventRaised(const std::vector<int>& host_ids,
blink::mojom::AppCacheEventID event_id) = 0;
virtual void OnProgressEventRaised(const std::vector<int>& host_ids,
const GURL& url,
int num_total,
int num_complete) = 0;
virtual void OnErrorEventRaised(
const std::vector<int>& host_ids,
const blink::mojom::AppCacheErrorDetails& details) = 0;
virtual void OnContentBlocked(int host_id, const GURL& manifest_url) = 0;
virtual void OnLogMessage(int host_id,
AppCacheLogLevel log_level,
const std::string& message) = 0;
// In the network service world, we pass the URLLoaderFactory instance to be
// used to issue subresource requeste in the |loader_factory_pipe_handle|
// parameter.
virtual void OnSetSubresourceFactory(
int host_id,
network::mojom::URLLoaderFactoryPtr url_loader_factory) = 0;
};
} // namespace content
#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_FRONTEND_H_
\ No newline at end of file
......@@ -8,6 +8,7 @@
#include <string>
#include <vector>
#include "content/browser/appcache/appcache_frontend.h"
#include "content/common/appcache_interfaces.h"
#include "third_party/blink/public/mojom/appcache/appcache.mojom.h"
#include "third_party/blink/public/mojom/appcache/appcache_info.mojom.h"
......
......@@ -8,6 +8,7 @@
#include "base/test/scoped_task_environment.h"
#include "content/browser/appcache/appcache.h"
#include "content/browser/appcache/appcache_frontend.h"
#include "content/browser/appcache/appcache_group.h"
#include "content/browser/appcache/appcache_host.h"
#include "content/browser/appcache/appcache_update_job.h"
......
......@@ -12,6 +12,7 @@
#include "base/strings/stringprintf.h"
#include "content/browser/appcache/appcache.h"
#include "content/browser/appcache/appcache_backend_impl.h"
#include "content/browser/appcache/appcache_frontend.h"
#include "content/browser/appcache/appcache_policy.h"
#include "content/browser/appcache/appcache_request.h"
#include "content/browser/appcache/appcache_request_handler.h"
......
......@@ -13,6 +13,7 @@
#include "base/test/scoped_task_environment.h"
#include "content/browser/appcache/appcache.h"
#include "content/browser/appcache/appcache_backend_impl.h"
#include "content/browser/appcache/appcache_frontend.h"
#include "content/browser/appcache/appcache_group.h"
#include "content/browser/appcache/mock_appcache_policy.h"
#include "content/browser/appcache/mock_appcache_service.h"
......
......@@ -10,6 +10,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "content/browser/appcache/appcache_frontend.h"
#include "content/common/appcache_interfaces.h"
#include "third_party/blink/public/mojom/appcache/appcache.mojom.h"
#include "third_party/blink/public/mojom/appcache/appcache_info.mojom.h"
......
......@@ -27,6 +27,7 @@
#include "base/threading/thread_task_runner_handle.h"
#include "content/browser/appcache/appcache.h"
#include "content/browser/appcache/appcache_backend_impl.h"
#include "content/browser/appcache/appcache_frontend.h"
#include "content/browser/appcache/appcache_job.h"
#include "content/browser/appcache/appcache_url_loader_job.h"
#include "content/browser/appcache/appcache_url_loader_request.h"
......
......@@ -28,6 +28,7 @@
#include "content/browser/appcache/appcache_backend_impl.h"
#include "content/browser/appcache/appcache_database.h"
#include "content/browser/appcache/appcache_entry.h"
#include "content/browser/appcache/appcache_frontend.h"
#include "content/browser/appcache/appcache_group.h"
#include "content/browser/appcache/appcache_host.h"
#include "content/browser/appcache/appcache_interceptor.h"
......
......@@ -9,6 +9,7 @@
#include "base/test/scoped_task_environment.h"
#include "content/browser/appcache/appcache.h"
#include "content/browser/appcache/appcache_frontend.h"
#include "content/browser/appcache/appcache_host.h"
#include "content/browser/appcache/mock_appcache_service.h"
#include "content/common/appcache_interfaces.h"
......
......@@ -12,6 +12,7 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/threading/thread_task_runner_handle.h"
#include "content/browser/appcache/appcache_frontend.h"
#include "content/browser/appcache/appcache_group.h"
#include "content/browser/appcache/appcache_histograms.h"
#include "content/browser/appcache/appcache_update_request_base.h"
......
......@@ -23,6 +23,7 @@
#include "base/test/scoped_feature_list.h"
#include "base/test/scoped_task_environment.h"
#include "base/threading/thread_task_runner_handle.h"
#include "content/browser/appcache/appcache_frontend.h"
#include "content/browser/appcache/appcache_group.h"
#include "content/browser/appcache/appcache_host.h"
#include "content/browser/appcache/appcache_response.h"
......
......@@ -16,6 +16,7 @@
#include "base/strings/stringprintf.h"
#include "base/threading/thread_task_runner_handle.h"
#include "content/browser/appcache/appcache.h"
#include "content/browser/appcache/appcache_frontend.h"
#include "content/browser/appcache/appcache_group.h"
#include "content/browser/appcache/appcache_histograms.h"
#include "content/browser/appcache/appcache_host.h"
......
......@@ -12,6 +12,7 @@
#include "mojo/public/cpp/system/data_pipe.h"
#include "mojo/public/cpp/system/data_pipe_drainer.h"
#include "services/network/public/mojom/url_loader.mojom.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h"
namespace content {
......
......@@ -5,21 +5,10 @@
#ifndef CONTENT_COMMON_APPCACHE_INTERFACES_H_
#define CONTENT_COMMON_APPCACHE_INTERFACES_H_
#include <stdint.h>
#include <string>
#include <vector>
#include "base/files/file_path.h"
#include "content/common/content_export.h"
#include "content/public/common/appcache_info.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "third_party/blink/public/mojom/appcache/appcache.mojom.h"
#include "third_party/blink/public/mojom/appcache/appcache_info.mojom.h"
namespace net {
class URLRequest;
}
namespace content {
......@@ -31,35 +20,6 @@ enum AppCacheLogLevel {
APPCACHE_LOG_ERROR
};
// Interface used by backend (browser-process) to talk to frontend (renderer).
class CONTENT_EXPORT AppCacheFrontend {
public:
virtual ~AppCacheFrontend() = default;
virtual void OnCacheSelected(int host_id,
const blink::mojom::AppCacheInfo& info) = 0;
virtual void OnStatusChanged(const std::vector<int>& host_ids,
blink::mojom::AppCacheStatus status) = 0;
virtual void OnEventRaised(const std::vector<int>& host_ids,
blink::mojom::AppCacheEventID event_id) = 0;
virtual void OnProgressEventRaised(const std::vector<int>& host_ids,
const GURL& url,
int num_total, int num_complete) = 0;
virtual void OnErrorEventRaised(
const std::vector<int>& host_ids,
const blink::mojom::AppCacheErrorDetails& details) = 0;
virtual void OnContentBlocked(int host_id,
const GURL& manifest_url) = 0;
virtual void OnLogMessage(int host_id, AppCacheLogLevel log_level,
const std::string& message) = 0;
// In the network service world, we pass the URLLoaderFactory instance to be
// used to issue subresource requeste in the |loader_factory_pipe_handle|
// parameter.
virtual void OnSetSubresourceFactory(
int host_id,
network::mojom::URLLoaderFactoryPtr url_loader_factory) = 0;
};
// Useful string constants.
CONTENT_EXPORT extern const char kHttpGETMethod[];
CONTENT_EXPORT extern const char kHttpHEADMethod[];
......
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