| Index: Source/bindings/v8/ScriptController.cpp
|
| diff --git a/Source/bindings/v8/ScriptController.cpp b/Source/bindings/v8/ScriptController.cpp
|
| index fcc59bac09c4d0f6944934c5e7b228838fdb1aaf..542862a1684ac73f42a094733ae929d40e6f7646 100644
|
| --- a/Source/bindings/v8/ScriptController.cpp
|
| +++ b/Source/bindings/v8/ScriptController.cpp
|
| @@ -1,6 +1,7 @@
|
| /*
|
| * Copyright (C) 2008, 2009 Google Inc. All rights reserved.
|
| * Copyright (C) 2009 Apple Inc. All rights reserved.
|
| + * Copyright (C) 2013 Opera Software ASA. All rights reserved.
|
| *
|
| * Redistribution and use in source and binary forms, with or without
|
| * modification, are permitted provided that the following conditions are
|
| @@ -361,6 +362,19 @@ void ScriptController::bindToWindowObject(Frame* frame, const String& key, NPObj
|
| global->Set(v8String(key, v8Context->GetIsolate()), value);
|
| }
|
|
|
| +void ScriptController::bindToWindowObject(Frame* frame, const String &key, v8::AccessorGetter getter, v8::AccessorSetter setter, v8::Handle<v8::Value> data)
|
| +{
|
| + v8::HandleScope handleScope;
|
| + v8::Handle<v8::Context> v8Context = ScriptController::mainWorldContext(frame);
|
| + if (v8Context.IsEmpty())
|
| + return;
|
| +
|
| + v8::Context::Scope scope(v8Context);
|
| +
|
| + v8::Handle<v8::Object> global = v8Context->Global();
|
| + global->SetAccessor(v8String(key, v8Context->GetIsolate()), getter, setter, data);
|
| +}
|
| +
|
| void ScriptController::enableEval()
|
| {
|
| if (!m_windowShell->isContextInitialized())
|
|
|