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

Unified Diff: components/html_viewer/html_viewer.cc

Issue 1161463004: Move URL Loader creation to a separate factory object. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 6 months 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 | « components/html_viewer/blink_platform_impl.cc ('k') | components/html_viewer/web_url_loader_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/html_viewer/html_viewer.cc
diff --git a/components/html_viewer/html_viewer.cc b/components/html_viewer/html_viewer.cc
index fe82f8152e2d1878bc3cba9ff19fa5e10afc535e..c8919870fa38b4fe9b42f708eef64b683c419ab3 100644
--- a/components/html_viewer/html_viewer.cc
+++ b/components/html_viewer/html_viewer.cc
@@ -20,6 +20,7 @@
#include "mojo/application/public/interfaces/content_handler.mojom.h"
#include "mojo/common/common_type_converters.h"
#include "mojo/services/network/public/interfaces/network_service.mojom.h"
+#include "mojo/services/network/public/interfaces/url_loader_factory.mojom.h"
#include "third_party/WebKit/public/web/WebKit.h"
#include "third_party/mojo/src/mojo/public/c/system/main.h"
#include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h"
@@ -72,7 +73,10 @@ class HTMLDocumentApplicationDelegate : public mojo::ApplicationDelegate {
void Initialize(mojo::ApplicationImpl* app) override {
mojo::URLRequestPtr request(mojo::URLRequest::New());
request->url = mojo::String::From("mojo:network_service");
- app_.ConnectToService(request.Pass(), (&network_service_));
+ mojo::ApplicationConnection* connection =
+ app_.ConnectToApplication(request.Pass());
+ connection->ConnectToService(&network_service_);
+ connection->ConnectToService(&url_loader_factory_);
}
bool ConfigureIncomingConnection(
mojo::ApplicationConnection* connection) override {
@@ -80,7 +84,7 @@ class HTMLDocumentApplicationDelegate : public mojo::ApplicationDelegate {
OnResponseReceived(URLLoaderPtr(), connection, initial_response_.Pass());
} else {
URLLoaderPtr loader;
- network_service_->CreateURLLoader(GetProxy(&loader));
+ url_loader_factory_->CreateURLLoader(GetProxy(&loader));
mojo::URLRequestPtr request(mojo::URLRequest::New());
request->url = url_;
request->auto_follow_redirects = true;
@@ -112,6 +116,7 @@ class HTMLDocumentApplicationDelegate : public mojo::ApplicationDelegate {
scoped_ptr<mojo::AppRefCount> parent_app_refcount_;
const String url_;
mojo::NetworkServicePtr network_service_;
+ mojo::URLLoaderFactoryPtr url_loader_factory_;
URLResponsePtr initial_response_;
Setup* setup_;
« no previous file with comments | « components/html_viewer/blink_platform_impl.cc ('k') | components/html_viewer/web_url_loader_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698