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

Unified Diff: sky/engine/public/sky/sky_view.cc

Issue 1197133004: Add support for snapshot loading to Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Fix mirror-system.sky Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/script/dart_snapshot_loader.cc ('k') | sky/engine/web/WebViewImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/public/sky/sky_view.cc
diff --git a/sky/engine/public/sky/sky_view.cc b/sky/engine/public/sky/sky_view.cc
index d16243f6e7dd8a7323ee5f11f09a53a550d42450..a282fa006144936538fdf0b8fe0457581cfeeac0 100644
--- a/sky/engine/public/sky/sky_view.cc
+++ b/sky/engine/public/sky/sky_view.cc
@@ -47,7 +47,9 @@ void SkyView::SetDisplayMetrics(const SkyDisplayMetrics& metrics) {
data_->view_->setDisplayMetrics(display_metrics_);
}
-void SkyView::Load(const WebURL& url, mojo::URLResponsePtr response) {
+void SkyView::Load(const WebURL& web_url, mojo::URLResponsePtr response) {
+ KURL url = web_url;
+
data_->view_ = View::create(base::Bind(
&SkyView::ScheduleFrame, weak_factory_.GetWeakPtr()));
data_->view_->setDisplayMetrics(display_metrics_);
@@ -63,7 +65,10 @@ void SkyView::Load(const WebURL& url, mojo::URLResponsePtr response) {
client_->DidCreateIsolate(isolate);
}
- dart_controller_->LoadMainLibrary(url, response.Pass());
+ if (url.path().endsWith(".snapshot"))
+ dart_controller_->LoadSnapshot(url, response.Pass());
+ else
+ dart_controller_->LoadMainLibrary(url, response.Pass());
}
void SkyView::BeginFrame(base::TimeTicks frame_time) {
« no previous file with comments | « sky/engine/core/script/dart_snapshot_loader.cc ('k') | sky/engine/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698