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

Side by Side Diff: Source/bindings/dart/DartNativeUtilities.cpp

Issue 23895004: Keep a persistent handle for the bindings classes to avoid repeated lookups that involve performing… (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: get custom ids from generated table, allocate table ahead of time 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
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 Dart_Handle exception = 0; 133 Dart_Handle exception = 0;
134 { 134 {
135 DartStringAdapter key = DartUtilities::dartToString(Dart_GetNativeArgume nt(args, 0), exception); 135 DartStringAdapter key = DartUtilities::dartToString(Dart_GetNativeArgume nt(args, 0), exception);
136 if (exception) 136 if (exception)
137 goto fail; 137 goto fail;
138 138
139 DartController* controller = DartController::retrieve(DartUtilities::scr iptExecutionContext()); 139 DartController* controller = DartController::retrieve(DartUtilities::scr iptExecutionContext());
140 NPObject* npObject = controller->npObject(key); 140 NPObject* npObject = controller->npObject(key);
141 if (npObject) { 141 if (npObject) {
142 // FIXME: put NPObjects into a map as well. 142 // FIXME: put NPObjects into a map as well.
143 Dart_SetReturnValue(args, DartDOMWrapper::newWrapper("_NPObject", Da rtUtilities::htmlLibraryName, npObject)); 143 Dart_SetReturnValue(args, DartDOMWrapper::newWrapper("_NPObject", Da rtUtilities::htmlLibraryName, _NPObjectClassId, npObject));
144 } 144 }
145 return; 145 return;
146 } 146 }
147 147
148 fail: 148 fail:
149 Dart_ThrowException(exception); 149 Dart_ThrowException(exception);
150 ASSERT_NOT_REACHED(); 150 ASSERT_NOT_REACHED();
151 } 151 }
152 152
153 static void npObjectProperty(Dart_NativeArguments args) 153 static void npObjectProperty(Dart_NativeArguments args)
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 if (argumentCount == 3 && str == "NPObject_invoke") 404 if (argumentCount == 3 && str == "NPObject_invoke")
405 return npObjectInvoke; 405 return npObjectInvoke;
406 if (argumentCount == 1 && str == "Window_history_cross_frame_Getter") 406 if (argumentCount == 1 && str == "Window_history_cross_frame_Getter")
407 return DartWindowInternal::historyCrossFrameGetter; 407 return DartWindowInternal::historyCrossFrameGetter;
408 if (argumentCount == 1 && str == "Window_location_cross_frame_Getter") 408 if (argumentCount == 1 && str == "Window_location_cross_frame_Getter")
409 return DartWindowInternal::locationCrossFrameGetter; 409 return DartWindowInternal::locationCrossFrameGetter;
410 return 0; 410 return 0;
411 } 411 }
412 412
413 } 413 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698