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

Side by Side Diff: Source/WebCore/bindings/dart/custom/DartMessageEventCustom.cpp

Issue 10660025: Cleanup dart to string conversions. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: . Created 8 years, 5 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
OLDNEW
1 // Copyright 2011, Google Inc. 1 // Copyright 2011, 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 DART_UNIMPLEMENTED(); 102 DART_UNIMPLEMENTED();
103 } 103 }
104 104
105 void initMessageEventCallback(Dart_NativeArguments args) 105 void initMessageEventCallback(Dart_NativeArguments args)
106 { 106 {
107 DartApiScope dartApiScope; 107 DartApiScope dartApiScope;
108 Dart_Handle exception = 0; 108 Dart_Handle exception = 0;
109 { 109 {
110 MessageEvent* receiver = DartDOMWrapper::receiver<MessageEvent>(args); 110 MessageEvent* receiver = DartDOMWrapper::receiver<MessageEvent>(args);
111 111
112 const ParameterAdapter<String> typeArg(Dart_GetNativeArgument(args, 1)); 112 DartStringAdapter typeArg = DartUtilities::dartToString(Dart_GetNativeAr gument(args, 1), exception);
113 if (!typeArg.conversionSuccessful()) { 113 if (exception)
114 exception = typeArg.exception();
115 goto fail; 114 goto fail;
116 }
117 115
118 bool canBubbleArg = DartUtilities::dartToBool(Dart_GetNativeArgument(arg s, 2), exception); 116 bool canBubbleArg = DartUtilities::dartToBool(Dart_GetNativeArgument(arg s, 2), exception);
119 if (exception) 117 if (exception)
120 goto fail; 118 goto fail;
121 119
122 bool cancelableArg = DartUtilities::dartToBool(Dart_GetNativeArgument(ar gs, 3), exception); 120 bool cancelableArg = DartUtilities::dartToBool(Dart_GetNativeArgument(ar gs, 3), exception);
123 if (exception) 121 if (exception)
124 goto fail; 122 goto fail;
125 123
126 RefPtr<SerializedScriptValue> dataArg = DartUtilities::dartToSerializedS criptValue(Dart_GetNativeArgument(args, 4), exception); 124 RefPtr<SerializedScriptValue> dataArg = DartUtilities::dartToSerializedS criptValue(Dart_GetNativeArgument(args, 4), exception);
127 if (exception) 125 if (exception)
128 goto fail; 126 goto fail;
129 127
130 const ParameterAdapter<String> originArg(Dart_GetNativeArgument(args, 5) ); 128 DartStringAdapter originArg = DartUtilities::dartToString(Dart_GetNative Argument(args, 5), exception);
131 if (!originArg.conversionSuccessful()) { 129 if (exception)
132 exception = originArg.exception();
133 goto fail; 130 goto fail;
134 }
135 131
136 const ParameterAdapter<String> lastEventIdArg(Dart_GetNativeArgument(arg s, 6)); 132 DartStringAdapter lastEventIdArg = DartUtilities::dartToString(Dart_GetN ativeArgument(args, 6), exception);
137 if (!lastEventIdArg.conversionSuccessful()) { 133 if (exception)
138 exception = lastEventIdArg.exception();
139 goto fail; 134 goto fail;
140 }
141 135
142 DOMWindow* sourceArg = DartDOMWindow::toNative(Dart_GetNativeArgument(ar gs, 7), exception); 136 DOMWindow* sourceArg = DartDOMWindow::toNative(Dart_GetNativeArgument(ar gs, 7), exception);
143 if (exception) 137 if (exception)
144 goto fail; 138 goto fail;
145 139
146 OwnPtr<MessagePortArray> portArray; 140 OwnPtr<MessagePortArray> portArray;
147 if (!Dart_IsNull(Dart_GetNativeArgument(args, 8))) { 141 if (!Dart_IsNull(Dart_GetNativeArgument(args, 8))) {
148 portArray = adoptPtr(new MessagePortArray); 142 portArray = adoptPtr(new MessagePortArray);
149 ArrayBufferArray bufferArray; 143 ArrayBufferArray bufferArray;
150 DartUtilities::toMessagePortArray(Dart_GetNativeArgument(args, 8), * portArray, bufferArray, exception); 144 DartUtilities::toMessagePortArray(Dart_GetNativeArgument(args, 8), * portArray, bufferArray, exception);
(...skipping 16 matching lines...) Expand all
167 161
168 void webkitInitMessageEventCallback(Dart_NativeArguments) 162 void webkitInitMessageEventCallback(Dart_NativeArguments)
169 { 163 {
170 // FIXME: proper implementation. 164 // FIXME: proper implementation.
171 DART_UNIMPLEMENTED(); 165 DART_UNIMPLEMENTED();
172 } 166 }
173 167
174 } 168 }
175 169
176 } 170 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698