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

Side by Side Diff: Source/wtf/text/StringView.h

Issue 23861003: Enable srcset support in HTMLImageElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed a flaky test Created 7 years, 3 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 | « Source/core/page/RuntimeEnabledFeatures.in ('k') | no next file » | 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 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } 79 }
80 80
81 const UChar* characters16() const 81 const UChar* characters16() const
82 { 82 {
83 if (!m_impl) 83 if (!m_impl)
84 return 0; 84 return 0;
85 ASSERT(!is8Bit()); 85 ASSERT(!is8Bit());
86 return m_impl->characters16() + m_offset; 86 return m_impl->characters16() + m_offset;
87 } 87 }
88 88
89 PassRefPtr<StringImpl> toString() const
90 {
91 if (!m_impl)
92 return m_impl;
93 if (m_impl->is8Bit())
94 return StringImpl::create(characters8(), m_length);
95 return StringImpl::create(characters16(), m_length);
96 }
97
89 private: 98 private:
90 RefPtr<StringImpl> m_impl; 99 RefPtr<StringImpl> m_impl;
91 unsigned m_offset; 100 unsigned m_offset;
92 unsigned m_length; 101 unsigned m_length;
93 }; 102 };
94 103
95 } 104 }
96 105
97 using WTF::StringView; 106 using WTF::StringView;
98 107
99 #endif 108 #endif
OLDNEW
« no previous file with comments | « Source/core/page/RuntimeEnabledFeatures.in ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698