)
SET(WRT_CORE_BASE_SOURCES
- ${WRT_SRC_DIR}/domain/global_context.cpp
${WRT_SRC_DIR}/domain/widget_data_types.cpp
${WRT_SRC_DIR}/domain/widget_deserialize_model.cpp
${WRT_SRC_DIR}/domain/localization_setting.cpp
SET(WRT_CORE_INCLUDES
${WRT_SRC_DIR}/plugin-service
- ${WRT_SRC_DIR}/common
- ${WRT_SRC_DIR}/utils
- ${WRT_SRC_DIR}/orm
- ${WRT_SRC_DIR}/configuration
${WRT_SRC_DIR}/domain
- ${WRT_SRC_DIR}/localization
${WRT_SRC_DIR}/profiling
- ${WRT_SRC_DIR}/global_logic
- ${WRT_SRC_DIR}/ui
- ${WRT_SRC_DIR}/smack
+ ${WRT_SRC_DIR}/popup-process
${WRT_SRC_DIR}/view
)
wrt-plugin-js-overlay
dpl-efl
security-wrt-ocsp
+ wrt-popup-wrt-runner
REQUIRED
)
#include "runnable_widget_object.h"
#include <string>
#include <main_thread.h>
-#include <global_context.h>
#include <dpl/log/log.h>
#include <dpl/assert.h>
#include <dpl/exception.h>
#include <profiling_util.h>
#include <widget_deserialize_model.h>
#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+#include <dpl/wrt-dao-ro/global_dao_read_only.h>
#include <EWebKit2.h>
+
IMPLEMENT_SINGLETON(WRT::CoreModule)
namespace { //Anonymous
EWK_COOKIE_JAR_ACCEPT_ALWAYS);
ADD_PROFILING_POINT("WebProcess fork", "stop");
- GlobalContext::TouchArchitecture();
-
ADD_PROFILING_POINT("attach databases", "start");
MainThreadSingleton::Instance().AttachDatabases();
ADD_PROFILING_POINT("attach databases", "stop");
}
}
+ CoreModule::NetworkAccessMode homeNetworkAccess()
+ {
+ switch (WrtDB::GlobalDAOReadOnly::GetHomeNetworkDataUsage()) {
+ case WrtDB::GlobalDAOReadOnly::NEVER_CONNECT:
+ return CoreModule::NEVER_CONNECT;
+ case WrtDB::GlobalDAOReadOnly::ALWAYS_ASK:
+ return CoreModule::ALWAYS_ASK;
+ case WrtDB::GlobalDAOReadOnly::CONNECT_AUTOMATICALLY:
+ return CoreModule::CONNECT_AUTOMATICALLY;
+ default:
+ break;
+ }
+ LogWarning("using default value");
+ return CoreModule::ALWAYS_ASK;
+ }
+
+ CoreModule::NetworkAccessMode roamingNetworkAccess()
+ {
+ switch (WrtDB::GlobalDAOReadOnly::GetRoamingDataUsage()) {
+ case WrtDB::GlobalDAOReadOnly::NEVER_CONNECT:
+ return CoreModule::NEVER_CONNECT;
+ case WrtDB::GlobalDAOReadOnly::ALWAYS_ASK:
+ return CoreModule::ALWAYS_ASK;
+ case WrtDB::GlobalDAOReadOnly::CONNECT_AUTOMATICALLY:
+ return CoreModule::CONNECT_AUTOMATICALLY;
+ default:
+ break;
+ }
+ LogWarning("using default value");
+ return CoreModule::ALWAYS_ASK;
+ }
+
+ bool developerMode()
+ {
+ return WrtDB::GlobalDAOReadOnly::GetDeveloperMode();
+ }
+
private:
bool m_initialized;
Ewk_Context* m_ewkContext;
return m_impl->getRunnableWidgetObject(tizenId);
}
+CoreModule::NetworkAccessMode CoreModule::homeNetworkAccess()
+{
+ return m_impl->homeNetworkAccess();
+}
+
+CoreModule::NetworkAccessMode CoreModule::roamingNetworkAccess()
+{
+ return m_impl->roamingNetworkAccess();
+}
+
+bool CoreModule::developerMode()
+{
+ return m_impl->developerMode();
+}
+
} /* namespace WRT */
{
public:
/**
+ * Network access mode enum.
+ */
+ enum NetworkAccessMode
+ {
+ NEVER_CONNECT,
+ ALWAYS_ASK,
+ CONNECT_AUTOMATICALLY
+ };
+
+ /**
* Initialize needed by WRT components (database etc).
* Will not throw exception. elm_init() is NOT called in this function.
* You MUST call it before running widget.
*/
RunnableWidgetObjectPtr getRunnableWidgetObject(
const std::string& tizenId);
+ /**
+ * Gets from database global property of homeNetworkAccess
+ * @return homeNetworkAccess value
+ */
+ NetworkAccessMode homeNetworkAccess();
+ /**
+ * Gets from database global property of roamingNetworkAccess
+ * @return roamingNetworkAccess value
+ */
+ NetworkAccessMode roamingNetworkAccess();
+ /**
+ * Returns actual value of developer mode.
+ * @return is developer mode on
+ */
+ bool developerMode();
+
private:
CoreModule();
~CoreModule();
#include <runnable_widget_object.h>
#include <privilege-control.h>
#include <dpl/wrt-dao-ro/global_config.h>
-#include "global_logic.h"
#include <dpl/utils/wrt_global_settings.h>
#include <appcore-common.h>
#include <profiling_util.h>
} // namespace anonymous
-
namespace WRT {
RunnableWidgetObject::RunnableWidgetObject(WidgetModelPtr &model, Ewk_Context* context) :
#include <string>
#include <memory>
-#include <common_error.h>
#include <widget_model.h>
#include <i_view_module.h>
#include "i_runnable_widget_object.h"
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * @file common_error.h
- * @author Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
- * @version 1.0
- * @brief Header file for common error definitions
- */
-#ifndef COMMON_ERROR_H
-#define COMMON_ERROR_H
-
-namespace CommonError {
-enum Type
-{
- WrtSuccess, ///< Success
-
- HandleNotFound, ///< Widget handle was not found
- AlreadyRunning, ///< Widget is already running
- AlreadyStopped, ///< Widget is already stopped
- InvalidLanguage, ///< Widget is invalid in current locales
- StillAuthorizing, ///< Widget is still autorizing and has not yet finished it
- EarlyKilled, ///< Widget was early killed during launch
- AccessDenied, ///< Access denied from ACE
- CertificateRevoked, ///< Some certificate was revoked.
- /// Widget is not allowed to run.
- DatabaseFailure, ///< Wrong database version
- NoPath, ///< Required path does not exist
-
- Unknown ///< Temporary error. Try to not use this.
-};
-}
-
-#endif // COMMON_ERROR_H
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * @file global_context.cpp
- * @author Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
- * @version 1.0
- * @brief Implementation file for global context
- */
-#include <global_context.h>
-#include <global_logic.h>
-
-namespace GlobalContext {
-
-void TouchArchitecture()
-{
- // Touch all WebRuntime controllers
- // Remember to always add here new singletons!
- GlobalLogicSingleton::Instance().GetGlobalModel();
- // Start UI process rpc server
-}
-} // namespace GlobalContext
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * @file global_context.h
- * @author Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
- * @version 1.0
- * @brief Header file for global contect
- */
-#ifndef GLOBAL_CONTEXT_H
-#define GLOBAL_CONTEXT_H
-
-namespace GlobalContext {
-
-void Initialize();
-
-void Finalize();
-
-/**
- * Touch all singletons to inherit default context
- */
-void TouchArchitecture();
-} // namespace GlobalContext
-
-#endif // GLOBAL_CONTEXT_H
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * @file global_logic.cpp
- * @author Lukasz Marek (l.marek@samgsung.com)
- * @version
- * @brief
- */
-
-#include "global_logic.h"
-
-#include <dpl/singleton_impl.h>
-IMPLEMENT_SINGLETON(GlobalLogic)
-
-GlobalLogic::GlobalLogic()
-{
-}
-
-GlobalLogic::~GlobalLogic()
-{
-}
-
-GlobalModel* GlobalLogic::GetGlobalModel() const
-{
- FREE_LOGIC_LOCK
- static GlobalModel globalLogic;
- return &globalLogic;
-}
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * @file global_logic.h
- * @author Lukasz Marek (l.marek@samgsung.com)
- * @version
- * @brief
- */
-
-#include <dpl/singleton.h>
-
-#include <global_model.h>
-#include <FreeLogic.h>
-
-class GlobalLogic : public FreeLogic
-{
- public:
- GlobalModel* GetGlobalModel() const;
-
- private:
- GlobalLogic();
- ~GlobalLogic();
-
- friend class DPL::Singleton<GlobalLogic>;
-};
-
-typedef DPL::Singleton<GlobalLogic> GlobalLogicSingleton;
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * @file global_model.cpp
- * @author Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
- */
-#include "global_model.h"
-#include <dpl/wrt-dao-ro/global_dao_read_only.h>
-
-using namespace WrtDB;
-
-GlobalModel::GlobalModel() :
- HomeNetworkAccess(this,
- & GlobalModel::HomeNetworkAccessReadProperty),
- RoamingNetworkAccess(this,
- & GlobalModel::RoamingNetworkAccessReadProperty),
- DeveloperMode(this,
- static_cast<DPL::Event::Property<bool,
- DPL::Event::PropertyReadOnly,
- DPL::Event::PropertyStorageDynamicCached>::ReadDelegateType>
- (& GlobalModel::ReadDeveloperMode))
-{
-}
-
-GlobalModel::NetworkAccessMode GlobalModel::HomeNetworkAccessReadProperty(
- DPL::Event::Model* /*model*/)
-{
- switch (GlobalDAOReadOnly::GetHomeNetworkDataUsage()) {
- case GlobalDAOReadOnly::NEVER_CONNECT:
- return GlobalModel::NEVER_CONNECT;
- case GlobalDAOReadOnly::ALWAYS_ASK:
- return GlobalModel::ALWAYS_ASK;
- case GlobalDAOReadOnly::CONNECT_AUTOMATICALLY:
- return GlobalModel::CONNECT_AUTOMATICALLY;
- default:
- break;
- }
- LogWarning("using default value");
- return GlobalModel::ALWAYS_ASK;
-}
-
-GlobalModel::NetworkAccessMode GlobalModel::RoamingNetworkAccessReadProperty(
- DPL::Event::Model* /*model*/)
-{
- switch (GlobalDAOReadOnly::GetRoamingDataUsage()) {
- case GlobalDAOReadOnly::NEVER_CONNECT:
- return GlobalModel::NEVER_CONNECT;
- case GlobalDAOReadOnly::ALWAYS_ASK:
- return GlobalModel::ALWAYS_ASK;
- case GlobalDAOReadOnly::CONNECT_AUTOMATICALLY:
- return GlobalModel::CONNECT_AUTOMATICALLY;
- default:
- break;
- }
- LogWarning("using default value");
- return GlobalModel::ALWAYS_ASK;
-}
-
-bool GlobalModel::ReadDeveloperMode(DPL::Event::Model */*model*/)
-{
- return GlobalDAOReadOnly::GetDeveloperMode();
-}
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * @file global_model.h
- * @author Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
- */
-#ifndef WRT_COMMON_GLOBAL_MODEL_H_
-#define WRT_COMMON_GLOBAL_MODEL_H_
-
-#include <string>
-#include <dpl/event/model.h>
-#include <dpl/event/property.h>
-#include <dpl/type_list.h>
-#include <dpl/shared_ptr.h>
-
-class GlobalModel : public DPL::Event::Model
-{
- public:
-
- /**
- * Network access mode enum.
- */
- enum NetworkAccessMode
- {
- NEVER_CONNECT,
- ALWAYS_ASK,
- CONNECT_AUTOMATICALLY
- };
-
- DPL::Event::Property<NetworkAccessMode,
- DPL::Event::PropertyReadOnly,
- DPL::Event::PropertyStorageDynamicCached> HomeNetworkAccess;
-
- DPL::Event::Property<NetworkAccessMode,
- DPL::Event::PropertyReadOnly,
- DPL::Event::PropertyStorageDynamicCached> RoamingNetworkAccess;
-
- DPL::Event::Property<bool,
- DPL::Event::PropertyReadOnly,
- DPL::Event::PropertyStorageDynamicCached> DeveloperMode;
-
- GlobalModel();
-
- private:
- // Custom read write delegates
- static NetworkAccessMode HomeNetworkAccessReadProperty(DPL::Event::Model *model);
-
- static NetworkAccessMode RoamingNetworkAccessReadProperty(DPL::Event::Model *model);
-
- static bool ReadDeveloperMode(DPL::Event::Model *model);
-};
-
-#endif // WRT_COMMON_GLOBAL_MODEL_H_
+++ /dev/null
-General purpose utilities
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * @file FreeLogic.h
- * @author Piotr Kozbial (p.kozbial@samsung.com)
- * @version 1.0
- * @brief Common base for Free Logic classes
- */
-
-#ifndef WRT_UTILS_FREELOGIC_H_
-#define WRT_UTILS_FREELOGIC_H_
-
-#include <dpl/noncopyable.h>
-#include <dpl/mutex.h>
-
-/*
- * This is the base class for any "Free Logic" class.
- *
- * A Free Logic is a bit like a Logic, but the difference is
- * that a Logic is always coupled with a controller and so
- * it is assigned to a single thread, while a Free Logic
- * doesn't have a controller, so it doesn't have a designated
- * thread.
- *
- * A Free Logic's public interface may be directly called
- * from any thread. For this to be safe, every Free Logic must
- * adhere to the following constraints:
- *
- * 1. Every (no matter how trivial) public API function must
- * start with locking the mutex using the following macro:
- *
- * FREE_LOGIC_LOCK
- *
- * 2. A Free Logic cannot contact other Logics, that is,
- * it cannot POST events to controllers and it cannot
- * call methods of other FreeLogics.
- *
- * 3. A Free Logic cannot emit or receive any events.
- *
- * 4. A Free Logic cannot do blocking system calls.
- *
- * 5. A Free Logic cannot use any synchronization
- * mechanisms (except the default lock, as described
- * above).
- */
-class FreeLogic : private DPL::Noncopyable
-{
- protected:
- mutable DPL::Mutex _freeLogicMutex;
-};
-
-#define FREE_LOGIC_LOCK \
- DPL::Mutex::ScopedLock _freeLogicLock(&_freeLogicMutex);
-
-#endif // WRT_UTILS_FREELOGIC_H_
-
)
SET(VIEW_MODULE_SOURCES
- ${PROJECT_SOURCE_DIR}/src/global_logic/global_logic.cpp #TODO this should be moved to separate module
- ${PROJECT_SOURCE_DIR}/src/global_logic/global_model.cpp #TODO this should be moved to separate module
${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic.cpp
${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_filesystem_support.cpp
${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_scheme_support.cpp
#include <dpl/exception.h>
#include <common/application_data.h>
#include <core_module.h>
-#include <global_logic.h>
#include <localization_setting.h>
#include <widget_deserialize_model.h>
#include <EWebKit2.h>
// every launched widgets as debug mode can use it.
if (m_dao->getWidgetType().appType == WrtDB::APP_TYPE_WAC20)
{
- bool developerMode =
- GlobalLogicSingleton::Instance().GetGlobalModel()
- ->DeveloperMode.Get();
+ bool developerMode = WRT::CoreModuleSingleton::Instance().developerMode();
//This code will be activated
//after WAC test certificate is used by SDK
//bool isTestWidget = view->m_widgetModel->IsTestWidget.Get();
// Developer Mode.
bool developerWidget = m_dao->isTestWidget();
- bool developerMode =
- GlobalLogicSingleton::Instance().GetGlobalModel()->DeveloperMode.Get();
+ bool developerMode = WRT::CoreModuleSingleton::Instance().developerMode();
LogDebug("Is WAC test widget: " << developerWidget);
LogDebug("Is developer Mode: " << developerMode);