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

Unified Diff: third_party/libxml/src/libxml_utils.cc

Issue 10128002: Retrieve Windows performance assessment information from results files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments and braces. Created 8 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
Index: third_party/libxml/src/libxml_utils.cc
diff --git a/chrome/common/libxml_utils.cc b/third_party/libxml/src/libxml_utils.cc
similarity index 73%
rename from chrome/common/libxml_utils.cc
rename to third_party/libxml/src/libxml_utils.cc
index 61d4237a0089f4b6a631111a41013dbe46978444..1c5e7a7247a3323e3c34ec8d84ef475e1416d289 100644
--- a/chrome/common/libxml_utils.cc
+++ b/third_party/libxml/src/libxml_utils.cc
@@ -2,13 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/common/libxml_utils.h"
-
-#include "base/compiler_specific.h"
-#include "base/file_path.h"
-#include "base/logging.h"
-#include "base/stringprintf.h"
-#include "base/utf_string_conversions.h"
+#include "libxml/libxml_utils.h"
#include "libxml/xmlreader.h"
@@ -20,10 +14,7 @@ std::string XmlStringToStdString(const xmlChar* xmlstring) {
return "";
}
-XmlReader::XmlReader()
- : reader_(NULL),
- ALLOW_THIS_IN_INITIALIZER_LIST(
- error_func_(this, &XmlReader::GenericErrorCallback)) {
+XmlReader::XmlReader() : reader_(NULL) {
}
XmlReader::~XmlReader() {
@@ -31,16 +22,6 @@ XmlReader::~XmlReader() {
xmlFreeTextReader(reader_);
}
-// static
-void XmlReader::GenericErrorCallback(void* context, const char* msg, ...) {
- va_list args;
- va_start(args, msg);
-
- XmlReader* reader = static_cast<XmlReader*>(context);
- reader->errors_.append(base::StringPrintV(msg, args));
- va_end(args);
-}
-
bool XmlReader::Load(const std::string& input) {
const int kParseOptions = XML_PARSE_RECOVER | // recover on errors
XML_PARSE_NONET; // forbid network access
@@ -51,19 +32,10 @@ bool XmlReader::Load(const std::string& input) {
return reader_ != NULL;
}
-bool XmlReader::LoadFile(const FilePath& file_path) {
+bool XmlReader::LoadFile(const std::string& file_path) {
const int kParseOptions = XML_PARSE_RECOVER | // recover on errors
XML_PARSE_NONET; // forbid network access
- reader_ = xmlReaderForFile(
-#if defined(OS_WIN)
- // libxml takes UTF-8 paths on Windows; search the source for
- // xmlWrapOpenUtf8 to see it converting UTF-8 back to wide
- // characters.
- WideToUTF8(file_path.value()).c_str(),
-#else
- file_path.value().c_str(),
-#endif
- NULL, kParseOptions);
+ reader_ = xmlReaderForFile(file_path.c_str(), NULL, kParseOptions);
return reader_ != NULL;
}
@@ -77,7 +49,6 @@ bool XmlReader::NodeAttribute(const char* name, std::string* out) {
}
bool XmlReader::ReadElementContent(std::string* content) {
- DCHECK(NodeType() == XML_READER_TYPE_ELEMENT);
const int start_depth = Depth();
if (xmlTextReaderIsEmptyElement(reader_)) {
@@ -103,7 +74,6 @@ bool XmlReader::ReadElementContent(std::string* content) {
}
// Advance past ending element tag.
- DCHECK_EQ(NodeType(), XML_READER_TYPE_END_ELEMENT);
if (!Read())
return false;
@@ -151,3 +121,4 @@ void XmlWriter::StopWriting() {
xmlFreeTextWriter(writer_);
writer_ = NULL;
}
+
« content/gpu/gpu_info_collector_win.cc ('K') | « third_party/libxml/src/include/libxml/libxml_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698