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

Side by Side Diff: sky/viewer/dart_library_provider_impl.cc

Issue 1203143004: Make it possible to run Sky apps offline (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: gn check 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/viewer/dart_library_provider_impl.h ('k') | sky/viewer/document_view.h » ('j') | 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 2015 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/viewer/dart_library_provider_impl.h"
6
7 namespace sky {
8
9 DartLibraryProviderImpl::PrefetchedLibrary::PrefetchedLibrary() {
10 }
11
12 DartLibraryProviderImpl::PrefetchedLibrary::~PrefetchedLibrary() {
13 }
14
15 DartLibraryProviderImpl::DartLibraryProviderImpl(
16 mojo::NetworkService* network_service,
17 scoped_ptr<PrefetchedLibrary> prefetched)
18 : shell::DartLibraryProviderNetwork(network_service),
19 prefetched_library_(prefetched.Pass()) {
20 }
21
22 DartLibraryProviderImpl::~DartLibraryProviderImpl() {
23 }
24
25 void DartLibraryProviderImpl::GetLibraryAsStream(
26 const String& name,
27 blink::DataPipeConsumerCallback callback) {
28 if (prefetched_library_ && prefetched_library_->name == name) {
29 mojo::ScopedDataPipeConsumerHandle pipe = prefetched_library_->pipe.Pass();
30 prefetched_library_ = nullptr;
31 callback.Run(pipe.Pass());
32 return;
33 }
34
35 shell::DartLibraryProviderNetwork::GetLibraryAsStream(name, callback);
36 }
37
38 } // namespace sky
OLDNEW
« no previous file with comments | « sky/viewer/dart_library_provider_impl.h ('k') | sky/viewer/document_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698