Port //services/device/geolocation to network::SimpleURLLoader

https://chromium-review.googlesource.com/c/chromium/src/+/1119398
This commit is contained in:
Jeremy Apthorp 2018-10-02 15:01:24 -07:00
parent 63176acde2
commit eef375a428
4 changed files with 2 additions and 16 deletions

View file

@ -216,7 +216,6 @@ static_library("electron_lib") {
"//content/public/app:both",
"//content/public/child",
"//content/public/common:service_names",
"//device/geolocation",
"//gin",
"//net:net_resources",
"//ppapi/host",

View file

@ -55,12 +55,12 @@
#include "content/public/common/service_names.mojom.h"
#include "content/public/common/url_constants.h"
#include "content/public/common/web_preferences.h"
#include "device/geolocation/public/cpp/location_provider.h"
#include "electron/buildflags/buildflags.h"
#include "electron/grit/electron_resources.h"
#include "net/base/escape.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "ppapi/host/ppapi_host.h"
#include "services/device/public/cpp/geolocation/location_provider.h"
#include "services/network/public/cpp/resource_request_body.h"
#include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h"
#include "ui/base/l10n/l10n_util.h"
@ -374,16 +374,6 @@ void AtomBrowserClient::DidCreatePpapiPlugin(content::BrowserPpapiHost* host) {
#endif
}
void AtomBrowserClient::GetGeolocationRequestContext(
base::OnceCallback<void(scoped_refptr<net::URLRequestContextGetter>)>
callback) {
auto* io_thread = AtomBrowserMainParts::Get()->io_thread();
auto* context = io_thread->GetRequestContext();
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::BindOnce(std::move(callback), base::RetainedRef(context)));
}
std::string AtomBrowserClient::GetGeolocationApiKey() {
std::unique_ptr<base::Environment> env(base::Environment::Create());
std::string api_key;

View file

@ -69,9 +69,6 @@ class AtomBrowserClient : public brightray::BrowserClient,
void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
int child_process_id) override;
void DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host) override;
void GetGeolocationRequestContext(
base::OnceCallback<void(scoped_refptr<net::URLRequestContextGetter>)>
callback) override;
std::string GetGeolocationApiKey() override;
content::QuotaPermissionContext* CreateQuotaPermissionContext() override;
void AllowCertificateError(

View file

@ -6,7 +6,7 @@
#define ATOM_BROWSER_FAKE_LOCATION_PROVIDER_H_
#include "base/macros.h"
#include "device/geolocation/public/cpp/location_provider.h"
#include "services/device/public/cpp/geolocation/location_provider.h"
#include "services/device/public/mojom/geoposition.mojom.h"
namespace atom {