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

Side by Side Diff: sky/engine/platform/fetcher/MojoFetcher.cpp

Issue 678683004: HTMLImportLoader should talk directly to mojo::NetworkService (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "platform/fetcher/MojoFetcher.h"
7
8 #include "base/bind.h"
9 #include "mojo/services/public/interfaces/network/network_service.mojom.h"
10 #include "platform/weborigin/KURL.h"
11 #include "public/platform/Platform.h"
12
13 namespace blink {
14
15 MojoFetcher::MojoFetcher(Client* client, const KURL& url)
16 : client_(client),
esprehn 2014/10/24 21:50:12 sigh, the comma at the end is really hard to catch
17 weak_factory_(this) {
18 DCHECK(client_);
19
20 mojo::NetworkService* net = Platform::current()->networkService();
21 net->CreateURLLoader(GetProxy(&url_loader_));
22
23 mojo::URLRequestPtr url_request = mojo::URLRequest::New();
24 url_request->url = url.string().toUTF8();
25 url_request->auto_follow_redirects = true;
26 url_loader_->Start(url_request.Pass(),
27 base::Bind(&MojoFetcher::OnReceivedResponse,
28 weak_factory_.GetWeakPtr()));
29 }
30
31 MojoFetcher::~MojoFetcher() {
32 }
33
34 void MojoFetcher::OnReceivedResponse(mojo::URLResponsePtr response) {
35 client_->OnReceivedResponse(response.Pass());
36 }
37
38 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698