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

Side by Side Diff: content/renderer/pepper/plugin_object.cc

Issue 1821103002: Migrate a bunch of LayoutTests from NPAPI to PPAPI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_open-and-close-window-with-plugin
Patch Set: rebase; fix expectations for plugin-initiate-popup-window-expected Created 4 years, 9 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
« no previous file with comments | « content/public/test/ppapi_test_utils.cc ('k') | ppapi/tests/blink_deprecated_test_plugin.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/plugin_object.h" 5 #include "content/renderer/pepper/plugin_object.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // If the plugin threw an exception, then throw a V8 version of it to 139 // If the plugin threw an exception, then throw a V8 version of it to
140 // JavaScript. Either way, return true, because we successfully dispatched 140 // JavaScript. Either way, return true, because we successfully dispatched
141 // the call to the plugin. 141 // the call to the plugin.
142 try_catch.ThrowException(); 142 try_catch.ThrowException();
143 return true; 143 return true;
144 } 144 }
145 145
146 std::vector<std::string> PluginObject::EnumerateNamedProperties( 146 std::vector<std::string> PluginObject::EnumerateNamedProperties(
147 v8::Isolate* isolate) { 147 v8::Isolate* isolate) {
148 std::vector<std::string> result; 148 std::vector<std::string> result;
149 if (!instance_) 149 if (!instance_) {
150 std::string error = "Plugin object deleted";
151 isolate->ThrowException(
152 v8::Exception::ReferenceError(gin::StringToV8(isolate, error)));
150 return result; 153 return result;
154 }
151 155
152 V8VarConverter var_converter(instance_->pp_instance(), 156 V8VarConverter var_converter(instance_->pp_instance(),
153 V8VarConverter::kAllowObjectVars); 157 V8VarConverter::kAllowObjectVars);
154 PepperTryCatchV8 try_catch(instance_, &var_converter, isolate); 158 PepperTryCatchV8 try_catch(instance_, &var_converter, isolate);
155 159
156 PP_Var* name_vars; 160 PP_Var* name_vars;
157 uint32_t count = 0; 161 uint32_t count = 0;
158 ppp_class_->GetAllPropertyNames(ppp_class_data_, &count, &name_vars, 162 ppp_class_->GetAllPropertyNames(ppp_class_data_, &count, &name_vars,
159 try_catch.exception()); 163 try_catch.exception());
160 ScopedPPVarArray scoped_name_vars( 164 ScopedPPVarArray scoped_name_vars(
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 return function_template; 297 return function_template;
294 function_template = 298 function_template =
295 gin::CreateFunctionTemplate( 299 gin::CreateFunctionTemplate(
296 isolate, base::Bind(&PluginObject::Call, weak_factory_.GetWeakPtr(), 300 isolate, base::Bind(&PluginObject::Call, weak_factory_.GetWeakPtr(),
297 name)); 301 name));
298 template_cache_.Set(name, function_template); 302 template_cache_.Set(name, function_template);
299 return function_template; 303 return function_template;
300 } 304 }
301 305
302 } // namespace content 306 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/ppapi_test_utils.cc ('k') | ppapi/tests/blink_deprecated_test_plugin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698