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

Side by Side Diff: sky/engine/core/app/AbstractModule.cpp

Issue 1223783002: Remove sky/engine/core/app (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/core/app/AbstractModule.h ('k') | sky/engine/core/app/Application.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 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/core/app/AbstractModule.h"
6
7 #include "sky/engine/core/app/Module.h"
8
9 namespace blink {
10
11 AbstractModule::AbstractModule(ExecutionContext* context,
12 PassRefPtr<Document> document,
13 const String& url)
14 : ContextLifecycleObserver(context),
15 document_(document),
16 url_(url) {
17 document_->setModule(this);
18 }
19
20 AbstractModule::~AbstractModule() {
21 document_->setModule(nullptr);
22 }
23
24 void AbstractModule::AddLibrary(RefPtr<DartValue> library,
25 TextPosition position) {
26 libraries_.append(LibraryEntry(library, position));
27 }
28
29 String AbstractModule::UrlForLibraryAt(TextPosition position) {
30 // TODO(eseidel): This could produce invalid urls?
31 // TODO(abarth): Mangle these library names to they're not predictable.
32 // Otherwise you could 'import url.sky' in dart and it could magically work!
33 int line = position.m_line.zeroBasedInt();
34 int column = position.m_column.zeroBasedInt();
35 return url() + String::format("#l%d,c%d", line, column);
36 }
37
38 ExecutionContext* AbstractModule::executionContext() const {
39 return ContextLifecycleObserver::executionContext();
40 }
41
42 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/app/AbstractModule.h ('k') | sky/engine/core/app/Application.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698