This commit enables code that was disabled during M108 build bring up.
Change-Id: I73290609db730754af2e9dd55f6eacc0d880197a
Signed-off-by: Chandan Padhi <c.padhi@samsung.com>
BrowserContextEfl::ResourceContextEfl::ResourceContextEfl(
scoped_refptr<CookieManager> cookie_manager)
- : getter_(nullptr), cookie_manager_(cookie_manager) {}
+ : cookie_manager_(cookie_manager) {}
BrowserContextEfl::~BrowserContextEfl() {
NotifyWillBeDestroyed();
}
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(
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<CookieManager>
BrowserContextEfl::ResourceContextEfl::GetCookieManager() const {
return cookie_manager_;
#include <vector>
-#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;
class ResourceContextEfl : public ResourceContext {
public:
ResourceContextEfl(scoped_refptr<CookieManager> 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<CookieManager> GetCookieManager() const;
private:
- scoped_refptr<URLRequestContextGetterEfl> getter_;
scoped_refptr<CookieManager> cookie_manager_;
HTTPCustomHeadersEflMap http_custom_headers_;
mutable base::Lock http_custom_headers_lock_;
BrowserContextEfl& operator=(const BrowserContextEfl&) = delete;
// BrowserContext implementation.
- net::URLRequestContextGetter* CreateMediaRequestContext();
- net::URLRequestContextGetter* CreateMediaRequestContextForStoragePartition(
- const base::FilePath&,
- bool);
PlatformNotificationService* GetPlatformNotificationService() override {
return nullptr;
}
std::unique_ptr<ZoomLevelDelegate> 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<GURL>& urls);
geolocation_permission_context_;
std::unique_ptr<visitedlink::VisitedLinkWriter> visitedlink_writer_;
ResourceContextEfl* resource_context_;
- scoped_refptr<URLRequestContextGetterEfl> request_context_getter_;
EWebContext* web_context_;
DownloadManagerDelegateEfl download_manager_delegate_;
base::ScopedTempDir temp_dir_;
DeleteSessionCookiesOnIOThread();
}
-void CookieManager::SetRequestContextGetter(
- scoped_refptr<content::URLRequestContextGetterEfl> getter) {
- request_context_getter_ = getter;
-}
-
void CookieManager::DeleteSessionCookiesOnIOThread() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
#include <Eina.h>
#include <queue>
-#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;
//This is synchronous call
std::string GetCookiesForURL(const std::string& url);
- void SetRequestContextGetter(scoped_refptr<content::URLRequestContextGetterEfl> getter);
-
base::WeakPtr<CookieManager> GetWeakPtr() {
return weak_ptr_factory_.GetWeakPtr();
}
#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"
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_);
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
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;
#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 {
return *content_main_delegate_efl_.get();
}
- content::URLRequestContextGetterEfl* GetSystemRequestContextGetter();
-
private:
EwkGlobalData();
~EwkGlobalData();
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_;
};
#endif // EWK_GLOBAL_DATA_H_
#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"
// 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();
}
}
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;
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:
}
void ContentRendererClientEfl::DidCreateScriptContext(
- blink::WebFrame* frame,
+ content::RenderFrame* render_frame,
v8::Handle<v8::Context> 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(
blink::WebNavigationPolicy default_policy,
bool is_redirect) override;
- void DidCreateScriptContext(
- blink::WebFrame* frame,
- v8::Handle<v8::Context> context,
- int world_id);
+ void DidCreateScriptContext(content::RenderFrame* render_frame,
+ v8::Handle<v8::Context> context,
+ int world_id);
void WillReleaseScriptContext(
blink::WebFrame* frame,
ContentRendererClientEfl* client = static_cast<ContentRendererClientEfl*>(
GetContentClientExport()->renderer());
- client->DidCreateScriptContext(render_frame()->GetWebFrame(), context,
- world_id);
+ client->DidCreateScriptContext(render_frame(), context, world_id);
}
void RenderFrameObserverEfl::WillReleaseScriptContext(
#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"