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

Unified Diff: webkit/api/src/WebDragData.cpp

Issue 269091: Change WebDragData to use ChromiumDataObject interface methods rather than direct member access (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/api/src/WebDragData.cpp
===================================================================
--- webkit/api/src/WebDragData.cpp (revision 29094)
+++ webkit/api/src/WebDragData.cpp (working copy)
@@ -67,122 +67,127 @@
WebURL WebDragData::url() const
{
ASSERT(!isNull());
- return m_private->url;
+ return m_private->mainURL();
}
void WebDragData::setURL(const WebURL& url)
{
ensureMutable();
- m_private->url = url;
+ m_private->setMainURL(url);
}
WebString WebDragData::urlTitle() const
{
ASSERT(!isNull());
- return m_private->urlTitle;
+ return m_private->mainURLTitle();
}
void WebDragData::setURLTitle(const WebString& urlTitle)
{
ensureMutable();
- m_private->urlTitle = urlTitle;
+ m_private->setMainURLTitle(urlTitle);
}
WebString WebDragData::fileExtension() const
{
ASSERT(!isNull());
- return m_private->fileExtension;
+ return m_private->contentFileExtension();
}
void WebDragData::setFileExtension(const WebString& fileExtension)
{
ensureMutable();
- m_private->fileExtension = fileExtension;
+ m_private->setContentFileExtension(fileExtension);
}
bool WebDragData::hasFileNames() const
{
ASSERT(!isNull());
- return !m_private->filenames.isEmpty();
+ return m_private->containsFileNames();
}
void WebDragData::fileNames(WebVector<WebString>& fileNames) const
{
ASSERT(!isNull());
- fileNames = m_private->filenames;
+ fileNames = m_private->fileNames();
}
void WebDragData::setFileNames(const WebVector<WebString>& fileNames)
{
ensureMutable();
- m_private->filenames.clear();
- m_private->filenames.append(fileNames.data(), fileNames.size());
+ m_private->clearFileNames();
+ // This is a comparatively slow operation (potentially causing multiple
+ // re-allocations), but for the purposes of this interface it's probably
+ // sufficient. A faster interface OTOH would require exposing more of the
+ // internal data structures.
+ for (size_t i = 0; i < fileNames.size(); ++i)
+ m_private->appendToFileNames(fileNames[i]);
}
void WebDragData::appendToFileNames(const WebString& fileName)
{
ensureMutable();
- m_private->filenames.append(fileName);
+ m_private->appendToFileNames(fileName);
}
WebString WebDragData::plainText() const
{
ASSERT(!isNull());
- return m_private->plainText;
+ return m_private->textPlain();
}
void WebDragData::setPlainText(const WebString& plainText)
{
ensureMutable();
- m_private->plainText = plainText;
+ m_private->setTextPlain(plainText);
}
WebString WebDragData::htmlText() const
{
ASSERT(!isNull());
- return m_private->textHtml;
+ return m_private->textHTML();
}
void WebDragData::setHTMLText(const WebString& htmlText)
{
ensureMutable();
- m_private->textHtml = htmlText;
+ m_private->setTextHTML(htmlText);
}
WebURL WebDragData::htmlBaseURL() const
{
ASSERT(!isNull());
- return m_private->htmlBaseUrl;
+ return m_private->htmlBaseURL();
}
void WebDragData::setHTMLBaseURL(const WebURL& htmlBaseURL)
{
ensureMutable();
- m_private->htmlBaseUrl = htmlBaseURL;
+ m_private->setHTMLBaseURL(htmlBaseURL);
}
WebString WebDragData::fileContentFileName() const
{
ASSERT(!isNull());
- return m_private->fileContentFilename;
+ return m_private->contentFileName();
}
void WebDragData::setFileContentFileName(const WebString& fileName)
{
ensureMutable();
- m_private->fileContentFilename = fileName;
+ m_private->setContentFileName(fileName);
}
WebData WebDragData::fileContent() const
{
ASSERT(!isNull());
- return WebData(m_private->fileContent);
+ return WebData(m_private->content());
}
void WebDragData::setFileContent(const WebData& fileContent)
{
ensureMutable();
- m_private->fileContent = fileContent;
+ m_private->setContent(fileContent);
}
WebDragData::WebDragData(const WTF::PassRefPtr<WebCore::ChromiumDataObject>& data)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698