Index: Source/bindings/core/v8/ScriptRegexp.cpp |
diff --git a/Source/bindings/core/v8/ScriptRegexp.cpp b/Source/bindings/core/v8/ScriptRegexp.cpp |
index 9a357a4a54d58eff9a3b2bd6bac04bdd4b55d911..5a59c7483531b54cd0db795d6b420362508596db 100644 |
--- a/Source/bindings/core/v8/ScriptRegexp.cpp |
+++ b/Source/bindings/core/v8/ScriptRegexp.cpp |
@@ -33,6 +33,7 @@ |
#include "bindings/core/v8/V8PerIsolateData.h" |
#include "bindings/core/v8/V8ScriptRunner.h" |
#include "platform/ScriptForbiddenScope.h" |
+#include "wtf/Optional.h" |
namespace blink { |
@@ -67,7 +68,9 @@ int ScriptRegexp::match(const String& string, int startFrom, int* matchLength) c |
if (string.length() > INT_MAX) |
return -1; |
- ScriptForbiddenScope::AllowUserAgentScript allowScript; |
+ Optional<ScriptForbiddenScope::AllowUserAgentScript> allowScript; |
+ if (isMainThread()) |
+ allowScript.emplace(); |
haraken
2015/08/27 23:46:40
Would it make sense to move the Optional into Allo
yurys
2015/08/27 23:56:49
Done. I'm not sure what was the reason to have all
|
v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
v8::HandleScope handleScope(isolate); |