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