From 38a211db2eadbd79e3c831742d7b76afa4831d79 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 2 Sep 2015 15:16:34 +0800 Subject: [PATCH] Fix API changes --- brightray/browser/devtools_ui.cc | 14 +++++++------- brightray/browser/inspectable_web_contents_impl.cc | 8 ++++---- brightray/browser/inspectable_web_contents_impl.h | 2 +- brightray/browser/network_delegate.cc | 5 ----- brightray/browser/network_delegate.h | 1 - brightray/browser/permission_manager.cc | 4 ++-- brightray/browser/permission_manager.h | 4 ++-- brightray/browser/url_request_context_getter.cc | 5 +++-- 8 files changed, 19 insertions(+), 24 deletions(-) diff --git a/brightray/browser/devtools_ui.cc b/brightray/browser/devtools_ui.cc index 8f8ded3b76d6..2e08a32d8fb3 100644 --- a/brightray/browser/devtools_ui.cc +++ b/brightray/browser/devtools_ui.cc @@ -29,19 +29,19 @@ std::string PathWithoutParams(const std::string& path) { std::string GetMimeTypeForPath(const std::string& path) { std::string filename = PathWithoutParams(path); - if (EndsWith(filename, ".html", false)) { + if (base::EndsWith(filename, ".html", false)) { return "text/html"; - } else if (EndsWith(filename, ".css", false)) { + } else if (base::EndsWith(filename, ".css", false)) { return "text/css"; - } else if (EndsWith(filename, ".js", false)) { + } else if (base::EndsWith(filename, ".js", false)) { return "application/javascript"; - } else if (EndsWith(filename, ".png", false)) { + } else if (base::EndsWith(filename, ".png", false)) { return "image/png"; - } else if (EndsWith(filename, ".gif", false)) { + } else if (base::EndsWith(filename, ".gif", false)) { return "image/gif"; - } else if (EndsWith(filename, ".svg", false)) { + } else if (base::EndsWith(filename, ".svg", false)) { return "image/svg+xml"; - } else if (EndsWith(filename, ".manifest", false)) { + } else if (base::EndsWith(filename, ".manifest", false)) { return "text/cache-manifest"; } return "text/html"; diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index 1aa442f09d08..59647b9a7f0a 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -282,13 +282,13 @@ void InspectableWebContentsImpl::CallClientFunction(const std::string& function_ std::string javascript = function_name + "("; if (arg1) { std::string json; - base::JSONWriter::Write(arg1, &json); + base::JSONWriter::Write(*arg1, &json); javascript.append(json); if (arg2) { - base::JSONWriter::Write(arg2, &json); + base::JSONWriter::Write(*arg2, &json); javascript.append(", ").append(json); if (arg3) { - base::JSONWriter::Write(arg3, &json); + base::JSONWriter::Write(*arg3, &json); javascript.append(", ").append(json); } } @@ -586,7 +586,7 @@ bool InspectableWebContentsImpl::ShouldCreateWebContents( int route_id, int main_frame_route_id, WindowContainerType window_container_type, - const base::string16& frame_name, + const std::string& frame_name, const GURL& target_url, const std::string& partition_id, content::SessionStorageNamespace* session_storage_namespace) { diff --git a/brightray/browser/inspectable_web_contents_impl.h b/brightray/browser/inspectable_web_contents_impl.h index 62cfffec4f62..9b985bbc6c96 100644 --- a/brightray/browser/inspectable_web_contents_impl.h +++ b/brightray/browser/inspectable_web_contents_impl.h @@ -143,7 +143,7 @@ class InspectableWebContentsImpl : int route_id, int main_frame_route_id, WindowContainerType window_container_type, - const base::string16& frame_name, + const std::string& frame_name, const GURL& target_url, const std::string& partition_id, content::SessionStorageNamespace* session_storage_namespace) override; diff --git a/brightray/browser/network_delegate.cc b/brightray/browser/network_delegate.cc index 373b5819a715..dbaeeeed3e2c 100644 --- a/brightray/browser/network_delegate.cc +++ b/brightray/browser/network_delegate.cc @@ -129,11 +129,6 @@ bool NetworkDelegate::OnCanAccessFile(const net::URLRequest& request, return true; } -bool NetworkDelegate::OnCanThrottleRequest( - const net::URLRequest& request) const { - return false; -} - bool NetworkDelegate::OnCanEnablePrivacyMode( const GURL& url, const GURL& first_party_for_cookies) const { diff --git a/brightray/browser/network_delegate.h b/brightray/browser/network_delegate.h index 642b0b4cac59..f281f663ffa2 100644 --- a/brightray/browser/network_delegate.h +++ b/brightray/browser/network_delegate.h @@ -61,7 +61,6 @@ class NetworkDelegate : public net::NetworkDelegate { net::CookieOptions* options) override; bool OnCanAccessFile(const net::URLRequest& request, const base::FilePath& path) const override; - bool OnCanThrottleRequest(const net::URLRequest& request) const override; bool OnCanEnablePrivacyMode( const GURL& url, const GURL& first_party_for_cookies) const override; diff --git a/brightray/browser/permission_manager.cc b/brightray/browser/permission_manager.cc index 5a2d4ee54c33..1290739c3609 100644 --- a/brightray/browser/permission_manager.cc +++ b/brightray/browser/permission_manager.cc @@ -17,7 +17,7 @@ PermissionManager::~PermissionManager() { void PermissionManager::RequestPermission( content::PermissionType permission, - content::WebContents* web_contents, + content::RenderFrameHost* render_frame_host, int request_id, const GURL& requesting_origin, bool user_gesture, @@ -27,7 +27,7 @@ void PermissionManager::RequestPermission( void PermissionManager::CancelPermissionRequest( content::PermissionType permission, - content::WebContents* web_contents, + content::RenderFrameHost* render_frame_host, int request_id, const GURL& requesting_origin) { } diff --git a/brightray/browser/permission_manager.h b/brightray/browser/permission_manager.h index d40bcd95e1f2..a0860dd39bdf 100644 --- a/brightray/browser/permission_manager.h +++ b/brightray/browser/permission_manager.h @@ -19,13 +19,13 @@ class PermissionManager : public content::PermissionManager { // content::PermissionManager: void RequestPermission( content::PermissionType permission, - content::WebContents* web_contents, + content::RenderFrameHost* render_frame_host, int request_id, const GURL& requesting_origin, bool user_gesture, const base::Callback& callback) override; void CancelPermissionRequest(content::PermissionType permission, - content::WebContents* web_contents, + content::RenderFrameHost* render_frame_host, int request_id, const GURL& requesting_origin) override; void ResetPermission(content::PermissionType permission, diff --git a/brightray/browser/url_request_context_getter.cc b/brightray/browser/url_request_context_getter.cc index e390f1c2afe7..b27a94cb3a79 100644 --- a/brightray/browser/url_request_context_getter.cc +++ b/brightray/browser/url_request_context_getter.cc @@ -143,7 +143,7 @@ URLRequestContextGetter::URLRequestContextGetter( // must synchronously run on the glib message loop. This will be passed to // the URLRequestContextStorage on the IO thread in GetURLRequestContext(). proxy_config_service_.reset(net::ProxyService::CreateSystemProxyConfigService( - io_loop_->message_loop_proxy(), file_loop_->message_loop_proxy())); + io_loop_->task_runner(), file_loop_->task_runner())); } URLRequestContextGetter::~URLRequestContextGetter() { @@ -233,7 +233,8 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { url_sec_mgr_.get(), host_resolver.get(), std::string(), // gssapi_library_name - false, // negotiate_disable_cname_lookup + std::string(), // gssapi_library_nam + false, // auth_android_negotiate_account_type true); // negotiate_enable_port storage_->set_cert_verifier(net::CertVerifier::CreateDefault());