"src/browser/tv/widget_state.h",
"src/browser/tv/wrt_browser_client_tv.cc",
"src/browser/tv/wrt_browser_client_tv.h",
+ "src/browser/tv/wrt_browser_context_tv.cc",
+ "src/browser/tv/wrt_browser_context_tv.h",
"src/browser/tv/wrt_native_window_tv.cc",
"src/browser/tv/wrt_native_window_tv.h",
"src/browser/tv/wrt_xwalk_extension_browser_tv.cc",
--- /dev/null
+// Copyright 2024 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "wrt/src/browser/tv/wrt_browser_context_tv.h"
+
+namespace wrt {
+
+WRTBrowserContextTV::WRTBrowserContextTV(
+ const electron::PartitionOrPath partition_location,
+ bool in_memory,
+ base::Value::Dict options)
+ : WRTBrowserContext(partition_location, in_memory, std::move(options)),
+ web_cache_manager_(this) {}
+
+void WRTBrowserContextTV::ClearWebCache() {
+ web_cache_manager_.ClearCache();
+}
+
+} // namespace wrt
--- /dev/null
+// Copyright 2024 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BROWSER_WRT_BROWSER_CONTEXT_TV_H_
+#define BROWSER_WRT_BROWSER_CONTEXT_TV_H_
+
+#include "wrt/src/browser/wrt_browser_context.h"
+
+#include "tizen_src/ewk/efl_integration/browser/web_cache_efl/web_cache_manager_efl.h"
+
+namespace wrt {
+
+class WRTBrowserContextTV : public WRTBrowserContext {
+ public:
+ WRTBrowserContextTV(const electron::PartitionOrPath partition_location,
+ bool in_memory,
+ base::Value::Dict options);
+ virtual ~WRTBrowserContextTV() override = default;
+
+ WRTBrowserContextTV(const WRTBrowserContextTV&) = delete;
+ WRTBrowserContextTV& operator=(const WRTBrowserContextTV&) = delete;
+
+ private:
+ void ClearWebCache() override;
+
+ WebCacheManagerEfl web_cache_manager_;
+};
+
+} // namespace wrt
+
+#endif // BROWSER_WRT_BROWSER_CONTEXT_TV_H_
#include "wrt/src/browser/wrt_special_storage_policy.h"
#include "wrt/src/common/application_data.h"
+#if BUILDFLAG(IS_TIZEN_TV)
+#include "wrt/src/browser/tv/wrt_browser_context_tv.h"
+
+using WRTBrowserContextType = wrt::WRTBrowserContextTV;
+#else
+using WRTBrowserContextType = wrt::WRTBrowserContext;
+#endif
+
namespace {
std::vector<base::WeakPtr<electron::ElectronBrowserContext>>
bool in_memory,
base::Value::Dict options)
: electron::ElectronBrowserContext(
- partition_location, in_memory, std::move(options))
-#if BUILDFLAG(IS_TIZEN_TV)
- ,
- web_cache_manager_(this)
-#endif
-{
+ partition_location, in_memory, std::move(options)) {
SetUserAgent(EflWebView::VersionInfo::GetInstance()->DefaultUserAgent());
InitVisitedLinkWriter();
base::BindOnce([](uint32_t num_deleted) {}));
}
-#if BUILDFLAG(IS_TIZEN_TV)
-void WRTBrowserContext::ClearWebCache() {
- web_cache_manager_.ClearCache();
-}
-#endif
-
} // namespace wrt
namespace electron {
if (browser_context)
return browser_context;
- auto* new_context = new wrt::WRTBrowserContext(
+ auto* new_context = new WRTBrowserContextType(
std::cref(partition), in_memory, std::move(options));
browser_context_map()[key] =
std::unique_ptr<ElectronBrowserContext>(new_context);
}
auto* new_context =
- new wrt::WRTBrowserContext(std::cref(path), false, std::move(options));
+ new WRTBrowserContextType(std::cref(path), false, std::move(options));
browser_context_map()[key] =
std::unique_ptr<ElectronBrowserContext>(new_context);
return new_context;
#include "electron/shell/browser/electron_browser_context.h"
#include "extensions/buildflags/buildflags.h"
-#if BUILDFLAG(IS_TIZEN_TV)
-#include "tizen_src/ewk/efl_integration/browser/web_cache_efl/web_cache_manager_efl.h"
-#endif
-
namespace visitedlink {
class VisitedLinkWriter;
}
WRTSpecialStoragePolicy* GetWRTSpecialStoragePolicy();
-#if BUILDFLAG(IS_TIZEN_TV)
- void ClearWebCache();
-#endif
+ // product specific features
+ virtual void ClearWebCache() {}
private:
// visitedlink::VisitedLinkDelegate implementation.
scoped_refptr<WRTSpecialStoragePolicy> wrt_special_storage_policy_;
std::unique_ptr<content::BackgroundSyncController>
background_sync_controller_;
-#if BUILDFLAG(IS_TIZEN_TV)
- WebCacheManagerEfl web_cache_manager_;
-#endif
};
} // namespace wrt