Merge Chromium 294442c0ce05 upstream to Crashpad

Remove stl_util from Crashpad. This also updates mini_chromium to
4f3cfc8e7c2b7d77f94f41a32c3ec84a6920f05d to remove stl_util from there
as well.

4f3cfc8e7c2b Remove stl_util from mini_chromium

BUG=chromium:555865

Change-Id: I8ecb1639a258dd233d524834ed205a4fcc641bac
Reviewed-on: https://chromium-review.googlesource.com/438865
Reviewed-by: Scott Graham <scottmg@chromium.org>
This commit is contained in:
Mark Mentovai 2017-02-07 16:04:41 -05:00
parent 35020d8010
commit 88442dd578
6 changed files with 20 additions and 29 deletions

2
DEPS
View File

@ -38,7 +38,7 @@ deps = {
'crashpad/third_party/mini_chromium/mini_chromium': 'crashpad/third_party/mini_chromium/mini_chromium':
Var('chromium_git') + '/chromium/mini_chromium@' + Var('chromium_git') + '/chromium/mini_chromium@' +
'e504d59673e56887a4e837cbeb44b32ec21974f9', '4f3cfc8e7c2b7d77f94f41a32c3ec84a6920f05d',
} }
hooks = [ hooks = [

View File

@ -17,7 +17,6 @@
#include <string> #include <string>
#include "base/logging.h" #include "base/logging.h"
#include "base/stl_util.h"
#include "minidump/minidump_extensions.h" #include "minidump/minidump_extensions.h"
#include "util/file/file_writer.h" #include "util/file/file_writer.h"
#include "util/numeric/safe_assignment.h" #include "util/numeric/safe_assignment.h"
@ -29,7 +28,8 @@ MinidumpHandleDataWriter::MinidumpHandleDataWriter()
} }
MinidumpHandleDataWriter::~MinidumpHandleDataWriter() { MinidumpHandleDataWriter::~MinidumpHandleDataWriter() {
base::STLDeleteContainerPairSecondPointers(strings_.begin(), strings_.end()); for (auto& item : strings_)
delete item.second;
} }
void MinidumpHandleDataWriter::InitializeFromSnapshot( void MinidumpHandleDataWriter::InitializeFromSnapshot(

View File

@ -18,7 +18,6 @@
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/stl_util.h"
#include "util/file/file_writer.h" #include "util/file/file_writer.h"
#include "util/numeric/safe_assignment.h" #include "util/numeric/safe_assignment.h"
@ -100,7 +99,8 @@ MinidumpSimpleStringDictionaryWriter::MinidumpSimpleStringDictionaryWriter()
} }
MinidumpSimpleStringDictionaryWriter::~MinidumpSimpleStringDictionaryWriter() { MinidumpSimpleStringDictionaryWriter::~MinidumpSimpleStringDictionaryWriter() {
base::STLDeleteContainerPairSecondPointers(entries_.begin(), entries_.end()); for (auto& item : entries_)
delete item.second;
} }
void MinidumpSimpleStringDictionaryWriter::InitializeFromMap( void MinidumpSimpleStringDictionaryWriter::InitializeFromMap(

View File

@ -14,6 +14,7 @@
#include "snapshot/win/thread_snapshot_win.h" #include "snapshot/win/thread_snapshot_win.h"
#include <iterator>
#include <vector> #include <vector>
#include "base/logging.h" #include "base/logging.h"

View File

@ -20,7 +20,6 @@
#include <limits> #include <limits>
#include "base/logging.h" #include "base/logging.h"
#include "base/stl_util.h"
#include "util/misc/implicit_cast.h" #include "util/misc/implicit_cast.h"
namespace crashpad { namespace crashpad {
@ -89,7 +88,8 @@ CompositeHTTPBodyStream::CompositeHTTPBodyStream(
} }
CompositeHTTPBodyStream::~CompositeHTTPBodyStream() { CompositeHTTPBodyStream::~CompositeHTTPBodyStream() {
base::STLDeleteContainerPointers(parts_.begin(), parts_.end()); for (auto& item : parts_)
delete item;
} }
FileOperationResult CompositeHTTPBodyStream::GetBytesBuffer(uint8_t* buffer, FileOperationResult CompositeHTTPBodyStream::GetBytesBuffer(uint8_t* buffer,

View File

@ -18,30 +18,9 @@
#include <vector> #include <vector>
#include "base/macros.h" #include "base/macros.h"
#include "base/stl_util.h"
namespace crashpad { namespace crashpad {
//! \brief Allows a standard container to “own” pointer elements stored in it.
//!
//! When the container is destroyed, `delete` will be called on its pointer
//! elements.
//!
//! \note No attempt is made to `delete` elements that are removed from the
//! container by other means, such as replacement or `clear()`.
template <typename ContainerType>
class PointerContainer : public ContainerType {
public:
PointerContainer() : ContainerType(), pointer_deleter_(this) {}
~PointerContainer() {}
private:
base::STLElementDeleter<ContainerType> pointer_deleter_;
DISALLOW_COPY_AND_ASSIGN(PointerContainer);
};
//! \brief Allows a `std::vector` to “own” pointer elements stored in it. //! \brief Allows a `std::vector` to “own” pointer elements stored in it.
//! //!
//! When the vector is destroyed, `delete` will be called on its pointer //! When the vector is destroyed, `delete` will be called on its pointer
@ -50,7 +29,18 @@ class PointerContainer : public ContainerType {
//! \note No attempt is made to `delete` elements that are removed from the //! \note No attempt is made to `delete` elements that are removed from the
//! vector by other means, such as replacement or `clear()`. //! vector by other means, such as replacement or `clear()`.
template <typename T> template <typename T>
using PointerVector = PointerContainer<std::vector<T*>>; class PointerVector : public std::vector<T*> {
public:
PointerVector() : std::vector<T*>() {}
~PointerVector() {
for (T* item : *this)
delete item;
}
private:
DISALLOW_COPY_AND_ASSIGN(PointerVector);
};
} // namespace crashpad } // namespace crashpad