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

Unified Diff: content/test/mock_webclipboard_impl.cc

Issue 135853010: Fix the WebStrings leak in MockWebClipboardImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use NullableString16 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/mock_webclipboard_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/mock_webclipboard_impl.cc
diff --git a/content/test/mock_webclipboard_impl.cc b/content/test/mock_webclipboard_impl.cc
index 06507145aa1c81d1a2cf5e852eddca1c8d1bd112..a9c2c6561b21fb2ab71995778b4bb9c66621c8b4 100644
--- a/content/test/mock_webclipboard_impl.cc
+++ b/content/test/mock_webclipboard_impl.cc
@@ -33,10 +33,10 @@ MockWebClipboardImpl::~MockWebClipboardImpl() {}
bool MockWebClipboardImpl::isFormatAvailable(Format format, Buffer buffer) {
switch (format) {
case FormatPlainText:
- return !m_plainText.isNull();
+ return !m_plainText.is_null();
case FormatHTML:
- return !m_htmlText.isNull();
+ return !m_htmlText.is_null();
case FormatSmartPaste:
return m_writeSmartPaste;
@@ -66,10 +66,10 @@ WebVector<WebString> MockWebClipboardImpl::readAvailableTypes(
bool* containsFilenames) {
*containsFilenames = false;
std::vector<WebString> results;
- if (!m_plainText.isEmpty()) {
+ if (!m_plainText.string().empty()) {
results.push_back(WebString("text/plain"));
}
- if (!m_htmlText.isEmpty()) {
+ if (!m_htmlText.string().empty()) {
results.push_back(WebString("text/html"));
}
if (!m_image.isNull()) {
@@ -97,7 +97,7 @@ blink::WebString MockWebClipboardImpl::readHTML(
unsigned* fragmentStart,
unsigned* fragmentEnd) {
*fragmentStart = 0;
- *fragmentEnd = static_cast<unsigned>(m_htmlText.length());
+ *fragmentEnd = static_cast<unsigned>(m_htmlText.string().length());
return m_htmlText;
}
@@ -199,8 +199,8 @@ void MockWebClipboardImpl::writeDataObject(const WebDragData& data) {
}
void MockWebClipboardImpl::clear() {
- m_plainText = WebString();
- m_htmlText = WebString();
+ m_plainText = base::NullableString16();
+ m_htmlText = base::NullableString16();
m_image.reset();
m_customData.clear();
m_writeSmartPaste = false;
« no previous file with comments | « content/test/mock_webclipboard_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698