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

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

Issue 1151743002: Decrease Dart binary size by 1.7MB (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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 | « runtime/bin/vmservice/resources.dart ('k') | runtime/tools/create_resources.py » ('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) 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 "bin/vmservice_impl.h" 5 #include "bin/vmservice_impl.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 8
9 #include "bin/builtin.h" 9 #include "bin/builtin.h"
10 #include "bin/dartutils.h" 10 #include "bin/dartutils.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 &data_list_buffer_length); 311 &data_list_buffer_length);
312 RETURN_ERROR_HANDLE(result); 312 RETURN_ERROR_HANDLE(result);
313 ASSERT(data_buffer_length == data_list_buffer_length); 313 ASSERT(data_buffer_length == data_list_buffer_length);
314 ASSERT(data_list_buffer != NULL); 314 ASSERT(data_list_buffer != NULL);
315 ASSERT(type = Dart_TypedData_kUint8); 315 ASSERT(type = Dart_TypedData_kUint8);
316 memmove(data_list_buffer, &data_buffer[0], data_buffer_length); 316 memmove(data_list_buffer, &data_buffer[0], data_buffer_length);
317 result = Dart_TypedDataReleaseData(data_list); 317 result = Dart_TypedDataReleaseData(data_list);
318 RETURN_ERROR_HANDLE(result); 318 RETURN_ERROR_HANDLE(result);
319 319
320 // Make invoke call. 320 // Make invoke call.
321 const intptr_t kNumArgs = 2; 321 const intptr_t kNumArgs = 3;
322 Dart_Handle args[kNumArgs] = { name, data_list }; 322 Dart_Handle compressed = Dart_True();
323 Dart_Handle args[kNumArgs] = { name, data_list, compressed };
323 result = Dart_Invoke(library, Dart_NewStringFromCString("_addResource"), 324 result = Dart_Invoke(library, Dart_NewStringFromCString("_addResource"),
324 kNumArgs, args); 325 kNumArgs, args);
325 return result; 326 return result;
326 } 327 }
327 328
328 329
329 Dart_Handle VmService::LoadResources(Dart_Handle library) { 330 Dart_Handle VmService::LoadResources(Dart_Handle library) {
330 Dart_Handle result = Dart_Null(); 331 Dart_Handle result = Dart_Null();
331 intptr_t prefixLen = strlen(kLibrarySourceNamePrefix); 332 intptr_t prefixLen = strlen(kLibrarySourceNamePrefix);
332 for (intptr_t i = 0; Resources::Path(i) != NULL; i++) { 333 for (intptr_t i = 0; Resources::Path(i) != NULL; i++) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 Dart_Handle source = GetSource(url_string); 377 Dart_Handle source = GetSource(url_string);
377 if (Dart_IsError(source)) { 378 if (Dart_IsError(source)) {
378 return source; 379 return source;
379 } 380 }
380 return Dart_LoadSource(library, url, source, 0, 0); 381 return Dart_LoadSource(library, url, source, 0, 0);
381 } 382 }
382 383
383 384
384 } // namespace bin 385 } // namespace bin
385 } // namespace dart 386 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/bin/vmservice/resources.dart ('k') | runtime/tools/create_resources.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698