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

Side by Side Diff: runtime/vm/isolate.cc

Issue 1154673004: Add "checked" parameter to Isolate.spawnUri. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add test. 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/isolate.h" 5 #include "vm/isolate.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "platform/json.h" 9 #include "platform/json.h"
10 #include "vm/code_observers.h" 10 #include "vm/code_observers.h"
(...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after
1804 parent_port_(parent_port), 1804 parent_port_(parent_port),
1805 script_url_(NULL), 1805 script_url_(NULL),
1806 package_root_(NULL), 1806 package_root_(NULL),
1807 library_url_(NULL), 1807 library_url_(NULL),
1808 class_name_(NULL), 1808 class_name_(NULL),
1809 function_name_(NULL), 1809 function_name_(NULL),
1810 serialized_args_(NULL), 1810 serialized_args_(NULL),
1811 serialized_args_len_(0), 1811 serialized_args_len_(0),
1812 serialized_message_(NULL), 1812 serialized_message_(NULL),
1813 serialized_message_len_(0), 1813 serialized_message_len_(0),
1814 paused_(paused) { 1814 paused_(paused),
1815 checked_(false) {
1815 script_url_ = NULL; 1816 script_url_ = NULL;
1816 const Class& cls = Class::Handle(func.Owner()); 1817 const Class& cls = Class::Handle(func.Owner());
1817 const Library& lib = Library::Handle(cls.library()); 1818 const Library& lib = Library::Handle(cls.library());
1818 const String& lib_url = String::Handle(lib.url()); 1819 const String& lib_url = String::Handle(lib.url());
1819 library_url_ = strdup(lib_url.ToCString()); 1820 library_url_ = strdup(lib_url.ToCString());
1820 1821
1821 const String& func_name = String::Handle(func.name()); 1822 const String& func_name = String::Handle(func.name());
1822 function_name_ = strdup(func_name.ToCString()); 1823 function_name_ = strdup(func_name.ToCString());
1823 if (!cls.IsTopLevel()) { 1824 if (!cls.IsTopLevel()) {
1824 const String& class_name = String::Handle(cls.Name()); 1825 const String& class_name = String::Handle(cls.Name());
1825 class_name_ = strdup(class_name.ToCString()); 1826 class_name_ = strdup(class_name.ToCString());
1826 } 1827 }
1827 bool can_send_any_object = true; 1828 bool can_send_any_object = true;
1828 SerializeObject(message, 1829 SerializeObject(message,
1829 &serialized_message_, 1830 &serialized_message_,
1830 &serialized_message_len_, 1831 &serialized_message_len_,
1831 can_send_any_object); 1832 can_send_any_object);
1832 } 1833 }
1833 1834
1834 1835
1835 IsolateSpawnState::IsolateSpawnState(Dart_Port parent_port, 1836 IsolateSpawnState::IsolateSpawnState(Dart_Port parent_port,
1836 const char* script_url, 1837 const char* script_url,
1837 const char* package_root, 1838 const char* package_root,
1838 const Instance& args, 1839 const Instance& args,
1839 const Instance& message, 1840 const Instance& message,
1840 bool paused) 1841 bool paused,
1842 bool checked)
1841 : isolate_(NULL), 1843 : isolate_(NULL),
1842 parent_port_(parent_port), 1844 parent_port_(parent_port),
1843 package_root_(NULL), 1845 package_root_(NULL),
1844 library_url_(NULL), 1846 library_url_(NULL),
1845 class_name_(NULL), 1847 class_name_(NULL),
1846 function_name_(NULL), 1848 function_name_(NULL),
1847 serialized_args_(NULL), 1849 serialized_args_(NULL),
1848 serialized_args_len_(0), 1850 serialized_args_len_(0),
1849 serialized_message_(NULL), 1851 serialized_message_(NULL),
1850 serialized_message_len_(0), 1852 serialized_message_len_(0),
1851 paused_(paused) { 1853 paused_(paused),
1854 checked_(checked) {
1852 script_url_ = strdup(script_url); 1855 script_url_ = strdup(script_url);
1853 if (package_root != NULL) { 1856 if (package_root != NULL) {
1854 package_root_ = strdup(package_root); 1857 package_root_ = strdup(package_root);
1855 } 1858 }
1856 library_url_ = NULL; 1859 library_url_ = NULL;
1857 function_name_ = strdup("main"); 1860 function_name_ = strdup("main");
1858 bool can_send_any_object = false; 1861 bool can_send_any_object = false;
1859 SerializeObject(args, 1862 SerializeObject(args,
1860 &serialized_args_, 1863 &serialized_args_,
1861 &serialized_args_len_, 1864 &serialized_args_len_,
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
1957 serialized_message_, serialized_message_len_); 1960 serialized_message_, serialized_message_len_);
1958 } 1961 }
1959 1962
1960 1963
1961 void IsolateSpawnState::Cleanup() { 1964 void IsolateSpawnState::Cleanup() {
1962 SwitchIsolateScope switch_scope(I); 1965 SwitchIsolateScope switch_scope(I);
1963 Dart::ShutdownIsolate(); 1966 Dart::ShutdownIsolate();
1964 } 1967 }
1965 1968
1966 } // namespace dart 1969 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698