From: Chandan Padhi Date: Wed, 7 Dec 2022 13:58:55 +0000 (+0530) Subject: Remove EWK_BRINGUP for code disabled during M108 build bring up X-Git-Tag: submit/tizen/20230227.160252~176 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F13%2F285213%2F4;p=platform%2Fframework%2Fweb%2Fchromium-efl.git Remove EWK_BRINGUP for code disabled during M108 build bring up This commit enables code that was disabled during M108 build bring up. Change-Id: I73290609db730754af2e9dd55f6eacc0d880197a Signed-off-by: Chandan Padhi --- diff --git a/tizen_src/ewk/efl_integration/browser_context_efl.cc b/tizen_src/ewk/efl_integration/browser_context_efl.cc index 01e57d8..8145294 100644 --- a/tizen_src/ewk/efl_integration/browser_context_efl.cc +++ b/tizen_src/ewk/efl_integration/browser_context_efl.cc @@ -52,7 +52,7 @@ static void CreateNetworkDelegateOnIOThread(BrowserContextEfl* context, BrowserContextEfl::ResourceContextEfl::ResourceContextEfl( scoped_refptr cookie_manager) - : getter_(nullptr), cookie_manager_(cookie_manager) {} + : cookie_manager_(cookie_manager) {} BrowserContextEfl::~BrowserContextEfl() { NotifyWillBeDestroyed(); @@ -66,12 +66,7 @@ BrowserContextEfl::~BrowserContextEfl() { } BrowserContextEfl::ResourceContextEfl::~ResourceContextEfl() { - // |cookie_manager_| has access to - // |URLRequestContextGetterEfl::GetURLRequestContext()|. So it should be - // released before NotifyContextShuttingDown() cookie_manager_ = nullptr; - if (getter_.get()) - getter_->NotifyContextShuttingDown(); } bool BrowserContextEfl::ResourceContextEfl::HTTPCustomHeaderAdd( @@ -101,33 +96,6 @@ BrowserContextEfl::ResourceContextEfl::GetHTTPCustomHeadersEflMap() const { return http_custom_headers_; } -net::HostResolver* BrowserContextEfl::ResourceContextEfl::GetHostResolver() { - CHECK(getter_.get()); - return getter_->host_resolver(); -} - -net::URLRequestContext* -BrowserContextEfl::ResourceContextEfl::GetRequestContext() { - CHECK(getter_.get()); - return getter_->GetURLRequestContext(); -} - -net::URLRequestContextGetter* BrowserContextEfl::CreateMediaRequestContext() { - return request_context_getter_.get(); -} - -net::URLRequestContextGetter* -BrowserContextEfl::CreateMediaRequestContextForStoragePartition( - const base::FilePath&, - bool) { - return nullptr; -} - -void BrowserContextEfl::ResourceContextEfl::set_url_request_context_getter( - URLRequestContextGetterEfl* getter) { - getter_ = getter; -} - scoped_refptr BrowserContextEfl::ResourceContextEfl::GetCookieManager() const { return cookie_manager_; diff --git a/tizen_src/ewk/efl_integration/browser_context_efl.h b/tizen_src/ewk/efl_integration/browser_context_efl.h index 8980035..90ac364 100644 --- a/tizen_src/ewk/efl_integration/browser_context_efl.h +++ b/tizen_src/ewk/efl_integration/browser_context_efl.h @@ -7,18 +7,17 @@ #include -#include "url_request_context_getter_efl.h" #include "base/files/scoped_temp_dir.h" #include "base/synchronization/lock.h" #include "browser/download_manager_delegate_efl.h" #include "browser/geolocation/geolocation_permission_context_efl.h" #include "browser/ssl_host_state_delegate_efl.h" #include "components/visitedlink/browser/visitedlink_delegate.h" -#include "content/public/browser/content_browser_client.h" #include "content/public/browser/browser_context.h" -#include "content/public/browser/storage_partition.h" +#include "content/public/browser/content_browser_client.h" #include "content/public/browser/resource_context.h" -#include "net/url_request/url_request_context.h" +#include "content/public/browser/storage_partition.h" +#include "url_request_context_getter_efl.h" class CookieManager; class PrefService; @@ -38,24 +37,20 @@ class BrowserContextEfl : public BrowserContext, class ResourceContextEfl : public ResourceContext { public: ResourceContextEfl(scoped_refptr cookie_manager); - ~ResourceContextEfl(); ResourceContextEfl(const ResourceContextEfl&) = delete; ResourceContextEfl& operator=(const ResourceContextEfl&) = delete; + ~ResourceContextEfl() override; + bool HTTPCustomHeaderAdd(const std::string& name, const std::string& value); bool HTTPCustomHeaderRemove(const std::string& name); void HTTPCustomHeaderClear(); const HTTPCustomHeadersEflMap GetHTTPCustomHeadersEflMap() const; - net::HostResolver* GetHostResolver(); - net::URLRequestContext* GetRequestContext(); - void set_url_request_context_getter(URLRequestContextGetterEfl* getter); - scoped_refptr GetCookieManager() const; private: - scoped_refptr getter_; scoped_refptr cookie_manager_; HTTPCustomHeadersEflMap http_custom_headers_; mutable base::Lock http_custom_headers_lock_; @@ -68,10 +63,6 @@ class BrowserContextEfl : public BrowserContext, BrowserContextEfl& operator=(const BrowserContextEfl&) = delete; // BrowserContext implementation. - net::URLRequestContextGetter* CreateMediaRequestContext(); - net::URLRequestContextGetter* CreateMediaRequestContextForStoragePartition( - const base::FilePath&, - bool); PlatformNotificationService* GetPlatformNotificationService() override { return nullptr; } @@ -104,9 +95,6 @@ class BrowserContextEfl : public BrowserContext, std::unique_ptr CreateZoomLevelDelegate( const base::FilePath& partition_path); - URLRequestContextGetterEfl* GetRequestContextEfl() { - return request_context_getter_.get(); - } // These methods map to Add methods in visitedlink::VisitedLinkMaster. void AddVisitedURLs(const std::vector& urls); @@ -132,7 +120,6 @@ class BrowserContextEfl : public BrowserContext, geolocation_permission_context_; std::unique_ptr visitedlink_writer_; ResourceContextEfl* resource_context_; - scoped_refptr request_context_getter_; EWebContext* web_context_; DownloadManagerDelegateEfl download_manager_delegate_; base::ScopedTempDir temp_dir_; diff --git a/tizen_src/ewk/efl_integration/cookie_manager.cc b/tizen_src/ewk/efl_integration/cookie_manager.cc index 8df7217..9e5ae2a 100644 --- a/tizen_src/ewk/efl_integration/cookie_manager.cc +++ b/tizen_src/ewk/efl_integration/cookie_manager.cc @@ -82,11 +82,6 @@ CookieManager::~CookieManager() { DeleteSessionCookiesOnIOThread(); } -void CookieManager::SetRequestContextGetter( - scoped_refptr getter) { - request_context_getter_ = getter; -} - void CookieManager::DeleteSessionCookiesOnIOThread() { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); diff --git a/tizen_src/ewk/efl_integration/cookie_manager.h b/tizen_src/ewk/efl_integration/cookie_manager.h index 61467fd..94bd2da 100644 --- a/tizen_src/ewk/efl_integration/cookie_manager.h +++ b/tizen_src/ewk/efl_integration/cookie_manager.h @@ -8,17 +8,15 @@ #include #include -#include "url_request_context_getter_efl.h" #include "base/memory/ref_counted.h" #include "base/synchronization/lock.h" -#include "net/url_request/url_request_context.h" -#include "net/url_request/url_request_context_getter.h" #include "net/cookies/canonical_cookie.h" #include "net/cookies/cookie_monster.h" #include "net/cookies/cookie_options.h" #include "net/cookies/cookie_util.h" #include "public/ewk_cookie_manager.h" #include "url/gurl.h" +#include "url_request_context_getter_efl.h" namespace content { class ResourceContext; @@ -90,8 +88,6 @@ class CookieManager : public base::RefCountedThreadSafe { //This is synchronous call std::string GetCookiesForURL(const std::string& url); - void SetRequestContextGetter(scoped_refptr getter); - base::WeakPtr GetWeakPtr() { return weak_ptr_factory_.GetWeakPtr(); } diff --git a/tizen_src/ewk/efl_integration/eweb_context.cc b/tizen_src/ewk/efl_integration/eweb_context.cc index 45eb3f7..4b77984 100644 --- a/tizen_src/ewk/efl_integration/eweb_context.cc +++ b/tizen_src/ewk/efl_integration/eweb_context.cc @@ -26,6 +26,7 @@ #include "net/http/http_cache.h" #include "net/proxy_resolution/proxy_config_service_fixed.h" #include "net/proxy_resolution/proxy_resolution_service.h" +#include "net/url_request/url_request_context.h" #include "storage/browser/database/database_quota_client.h" #include "storage/browser/file_system/file_system_quota_client.h" #include "storage/browser/quota/quota_manager.h" diff --git a/tizen_src/ewk/efl_integration/eweb_view.cc b/tizen_src/ewk/efl_integration/eweb_view.cc index 14e2880..c71aa3d 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.cc +++ b/tizen_src/ewk/efl_integration/eweb_view.cc @@ -702,10 +702,7 @@ void JavaScriptComplete(JavaScriptCallbackDetails* script_callback_data, if (!script_callback_data->callback_func_) return; - std::string return_string; -#if !defined(EWK_BRINGUP) // FIXME: m108 bringup - result->GetAsString(&return_string); -#endif + std::string return_string = result->GetString(); script_callback_data->callback_func_(script_callback_data->view_, return_string.c_str(), script_callback_data->user_data_); diff --git a/tizen_src/ewk/efl_integration/ewk_global_data.cc b/tizen_src/ewk/efl_integration/ewk_global_data.cc index 4f2015f..ae28b71 100644 --- a/tizen_src/ewk/efl_integration/ewk_global_data.cc +++ b/tizen_src/ewk/efl_integration/ewk_global_data.cc @@ -69,8 +69,6 @@ EwkGlobalData::EwkGlobalData() EwkGlobalData::~EwkGlobalData() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - // URLRequestContextGetterEfl needs to be deleted before loop stops - system_request_context_ = nullptr; // We need to pretend that message loop was stopped so chromium unwinds // correctly @@ -198,14 +196,6 @@ EwkGlobalData* EwkGlobalData::GetInstance() { return instance_; } -content::URLRequestContextGetterEfl* -EwkGlobalData::GetSystemRequestContextGetter() { - if (!system_request_context_.get()) { - system_request_context_ = new content::URLRequestContextGetterEfl(); - } - return system_request_context_.get(); -} - void EwkGlobalData::Delete() { delete instance_; instance_ = NULL; diff --git a/tizen_src/ewk/efl_integration/ewk_global_data.h b/tizen_src/ewk/efl_integration/ewk_global_data.h index 8249caa..5461e13 100644 --- a/tizen_src/ewk/efl_integration/ewk_global_data.h +++ b/tizen_src/ewk/efl_integration/ewk_global_data.h @@ -7,7 +7,6 @@ #include "base/memory/ref_counted.h" #include "content/browser/startup_data_impl.h" -#include "url_request_context_getter_efl.h" #if defined(USE_OZONE) namespace display { @@ -37,8 +36,6 @@ class EwkGlobalData return *content_main_delegate_efl_.get(); } - content::URLRequestContextGetterEfl* GetSystemRequestContextGetter(); - private: EwkGlobalData(); ~EwkGlobalData(); @@ -63,8 +60,6 @@ class EwkGlobalData std::unique_ptr content_main_delegate_efl_; std::unique_ptr content_main_runner_; std::unique_ptr browser_main_runner_; - - scoped_refptr system_request_context_; }; #endif // EWK_GLOBAL_DATA_H_ diff --git a/tizen_src/ewk/efl_integration/private/ewk_policy_decision_private.cc b/tizen_src/ewk/efl_integration/private/ewk_policy_decision_private.cc index 0172c8a..2a11597 100644 --- a/tizen_src/ewk/efl_integration/private/ewk_policy_decision_private.cc +++ b/tizen_src/ewk/efl_integration/private/ewk_policy_decision_private.cc @@ -10,6 +10,7 @@ #include "content/public/browser/render_view_host.h" #include "eweb_view.h" #include "net/http/http_response_headers.h" +#include "net/url_request/url_request_context.h" #include "private/ewk_frame_private.h" #include "third_party/blink/public/common/mime_util/mime_util.h" @@ -214,9 +215,9 @@ void _Ewk_Policy_Decision::InitializeOnUIThread() { // DCHECK(viewhost); if (viewhost) { -#if !defined(EWK_BRINGUP) // FIXME: m108 bringup - host = viewhost->GetMainFrame(); -#endif + content::WebContents* web_contents = + content::WebContents::FromRenderViewHost(viewhost); + host = web_contents->GetPrimaryMainFrame(); } } diff --git a/tizen_src/ewk/efl_integration/public/ewk_error.cc b/tizen_src/ewk/efl_integration/public/ewk_error.cc index 26fb4e7..6feff94 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_error.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_error.cc @@ -110,9 +110,6 @@ static Ewk_Error_Code convertErrorCode(const Ewk_Error* error) return EWK_ERROR_CODE_CANT_LOOKUP_HOST; case net::ERR_BAD_SSL_CLIENT_AUTH_CERT: -#if !defined(EWK_BRINGUP) // FIXME: m108 bringup - case net::ERR_CERT_ERROR_IN_SSL_RENEGOTIATION: -#endif case net::ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED: case net::ERR_SSL_HANDSHAKE_NOT_COMPLETED: return EWK_ERROR_CODE_FAILED_TLS_HANDSHAKE; @@ -144,10 +141,8 @@ static Ewk_Error_Code convertErrorCode(const Ewk_Error* error) case net::ERR_ADDRESS_INVALID: case net::ERR_INVALID_URL: return EWK_ERROR_CODE_BAD_URL; -#if !defined(EWK_BRINGUP) // FIXME: m108 bringup - case net::ERR_ // DISALLOWED_URL_SCHEME: -#endif - case net::ERR_UNKNOWN_URL_SCHEME: + case net::ERR_DISALLOWED_URL_SCHEME: + case net::ERR_UNKNOWN_URL_SCHEME: return EWK_ERROR_CODE_UNSUPPORTED_SCHEME; case net::ERR_CLIENT_AUTH_CERT_TYPE_UNSUPPORTED: diff --git a/tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.cc b/tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.cc index be5d023..78dbbeb 100644 --- a/tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.cc +++ b/tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.cc @@ -174,22 +174,18 @@ bool ContentRendererClientEfl::OverrideCreatePlugin( } void ContentRendererClientEfl::DidCreateScriptContext( - blink::WebFrame* frame, + content::RenderFrame* render_frame, v8::Handle context, int world_id) { -#if !defined(EWK_BRINGUP) // FIXME: m108 bringup - content::RenderView* render_view = - content::RenderView::FromWebView(frame->View()); if (widget_) { - widget_->StartSession(context, render_view->GetRoutingID(), - frame->ToWebLocalFrame() + widget_->StartSession(context, render_frame->GetRoutingID(), + render_frame->GetWebFrame() ->GetDocument() .BaseURL() .GetString() .Utf8() .c_str()); } -#endif } void ContentRendererClientEfl::WillReleaseScriptContext( diff --git a/tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.h b/tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.h index f0a0205..2400cfe 100755 --- a/tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.h +++ b/tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.h @@ -61,10 +61,9 @@ class ContentRendererClientEfl : public content::ContentRendererClient { blink::WebNavigationPolicy default_policy, bool is_redirect) override; - void DidCreateScriptContext( - blink::WebFrame* frame, - v8::Handle context, - int world_id); + void DidCreateScriptContext(content::RenderFrame* render_frame, + v8::Handle context, + int world_id); void WillReleaseScriptContext( blink::WebFrame* frame, diff --git a/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.cc b/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.cc index 6df21a8..0edf0b5 100644 --- a/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.cc +++ b/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.cc @@ -202,8 +202,7 @@ void RenderFrameObserverEfl::DidCreateScriptContext( ContentRendererClientEfl* client = static_cast( GetContentClientExport()->renderer()); - client->DidCreateScriptContext(render_frame()->GetWebFrame(), context, - world_id); + client->DidCreateScriptContext(render_frame(), context, world_id); } void RenderFrameObserverEfl::WillReleaseScriptContext( diff --git a/tizen_src/ewk/efl_integration/url_request_context_getter_efl.cc b/tizen_src/ewk/efl_integration/url_request_context_getter_efl.cc index 7baa31c..844ea4c 100644 --- a/tizen_src/ewk/efl_integration/url_request_context_getter_efl.cc +++ b/tizen_src/ewk/efl_integration/url_request_context_getter_efl.cc @@ -31,6 +31,7 @@ #include "net/proxy_resolution/proxy_resolution_service.h" #include "net/ssl/ssl_config_service_defaults.h" #include "net/url_request/static_http_user_agent_settings.h" +#include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_builder.h" #include "net/url_request/url_request_job_factory.h" #include "network_delegate_efl.h"