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

Side by Side Diff: Source/platform/exported/WebString.cpp

Issue 141273002: Code problems detected by cppcheck (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add a few more fixes Created 6 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 WebString WebString::fromLatin1(const WebLChar* data, size_t length) 113 WebString WebString::fromLatin1(const WebLChar* data, size_t length)
114 { 114 {
115 return String(data, length); 115 return String(data, length);
116 } 116 }
117 117
118 bool WebString::equals(const WebString& s) const 118 bool WebString::equals(const WebString& s) const
119 { 119 {
120 return equal(m_private.get(), s.m_private.get()); 120 return equal(m_private.get(), s.m_private.get());
121 } 121 }
122 122
123 WebString::WebString(const WTF::String& s) 123 WebString::WebString(const WTF::String& s) : m_private(s.impl())
abarth-chromium 2014/01/17 06:59:08 ditto
124 { 124 {
125 m_private = s.impl();
126 } 125 }
127 126
128 WebString& WebString::operator=(const WTF::String& s) 127 WebString& WebString::operator=(const WTF::String& s)
129 { 128 {
130 assign(s.impl()); 129 assign(s.impl());
131 return *this; 130 return *this;
132 } 131 }
133 132
134 WebString::operator WTF::String() const 133 WebString::operator WTF::String() const
135 { 134 {
(...skipping 15 matching lines...) Expand all
151 { 150 {
152 return WTF::AtomicString(m_private.get()); 151 return WTF::AtomicString(m_private.get());
153 } 152 }
154 153
155 void WebString::assign(WTF::StringImpl* p) 154 void WebString::assign(WTF::StringImpl* p)
156 { 155 {
157 m_private = p; 156 m_private = p;
158 } 157 }
159 158
160 } // namespace blink 159 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698