} // namespace
EwkGlobalData::EwkGlobalData()
- : content_main_runner_(ContentMainRunner::Create()) {}
+ : content_main_runner_(ContentMainRunner::Create()),
+ content_main_delegate_efl_(new ContentMainDelegateEfl) {}
EwkGlobalData::~EwkGlobalData() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// FIXME: EWK_BRINGUP definition should be removed.
loop->RunUntilIdle();
#endif // !defined(EWK_BRINGUP)
-
- // browser_main_runner must be deleted first as it depends on
- // content_main_runner
- delete browser_main_runner_;
- delete content_main_runner_;
-
- // content_main_delegate_efl_ must be deleted after content_main_runner_
- delete content_main_delegate_efl_;
}
EwkGlobalData* EwkGlobalData::GetInstance() {
ui::InstallScreenInstance();
efl::WindowFactory::SetDelegate(&EWebView::GetHostWindowDelegate);
- instance_->content_main_delegate_efl_ = new ContentMainDelegateEfl();
- content::ContentMainParams params(instance_->content_main_delegate_efl_);
+ content::ContentMainParams params(
+ instance_->content_main_delegate_efl_.get());
params.argc = CommandLineEfl::GetArgc();
params.argv = CommandLineEfl::GetArgv();
content::StartBrowserTaskScheduler();
content::BrowserTaskExecutor::Create();
- instance_->browser_main_runner_ = BrowserMainRunner::Create().get();
+ instance_->browser_main_runner_ = BrowserMainRunner::Create();
instance_->browser_main_runner_->Initialize(main_funtion_params);
base::ThreadRestrictions::SetIOAllowed(true);
static void Delete();
static bool IsInitialized();
- content::ContentMainDelegateEfl& GetContentMainDelegatEfl() const {
- return *content_main_delegate_efl_;
+ content::ContentMainDelegateEfl& GetContentMainDelegateEfl() const {
+ return *content_main_delegate_efl_.get();
}
content::URLRequestContextGetterEfl* GetSystemRequestContextGetter();
static EwkGlobalData* instance_;
- content::ContentMainRunner* content_main_runner_;
- content::BrowserMainRunner* browser_main_runner_;
- content::ContentMainDelegateEfl* content_main_delegate_efl_;
- scoped_refptr<content::URLRequestContextGetterEfl> system_request_context_;
+ // |browser_main_runner_| must be deleted first as it depends on
+ // |content_main_runner_|. |content_main_delegate_efl_| must be deleted after
+ // |content_main_runner_|.
+ std::unique_ptr<content::ContentMainDelegateEfl> content_main_delegate_efl_;
+ std::unique_ptr<content::ContentMainRunner> content_main_runner_;
+ std::unique_ptr<content::BrowserMainRunner> browser_main_runner_;
+ scoped_refptr<content::URLRequestContextGetterEfl> system_request_context_;
DISALLOW_COPY_AND_ASSIGN(EwkGlobalData);
};