#include "base/basictypes.h"
#include "base/strings/string_util.h"
#include "content/common/content_export.h"
+#include "content/public/common/request_context_frame_type.h"
+#include "content/public/common/request_context_type.h"
+#include "third_party/WebKit/public/platform/WebServiceWorkerResponseType.h"
#include "third_party/WebKit/public/platform/WebServiceWorkerState.h"
#include "url/gurl.h"
static const int64 kInvalidServiceWorkerResponseId = -1;
static const int kInvalidEmbeddedWorkerThreadId = -1;
+enum FetchRequestMode {
+ FETCH_REQUEST_MODE_SAME_ORIGIN,
+ FETCH_REQUEST_MODE_NO_CORS,
+ FETCH_REQUEST_MODE_CORS,
+ FETCH_REQUEST_MODE_CORS_WITH_FORCED_PREFLIGHT,
+ FETCH_REQUEST_MODE_LAST = FETCH_REQUEST_MODE_CORS_WITH_FORCED_PREFLIGHT
+};
+
+enum FetchCredentialsMode {
+ FETCH_CREDENTIALS_MODE_OMIT,
+ FETCH_CREDENTIALS_MODE_SAME_ORIGIN,
+ FETCH_CREDENTIALS_MODE_INCLUDE,
+ FETCH_CREDENTIALS_MODE_LAST = FETCH_CREDENTIALS_MODE_INCLUDE
+};
+
// Indicates how the service worker handled a fetch event.
enum ServiceWorkerFetchEventResult {
// Browser should fallback to native fetch.
bool is_reload);
~ServiceWorkerFetchRequest();
+ FetchRequestMode mode;
+ RequestContextType request_context_type;
+ RequestContextFrameType frame_type;
GURL url;
std::string method;
ServiceWorkerHeaderMap headers;
std::string blob_uuid;
uint64 blob_size;
GURL referrer;
+ FetchCredentialsMode credentials_mode;
bool is_reload;
};
ServiceWorkerResponse(const GURL& url,
int status_code,
const std::string& status_text,
+ blink::WebServiceWorkerResponseType response_type,
const ServiceWorkerHeaderMap& headers,
- const std::string& blob_uuid);
+ const std::string& blob_uuid,
+ uint64 blob_size);
~ServiceWorkerResponse();
GURL url;
int status_code;
std::string status_text;
+ blink::WebServiceWorkerResponseType response_type;
ServiceWorkerHeaderMap headers;
std::string blob_uuid;
+ uint64 blob_size;
};
// Controls how requests are matched in the Cache API.
GURL scope;
GURL url;
blink::WebServiceWorkerState state;
+ int64 version_id;
};
struct ServiceWorkerRegistrationObjectInfo {
ServiceWorkerRegistrationObjectInfo();
int handle_id;
GURL scope;
+ int64 registration_id;
};
struct ServiceWorkerVersionAttributes {