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

Unified Diff: third_party/WebKit/Source/core/fetch/ImageResourceInfo.h

Issue 2469873002: [ImageResource 4] Split ImageResource into Resource and Image parts (Closed)
Patch Set: fix 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/fetch/ImageResourceInfo.h
diff --git a/third_party/WebKit/Source/core/fetch/ImageResourceInfo.h b/third_party/WebKit/Source/core/fetch/ImageResourceInfo.h
new file mode 100644
index 0000000000000000000000000000000000000000..7d5a656e7d3c76f23932dbab0c2f9b405c7683f8
--- /dev/null
+++ b/third_party/WebKit/Source/core/fetch/ImageResourceInfo.h
@@ -0,0 +1,56 @@
+// 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 ImageResourceInfo_h
+#define ImageResourceInfo_h
+
+#include "core/CoreExport.h"
+#include "core/fetch/ResourceStatus.h"
+#include "platform/heap/Heap.h"
+#include "platform/weborigin/KURL.h"
yhirano 2016/12/05 09:02:04 +wtf/Forward.h
hiroshige 2016/12/06 09:32:51 Done.
+
+namespace blink {
+
+class ResourceError;
+class ResourceFetcher;
+class ResourceResponse;
+class SecurityOrigin;
+
+// Delegate class of ImageResource that encapsulates the interface and data
+// visible to ImageResourceContent.
+// TODO(hiroshige): reduce the members of this class to further decouple
+// ImageResource and ImageResourceContent.
+class CORE_EXPORT ImageResourceInfo : public GarbageCollectedMixin {
+ public:
+ ~ImageResourceInfo() {}
+ virtual const KURL& url() const = 0;
+ virtual bool isSchedulingReload() const = 0;
+ virtual bool hasDevicePixelRatioHeaderValue() const = 0;
+ virtual float devicePixelRatioHeaderValue() const = 0;
+ virtual const ResourceResponse& response() const = 0;
+ virtual ResourceStatus getStatus() const = 0;
+ virtual bool isPlaceholder() const = 0;
+ virtual bool isCacheValidator() const = 0;
+ virtual bool schedulingReloadOrShouldReloadBrokenPlaceholder() const = 0;
+ virtual bool isAccessAllowed(
yhirano 2016/12/05 09:02:03 Please use enum rather than boolean for a public m
hiroshige 2016/12/06 09:32:51 Done.
+ SecurityOrigin*,
+ bool doesCurrentFrameHasSingleSecurityOrigin) const = 0;
+ virtual bool hasCacheControlNoStoreHeader() const = 0;
+ virtual const ResourceError& resourceError() const = 0;
+
+ DEFINE_INLINE_VIRTUAL_TRACE() {}
yhirano 2016/12/05 09:02:03 [optional] can you place this function at the bott
hiroshige 2016/12/06 09:32:51 Done.
+
+ virtual void decodeError(bool allDataReceived) {}
yhirano 2016/12/05 09:02:03 It might be good to have comments for non-trivial
yhirano 2016/12/05 09:02:03 Can you tell me why these functions have the defau
hiroshige 2016/12/06 09:32:51 The most thing I want to say for these methods is:
hiroshige 2016/12/06 09:32:51 I made e.g. url() abstract because we need a dummy
+ virtual void setDecodedSize(size_t) {}
+ virtual void willAddClientOrObserver() {}
+ virtual void didRemoveClientOrObserver() {}
+ virtual void emulateLoadStartedForInspector(
+ ResourceFetcher*,
+ const KURL&,
+ const AtomicString& initiatorName) {}
+};
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698