OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/renderer/extensions/chrome_v8_context_set.h" | 5 #include "chrome/renderer/extensions/chrome_v8_context_set.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/tracked_objects.h" | 9 #include "base/tracked_objects.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 CHECK(arguments.Get(i, &item)); | 141 CHECK(arguments.Get(i, &item)); |
142 v8_arguments.push_back(converter->ToV8Value(item, context)); | 142 v8_arguments.push_back(converter->ToV8Value(item, context)); |
143 } | 143 } |
144 | 144 |
145 v8::Handle<v8::Value> retval; | 145 v8::Handle<v8::Value> retval; |
146 (*it)->CallChromeHiddenMethod( | 146 (*it)->CallChromeHiddenMethod( |
147 method_name, v8_arguments.size(), &v8_arguments[0], &retval); | 147 method_name, v8_arguments.size(), &v8_arguments[0], &retval); |
148 // In debug, the js will validate the event parameters and return a | 148 // In debug, the js will validate the event parameters and return a |
149 // string if a validation error has occured. | 149 // string if a validation error has occured. |
150 // TODO(rafaelw): Consider only doing this check if function_name == | 150 // TODO(rafaelw): Consider only doing this check if function_name == |
151 // "Event.dispatchJSON". | 151 // "Event.dispatch". |
152 #ifndef NDEBUG | 152 #ifndef NDEBUG |
153 if (!retval.IsEmpty() && !retval->IsUndefined()) { | 153 if (!retval.IsEmpty() && !retval->IsUndefined()) { |
154 std::string error = *v8::String::AsciiValue(retval); | 154 std::string error = *v8::String::AsciiValue(retval); |
155 DCHECK(false) << error; | 155 DCHECK(false) << error; |
156 } | 156 } |
157 #endif | 157 #endif |
158 } | 158 } |
159 } | 159 } |
OLD | NEW |