Commit 33e3e5bb authored by Javier Ernesto Flores Robles's avatar Javier Ernesto Flores Robles Committed by Commit Bot

[iOS] Use URL loader factory

This replaces the old URLRequestContextGetter, and is 1/2 CLs to fix
the internal repo.

Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: Ia69ee02311aa9923156f9f56961fd3c315fb0967
Reviewed-on: https://chromium-review.googlesource.com/1240122Reviewed-by: default avatarOlivier Robin <olivierrobin@chromium.org>
Reviewed-by: default avatarEric Noyau <noyau@chromium.org>
Commit-Queue: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593520}
parent 1d64ee16
......@@ -158,7 +158,7 @@
#include "ios/web/public/webui/web_ui_ios_controller_factory.h"
#include "mojo/core/embedder/embedder.h"
#import "net/base/mac/url_conversions.h"
#include "net/url_request/url_request_context.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
......@@ -1054,12 +1054,12 @@ enum class ShowTabSwitcherSnapshotResult {
[[DeferredInitializationRunner sharedInstance]
enqueueBlockNamed:kSendInstallPingIfNecessary
block:^{
net::URLRequestContextGetter* context =
_mainBrowserState->GetRequestContext();
auto URLLoaderFactory =
_mainBrowserState->GetSharedURLLoaderFactory();
bool is_first_run = FirstRun::IsChromeFirstRun();
ios::GetChromeBrowserProvider()
->GetAppDistributionProvider()
->ScheduleDistributionNotifications(context,
->ScheduleDistributionNotifications(URLLoaderFactory,
is_first_run);
InitializeFirebase(is_first_run);
}];
......
......@@ -13,7 +13,7 @@
namespace network {
class SharedURLLoaderFactory;
}
} // namespace network
// Delegate protocol for RetryableURLFetcher object.
@protocol RetryableURLFetcherDelegate<NSObject>
......
......@@ -8,10 +8,11 @@
#include <string>
#include "base/macros.h"
#include "base/memory/scoped_refptr.h"
namespace net {
class URLRequestContextGetter;
}
namespace network {
class SharedURLLoaderFactory;
} // namespace network
class AppDistributionProvider {
public:
......@@ -23,7 +24,7 @@ class AppDistributionProvider {
// Schedules distribution notifications to be sent using the given |context|.
virtual void ScheduleDistributionNotifications(
net::URLRequestContextGetter* context,
scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory,
bool is_first_run);
// Cancels any pending distribution notifications.
......
......@@ -17,7 +17,7 @@ std::string AppDistributionProvider::GetDistributionBrandCode() {
}
void AppDistributionProvider::ScheduleDistributionNotifications(
net::URLRequestContextGetter* context,
scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory,
bool is_first_run) {}
void AppDistributionProvider::CancelDistributionNotifications() {}
......@@ -5,9 +5,15 @@
#ifndef IOS_PUBLIC_PROVIDER_CHROME_BROWSER_DISTRIBUTION_TEST_APP_DISTRIBUTION_PROVIDER_H_
#define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_DISTRIBUTION_TEST_APP_DISTRIBUTION_PROVIDER_H_
#include "base/macros.h"
#import "ios/public/provider/chrome/browser/distribution/app_distribution_provider.h"
#include "base/macros.h"
#include "base/memory/scoped_refptr.h"
namespace network {
class SharedURLLoaderFactory;
} // namespace network
class TestAppDistributionProvider : public AppDistributionProvider {
public:
TestAppDistributionProvider();
......@@ -15,8 +21,9 @@ class TestAppDistributionProvider : public AppDistributionProvider {
// AppDistributionProvider.
std::string GetDistributionBrandCode() override;
void ScheduleDistributionNotifications(net::URLRequestContextGetter* context,
bool is_first_run) override;
void ScheduleDistributionNotifications(
scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory,
bool is_first_run) override;
void CancelDistributionNotifications() override;
private:
......
......@@ -17,7 +17,7 @@ std::string TestAppDistributionProvider::GetDistributionBrandCode() {
}
void TestAppDistributionProvider::ScheduleDistributionNotifications(
net::URLRequestContextGetter* context,
scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory,
bool is_first_run) {}
void TestAppDistributionProvider::CancelDistributionNotifications() {}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment