| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/renderer/pepper/npapi_glue.h" | 5 #include "content/renderer/pepper/npapi_glue.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "content/renderer/pepper/host_array_buffer_var.h" | 10 #include "content/renderer/pepper/host_array_buffer_var.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 if (!frame) | 182 if (!frame) |
| 183 return PP_MakeUndefined(); | 183 return PP_MakeUndefined(); |
| 184 | 184 |
| 185 v8::HandleScope scope(instance->GetIsolate()); | 185 v8::HandleScope scope(instance->GetIsolate()); |
| 186 v8::Local<v8::Context> context = frame->mainWorldScriptContext(); | 186 v8::Local<v8::Context> context = frame->mainWorldScriptContext(); |
| 187 return NPObjectToPPVarImpl(instance, object, context); | 187 return NPObjectToPPVarImpl(instance, object, context); |
| 188 } | 188 } |
| 189 | 189 |
| 190 PP_Var NPObjectToPPVarForTest(PepperPluginInstanceImpl* instance, | 190 PP_Var NPObjectToPPVarForTest(PepperPluginInstanceImpl* instance, |
| 191 NPObject* object) { | 191 NPObject* object) { |
| 192 v8::Isolate* test_isolate = v8::Isolate::New(); | |
| 193 PP_Var result = PP_MakeUndefined(); | 192 PP_Var result = PP_MakeUndefined(); |
| 194 { | 193 v8::HandleScope scope(instance->GetIsolate()); |
| 195 v8::HandleScope scope(test_isolate); | 194 v8::Local<v8::Context> context = v8::Context::New(instance->GetIsolate()); |
| 196 v8::Isolate::Scope isolate_scope(test_isolate); | 195 result = NPObjectToPPVarImpl(instance, object, context); |
| 197 v8::Local<v8::Context> context = v8::Context::New(test_isolate); | |
| 198 result = NPObjectToPPVarImpl(instance, object, context); | |
| 199 } | |
| 200 test_isolate->Dispose(); | |
| 201 return result; | 196 return result; |
| 202 } | 197 } |
| 203 | 198 |
| 204 // PPResultAndExceptionToNPResult ---------------------------------------------- | 199 // PPResultAndExceptionToNPResult ---------------------------------------------- |
| 205 | 200 |
| 206 PPResultAndExceptionToNPResult::PPResultAndExceptionToNPResult( | 201 PPResultAndExceptionToNPResult::PPResultAndExceptionToNPResult( |
| 207 NPObject* object_var, | 202 NPObject* object_var, |
| 208 NPVariant* np_result) | 203 NPVariant* np_result) |
| 209 : object_var_(object_var), | 204 : object_var_(object_var), |
| 210 np_result_(np_result), | 205 np_result_(np_result), |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 } | 344 } |
| 350 } | 345 } |
| 351 } | 346 } |
| 352 | 347 |
| 353 // static | 348 // static |
| 354 void TryCatch::Catch(void* self, const char* message) { | 349 void TryCatch::Catch(void* self, const char* message) { |
| 355 static_cast<TryCatch*>(self)->SetException(message); | 350 static_cast<TryCatch*>(self)->SetException(message); |
| 356 } | 351 } |
| 357 | 352 |
| 358 } // namespace content | 353 } // namespace content |
| OLD | NEW |