Skip to content

Commit

Permalink
fix nits
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Smith <sesmith177@gmail.com>
  • Loading branch information
sesmith177 committed Dec 18, 2018
1 parent 7d0acef commit 6313b4f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion source/common/api/api_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Impl::Impl(std::chrono::milliseconds file_flush_interval_msec,
file_system_(file_flush_interval_msec, thread_factory, stats_store) {}

Event::DispatcherPtr Impl::allocateDispatcher(Event::TimeSystem& time_system) {
return Event::DispatcherPtr{new Event::DispatcherImpl(time_system, *this)};
return std::make_unique<Event::DispatcherImpl>(time_system, *this);
}

Filesystem::FileSharedPtr Impl::createFile(const std::string& path, Event::Dispatcher& dispatcher,
Expand Down
12 changes: 6 additions & 6 deletions source/exe/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ envoy_cc_library(
],
deps = [
":envoy_main_common_lib",
] + envoy_cc_platform_dep("platform_main_lib"),
] + envoy_cc_platform_dep("platform_impl_lib"),
)

envoy_cc_library(
Expand All @@ -79,19 +79,19 @@ envoy_cc_library(
":sigaction_lib",
":terminate_handler_lib",
],
}) + envoy_cc_platform_dep("platform_main_lib"),
}) + envoy_cc_platform_dep("platform_impl_lib"),
)

envoy_cc_posix_library(
name = "platform_main_lib",
hdrs = ["posix/platform_main.h"],
name = "platform_impl_lib",
hdrs = ["posix/platform_impl.h"],
strip_include_prefix = "posix",
deps = ["//source/common/common:thread_lib"],
)

envoy_cc_win32_library(
name = "platform_main_lib",
hdrs = ["win32/platform_main.h"],
name = "platform_impl_lib",
hdrs = ["win32/platform_impl.h"],
strip_include_prefix = "win32",
deps = [
"//source/common/common:assert_lib",
Expand Down
2 changes: 1 addition & 1 deletion source/exe/main_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void MainCommonBase::adminRequest(absl::string_view path_and_query, absl::string
MainCommon::MainCommon(int argc, const char* const* argv)
: options_(argc, argv, &MainCommon::hotRestartVersion, spdlog::level::info),
base_(options_, real_time_system_, default_test_hooks_, prod_component_factory_,
std::make_unique<Runtime::RandomGeneratorImpl>(), platform_main_.threadFactory()) {}
std::make_unique<Runtime::RandomGeneratorImpl>(), platform_impl_.threadFactory()) {}

std::string MainCommon::hotRestartVersion(uint64_t max_num_stats, uint64_t max_stat_name_len,
bool hot_restart_enabled) {
Expand Down
4 changes: 2 additions & 2 deletions source/exe/main_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "common/stats/thread_local_store.h"
#include "common/thread_local/thread_local_impl.h"

#include "exe/platform_main.h"
#include "exe/platform_impl.h"

#include "server/options_impl.h"
#include "server/server.h"
Expand Down Expand Up @@ -108,7 +108,7 @@ class MainCommon {
Envoy::TerminateHandler log_on_terminate;
#endif

PlatformMain platform_main_;
PlatformImpl platform_impl_;
Envoy::OptionsImpl options_;
Event::RealTimeSystem real_time_system_;
DefaultTestHooks default_test_hooks_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Envoy {

class PlatformMain {
class PlatformImpl {
public:
Thread::ThreadFactory& threadFactory() { return thread_factory_; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@

namespace Envoy {

class PlatformMain {
class PlatformImpl {
public:
PlatformMain() {
PlatformImpl() {
const WORD wVersionRequested = MAKEWORD(2, 2);
WSADATA wsaData;
const int rc = ::WSAStartup(wVersionRequested, &wsaData);
RELEASE_ASSERT(rc == 0, "WSAStartup failed with error");
}

~PlatformMain() { ::WSACleanup(); }
~PlatformImpl() { ::WSACleanup(); }

Thread::ThreadFactory& threadFactory() { return thread_factory_; }

Expand Down

0 comments on commit 6313b4f

Please sign in to comment.