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

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 defined(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
187 #if defined(ANDROID)
188 char forwardingProperty[PROP_VALUE_MAX];
189 int propLen =
190 __system_property_get("DART_FORWARDING_PRINT", &forwardingProperty[0]);
191 const char * const printClosure = (propLen > 0) ?
Anton Muhin 2013/10/24 06:01:50 maybe introduce bool forwardPrint which is platfor
192 "_forwardingPrintClosure" :
193 (isDOMEnabled ? "_printClosure" : "_pureIsolatePrintClosure");
194 #else
182 const char * const printClosure = getenv("DART_FORWARDING_PRINT") ? 195 const char * const printClosure = getenv("DART_FORWARDING_PRINT") ?
183 "_forwardingPrintClosure" : 196 "_forwardingPrintClosure" :
184 (isDOMEnabled ? "_printClosure" : "_pureIsolatePrintClosure"); 197 (isDOMEnabled ? "_printClosure" : "_pureIsolatePrintClosure");
198 #endif
185 copyValue(html, printClosure, "dart:_collection-dev", 0, "_printClosure"); 199 copyValue(html, printClosure, "dart:_collection-dev", 0, "_printClosure");
186 copyValue(html, isDOMEnabled ? "_timerFactoryClosure" : "_pureIsolateTimerFa ctoryClosure", "dart:async", "_TimerFactory", "_factory"); 200 copyValue(html, isDOMEnabled ? "_timerFactoryClosure" : "_pureIsolateTimerFa ctoryClosure", "dart:async", "_TimerFactory", "_factory");
187 copyValue(html, isDOMEnabled ? "_scheduleImmediateClosure" : "_pureIsolateSc heduleImmediateClosure", "dart:async", "_ScheduleImmediate", "_closure"); 201 copyValue(html, isDOMEnabled ? "_scheduleImmediateClosure" : "_pureIsolateSc heduleImmediateClosure", "dart:async", "_ScheduleImmediate", "_closure");
188 202
189 if (isDOMEnabled) { 203 if (isDOMEnabled) {
190 // Create strongly reachable document wrapper. Document wrapper acts as a 204 // 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 205 // 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 206 // this persistent handle explicitly because we will shutdown the isolat e on
193 // navigation. 207 // navigation.
194 Dart_Handle localHandle = DartDocument::toDart(document); 208 Dart_Handle localHandle = DartDocument::toDart(document);
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 libraryIdMap->set(libraryIdKey, scriptState); 933 libraryIdMap->set(libraryIdKey, scriptState);
920 } else { 934 } else {
921 scriptState = libraryIter->value; 935 scriptState = libraryIter->value;
922 ASSERT(scriptState); 936 ASSERT(scriptState);
923 } 937 }
924 result.append(scriptState); 938 result.append(scriptState);
925 } 939 }
926 } 940 }
927 941
928 } 942 }
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