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

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

Issue 2469873002: [ImageResource 4] Split ImageResource into Resource and Image parts (Closed)
Patch Set: style 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ImageResourceInfo_h
6 #define ImageResourceInfo_h
7
8 #include "core/CoreExport.h"
9 #include "core/fetch/ResourceStatus.h"
10 #include "platform/heap/Handle.h"
11 #include "platform/heap/Heap.h"
12 #include "platform/weborigin/KURL.h"
13 #include "wtf/Forward.h"
14
15 namespace blink {
16
17 class ResourceError;
18 class ResourceFetcher;
19 class ResourceResponse;
20 class SecurityOrigin;
21
22 // Delegate class of ImageResource that encapsulates the interface and data
23 // visible to ImageResourceContent.
24 // Do not add new members or new call sites unless really needed.
25 // TODO(hiroshige): reduce the members of this class to further decouple
26 // ImageResource and ImageResourceContent.
27 class CORE_EXPORT ImageResourceInfo : public GarbageCollectedMixin {
28 public:
29 ~ImageResourceInfo() {}
30 virtual const KURL& url() const = 0;
31 virtual bool isSchedulingReload() const = 0;
32 virtual bool hasDevicePixelRatioHeaderValue() const = 0;
33 virtual float devicePixelRatioHeaderValue() const = 0;
34 virtual const ResourceResponse& response() const = 0;
35 virtual ResourceStatus getStatus() const = 0;
36 virtual bool isPlaceholder() const = 0;
37 virtual bool isCacheValidator() const = 0;
38 virtual bool schedulingReloadOrShouldReloadBrokenPlaceholder() const = 0;
39 enum DoesCurrentFrameHaveSingleSecurityOrigin {
40 HasMultipleSecurityOrigin,
41 HasSingleSecurityOrigin
42 };
43 virtual bool isAccessAllowed(
44 SecurityOrigin*,
45 DoesCurrentFrameHaveSingleSecurityOrigin) const = 0;
46 virtual bool hasCacheControlNoStoreHeader() const = 0;
47 virtual const ResourceError& resourceError() const = 0;
48
49 // Like Resource::error(), decodeError() makes corresponding ImageResource
50 // (if any) DecodeError and finishes loading.
51 virtual void decodeError(bool allDataReceived) = 0;
52
53 // TODO(hiroshige): Remove this once MemoryCache becomes further weaker.
54 virtual void setDecodedSize(size_t) = 0;
55
56 // TODO(hiroshige): Remove these.
57 virtual void willAddClientOrObserver() = 0;
58 virtual void didRemoveClientOrObserver() = 0;
59
60 // TODO(hiroshige): Remove this. crbug.com/666214
61 virtual void emulateLoadStartedForInspector(
62 ResourceFetcher*,
63 const KURL&,
64 const AtomicString& initiatorName) = 0;
65
66 DEFINE_INLINE_VIRTUAL_TRACE() {}
67 };
68
69 } // namespace blink
70
71 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698