Skip to content

Commit

Permalink
merge fix
Browse files Browse the repository at this point in the history
  • Loading branch information
petemill committed Feb 28, 2024
1 parent a968320 commit 4845e53
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions components/ai_chat/content/browser/page_content_fetcher.cc
Expand Up @@ -131,9 +131,7 @@ class PageContentFetcher {

void StartGithub(
GURL patch_url,
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
FetchPageContentCallback callback) {
url_loader_factory_ = url_loader_factory;
auto request = std::make_unique<network::ResourceRequest>();
request->url = patch_url;
request->load_flags = net::LOAD_DO_NOT_SAVE_COOKIES;
Expand Down Expand Up @@ -502,24 +500,23 @@ void FetchPageContent(content::WebContents* web_contents,
}
}
#endif
auto* fetcher = new PageContentFetcher();
auto* loader = url_loader_factory_for_test.get()
? url_loader_factory_for_test.get()
: web_contents->GetBrowserContext()
->GetDefaultStoragePartition()
->GetURLLoaderFactoryForBrowserProcess()
.get();
auto* fetcher = new PageContentFetcher(loader);
auto patch_url = GetGithubPatchURLForPRURL(url);
if (patch_url) {
fetcher->StartGithub(patch_url.value(), loader, std::move(callback));
fetcher->StartGithub(patch_url.value(), std::move(callback));
return;
}

mojo::Remote<mojom::PageContentExtractor> extractor;
// GetRemoteInterfaces() cannot be null if the render frame is created.
primary_rfh->GetRemoteInterfaces()->GetInterface(
extractor.BindNewPipeAndPassReceiver());
auto* fetcher = new PageContentFetcher(loader);
fetcher->Start(std::move(extractor), invalidation_token, std::move(callback));
}

Expand Down

0 comments on commit 4845e53

Please sign in to comment.