Skip to content

Commit

Permalink
Merge pull request #4763 from brave/issue_8419_wayback
Browse files Browse the repository at this point in the history
Make wayback url request to use per-profile SharedLoaderFactory
  • Loading branch information
pilgrim-brave authored Feb 27, 2020
2 parents ba18018 + bf189f1 commit dd241fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
#include "brave/grit/brave_generated_resources.h"
#include "brave/grit/brave_theme_resources.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/themes/theme_properties.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/chrome_typography.h"
#include "components/grit/components_scaled_resources.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
Expand Down Expand Up @@ -55,8 +56,9 @@ BraveWaybackMachineInfoBarContentsView::BraveWaybackMachineInfoBarContentsView(
contents_(contents),
wayback_machine_url_fetcher_(
this,
SystemNetworkContextManager::GetInstance()->
GetSharedURLLoaderFactory()) {
content::BrowserContext::GetDefaultStoragePartition(
contents->GetBrowserContext())->
GetURLLoaderFactoryForBrowserProcess()) {
SetLayoutManager(std::make_unique<views::FlexLayout>());
InitializeChildren();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "base/json/json_reader.h"
#include "brave/components/brave_wayback_machine/url_constants.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/base/load_flags.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/simple_url_loader.h"
Expand Down Expand Up @@ -58,6 +59,8 @@ void WaybackMachineURLFetcher::Fetch(const GURL& url) {
std::string wayback_fetch_url =
std::string(kWaybackQueryURL) + url.spec();
request->url = GURL(wayback_fetch_url);
request->load_flags =
net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES;
wayback_url_loader_ = network::SimpleURLLoader::Create(
std::move(request), GetNetworkTrafficAnnotationTag());
wayback_url_loader_->DownloadToString(
Expand Down

0 comments on commit dd241fa

Please sign in to comment.