diff --git a/Atom-Linux/Makefile b/Atom-Linux/Makefile index 2679f788f..2b393f82c 100644 --- a/Atom-Linux/Makefile +++ b/Atom-Linux/Makefile @@ -61,7 +61,7 @@ LIBS := -lX11 \ -lcef \ -lcef_dll_wrapper -SOURCES=atom.cpp cefclient.cpp string_util.cpp native_handler.cpp cefclient_switches.cpp client_handler.cpp client_handler_gtk.cpp +SOURCES=atom.cpp cefclient.cpp native_handler.cpp cefclient_switches.cpp client_handler.cpp client_handler_gtk.cpp OBJECTS=$(SOURCES:.cpp=.o) all: diff --git a/Atom-Linux/cefclient.cpp b/Atom-Linux/cefclient.cpp index 4145912ca..cf4e314cf 100644 --- a/Atom-Linux/cefclient.cpp +++ b/Atom-Linux/cefclient.cpp @@ -16,7 +16,6 @@ #include "include/cef_web_urlrequest.h" #include "cefclient_switches.h" #include "client_handler.h" -#include "string_util.h" #include "util.h" namespace { diff --git a/Atom-Linux/client_handler.cpp b/Atom-Linux/client_handler.cpp index d64251b3e..00f33658b 100644 --- a/Atom-Linux/client_handler.cpp +++ b/Atom-Linux/client_handler.cpp @@ -9,7 +9,6 @@ #include "include/cef_browser.h" #include "include/cef_frame.h" #include "cefclient.h" -#include "string_util.h" #include "native_handler.h" ClientHandler::ClientHandler() : diff --git a/Atom-Linux/client_handler_gtk.cpp b/Atom-Linux/client_handler_gtk.cpp index 8a9fe1a22..0e79ee246 100644 --- a/Atom-Linux/client_handler_gtk.cpp +++ b/Atom-Linux/client_handler_gtk.cpp @@ -7,7 +7,6 @@ #include "client_handler.h" #include "include/cef_browser.h" #include "include/cef_frame.h" -#include "string_util.h" // ClientHandler::ClientLifeSpanHandler implementation bool ClientHandler::OnBeforePopup(CefRefPtr parentBrowser, diff --git a/Atom-Linux/string_util.cpp b/Atom-Linux/string_util.cpp deleted file mode 100644 index 8952d1bf3..000000000 --- a/Atom-Linux/string_util.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights -// reserved. Use of this source code is governed by a BSD-style license that -// can be found in the LICENSE file. - -#include "string_util.h" -#include -#include -#include "include/cef_request.h" - -void DumpRequestContents(CefRefPtr request, std::string& str) { - std::stringstream ss; - - ss << "URL: " << std::string(request->GetURL()); - ss << "\nMethod: " << std::string(request->GetMethod()); - - CefRequest::HeaderMap headerMap; - request->GetHeaderMap(headerMap); - if (headerMap.size() > 0) { - ss << "\nHeaders:"; - CefRequest::HeaderMap::const_iterator it = headerMap.begin(); - for (; it != headerMap.end(); ++it) { - ss << "\n\t" << std::string((*it).first) << ": " << - std::string((*it).second); - } - } - - CefRefPtr postData = request->GetPostData(); - if (postData.get()) { - CefPostData::ElementVector elements; - postData->GetElements(elements); - if (elements.size() > 0) { - ss << "\nPost Data:"; - CefRefPtr element; - CefPostData::ElementVector::const_iterator it = elements.begin(); - for (; it != elements.end(); ++it) { - element = (*it); - if (element->GetType() == PDE_TYPE_BYTES) { - // the element is composed of bytes - ss << "\n\tBytes: "; - if (element->GetBytesCount() == 0) { - ss << "(empty)"; - } else { - // retrieve the data. - size_t size = element->GetBytesCount(); - char* bytes = new char[size]; - element->GetBytes(size, bytes); - ss << std::string(bytes, size); - delete [] bytes; - } - } else if (element->GetType() == PDE_TYPE_FILE) { - ss << "\n\tFile: " << std::string(element->GetFile()); - } - } - } - } - - str = ss.str(); -} - -std::string StringReplace(const std::string& str, const std::string& from, - const std::string& to) { - std::string result = str; - std::string::size_type pos = 0; - std::string::size_type from_len = from.length(); - std::string::size_type to_len = to.length(); - do { - pos = result.find(from, pos); - if (pos != std::string::npos) { - result.replace(pos, from_len, to); - pos += to_len; - } - } while (pos != std::string::npos); - return result; -} diff --git a/Atom-Linux/string_util.h b/Atom-Linux/string_util.h deleted file mode 100644 index c43e6f210..000000000 --- a/Atom-Linux/string_util.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights -// reserved. Use of this source code is governed by a BSD-style license that -// can be found in the LICENSE file. - -#ifndef CEF_TESTS_CEFCLIENT_STRING_UTIL_H_ -#define CEF_TESTS_CEFCLIENT_STRING_UTIL_H_ -#pragma once - -#include -#include "include/cef_base.h" - -class CefRequest; - -// Dump the contents of the request into a string. -void DumpRequestContents(CefRefPtr request, std::string& str); - -// Replace all instances of |from| with |to| in |str|. -std::string StringReplace(const std::string& str, const std::string& from, - const std::string& to); - -#endif // CEF_TESTS_CEFCLIENT_STRING_UTIL_H_