Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: third_party/WebKit/Source/core/fetch/Resource.h

Issue 2537063002: Split Resource::Status into a separate file (Closed)
Patch Set: Rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller <mueller@kde.org> 3 Copyright (C) 2001 Dirk Mueller <mueller@kde.org>
4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 rights reserved. 6 rights reserved.
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 10 matching lines...) Expand all
21 Boston, MA 02110-1301, USA. 21 Boston, MA 02110-1301, USA.
22 */ 22 */
23 23
24 #ifndef Resource_h 24 #ifndef Resource_h
25 #define Resource_h 25 #define Resource_h
26 26
27 #include "core/CoreExport.h" 27 #include "core/CoreExport.h"
28 #include "core/fetch/CachedMetadataHandler.h" 28 #include "core/fetch/CachedMetadataHandler.h"
29 #include "core/fetch/IntegrityMetadata.h" 29 #include "core/fetch/IntegrityMetadata.h"
30 #include "core/fetch/ResourceLoaderOptions.h" 30 #include "core/fetch/ResourceLoaderOptions.h"
31 #include "core/fetch/ResourceStatus.h"
31 #include "platform/MemoryCoordinator.h" 32 #include "platform/MemoryCoordinator.h"
32 #include "platform/SharedBuffer.h" 33 #include "platform/SharedBuffer.h"
33 #include "platform/Timer.h" 34 #include "platform/Timer.h"
34 #include "platform/network/ResourceError.h" 35 #include "platform/network/ResourceError.h"
35 #include "platform/network/ResourceLoadPriority.h" 36 #include "platform/network/ResourceLoadPriority.h"
36 #include "platform/network/ResourceRequest.h" 37 #include "platform/network/ResourceRequest.h"
37 #include "platform/network/ResourceResponse.h" 38 #include "platform/network/ResourceResponse.h"
38 #include "platform/tracing/web_process_memory_dump.h" 39 #include "platform/tracing/web_process_memory_dump.h"
39 #include "public/platform/WebDataConsumerHandle.h" 40 #include "public/platform/WebDataConsumerHandle.h"
40 #include "wtf/Allocator.h" 41 #include "wtf/Allocator.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 SVGDocument, 77 SVGDocument,
77 XSLStyleSheet, 78 XSLStyleSheet,
78 LinkPrefetch, 79 LinkPrefetch,
79 TextTrack, 80 TextTrack,
80 ImportResource, 81 ImportResource,
81 Media, // Audio or video file requested by a HTML5 media element 82 Media, // Audio or video file requested by a HTML5 media element
82 Manifest 83 Manifest
83 }; 84 };
84 static const int kLastResourceType = Manifest + 1; 85 static const int kLastResourceType = Manifest + 1;
85 86
86 enum Status { 87 using Status = ResourceStatus;
87 NotStarted, 88
88 Pending, // load in progress 89 // TODO(hiroshige): Remove the following declarations.
89 Cached, // load completed successfully 90 static constexpr Status NotStarted = ResourceStatus::NotStarted;
90 LoadError, 91 static constexpr Status Pending = ResourceStatus::Pending;
91 DecodeError 92 static constexpr Status Cached = ResourceStatus::Cached;
92 }; 93 static constexpr Status LoadError = ResourceStatus::LoadError;
94 static constexpr Status DecodeError = ResourceStatus::DecodeError;
93 95
94 // Whether a resource client for a preload should mark the preload as 96 // Whether a resource client for a preload should mark the preload as
95 // referenced. 97 // referenced.
96 enum PreloadReferencePolicy { 98 enum PreloadReferencePolicy {
97 MarkAsReferenced, 99 MarkAsReferenced,
98 DontMarkAsReferenced, 100 DontMarkAsReferenced,
99 }; 101 };
100 102
101 virtual ~Resource(); 103 virtual ~Resource();
102 104
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 }; 493 };
492 494
493 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ 495 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \
494 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \ 496 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \
495 resource->getType() == Resource::typeName, \ 497 resource->getType() == Resource::typeName, \
496 resource.getType() == Resource::typeName); 498 resource.getType() == Resource::typeName);
497 499
498 } // namespace blink 500 } // namespace blink
499 501
500 #endif 502 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698