#ifndef CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_
#define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_
#include <map>
#include <string>
#include "base/basictypes.h"
#include "content/common/content_export.h"
#include "url/gurl.h"
namespace content {
const static int kInvalidServiceWorkerRequestId = -1;
const static int kInvalidServiceWorkerProviderId = -1;
struct CONTENT_EXPORT ServiceWorkerFetchRequest {
ServiceWorkerFetchRequest();
ServiceWorkerFetchRequest(
const GURL& url,
const std::string& method,
const std::map<std::string, std::string>& headers);
~ServiceWorkerFetchRequest();
GURL url;
std::string method;
std::map<std::string, std::string> headers;
};
enum ServiceWorkerFetchEventResult {
SERVICE_WORKER_FETCH_EVENT_RESULT_FALLBACK,
SERVICE_WORKER_FETCH_EVENT_RESULT_RESPONSE,
SERVICE_WORKER_FETCH_EVENT_LAST = SERVICE_WORKER_FETCH_EVENT_RESULT_RESPONSE
};
struct CONTENT_EXPORT ServiceWorkerResponse {
ServiceWorkerResponse();
ServiceWorkerResponse(int status_code,
const std::string& status_text,
const std::string& method,
const std::map<std::string, std::string>& headers);
~ServiceWorkerResponse();
int status_code;
std::string status_text;
std::string method;
std::map<std::string, std::string> headers;
};
}
#endif