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

Side by Side Diff: Source/bindings/dart/DartController.cpp

Issue 38323002: On Android uses system properties instead of environment variables. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit/
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009, Google Inc. 1 // Copyright (c) 2009, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 12 matching lines...) Expand all
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 29
30 #include "config.h" 30 #include "config.h"
31 #include "bindings/dart/DartController.h" 31 #include "bindings/dart/DartController.h"
32 32
33 #if OS(ANDROID)
34 #include <sys/system_properties.h>
35 #endif
36
37
33 #include "DartDocument.h" 38 #include "DartDocument.h"
34 #include "DartWindow.h" 39 #include "DartWindow.h"
35 #include "HTMLNames.h" 40 #include "HTMLNames.h"
36 #include "V8Navigator.h" 41 #include "V8Navigator.h"
37 #include "bindings/dart/DartApplicationLoader.h" 42 #include "bindings/dart/DartApplicationLoader.h"
38 #include "bindings/dart/DartAsyncLoader.h" 43 #include "bindings/dart/DartAsyncLoader.h"
39 #include "bindings/dart/DartDOMData.h" 44 #include "bindings/dart/DartDOMData.h"
40 #include "bindings/dart/DartDOMWrapper.h" 45 #include "bindings/dart/DartDOMWrapper.h"
41 #include "bindings/dart/DartDebugServer.h" 46 #include "bindings/dart/DartDebugServer.h"
42 #include "bindings/dart/DartGCController.h" 47 #include "bindings/dart/DartGCController.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 Dart_Handle core = Dart_LookupLibrary(Dart_NewStringFromCString("dart:core") ); 177 Dart_Handle core = Dart_LookupLibrary(Dart_NewStringFromCString("dart:core") );
173 ASSERT(!Dart_IsError(core)); 178 ASSERT(!Dart_IsError(core));
174 Dart_LibraryImportLibrary(core, html, Dart_Null()); 179 Dart_LibraryImportLibrary(core, html, Dart_Null());
175 domData->setCoreLibrary(Dart_NewPersistentHandle(core)); 180 domData->setCoreLibrary(Dart_NewPersistentHandle(core));
176 181
177 Dart_Handle typedData = Dart_LookupLibrary(Dart_NewStringFromCString("dart:t yped_data")); 182 Dart_Handle typedData = Dart_LookupLibrary(Dart_NewStringFromCString("dart:t yped_data"));
178 ASSERT(!Dart_IsError(typedData)); 183 ASSERT(!Dart_IsError(typedData));
179 domData->setTypedDataLibrary(Dart_NewPersistentHandle(typedData)); 184 domData->setTypedDataLibrary(Dart_NewPersistentHandle(typedData));
180 185
181 // Setup configuration closures 186 // Setup configuration closures
182 const char * const printClosure = getenv("DART_FORWARDING_PRINT") ? 187 #if OS(ANDROID)
188 char forwardingProperty[PROP_VALUE_MAX];
189 int propLen = __system_property_get("DART_FORWARDING_PRINT", &forwardingProp erty[0]);
190 bool forwardPrint = propLen > 0;
191 #else
192 bool forwardPrint = getenv("DART_FORWARDING_PRINT");
193 #endif
194 const char * const printClosure = forwardPrint ?
183 "_forwardingPrintClosure" : 195 "_forwardingPrintClosure" :
184 (isDOMEnabled ? "_printClosure" : "_pureIsolatePrintClosure"); 196 (isDOMEnabled ? "_printClosure" : "_pureIsolatePrintClosure");
185 copyValue(html, printClosure, "dart:_collection-dev", 0, "_printClosure"); 197 copyValue(html, printClosure, "dart:_collection-dev", 0, "_printClosure");
186 copyValue(html, isDOMEnabled ? "_timerFactoryClosure" : "_pureIsolateTimerFa ctoryClosure", "dart:async", "_TimerFactory", "_factory"); 198 copyValue(html, isDOMEnabled ? "_timerFactoryClosure" : "_pureIsolateTimerFa ctoryClosure", "dart:async", "_TimerFactory", "_factory");
187 copyValue(html, isDOMEnabled ? "_scheduleImmediateClosure" : "_pureIsolateSc heduleImmediateClosure", "dart:async", "_ScheduleImmediate", "_closure"); 199 copyValue(html, isDOMEnabled ? "_scheduleImmediateClosure" : "_pureIsolateSc heduleImmediateClosure", "dart:async", "_ScheduleImmediate", "_closure");
188 200
189 if (isDOMEnabled) { 201 if (isDOMEnabled) {
190 // Create strongly reachable document wrapper. Document wrapper acts as a 202 // Create strongly reachable document wrapper. Document wrapper acts as a
191 // retainer for in-document node wrappers group. There is no need to des troy 203 // retainer for in-document node wrappers group. There is no need to des troy
192 // this persistent handle explicitly because we will shutdown the isolat e on 204 // this persistent handle explicitly because we will shutdown the isolat e on
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 Dart_Handle libraryIdHandle = Dart_ListGetAt(libraryIdList, i); 957 Dart_Handle libraryIdHandle = Dart_ListGetAt(libraryIdList, i);
946 Dart_Handle exception = 0; 958 Dart_Handle exception = 0;
947 intptr_t libraryId = DartUtilities::toInteger(libraryIdHandle, exception ); 959 intptr_t libraryId = DartUtilities::toInteger(libraryIdHandle, exception );
948 ASSERT(!exception); 960 ASSERT(!exception);
949 DartScriptState* scriptState = lookupScriptStateFromLibraryIdMap(isolate , v8Context, libraryIdMap, libraryId); 961 DartScriptState* scriptState = lookupScriptStateFromLibraryIdMap(isolate , v8Context, libraryIdMap, libraryId);
950 result.append(scriptState); 962 result.append(scriptState);
951 } 963 }
952 } 964 }
953 965
954 } 966 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698