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

Side by Side Diff: runtime/bin/main.cc

Issue 9034005: Change the behavior of open on files to not truncate by default (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comment.s Created 8 years, 11 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 | « runtime/bin/gen_snapshot.cc ('k') | tests/standalone/src/FileInvalidArgumentsTest.dart » ('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 (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 <stdlib.h> 5 #include <stdlib.h>
6 #include <string.h> 6 #include <string.h>
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include "include/dart_api.h" 9 #include "include/dart_api.h"
10 #include "include/dart_debugger_api.h" 10 #include "include/dart_debugger_api.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 190
191 return Dart_SetStaticField(runtime_options_class, 191 return Dart_SetStaticField(runtime_options_class,
192 native_name, 192 native_name,
193 dart_arguments); 193 dart_arguments);
194 } 194 }
195 195
196 196
197 static void DumpPprofSymbolInfo() { 197 static void DumpPprofSymbolInfo() {
198 if (generate_pprof_symbols_filename != NULL) { 198 if (generate_pprof_symbols_filename != NULL) {
199 Dart_EnterScope(); 199 Dart_EnterScope();
200 File* pprof_file = File::Open(generate_pprof_symbols_filename, true); 200 File* pprof_file =
201 File::Open(generate_pprof_symbols_filename, File::kWriteTruncate);
201 ASSERT(pprof_file != NULL); 202 ASSERT(pprof_file != NULL);
202 void* buffer; 203 void* buffer;
203 int buffer_size; 204 int buffer_size;
204 Dart_GetPprofSymbolInfo(&buffer, &buffer_size); 205 Dart_GetPprofSymbolInfo(&buffer, &buffer_size);
205 if (buffer_size > 0) { 206 if (buffer_size > 0) {
206 ASSERT(buffer != NULL); 207 ASSERT(buffer != NULL);
207 pprof_file->WriteFully(buffer, buffer_size); 208 pprof_file->WriteFully(buffer, buffer_size);
208 } 209 }
209 delete pprof_file; // Closes the file. 210 delete pprof_file; // Closes the file.
210 Dart_ExitScope(); 211 Dart_ExitScope();
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 return 255; // Indicates we encountered an error. 498 return 255; // Indicates we encountered an error.
498 } 499 }
499 free(canonical_script_name); 500 free(canonical_script_name);
500 Dart_ExitScope(); 501 Dart_ExitScope();
501 // Dump symbol information for the profiler. 502 // Dump symbol information for the profiler.
502 DumpPprofSymbolInfo(); 503 DumpPprofSymbolInfo();
503 // Shutdown the isolate. 504 // Shutdown the isolate.
504 Dart_ShutdownIsolate(); 505 Dart_ShutdownIsolate();
505 return 0; 506 return 0;
506 } 507 }
OLDNEW
« no previous file with comments | « runtime/bin/gen_snapshot.cc ('k') | tests/standalone/src/FileInvalidArgumentsTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698