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 @@ ...@@ -158,7 +158,7 @@
#include "ios/web/public/webui/web_ui_ios_controller_factory.h" #include "ios/web/public/webui/web_ui_ios_controller_factory.h"
#include "mojo/core/embedder/embedder.h" #include "mojo/core/embedder/embedder.h"
#import "net/base/mac/url_conversions.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) #if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support." #error "This file requires ARC support."
...@@ -1054,12 +1054,12 @@ enum class ShowTabSwitcherSnapshotResult { ...@@ -1054,12 +1054,12 @@ enum class ShowTabSwitcherSnapshotResult {
[[DeferredInitializationRunner sharedInstance] [[DeferredInitializationRunner sharedInstance]
enqueueBlockNamed:kSendInstallPingIfNecessary enqueueBlockNamed:kSendInstallPingIfNecessary
block:^{ block:^{
net::URLRequestContextGetter* context = auto URLLoaderFactory =
_mainBrowserState->GetRequestContext(); _mainBrowserState->GetSharedURLLoaderFactory();
bool is_first_run = FirstRun::IsChromeFirstRun(); bool is_first_run = FirstRun::IsChromeFirstRun();
ios::GetChromeBrowserProvider() ios::GetChromeBrowserProvider()
->GetAppDistributionProvider() ->GetAppDistributionProvider()
->ScheduleDistributionNotifications(context, ->ScheduleDistributionNotifications(URLLoaderFactory,
is_first_run); is_first_run);
InitializeFirebase(is_first_run); InitializeFirebase(is_first_run);
}]; }];
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
namespace network { namespace network {
class SharedURLLoaderFactory; class SharedURLLoaderFactory;
} } // namespace network
// Delegate protocol for RetryableURLFetcher object. // Delegate protocol for RetryableURLFetcher object.
@protocol RetryableURLFetcherDelegate<NSObject> @protocol RetryableURLFetcherDelegate<NSObject>
......
...@@ -8,10 +8,11 @@ ...@@ -8,10 +8,11 @@
#include <string> #include <string>
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/scoped_refptr.h"
namespace net { namespace network {
class URLRequestContextGetter; class SharedURLLoaderFactory;
} } // namespace network
class AppDistributionProvider { class AppDistributionProvider {
public: public:
...@@ -23,7 +24,7 @@ class AppDistributionProvider { ...@@ -23,7 +24,7 @@ class AppDistributionProvider {
// Schedules distribution notifications to be sent using the given |context|. // Schedules distribution notifications to be sent using the given |context|.
virtual void ScheduleDistributionNotifications( virtual void ScheduleDistributionNotifications(
net::URLRequestContextGetter* context, scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory,
bool is_first_run); bool is_first_run);
// Cancels any pending distribution notifications. // Cancels any pending distribution notifications.
......
...@@ -17,7 +17,7 @@ std::string AppDistributionProvider::GetDistributionBrandCode() { ...@@ -17,7 +17,7 @@ std::string AppDistributionProvider::GetDistributionBrandCode() {
} }
void AppDistributionProvider::ScheduleDistributionNotifications( void AppDistributionProvider::ScheduleDistributionNotifications(
net::URLRequestContextGetter* context, scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory,
bool is_first_run) {} bool is_first_run) {}
void AppDistributionProvider::CancelDistributionNotifications() {} void AppDistributionProvider::CancelDistributionNotifications() {}
...@@ -5,9 +5,15 @@ ...@@ -5,9 +5,15 @@
#ifndef IOS_PUBLIC_PROVIDER_CHROME_BROWSER_DISTRIBUTION_TEST_APP_DISTRIBUTION_PROVIDER_H_ #ifndef IOS_PUBLIC_PROVIDER_CHROME_BROWSER_DISTRIBUTION_TEST_APP_DISTRIBUTION_PROVIDER_H_
#define 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" #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 { class TestAppDistributionProvider : public AppDistributionProvider {
public: public:
TestAppDistributionProvider(); TestAppDistributionProvider();
...@@ -15,8 +21,9 @@ class TestAppDistributionProvider : public AppDistributionProvider { ...@@ -15,8 +21,9 @@ class TestAppDistributionProvider : public AppDistributionProvider {
// AppDistributionProvider. // AppDistributionProvider.
std::string GetDistributionBrandCode() override; std::string GetDistributionBrandCode() override;
void ScheduleDistributionNotifications(net::URLRequestContextGetter* context, void ScheduleDistributionNotifications(
bool is_first_run) override; scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory,
bool is_first_run) override;
void CancelDistributionNotifications() override; void CancelDistributionNotifications() override;
private: private:
......
...@@ -17,7 +17,7 @@ std::string TestAppDistributionProvider::GetDistributionBrandCode() { ...@@ -17,7 +17,7 @@ std::string TestAppDistributionProvider::GetDistributionBrandCode() {
} }
void TestAppDistributionProvider::ScheduleDistributionNotifications( void TestAppDistributionProvider::ScheduleDistributionNotifications(
net::URLRequestContextGetter* context, scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory,
bool is_first_run) {} bool is_first_run) {}
void TestAppDistributionProvider::CancelDistributionNotifications() {} 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