summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Vakulenko <avakulenko@google.com>2016-01-20 07:55:47 -0800
committerAlex Vakulenko <avakulenko@google.com>2016-01-20 07:55:47 -0800
commit7e763a9434e12c7980529980de5f8eced22b310a (patch)
treebc5b5a3b03d2e4f32c24bfeec89b297d4e3303d7
parent3d9de9ace6d8bf53df452787f51109c609281293 (diff)
downloadtpm-7e763a9434e12c7980529980de5f8eced22b310a.tar.gz
tpm: Update libchrome APIs to r369476
The new libchrome has been ported from Chromium and some APIs have changed. Make necessary changes at call sites. Change-Id: I7c256cc2c41c2c14d3872765d62012517e8432ba
-rw-r--r--attestation/server/pkcs11_key_store.cc2
-rw-r--r--trunks/background_command_transceiver.cc14
-rw-r--r--trunks/background_command_transceiver_test.cc4
-rw-r--r--trunks/mock_authorization_delegate.h2
-rw-r--r--trunks/mock_command_transceiver.h2
-rw-r--r--trunks/tpm_generated.cc2
-rw-r--r--trunks/tpm_generated.h2
-rw-r--r--trunks/trunks_client_test.cc2
-rw-r--r--trunks/trunksd.cc4
9 files changed, 17 insertions, 17 deletions
diff --git a/attestation/server/pkcs11_key_store.cc b/attestation/server/pkcs11_key_store.cc
index 45be47e..6ffb872 100644
--- a/attestation/server/pkcs11_key_store.cc
+++ b/attestation/server/pkcs11_key_store.cc
@@ -602,7 +602,7 @@ bool Pkcs11KeyStore::DeleteIfMatchesPrefix(CK_SESSION_HANDLE session_handle,
const std::string& key_prefix,
const std::string& key_name,
CK_OBJECT_HANDLE object_handle) {
- if (base::StartsWithASCII(key_name, key_prefix, true /*case_sensitive*/)) {
+ if (base::StartsWith(key_name, key_prefix, base::CompareCase::SENSITIVE)) {
if (C_DestroyObject(session_handle, object_handle) != CKR_OK) {
LOG(ERROR) << "C_DestroyObject failed.";
return false;
diff --git a/trunks/background_command_transceiver.cc b/trunks/background_command_transceiver.cc
index b344297..cc96e69 100644
--- a/trunks/background_command_transceiver.cc
+++ b/trunks/background_command_transceiver.cc
@@ -20,7 +20,7 @@
#include <base/callback.h>
#include <base/location.h>
#include <base/logging.h>
-#include <base/message_loop/message_loop_proxy.h>
+#include <base/single_thread_task_runner.h>
#include <base/synchronization/waitable_event.h>
namespace {
@@ -33,13 +33,13 @@ void AssignAndSignal(std::string* destination,
event->Signal();
}
-// A callback which posts another |callback| to a given |message_loop|.
-void PostCallbackToMessageLoop(
+// A callback which posts another |callback| to a given |task_runner|.
+void PostCallbackToTaskRunner(
const trunks::CommandTransceiver::ResponseCallback& callback,
- scoped_refptr<base::MessageLoopProxy> message_loop,
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner,
const std::string& response) {
base::Closure task = base::Bind(callback, response);
- message_loop->PostTask(FROM_HERE, task);
+ task_runner->PostTask(FROM_HERE, task);
}
} // namespace
@@ -60,9 +60,9 @@ void BackgroundCommandTransceiver::SendCommand(
const ResponseCallback& callback) {
if (task_runner_.get()) {
ResponseCallback background_callback = base::Bind(
- PostCallbackToMessageLoop,
+ PostCallbackToTaskRunner,
callback,
- base::MessageLoopProxy::current());
+ base::ThreadTaskRunnerHandle::Get());
// Use SendCommandTask instead of binding to next_transceiver_ directly to
// leverage weak pointer semantics.
base::Closure task = base::Bind(
diff --git a/trunks/background_command_transceiver_test.cc b/trunks/background_command_transceiver_test.cc
index be17f72..125eed3 100644
--- a/trunks/background_command_transceiver_test.cc
+++ b/trunks/background_command_transceiver_test.cc
@@ -80,7 +80,7 @@ class BackgroundTransceiverTest : public testing::Test {
TEST_F(BackgroundTransceiverTest, Asynchronous) {
trunks::BackgroundCommandTransceiver background_transceiver(
&next_transceiver_,
- test_thread_.message_loop_proxy());
+ test_thread_.task_runner());
std::string output = "not_assigned";
background_transceiver.SendCommand("test", base::Bind(Assign, &output));
do {
@@ -94,7 +94,7 @@ TEST_F(BackgroundTransceiverTest, Asynchronous) {
TEST_F(BackgroundTransceiverTest, Synchronous) {
trunks::BackgroundCommandTransceiver background_transceiver(
&next_transceiver_,
- test_thread_.message_loop_proxy());
+ test_thread_.task_runner());
std::string output = "not_assigned";
// Post a synchronous call to be run when we start pumping the loop.
message_loop_.PostTask(FROM_HERE,
diff --git a/trunks/mock_authorization_delegate.h b/trunks/mock_authorization_delegate.h
index 72b63d3..2069a4e 100644
--- a/trunks/mock_authorization_delegate.h
+++ b/trunks/mock_authorization_delegate.h
@@ -19,7 +19,7 @@
#include <string>
-#include <base/basictypes.h>
+#include <base/macros.h>
#include <gmock/gmock.h>
#include "trunks/authorization_delegate.h"
diff --git a/trunks/mock_command_transceiver.h b/trunks/mock_command_transceiver.h
index 9c94f2b..fa7c70d 100644
--- a/trunks/mock_command_transceiver.h
+++ b/trunks/mock_command_transceiver.h
@@ -19,8 +19,8 @@
#include <string>
-#include <base/basictypes.h>
#include <base/callback.h>
+#include <base/macros.h>
#include <gmock/gmock.h>
#include "trunks/command_transceiver.h"
diff --git a/trunks/tpm_generated.cc b/trunks/tpm_generated.cc
index 657c880..70979aa 100644
--- a/trunks/tpm_generated.cc
+++ b/trunks/tpm_generated.cc
@@ -20,10 +20,10 @@
#include <string>
-#include <base/basictypes.h>
#include <base/bind.h>
#include <base/callback.h>
#include <base/logging.h>
+#include <base/macros.h>
#include <base/stl_util.h>
#include <base/strings/string_number_conversions.h>
#include <base/sys_byteorder.h>
diff --git a/trunks/tpm_generated.h b/trunks/tpm_generated.h
index 5a7c7e0..df46844 100644
--- a/trunks/tpm_generated.h
+++ b/trunks/tpm_generated.h
@@ -21,8 +21,8 @@
#include <string>
-#include <base/basictypes.h>
#include <base/callback_forward.h>
+#include <base/macros.h>
#include "trunks/trunks_export.h"
diff --git a/trunks/trunks_client_test.cc b/trunks/trunks_client_test.cc
index cd7de4e..594747a 100644
--- a/trunks/trunks_client_test.cc
+++ b/trunks/trunks_client_test.cc
@@ -62,7 +62,7 @@ TrunksClientTest::TrunksClientTest() : factory_(new TrunksFactoryImpl()) {
}
TrunksClientTest::TrunksClientTest(scoped_ptr<TrunksFactory> factory)
- : factory_(factory.Pass()) {}
+ : factory_(std::move(factory)) {}
TrunksClientTest::~TrunksClientTest() {}
diff --git a/trunks/trunksd.cc b/trunks/trunksd.cc
index ecb047a..4eb7f05 100644
--- a/trunks/trunksd.cc
+++ b/trunks/trunksd.cc
@@ -78,14 +78,14 @@ class TrunksDaemon : public brillo::DBusServiceDaemon {
resource_manager_.reset(new trunks::ResourceManager(
*factory_,
transceiver_.get()));
- background_thread_->message_loop_proxy()->PostNonNestableTask(
+ background_thread_->task_runner()->PostNonNestableTask(
FROM_HERE,
base::Bind(&trunks::ResourceManager::Initialize,
base::Unretained(resource_manager_.get())));
background_transceiver_.reset(
new trunks::BackgroundCommandTransceiver(
resource_manager_.get(),
- background_thread_->message_loop_proxy()));
+ background_thread_->task_runner()));
}
protected: