}
Evas_Object* WebEngineService::getTabView(TabId id){
+ if (m_tabs.find(id) == m_tabs.end()) {
+ BROWSER_LOGW("[%s:%d] there is no tab of id %d", __PRETTY_FUNCTION__, __LINE__, id.get());
+ return nullptr;
+ }
return m_tabs[id]->getLayout();
}
suspend();
}
+ if (m_tabs.find(newTabId) == m_tabs.end()) {
+ BROWSER_LOGW("[%s:%d] there is no tab of id %d", __PRETTY_FUNCTION__, __LINE__, newTabId.get());
+ return false;
+ }
+
m_currentWebView = m_tabs[newTabId];
m_currentTabId = newTabId;
m_mostRecentTab.erase(std::remove(m_mostRecentTab.begin(), m_mostRecentTab.end(), newTabId), m_mostRecentTab.end());
bool WebEngineService::isPrivateMode(const TabId& id)
{
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+ if (m_tabs.find(id) == m_tabs.end()) {
+ BROWSER_LOGW("[%s:%d] there is no tab of id %d", __PRETTY_FUNCTION__, __LINE__, id.get());
+ return false;
+ }
return m_tabs[id]->isPrivateMode();
}
std::shared_ptr<tizen_browser::tools::BrowserImage> WebEngineService::getSnapshotData(TabId id, int width, int height, bool async,
tizen_browser::tools::SnapshotType snapshot_type){
+ if (m_tabs.find(id) == m_tabs.end()) {
+ BROWSER_LOGW("[%s:%d] there is no tab of id %d", __PRETTY_FUNCTION__, __LINE__, id.get());
+ return std::shared_ptr<tizen_browser::tools::BrowserImage>();
+ }
return m_tabs[id]->captureSnapshot(width, height, async, snapshot_type);
}