reallaunch_mutex.unlock();
}
-void WRTMainDelegateTV::PrelaunchOnLoader(const std::string& pkg_id) {
+void WRTMainDelegateTV::PrelaunchOnLoader(const std::string& app_path,
+ const std::string& pkg_id) {
+ base::CommandLine::ForCurrentProcess()->SetProgram(base::FilePath(app_path));
prelaunch_pkg_id = pkg_id;
prelaunch_mutex.unlock();
}
bool CheckPlatformReady(int argc, char** argv) override;
void LoaderCreated() override;
void LoaderTerminated() override;
- void PrelaunchOnLoader(const std::string& pkg_id) override;
+ void PrelaunchOnLoader(const std::string& app_path,
+ const std::string& pkg_id) override;
bool PreSetup() override;
absl::optional<int> PostEarlyInitialization(InvokedIn invoked_in) override;
LOG(INFO) << "ContentMain will be initialized in idler.";
auto* content_main = static_cast<WRTContentMain*>(data);
content_main->Initialize();
- content_main->main_delegate_->LoaderCreated();
+ content_main->LoaderCreated();
return ECORE_CALLBACK_CANCEL;
}, static_cast<Loader*>(user_data)->content_main_);
};
const char* appid, const char* pkgid,
const char* pkg_type, void* user_data) {
LOG(INFO) << "loader prelaunch";
-#if BUILDFLAG(IS_TIZEN_TV)
- base::CommandLine::ForCurrentProcess()->SetProgram(
- base::FilePath(app_path));
auto* content_main = static_cast<Loader*>(user_data)->content_main_;
- content_main->main_delegate_->PrelaunchOnLoader(pkgid);
-#endif
+ content_main->PrelaunchOnLoader(app_path, pkgid);
return 0;
};
#endif
LOG(FATAL) << "Fail to initialize content main runner";
}
+void WRTContentMain::LoaderCreated() {
+ if (main_delegate_)
+ main_delegate_->LoaderCreated();
+}
+
+void WRTContentMain::PrelaunchOnLoader(const std::string& app_path,
+ const std::string& pkg_id) {
+ if (main_delegate_)
+ main_delegate_->PrelaunchOnLoader(app_path, pkg_id);
+}
+
int WRTContentMain::Main(int argc, char** argv) {
#if BUILDFLAG(USE_ALLOCATOR_SHIM)
heap_profiling::InitTLSSlot();
int Main(int argc, char** argv);
private:
- void Initialize();
int Run(int argc, char** argv);
+ void Initialize();
+ void LoaderCreated();
+ void PrelaunchOnLoader(const std::string& app_path,
+ const std::string& pkg_id);
+
class Loader;
std::unique_ptr<WRTMainDelegate> main_delegate_;
virtual bool CheckPlatformReady(int argc, char** argv) { return true; }
virtual void LoaderCreated() {}
virtual void LoaderTerminated() {}
- virtual void PrelaunchOnLoader(const std::string& pkg_id) {}
+ virtual void PrelaunchOnLoader(const std::string& app_path,
+ const std::string& pkg_id) {}
virtual bool PreSetup();
WRTProfileDelegate* GetRuntimeDelegate() { return runtime_delegate_; }