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

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

Issue 23540002: Get rid of some downcasts (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 | runtime/bin/process.cc » ('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/dartutils.h" 5 #include "bin/dartutils.h"
6 #include "bin/filter.h" 6 #include "bin/filter.h"
7 #include "bin/io_buffer.h" 7 #include "bin/io_buffer.h"
8 8
9 #include "include/dart_api.h" 9 #include "include/dart_api.h"
10 10
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 if (Dart_IsError(result)) { 75 if (Dart_IsError(result)) {
76 delete filter; 76 delete filter;
77 Dart_PropagateError(result); 77 Dart_PropagateError(result);
78 } 78 }
79 } 79 }
80 80
81 void FUNCTION_NAME(Filter_Process)(Dart_NativeArguments args) { 81 void FUNCTION_NAME(Filter_Process)(Dart_NativeArguments args) {
82 Dart_Handle filter_obj = Dart_GetNativeArgument(args, 0); 82 Dart_Handle filter_obj = Dart_GetNativeArgument(args, 0);
83 Filter* filter = GetFilter(filter_obj); 83 Filter* filter = GetFilter(filter_obj);
84 Dart_Handle data_obj = Dart_GetNativeArgument(args, 1); 84 Dart_Handle data_obj = Dart_GetNativeArgument(args, 1);
85 intptr_t start = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 2)); 85 intptr_t start = DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 2));
86 intptr_t end = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 3)); 86 intptr_t end = DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 3));
87 intptr_t chunk_length = end - start; 87 intptr_t chunk_length = end - start;
88 intptr_t length; 88 intptr_t length;
89 Dart_TypedData_Type type; 89 Dart_TypedData_Type type;
90 uint8_t* buffer = NULL; 90 uint8_t* buffer = NULL;
91 Dart_Handle result = Dart_TypedDataAcquireData( 91 Dart_Handle result = Dart_TypedDataAcquireData(
92 data_obj, &type, reinterpret_cast<void**>(&buffer), &length); 92 data_obj, &type, reinterpret_cast<void**>(&buffer), &length);
93 if (!Dart_IsError(result)) { 93 if (!Dart_IsError(result)) {
94 uint8_t* zlib_buffer = new uint8_t[chunk_length]; 94 uint8_t* zlib_buffer = new uint8_t[chunk_length];
95 if (zlib_buffer == NULL) { 95 if (zlib_buffer == NULL) {
96 Dart_TypedDataReleaseData(data_obj); 96 Dart_TypedDataReleaseData(data_obj);
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 case Z_STREAM_ERROR: 304 case Z_STREAM_ERROR:
305 // An error occoured. 305 // An error occoured.
306 delete[] current_buffer_; 306 delete[] current_buffer_;
307 current_buffer_ = NULL; 307 current_buffer_ = NULL;
308 return -1; 308 return -1;
309 } 309 }
310 } 310 }
311 311
312 } // namespace bin 312 } // namespace bin
313 } // namespace dart 313 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698