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

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

Issue 1214513003: Remove references into sky/engine/core/fetch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « sky/engine/platform/fetcher/MojoFetcher.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "sky/engine/platform/fetcher/MojoFetcher.h"
6
7 #include "base/bind.h"
8 #include "mojo/services/network/public/interfaces/network_service.mojom.h"
9 #include "sky/engine/platform/weborigin/KURL.h"
10 #include "sky/engine/public/platform/Platform.h"
11
12 namespace blink {
13
14 MojoFetcher::MojoFetcher(Client* client, const KURL& url)
15 : client_(client),
16 weak_factory_(this) {
17 DCHECK(client_);
18
19 mojo::NetworkService* net = Platform::current()->networkService();
20 net->CreateURLLoader(GetProxy(&url_loader_));
21
22 mojo::URLRequestPtr url_request = mojo::URLRequest::New();
23 url_request->url = url.string().toUTF8();
24 url_request->auto_follow_redirects = true;
25 // TODO(rafaelw): Bypass the cache until we can figure out why modified
26 // resources aren't updating within sky.
27 url_request->bypass_cache = true;
28 url_loader_->Start(url_request.Pass(),
29 base::Bind(&MojoFetcher::OnReceivedResponse,
30 weak_factory_.GetWeakPtr()));
31 }
32
33 MojoFetcher::~MojoFetcher() {
34 }
35
36 void MojoFetcher::OnReceivedResponse(mojo::URLResponsePtr response) {
37 client_->OnReceivedResponse(response.Pass());
38 }
39
40 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/platform/fetcher/MojoFetcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698