Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(550)

Unified Diff: content/child/web_url_loader_impl.cc

Issue 2449933003: Use Associated interfaces for mojo-loading (Closed)
Patch Set: fix Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/child/web_url_loader_impl.h ('k') | content/child/web_url_loader_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/web_url_loader_impl.cc
diff --git a/content/child/web_url_loader_impl.cc b/content/child/web_url_loader_impl.cc
index f2b95cc2b35134dc892932c7c375204936b6b705..1b211972bbc467cb2b6924ed7b11b06494cbd3a5 100644
--- a/content/child/web_url_loader_impl.cc
+++ b/content/child/web_url_loader_impl.cc
@@ -38,6 +38,7 @@
#include "content/public/child/fixed_received_data.h"
#include "content/public/child/request_peer.h"
#include "content/public/common/browser_side_navigation_policy.h"
+#include "mojo/public/cpp/bindings/associated_group.h"
#include "net/base/data_url.h"
#include "net/base/filename_util.h"
#include "net/base/net_errors.h"
@@ -362,7 +363,8 @@ class WebURLLoaderImpl::Context : public base::RefCounted<Context> {
Context(WebURLLoaderImpl* loader,
ResourceDispatcher* resource_dispatcher,
- mojom::URLLoaderFactory* factory);
+ mojom::URLLoaderFactory* factory,
+ mojo::AssociatedGroup* associated_group);
WebURLLoaderClient* client() const { return client_; }
void set_client(WebURLLoaderClient* client) { client_ = client; }
@@ -411,7 +413,9 @@ class WebURLLoaderImpl::Context : public base::RefCounted<Context> {
DeferState defers_loading_;
int request_id_;
+ // These are owned by the Blink::Platform singleton.
mojom::URLLoaderFactory* url_loader_factory_;
+ mojo::AssociatedGroup* associated_group_;
};
// A thin wrapper class for Context to ensure its lifetime while it is
@@ -444,14 +448,16 @@ class WebURLLoaderImpl::RequestPeerImpl : public RequestPeer {
WebURLLoaderImpl::Context::Context(WebURLLoaderImpl* loader,
ResourceDispatcher* resource_dispatcher,
- mojom::URLLoaderFactory* url_loader_factory)
+ mojom::URLLoaderFactory* url_loader_factory,
+ mojo::AssociatedGroup* associated_group)
: loader_(loader),
client_(NULL),
resource_dispatcher_(resource_dispatcher),
task_runner_(base::ThreadTaskRunnerHandle::Get()),
defers_loading_(NOT_DEFERRING),
request_id_(-1),
- url_loader_factory_(url_loader_factory) {}
+ url_loader_factory_(url_loader_factory),
+ associated_group_(associated_group) {}
void WebURLLoaderImpl::Context::Cancel() {
TRACE_EVENT_WITH_FLOW0("loading", "WebURLLoaderImpl::Context::Cancel", this,
@@ -622,7 +628,7 @@ void WebURLLoaderImpl::Context::Start(const WebURLRequest& request,
std::move(resource_request), request.requestorID(), task_runner_,
extra_data->frame_origin(),
base::MakeUnique<WebURLLoaderImpl::RequestPeerImpl>(this),
- request.getLoadingIPCType(), url_loader_factory_);
+ request.getLoadingIPCType(), url_loader_factory_, associated_group_);
if (defers_loading_ != NOT_DEFERRING)
resource_dispatcher_->SetDefersLoading(request_id_, true);
@@ -1007,8 +1013,12 @@ void WebURLLoaderImpl::RequestPeerImpl::OnCompletedRequest(
// WebURLLoaderImpl -----------------------------------------------------------
WebURLLoaderImpl::WebURLLoaderImpl(ResourceDispatcher* resource_dispatcher,
- mojom::URLLoaderFactory* url_loader_factory)
- : context_(new Context(this, resource_dispatcher, url_loader_factory)) {}
+ mojom::URLLoaderFactory* url_loader_factory,
+ mojo::AssociatedGroup* associated_group)
+ : context_(new Context(this,
+ resource_dispatcher,
+ url_loader_factory,
+ associated_group)) {}
WebURLLoaderImpl::~WebURLLoaderImpl() {
cancel();
« no previous file with comments | « content/child/web_url_loader_impl.h ('k') | content/child/web_url_loader_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698