Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Address review comments and rebase
Browse files Browse the repository at this point in the history
coryan committed Jul 11, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent eea788a commit d081031
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ci/cloudbuild/builds/check-api.sh
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ io::run cmake "${cmake_args[@]}" \
-DGOOGLE_CLOUD_CPP_ENABLE="${ENABLED_FEATURES}" \
-DCMAKE_CXX_FLAGS="-Og -Wno-maybe-uninitialized"
io::run cmake --build cmake-out
io::run cmake --install cmake-out #>/dev/null
io::run cmake --install cmake-out >/dev/null

if [ "${GOOGLE_CLOUD_CPP_CHECK_API:-}" ]; then
IFS=',' read -ra library_list <<<"${GOOGLE_CLOUD_CPP_CHECK_API}"
11 changes: 6 additions & 5 deletions google/cloud/access_token_generator.cc
Original file line number Diff line number Diff line change
@@ -23,22 +23,23 @@ namespace {
class AccessTokenGeneratorImpl : public AccessTokenGenerator {
public:
explicit AccessTokenGeneratorImpl(
std::shared_ptr<google::cloud::oauth2_internal::Credentials> impl)
: impl_(std::move(impl)) {}
std::shared_ptr<google::cloud::oauth2_internal::Credentials> creds)
: creds_(std::move(creds)) {}
~AccessTokenGeneratorImpl() override = default;

StatusOr<AccessToken> GetToken() override {
return impl_->GetToken(std::chrono::system_clock::now());
return creds_->GetToken(std::chrono::system_clock::now());
}

private:
std::shared_ptr<google::cloud::oauth2_internal::Credentials> impl_;
std::shared_ptr<google::cloud::oauth2_internal::Credentials> creds_;
};

} // namespace

std::shared_ptr<AccessTokenGenerator> MakeAccessTokenGenerator(
std::shared_ptr<Credentials> credentials) { // NOLINT
// NOLINTNEXTLINE(performance-unnecessary-value-param)
std::shared_ptr<Credentials> credentials) {
return std::make_shared<AccessTokenGeneratorImpl>(
rest_internal::MapCredentials(credentials));
}

0 comments on commit d081031

Please sign in to comment.