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

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

Issue 10660025: Cleanup dart to string conversions. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: . Created 8 years, 6 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 2012, Google Inc. 1 // Copyright 2012, 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 24 matching lines...) Expand all
35 35
36 namespace WebCore { 36 namespace WebCore {
37 37
38 namespace DartIntentInternal { 38 namespace DartIntentInternal {
39 39
40 void constructorCallback(Dart_NativeArguments args) 40 void constructorCallback(Dart_NativeArguments args)
41 { 41 {
42 DartApiScope dartApiScope; 42 DartApiScope dartApiScope;
43 Dart_Handle exception = 0; 43 Dart_Handle exception = 0;
44 { 44 {
45 const ParameterAdapter<String> action(Dart_GetNativeArgument(args, 0)); 45 DartStringAdapter action = DartUtilities::dartToString(Dart_GetNativeArg ument(args, 0), exception);
46 if (!action.conversionSuccessful()) { 46 if (exception)
47 exception = action.exception();
48 goto fail; 47 goto fail;
49 }
50 48
51 const ParameterAdapter<String> type(Dart_GetNativeArgument(args, 1)); 49 DartStringAdapter type = DartUtilities::dartToString(Dart_GetNativeArgum ent(args, 1), exception);
52 if (!type.conversionSuccessful()) { 50 if (exception)
53 exception = type.exception();
54 goto fail; 51 goto fail;
55 }
56 52
57 RefPtr<SerializedScriptValue> data; 53 RefPtr<SerializedScriptValue> data;
58 if (!Dart_IsNull(Dart_GetNativeArgument(args, 2))) { 54 if (!Dart_IsNull(Dart_GetNativeArgument(args, 2))) {
59 data = DartUtilities::dartToSerializedScriptValue(Dart_GetNativeArgu ment(args, 2), exception); 55 data = DartUtilities::dartToSerializedScriptValue(Dart_GetNativeArgu ment(args, 2), exception);
60 if (exception) 56 if (exception)
61 goto fail; 57 goto fail;
62 } 58 }
63 59
64 MessagePortArray transferList; 60 MessagePortArray transferList;
65 ArrayBufferArray arrayBufferArray; 61 ArrayBufferArray arrayBufferArray;
(...skipping 15 matching lines...) Expand all
81 fail: 77 fail:
82 Dart_ThrowException(exception); 78 Dart_ThrowException(exception);
83 ASSERT_NOT_REACHED(); 79 ASSERT_NOT_REACHED();
84 } 80 }
85 81
86 } 82 }
87 83
88 } 84 }
89 85
90 #endif 86 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/bindings/dart/custom/DartIDBKeyCustom.cpp ('k') | Source/WebCore/bindings/dart/custom/DartLocationCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698