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

Side by Side Diff: sky/engine/core/script/dart_controller.cc

Issue 1237973004: Port more String and HashMap usages (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 | « services/sky/document_view.cc ('k') | sky/engine/tonic/dart_exception_factory.h » ('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 "sky/engine/core/script/dart_controller.h" 5 #include "sky/engine/core/script/dart_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 void DartController::RunFromLibrary(const String& name, 109 void DartController::RunFromLibrary(const String& name,
110 DartLibraryProvider* library_provider) { 110 DartLibraryProvider* library_provider) {
111 DartState::Scope scope(dart_state()); 111 DartState::Scope scope(dart_state());
112 CreateEmptyRootLibraryIfNeeded(); 112 CreateEmptyRootLibraryIfNeeded();
113 113
114 DartLibraryLoader& loader = dart_state()->library_loader(); 114 DartLibraryLoader& loader = dart_state()->library_loader();
115 loader.set_library_provider(library_provider); 115 loader.set_library_provider(library_provider);
116 116
117 DartDependencyCatcher dependency_catcher(loader); 117 DartDependencyCatcher dependency_catcher(loader);
118 loader.LoadLibrary(name); 118 loader.LoadLibrary(name.toUTF8());
119 loader.WaitForDependencies(dependency_catcher.dependencies(), 119 loader.WaitForDependencies(dependency_catcher.dependencies(),
120 base::Bind(&DartController::DidLoadMainLibrary, 120 base::Bind(&DartController::DidLoadMainLibrary,
121 weak_factory_.GetWeakPtr(), name)); 121 weak_factory_.GetWeakPtr(), name));
122 } 122 }
123 123
124 void DartController::CreateIsolateFor(PassOwnPtr<DOMDartState> state) { 124 void DartController::CreateIsolateFor(PassOwnPtr<DOMDartState> state) {
125 CHECK(kDartIsolateSnapshotBuffer); 125 CHECK(kDartIsolateSnapshotBuffer);
126 char* error = nullptr; 126 char* error = nullptr;
127 dom_dart_state_ = state; 127 dom_dart_state_ = state;
128 Dart_Isolate isolate = Dart_CreateIsolate( 128 Dart_Isolate isolate = Dart_CreateIsolate(
(...skipping 24 matching lines...) Expand all
153 } 153 }
154 154
155 void DartController::InstallView(View* view) { 155 void DartController::InstallView(View* view) {
156 DartIsolateScope isolate_scope(dart_state()->isolate()); 156 DartIsolateScope isolate_scope(dart_state()->isolate());
157 DartApiScope dart_api_scope; 157 DartApiScope dart_api_scope;
158 158
159 builtin_sky_->InstallView(view); 159 builtin_sky_->InstallView(view);
160 } 160 }
161 161
162 } // namespace blink 162 } // namespace blink
OLDNEW
« no previous file with comments | « services/sky/document_view.cc ('k') | sky/engine/tonic/dart_exception_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698