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

Side by Side Diff: sky/engine/core/fetch/ImageResource.h

Issue 776743002: Make v8 inspector not crash (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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
« no previous file with comments | « sky/engine/bindings/core/v8/DebuggerScript.js ('k') | sky/engine/core/fetch/ImageResource.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 ImageResource(const ResourceRequest&, blink::Image*); 51 ImageResource(const ResourceRequest&, blink::Image*);
52 virtual ~ImageResource(); 52 virtual ~ImageResource();
53 53
54 virtual void load(ResourceFetcher*, const ResourceLoaderOptions&) override; 54 virtual void load(ResourceFetcher*, const ResourceLoaderOptions&) override;
55 55
56 blink::Image* image(); // Returns the nullImage() if the image is not availa ble yet. 56 blink::Image* image(); // Returns the nullImage() if the image is not availa ble yet.
57 blink::Image* imageForRenderer(const RenderObject*); // Returns the nullImag e() if the image is not available yet. 57 blink::Image* imageForRenderer(const RenderObject*); // Returns the nullImag e() if the image is not available yet.
58 bool hasImage() const { return m_image.get(); } 58 bool hasImage() const { return m_image.get(); }
59 bool currentFrameKnownToBeOpaque(const RenderObject*); // Side effect: ensur es decoded image is in cache, therefore should only be called when about to draw the image. 59 bool currentFrameKnownToBeOpaque(const RenderObject*); // Side effect: ensur es decoded image is in cache, therefore should only be called when about to draw the image.
60 60
61 static std::pair<blink::Image*, float> brokenImage(float deviceScaleFactor); // Returns an image and the image's resolution scale factor.
62
63 bool canRender(const RenderObject& renderer) { return !errorOccurred() && !i mageSizeForRenderer(&renderer).isEmpty(); } 61 bool canRender(const RenderObject& renderer) { return !errorOccurred() && !i mageSizeForRenderer(&renderer).isEmpty(); }
64 62
65 void setContainerSizeForRenderer(const ImageResourceClient*, const IntSize&) ; 63 void setContainerSizeForRenderer(const ImageResourceClient*, const IntSize&) ;
66 bool usesImageContainerSize() const; 64 bool usesImageContainerSize() const;
67 bool imageHasRelativeWidth() const; 65 bool imageHasRelativeWidth() const;
68 bool imageHasRelativeHeight() const; 66 bool imageHasRelativeHeight() const;
69 // The device pixel ratio we got from the server for this image, or 1.0. 67 // The device pixel ratio we got from the server for this image, or 1.0.
70 float devicePixelRatioHeaderValue() const { return m_devicePixelRatioHeaderV alue; } 68 float devicePixelRatioHeaderValue() const { return m_devicePixelRatioHeaderV alue; }
71 bool hasDevicePixelRatioHeaderValue() const { return m_hasDevicePixelRatioHe aderValue; } 69 bool hasDevicePixelRatioHeaderValue() const { return m_hasDevicePixelRatioHe aderValue; }
72 70
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 RefPtr<blink::Image> m_image; 122 RefPtr<blink::Image> m_image;
125 bool m_loadingMultipartContent; 123 bool m_loadingMultipartContent;
126 bool m_hasDevicePixelRatioHeaderValue; 124 bool m_hasDevicePixelRatioHeaderValue;
127 }; 125 };
128 126
129 DEFINE_RESOURCE_TYPE_CASTS(Image); 127 DEFINE_RESOURCE_TYPE_CASTS(Image);
130 128
131 } 129 }
132 130
133 #endif // SKY_ENGINE_CORE_FETCH_IMAGERESOURCE_H_ 131 #endif // SKY_ENGINE_CORE_FETCH_IMAGERESOURCE_H_
OLDNEW
« no previous file with comments | « sky/engine/bindings/core/v8/DebuggerScript.js ('k') | sky/engine/core/fetch/ImageResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698