Make sky/tools/packager build on Mac
This CL removes all C++11 library features from sky/tools/packager because we can't use C++11 library features on Mac. R=eseidel@chromium.org Review URL: https://codereview.chromium.org/1198313004.
This commit is contained in:
@@ -14,16 +14,12 @@ group("sky") {
|
||||
"//sky/engine/web:sky_unittests",
|
||||
"//sky/engine/wtf:unittests",
|
||||
"//sky/tools/imagediff",
|
||||
"//sky/tools/packager($host_toolchain)",
|
||||
"//sky/tools/tester",
|
||||
"//sky/viewer",
|
||||
":sky_apk",
|
||||
]
|
||||
|
||||
# Mac's host toolchain doesn't support C++11 and can't build the packager.
|
||||
if (host_os != "mac") {
|
||||
deps += [ "//sky/tools/packager($host_toolchain)" ]
|
||||
}
|
||||
|
||||
if (is_android) {
|
||||
deps += [ "//sky/apk/stocks" ]
|
||||
}
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
#include "sky/tools/packager/loader.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
@@ -44,7 +42,7 @@ base::FilePath SimplifyPath(const base::FilePath& path) {
|
||||
|
||||
class Loader {
|
||||
public:
|
||||
Loader(base::FilePath package_root);
|
||||
Loader(const base::FilePath& package_root);
|
||||
|
||||
std::string CanonicalizePackageURL(std::string url);
|
||||
Dart_Handle CanonicalizeURL(Dart_Handle library, Dart_Handle url);
|
||||
@@ -57,8 +55,8 @@ class Loader {
|
||||
DISALLOW_COPY_AND_ASSIGN(Loader);
|
||||
};
|
||||
|
||||
Loader::Loader(base::FilePath package_root)
|
||||
: package_root_(std::move(package_root)) {
|
||||
Loader::Loader(const base::FilePath& package_root)
|
||||
: package_root_(package_root) {
|
||||
}
|
||||
|
||||
std::string Loader::CanonicalizePackageURL(std::string url) {
|
||||
@@ -72,7 +70,7 @@ Dart_Handle Loader::CanonicalizeURL(Dart_Handle library, Dart_Handle url) {
|
||||
if (StartsWithASCII(string, "dart:", true))
|
||||
return url;
|
||||
if (StartsWithASCII(string, "package:", true))
|
||||
return StringToDart(CanonicalizePackageURL(std::move(string)));
|
||||
return StringToDart(CanonicalizePackageURL(string));
|
||||
base::FilePath base_path(StringFromDart(Dart_LibraryUrl(library)));
|
||||
base::FilePath resolved_path = base_path.DirName().Append(string);
|
||||
base::FilePath normalized_path = SimplifyPath(resolved_path);
|
||||
@@ -132,7 +130,7 @@ void LoadSkyInternals() {
|
||||
LogIfError(Dart_LoadLibrary(library_name, StringToDart(Fetch(url)), 0, 0));
|
||||
}
|
||||
|
||||
void LoadScript(std::string url) {
|
||||
void LoadScript(const std::string& url) {
|
||||
LogIfError(
|
||||
Dart_LoadScript(StringToDart(url), StringToDart(Fetch(url)), 0, 0));
|
||||
}
|
||||
|
||||
@@ -13,6 +13,6 @@ Dart_Handle HandleLibraryTag(Dart_LibraryTag tag,
|
||||
Dart_Handle library,
|
||||
Dart_Handle url);
|
||||
void LoadSkyInternals();
|
||||
void LoadScript(std::string url);
|
||||
void LoadScript(const std::string& url);
|
||||
|
||||
#endif // SKY_TOOLS_PACKAGER_LOADER_H_
|
||||
|
||||
@@ -26,7 +26,7 @@ void InitDartVM() {
|
||||
Dart_Isolate CreateDartIsolate() {
|
||||
CHECK(blink::kDartIsolateSnapshotBuffer);
|
||||
char* error = nullptr;
|
||||
Dart_Isolate isolate = Dart_CreateIsolate("http://example.com", "main",
|
||||
Dart_Isolate isolate = Dart_CreateIsolate("dart:snapshot", "main",
|
||||
blink::kDartIsolateSnapshotBuffer,
|
||||
nullptr, nullptr, &error);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user