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

Unified Diff: Source/bindings/core/v8/ScriptRegexp.cpp

Issue 1315413005: Fix assertion failure in ScriptRegexp::match (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698