  class Object;
  class Value;
  template <class T> class Local;
-@@ -335,6 +336,7 @@ public:
+@@ -322,6 +323,7 @@ public:
      // be calling this API.
      virtual v8::Local<v8::Context> mainWorldScriptContext() const = 0;
  

diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
index 9a9e07e..affccfe 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -844,6 +844,13 @@ v8::Local<v8::Context> WebLocalFrameImpl::mainWorldScriptContext() const
     return scriptState->context();
 }
 
+v8::Local<v8::Context> WebLocalFrameImpl::worldScriptContext(v8::Isolate* isolate, int worldID, int extensionGroup) const
+{
+  RefPtr<DOMWrapperWorld> world = DOMWrapperWorld::ensureIsolatedWorld(
+      isolate, worldID, extensionGroup);
+  return ScriptState::forWorld(frame(), *world)->context();
+}
+
 bool WebFrame::scriptCanAccess(WebFrame* target)
 {
     return BindingSecurity::shouldAllowAccessToFrame(mainThreadIsolate(), currentDOMWindow(mainThreadIsolate()), target->toImplBase()->frame(), DoNotReportSecurityError);
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.h b/third_party/WebKit/Source/web/WebLocalFrameImpl.h
index 8f1a7ce..9faab81 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.h
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.h
@@ -122,6 +122,7 @@ public:

 {
     return toV8Context(frame(), DOMWrapperWorld::mainWorld());
diff --git a/third_party/WebKit/Source/web/WebRemoteFrameImpl.h b/third_party/WebKit/Source/web/WebRemoteFrameImpl.h
index c4cd1dc..f1947a9 100644
--- a/third_party/WebKit/Source/web/WebRemoteFrameImpl.h
+++ b/third_party/WebKit/Source/web/WebRemoteFrameImpl.h
@@ -67,6 +67,7 @@ public:
