#include "third_party/WebKit/public/web/WebBindings.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebElement.h"
-#include "third_party/WebKit/public/web/WebFrame.h"
+#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebPluginContainer.h"
#include "v8/include/v8.h"
using ppapi::Var;
using blink::WebArrayBuffer;
using blink::WebBindings;
-using blink::WebFrame;
+using blink::WebLocalFrame;
using blink::WebPluginContainer;
namespace content {
return object_var->GetPPVar();
}
-
} // namespace
// Utilities -------------------------------------------------------------------
// the DOM (but the PluginInstance is not destroyed yet).
if (!container)
return PP_MakeUndefined();
- WebFrame* frame = container->element().document().frame();
+ WebLocalFrame* frame = container->element().document().frame();
if (!frame)
return PP_MakeUndefined();
np_result_(np_result),
exception_(PP_MakeUndefined()),
success_(false),
- checked_exception_(false) {
-}
+ checked_exception_(false) {}
PPResultAndExceptionToNPResult::~PPResultAndExceptionToNPResult() {
// The user should have called SetResult or CheckExceptionForNoResult
// the JS engine. It will update the success flag and return it.
bool PPResultAndExceptionToNPResult::SetResult(PP_Var result) {
DCHECK(!checked_exception_); // Don't call more than once.
- DCHECK(np_result_); // Should be expecting a result.
+ DCHECK(np_result_); // Should be expecting a result.
checked_exception_ = true;
// The success flag will be returned.
bool PPResultAndExceptionToNPResult::CheckExceptionForNoResult() {
DCHECK(!checked_exception_); // Don't call more than once.
- DCHECK(!np_result_); // Can't have a result when doing this.
+ DCHECK(!np_result_); // Can't have a result when doing this.
checked_exception_ = true;
PPVarFromNPObject::PPVarFromNPObject(PepperPluginInstanceImpl* instance,
NPObject* object)
- : var_(NPObjectToPPVar(instance, object)) {
-}
+ : var_(NPObjectToPPVar(instance, object)) {}
PPVarFromNPObject::~PPVarFromNPObject() {
PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(var_);
WebBindings::pushExceptionHandler(&TryCatch::Catch, this);
}
-TryCatch::~TryCatch() {
- WebBindings::popExceptionHandler();
-}
+TryCatch::~TryCatch() { WebBindings::popExceptionHandler(); }
void TryCatch::SetException(const char* message) {
if (!has_exception()) {
has_exception_ = true;
if (exception_) {
+ if (!message)
+ message = "Unknown exception.";
*exception_ = ppapi::StringVar::StringToPPVar(message, strlen(message));
}
}