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

Side by Side Diff: tonic/dart_library_provider_network.cc

Issue 1641513004: Update //base to chromium 9659b08ea5a34f889dc4166217f438095ddc10d2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 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 | « tonic/dart_library_provider_files.cc ('k') | tools/android/forwarder2/device_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "tonic/dart_library_provider_network.h" 5 #include "tonic/dart_library_provider_network.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "tonic/dart_converter.h" 9 #include "tonic/dart_converter.h"
10 #include "url/gurl.h" 10 #include "url/gurl.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 void DartLibraryProviderNetwork::GetLibraryAsStream( 75 void DartLibraryProviderNetwork::GetLibraryAsStream(
76 const std::string& name, 76 const std::string& name,
77 DataPipeConsumerCallback callback) { 77 DataPipeConsumerCallback callback) {
78 jobs_.insert(std::unique_ptr<Job>(new Job(this, name, callback))); 78 jobs_.insert(std::unique_ptr<Job>(new Job(this, name, callback)));
79 } 79 }
80 80
81 Dart_Handle DartLibraryProviderNetwork::CanonicalizeURL(Dart_Handle library, 81 Dart_Handle DartLibraryProviderNetwork::CanonicalizeURL(Dart_Handle library,
82 Dart_Handle url) { 82 Dart_Handle url) {
83 std::string string = StdStringFromDart(url); 83 std::string string = StdStringFromDart(url);
84 if (StartsWithASCII(string, "dart:", true)) 84 if (base::StartsWithASCII(string, "dart:", true))
85 return url; 85 return url;
86 // TODO(abarth): The package root should be configurable. 86 // TODO(abarth): The package root should be configurable.
87 if (StartsWithASCII(string, "package:", true)) 87 if (base::StartsWithASCII(string, "package:", true))
88 ReplaceFirstSubstringAfterOffset(&string, 0, "package:", "/packages/"); 88 base::ReplaceFirstSubstringAfterOffset(&string, 0, "package:",
89 "/packages/");
89 GURL library_url(StdStringFromDart(Dart_LibraryUrl(library))); 90 GURL library_url(StdStringFromDart(Dart_LibraryUrl(library)));
90 GURL resolved_url = library_url.Resolve(string); 91 GURL resolved_url = library_url.Resolve(string);
91 return StdStringToDart(resolved_url.spec()); 92 return StdStringToDart(resolved_url.spec());
92 } 93 }
93 94
94 } // namespace tonic 95 } // namespace tonic
OLDNEW
« no previous file with comments | « tonic/dart_library_provider_files.cc ('k') | tools/android/forwarder2/device_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698