diff options
author | Luis Hector Chavez <lhchavez@google.com> | 2016-05-20 23:07:35 -0700 |
---|---|---|
committer | Luis Hector Chavez <lhchavez@google.com> | 2016-05-27 09:04:35 -0700 |
commit | 4ec4c4d2e4f8ac46ea8e767c1ed88242811a8f4d (patch) | |
tree | 9903be936e3eb7975bd81a59f2406ccba8f82a11 /brillo | |
parent | ae40d5e67c6686d02918ba42686f94d45ac92f86 (diff) | |
download | platform_external_libbrillo-4ec4c4d2e4f8ac46ea8e767c1ed88242811a8f4d.tar.gz platform_external_libbrillo-4ec4c4d2e4f8ac46ea8e767c1ed88242811a8f4d.tar.bz2 platform_external_libbrillo-4ec4c4d2e4f8ac46ea8e767c1ed88242811a8f4d.zip |
libbrillo: Update libchrome APIs to r395517android-n-preview-4
The new libchrome has been ported from Chromium and some APIs have
changed. Make necessary changes at call sites.
BUG: 28985443
TEST: All tests in libbrillo_test pass on dragonboard-eng build
Change-Id: Ie9343893a77b3638e03e89e3090ef61868d43c3b
Diffstat (limited to 'brillo')
-rw-r--r-- | brillo/asynchronous_signal_handler.h | 1 | ||||
-rw-r--r-- | brillo/bind_lambda.h | 4 | ||||
-rw-r--r-- | brillo/dbus/utils.cc | 1 | ||||
-rw-r--r-- | brillo/glib/object.h | 8 | ||||
-rw-r--r-- | brillo/glib/object_unittest.cc | 2 | ||||
-rw-r--r-- | brillo/process.cc | 5 |
6 files changed, 11 insertions, 10 deletions
diff --git a/brillo/asynchronous_signal_handler.h b/brillo/asynchronous_signal_handler.h index f43b9c9..ceae1ff 100644 --- a/brillo/asynchronous_signal_handler.h +++ b/brillo/asynchronous_signal_handler.h @@ -13,7 +13,6 @@ #include <base/callback.h> #include <base/compiler_specific.h> #include <base/macros.h> -#include <base/memory/scoped_ptr.h> #include <base/message_loop/message_loop.h> #include <brillo/asynchronous_signal_handler_interface.h> #include <brillo/brillo_export.h> diff --git a/brillo/bind_lambda.h b/brillo/bind_lambda.h index 687ae1a..18c3212 100644 --- a/brillo/bind_lambda.h +++ b/brillo/bind_lambda.h @@ -31,7 +31,7 @@ class LambdaAdapter<Lambda, R(Lambda::*)(Args... args)> { public: typedef R(RunType)(Args...); LambdaAdapter(Lambda lambda) : lambda_(lambda) {} - R Run(Args... args) { return lambda_(CallbackForward(args)...); } + R Run(Args... args) { return lambda_(std::forward<Args>(args)...); } private: Lambda lambda_; @@ -43,7 +43,7 @@ class LambdaAdapter<Lambda, R(Lambda::*)(Args... args) const> { public: typedef R(RunType)(Args...); LambdaAdapter(Lambda lambda) : lambda_(lambda) {} - R Run(Args... args) { return lambda_(CallbackForward(args)...); } + R Run(Args... args) { return lambda_(std::forward<Args>(args)...); } private: Lambda lambda_; diff --git a/brillo/dbus/utils.cc b/brillo/dbus/utils.cc index d2e4ac6..c9bb4db 100644 --- a/brillo/dbus/utils.cc +++ b/brillo/dbus/utils.cc @@ -8,7 +8,6 @@ #include <vector> #include <base/bind.h> -#include <base/memory/scoped_ptr.h> #include <brillo/errors/error_codes.h> #include <brillo/strings/string_utils.h> diff --git a/brillo/glib/object.h b/brillo/glib/object.h index b9f2079..dfa96b6 100644 --- a/brillo/glib/object.h +++ b/brillo/glib/object.h @@ -10,10 +10,10 @@ #include <base/logging.h> #include <base/macros.h> -#include <base/memory/scoped_ptr.h> #include <algorithm> #include <cstddef> +#include <memory> #include <string> namespace brillo { @@ -61,7 +61,7 @@ class ResetHelper { // *x = new int(10); // } // ... -// scoped_ptr<int> x; +// std::unique_ptr<int> x; // function(Resetter(x).lvalue()); // // \end_example @@ -314,7 +314,7 @@ struct FreeError { } }; -typedef ::scoped_ptr< ::GError, FreeError> ScopedError; +typedef std::unique_ptr< ::GError, FreeError> ScopedError; // \brief ScopedArray holds a ::GArray* and deletes both the container and the // segment containing the elements on destruction. @@ -326,7 +326,7 @@ struct FreeArray { } }; -typedef ::scoped_ptr< ::GArray, FreeArray> ScopedArray; +typedef std::unique_ptr< ::GArray, FreeArray> ScopedArray; // \brief ScopedPtrArray adapts ::GPtrArray* to conform to the standard // container requirements. diff --git a/brillo/glib/object_unittest.cc b/brillo/glib/object_unittest.cc index 5bc4b85..a1ed408 100644 --- a/brillo/glib/object_unittest.cc +++ b/brillo/glib/object_unittest.cc @@ -56,7 +56,7 @@ void OutArgument(int** x) { } // namespace TEST(ResetterTest, All) { - scoped_ptr<int> x; + std::unique_ptr<int> x; OutArgument(&Resetter(&x).lvalue()); EXPECT_EQ(*x, 10); } diff --git a/brillo/process.cc b/brillo/process.cc index 2700532..7af8fbb 100644 --- a/brillo/process.cc +++ b/brillo/process.cc @@ -13,9 +13,11 @@ #include <unistd.h> #include <map> +#include <memory> #include <base/files/file_util.h> #include <base/logging.h> +#include <base/memory/ptr_util.h> #include <base/posix/eintr_wrapper.h> #include <base/process/process_metrics.h> #include <base/strings/string_number_conversions.h> @@ -209,7 +211,8 @@ bool ProcessImpl::Start() { if (arguments_.empty()) { return false; } - scoped_ptr<char*[]> argv(new char*[arguments_.size() + 1]); + std::unique_ptr<char* []> argv = + base::MakeUnique<char* []>(arguments_.size() + 1); for (size_t i = 0; i < arguments_.size(); ++i) argv[i] = const_cast<char*>(arguments_[i].c_str()); |