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

Side by Side Diff: Source/core/html/parser/HTMLSrcsetParser.h

Issue 311053011: Initialize all ImageCandidate's member variables (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added initialization test Created 6 years, 6 months 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 | « no previous file | Source/core/html/parser/HTMLSrcsetParserTest.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) 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 class ImageCandidate { 68 class ImageCandidate {
69 public: 69 public:
70 enum OriginAttribute { 70 enum OriginAttribute {
71 SrcsetOrigin, 71 SrcsetOrigin,
72 SrcOrigin 72 SrcOrigin
73 }; 73 };
74 74
75 ImageCandidate() 75 ImageCandidate()
76 : m_density(1.0) 76 : m_density(1.0)
77 , m_resourceWidth(UninitializedDescriptor)
78 , m_originAttribute(SrcsetOrigin)
77 { 79 {
78 } 80 }
79 81
80 ImageCandidate(const String& source, unsigned start, unsigned length, const DescriptorParsingResult& result, OriginAttribute originAttribute) 82 ImageCandidate(const String& source, unsigned start, unsigned length, const DescriptorParsingResult& result, OriginAttribute originAttribute)
81 : m_string(source.createView(start, length)) 83 : m_string(source.createView(start, length))
82 , m_density(result.hasDensity()?result.density():UninitializedDescriptor ) 84 , m_density(result.hasDensity()?result.density():UninitializedDescriptor )
83 , m_resourceWidth(result.hasWidth()?result.resourceWidth():Uninitialized Descriptor) 85 , m_resourceWidth(result.hasWidth()?result.resourceWidth():Uninitialized Descriptor)
84 , m_originAttribute(originAttribute) 86 , m_originAttribute(originAttribute)
85 { 87 {
86 } 88 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 131
130 ImageCandidate bestFitSourceForSrcsetAttribute(float deviceScaleFactor, unsigned sourceSize, const String& srcsetAttribute); 132 ImageCandidate bestFitSourceForSrcsetAttribute(float deviceScaleFactor, unsigned sourceSize, const String& srcsetAttribute);
131 133
132 ImageCandidate bestFitSourceForImageAttributes(float deviceScaleFactor, unsigned sourceSize, const String& srcAttribute, const String& srcsetAttribute); 134 ImageCandidate bestFitSourceForImageAttributes(float deviceScaleFactor, unsigned sourceSize, const String& srcAttribute, const String& srcsetAttribute);
133 135
134 String bestFitSourceForImageAttributes(float deviceScaleFactor, unsigned sourceS ize, const String& srcAttribute, ImageCandidate& srcsetImageCandidate); 136 String bestFitSourceForImageAttributes(float deviceScaleFactor, unsigned sourceS ize, const String& srcAttribute, ImageCandidate& srcsetImageCandidate);
135 137
136 } 138 }
137 139
138 #endif 140 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/parser/HTMLSrcsetParserTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698