Skip to content

Commit

Permalink
Apply review's comment
Browse files Browse the repository at this point in the history
Signed-off-by: MuHong Byun <mh.byun@samsung.com>
  • Loading branch information
bwikbs committed Jun 30, 2021
1 parent 8088228 commit e375b8c
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 38 deletions.
2 changes: 1 addition & 1 deletion shell/platform/tizen/channels/localization_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,4 @@ FlutterLocale* LocalizationChannel::GetFlutterLocale(const char* locale) {

void LocalizationChannel::DestroyFlutterLocale(FlutterLocale* flutter_locale) {}
} // namespace flutter
#endif
#endif
7 changes: 4 additions & 3 deletions shell/platform/tizen/channels/platform_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,14 @@ PlatformChannel::PlatformChannel(BinaryMessenger* messenger,
std::unique_ptr<MethodResult<rapidjson::Document>> result) {
HandleMethodCall(call, std::move(result));
});
if (!renderer_) {
}

PlatformChannel::~PlatformChannel() {
if (renderer_) {
renderer_ = nullptr;
}
}

PlatformChannel::~PlatformChannel() {}

void PlatformChannel::HandleMethodCall(
const MethodCall<rapidjson::Document>& call,
std::unique_ptr<MethodResult<rapidjson::Document>> result) {
Expand Down
4 changes: 3 additions & 1 deletion shell/platform/tizen/testing/mock_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ FlutterEngineResult FlutterEngineDispatchSemanticsAction(
}

uint64_t FlutterEngineGetCurrentTime() {
return 0;
const auto elapsed_time = std::chrono::steady_clock::now().time_since_epoch();
return std::chrono::duration_cast<std::chrono::nanoseconds>(elapsed_time)
.count();
}

FlutterEngineResult FlutterEngineGetProcAddresses(
Expand Down
51 changes: 20 additions & 31 deletions shell/platform/tizen/tizen_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@
#define EMBEDDER_TIZEN_LOG_H_

#ifndef __X64_SHELL__

#include <dlog.h>
#else
#define log_priority int
#define DLOG_DEBUG 0
#define DLOG_WARN 1
#define DLOG_INFO 2
#define DLOG_ERROR 3
#endif

#include <cassert>
#include <cstdlib>
Expand All @@ -29,7 +35,9 @@ log_priority GetMinLoggingLevel();
#define LOG_TAG "ConsoleMessage"

#undef __LOG
#ifdef TV_PROFILE
#ifdef __X64_SHELL__
#define __LOG(prio, fmt, args...) printf(fmt, ##args)
#elif TV_PROFILE
// dlog_print() cannot be used because it implicitly passes LOG_ID_APPS as
// a log id, which is ignored by TV devices. Instead, an internal function
// __dlog_print() that takes a log id as a parameter is used.
Expand All @@ -39,13 +47,23 @@ log_priority GetMinLoggingLevel();
#define __LOG(prio, fmt, args...) dlog_print(prio, LOG_TAG, fmt, ##args)
#endif

#ifdef __X64_SHELL__
#define __FT_LOG(prio, fmt, args...) \
do { \
if (prio >= flutter::GetMinLoggingLevel()) { \
__LOG(prio, "%s: %s(%d) > " fmt, "X64_SHELL", __func__, __LINE__, \
##args); \
} \
} while (0)
#else
#define __FT_LOG(prio, fmt, args...) \
do { \
if (prio >= flutter::GetMinLoggingLevel()) { \
__LOG(prio, "%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, \
##args); \
} \
} while (0)
#endif

#define FT_LOGD(fmt, args...) __FT_LOG(DLOG_DEBUG, fmt, ##args)
#define FT_LOGI(fmt, args...) __FT_LOG(DLOG_INFO, fmt, ##args)
Expand Down Expand Up @@ -88,33 +106,4 @@ log_priority GetMinLoggingLevel();

} // namespace flutter

#else

namespace flutter {

#define log_priority int
#define DLOG_DEBUG 0
#define DLOG_WARN 1
#define DLOG_INFO 2
#define DLOG_ERROR 3

void StartLogging();
void SetMinLoggingLevel(log_priority p);
log_priority GetMinLoggingLevel();

#define FT_LOGD(fmt, args...) ((void)0)
#define FT_LOGI(fmt, args...) ((void)0)
#define FT_LOGW(fmt, args...) ((void)0)
#define FT_LOGE(fmt, args...) ((void)0)

#define FT_ASSERT(assertion) ((void)0)
#define FT_ASSERT_NOT_REACHED() ((void)0)
#define FT_ASSERT_STATIC(assertion, reason)
#define FT_RELEASE_ASSERT_NOT_REACHED() ((void)0)

#define FT_UNIMPLEMENTED() FT_LOGW("UNIMPLEMENTED!")

} // namespace flutter
#endif

#endif // EMBEDDER_TIZEN_LOG_H_
2 changes: 0 additions & 2 deletions tools/gn
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ def to_gn_args(args):
gn_args['use_clang_static_analyzer'] = args.clang_static_analyzer

gn_args['embedder_for_target'] = args.embedder_for_target

gn_args['build_tizen_shell'] = args.build_tizen_shell

gn_args['enable_coverage'] = args.coverage
Expand Down Expand Up @@ -406,7 +405,6 @@ def parse_args(args):
parser.add_argument('--always-use-skshaper', action='store_true', default=False)

parser.add_argument('--embedder-for-target', dest='embedder_for_target', action='store_true', default=False)

parser.add_argument('--build-tizen-shell', dest='build_tizen_shell', action='store_true', default=False)

parser.add_argument('--coverage', default=False, action='store_true')
Expand Down

0 comments on commit e375b8c

Please sign in to comment.