Update libchrome to r307740 and fix build errors
Updated libchrome, libchrome_crypto, metrics, feedback to the
latest revisions from Chrome (r307740).
Fixed build breaks due to the changes in upstream code:
- scope_ptr no longer needs explicit PassAs<T>() calls.
- scope_ptr<T> no longer has implicit conversion to T*.
Must use scope_ptr<T>::get() instead.
- base/file_util.h moved to base/files/file_util.h
- ARRAYSIZE_UNSAFE() removed in favor of arraysize()
- base::AppendToFile() and base::WriteFileDescriptor() now
return bool instead of the number of bytes written.
- dbus::Bus::AddFilterFunction() now returns void.
- C++11 features are enabled in libchromeos, so all targets
linking with it now have to support C++11
- OVERRIDE macro is removed in favor of native C++11
'override' keyword.
BUG=chromium:416628, chromium:411508
TEST=Build the world on x86, x64, ARM. The following builders
were tried:
x86-generic-full amd64-generic-full arm-generic-full
amd64-generic-asan daisy-full nyan-full pre-cq-group
daisy-release-group sandybridge-release-group
pineview-release-group
CQ-DEPEND=CL:234450,CL:234980
Change-Id: I374bebe2211d533c4431c82efb8be1cdcb1f405d
Reviewed-on: https://chromium-review.googlesource.com/234440
Reviewed-by: Bertrand Simonnet <bsimonnet@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/http_common.cc b/http_common.cc
index 756fa55..7737f4c 100644
--- a/http_common.cc
+++ b/http_common.cc
@@ -42,7 +42,7 @@
bool is_found = false;
size_t i;
- for (i = 0; i < ARRAYSIZE_UNSAFE(http_response_table); i++)
+ for (i = 0; i < arraysize(http_response_table); i++)
if ((is_found = (http_response_table[i].code == code)))
break;
@@ -64,7 +64,7 @@
bool is_found = false;
size_t i;
- for (i = 0; i < ARRAYSIZE_UNSAFE(http_content_type_table); i++)
+ for (i = 0; i < arraysize(http_content_type_table); i++)
if ((is_found = (http_content_type_table[i].type == type)))
break;
diff --git a/update_manager/chromeos_policy_unittest.cc b/update_manager/chromeos_policy_unittest.cc
index 34d8150..5905437 100644
--- a/update_manager/chromeos_policy_unittest.cc
+++ b/update_manager/chromeos_policy_unittest.cc
@@ -172,8 +172,8 @@
string error = "<None>";
eval_ctx_->ResetEvaluation();
EXPECT_EQ(expected,
- (policy_.*policy_method)(eval_ctx_, &fake_state_, &error, result,
- args...))
+ (policy_.*policy_method)(eval_ctx_.get(), &fake_state_, &error,
+ result, args...))
<< "Returned error: " << error
<< "\nEvaluation context: " << eval_ctx_->DumpContext();
}
diff --git a/update_manager/update_manager-inl.h b/update_manager/update_manager-inl.h
index 5e30031..06bda93 100644
--- a/update_manager/update_manager-inl.h
+++ b/update_manager/update_manager-inl.h
@@ -73,7 +73,7 @@
Args... args) {
// Evaluate the policy.
R result;
- EvalStatus status = EvaluatePolicy(ec, policy_method, &result, args...);
+ EvalStatus status = EvaluatePolicy(ec.get(), policy_method, &result, args...);
if (status != EvalStatus::kAskMeAgainLater) {
// AsyncPolicyRequest finished.
@@ -111,8 +111,8 @@
// IMPORTANT: To ensure that ActualArgs can be converted to ExpectedArgs, we
// explicitly instantiate EvaluatePolicy with the latter in lieu of the
// former.
- EvalStatus ret = EvaluatePolicy<R, ExpectedArgs...>(ec, policy_method, result,
- args...);
+ EvalStatus ret = EvaluatePolicy<R, ExpectedArgs...>(ec.get(), policy_method,
+ result, args...);
// Sync policy requests must not block, if they do then this is an error.
DCHECK(EvalStatus::kAskMeAgainLater != ret);
LOG_IF(WARNING, EvalStatus::kAskMeAgainLater == ret)