Commit 34706455 authored by hiroshige's avatar hiroshige Committed by Commit bot

Split Resource::Status into a separate file

This is to remove dependencies from ImageResourceInfo.h and
ImageResourceContent.h to Resource.h in
https://codereview.chromium.org/2469873002/.

BUG=667641

Review-Url: https://codereview.chromium.org/2537063002
Cr-Commit-Position: refs/heads/master@{#437700}
parent f5da68f6
......@@ -41,6 +41,7 @@ blink_core_sources("fetch") {
"ResourceLoader.h",
"ResourceLoaderOptions.h",
"ResourceLoadingLog.h",
"ResourceStatus.h",
"SubstituteData.h",
"UniqueIdentifier.cpp",
"UniqueIdentifier.h",
......
......@@ -301,6 +301,12 @@ void Resource::ResourceCallback::runTask() {
resource->finishPendingClients();
}
constexpr Resource::Status Resource::NotStarted;
constexpr Resource::Status Resource::Pending;
constexpr Resource::Status Resource::Cached;
constexpr Resource::Status Resource::LoadError;
constexpr Resource::Status Resource::DecodeError;
Resource::Resource(const ResourceRequest& request,
Type type,
const ResourceLoaderOptions& options)
......
......@@ -28,6 +28,7 @@
#include "core/fetch/CachedMetadataHandler.h"
#include "core/fetch/IntegrityMetadata.h"
#include "core/fetch/ResourceLoaderOptions.h"
#include "core/fetch/ResourceStatus.h"
#include "platform/MemoryCoordinator.h"
#include "platform/SharedBuffer.h"
#include "platform/Timer.h"
......@@ -83,13 +84,14 @@ class CORE_EXPORT Resource : public GarbageCollectedFinalized<Resource>,
};
static const int kLastResourceType = Manifest + 1;
enum Status {
NotStarted,
Pending, // load in progress
Cached, // load completed successfully
LoadError,
DecodeError
};
using Status = ResourceStatus;
// TODO(hiroshige): Remove the following declarations.
static constexpr Status NotStarted = ResourceStatus::NotStarted;
static constexpr Status Pending = ResourceStatus::Pending;
static constexpr Status Cached = ResourceStatus::Cached;
static constexpr Status LoadError = ResourceStatus::LoadError;
static constexpr Status DecodeError = ResourceStatus::DecodeError;
// Whether a resource client for a preload should mark the preload as
// referenced.
......
// Copyright 2016 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 ResourceStatus_h
#define ResourceStatus_h
namespace blink {
enum class ResourceStatus {
NotStarted,
Pending, // load in progress
Cached, // load completed successfully
LoadError,
DecodeError
};
} // namespace blink
#endif
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