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

Unified Diff: tools/gn/xml_element_writer.h

Issue 1869503004: Convert //tools to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, change iwyu fixes for converted directories to include <memory> Created 4 years, 8 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 | « tools/gn/visual_studio_writer.cc ('k') | tools/gn/xml_element_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/xml_element_writer.h
diff --git a/tools/gn/xml_element_writer.h b/tools/gn/xml_element_writer.h
index 186bd35ca944a28461bd50ad973b0a1dfbb0e11d..8a83df0a9a5600fa368e5ee8fe8d312390049917 100644
--- a/tools/gn/xml_element_writer.h
+++ b/tools/gn/xml_element_writer.h
@@ -6,12 +6,13 @@
#define TOOLS_GN_XML_ELEMENT_WRITER_H_
#include <iosfwd>
+#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_piece.h"
// Vector of XML attribute key-value pairs.
@@ -58,13 +59,14 @@ class XmlElementWriter {
// Starts new XML sub-element. Caller must ensure that parent element outlives
// its children.
- scoped_ptr<XmlElementWriter> SubElement(const std::string& tag);
- scoped_ptr<XmlElementWriter> SubElement(const std::string& tag,
- const XmlAttributes& attributes);
+ std::unique_ptr<XmlElementWriter> SubElement(const std::string& tag);
+ std::unique_ptr<XmlElementWriter> SubElement(const std::string& tag,
+ const XmlAttributes& attributes);
template <class Writer>
- scoped_ptr<XmlElementWriter> SubElement(const std::string& tag,
- const std::string& attribute_name,
- const Writer& attribute_value_writer);
+ std::unique_ptr<XmlElementWriter> SubElement(
+ const std::string& tag,
+ const std::string& attribute_name,
+ const Writer& attribute_value_writer);
// Finishes opening tag if it isn't finished yet and optionally starts new
// document line. Returns the stream where XML element content can be written.
@@ -109,12 +111,12 @@ XmlElementWriter::XmlElementWriter(std::ostream& out,
}
template <class Writer>
-scoped_ptr<XmlElementWriter> XmlElementWriter::SubElement(
+std::unique_ptr<XmlElementWriter> XmlElementWriter::SubElement(
const std::string& tag,
const std::string& attribute_name,
const Writer& attribute_value_writer) {
StartContent(true);
- return make_scoped_ptr(new XmlElementWriter(
+ return base::WrapUnique(new XmlElementWriter(
out_, tag, attribute_name, attribute_value_writer, indent_ + 2));
}
« no previous file with comments | « tools/gn/visual_studio_writer.cc ('k') | tools/gn/xml_element_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698