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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptRegexp.cpp

Issue 2508033004: Reduce unnecessary usage of TextCaseSensitivity::TextCaseInsensitive. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Collabora Ltd. 3 * Copyright (C) 2008 Collabora Ltd.
4 * Copyright (C) 2011 Peter Varga (pvarga@webkit.org), University of Szeged 4 * Copyright (C) 2011 Peter Varga (pvarga@webkit.org), University of Szeged
5 * Copyright (C) 2013 Google Inc. All rights reserved. 5 * Copyright (C) 2013 Google Inc. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 29 matching lines...) Expand all
40 MultilineMode multilineMode, 40 MultilineMode multilineMode,
41 CharacterMode charMode) { 41 CharacterMode charMode) {
42 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 42 v8::Isolate* isolate = v8::Isolate::GetCurrent();
43 v8::HandleScope handleScope(isolate); 43 v8::HandleScope handleScope(isolate);
44 v8::Local<v8::Context> context = 44 v8::Local<v8::Context> context =
45 V8PerIsolateData::from(isolate)->ensureScriptRegexpContext(); 45 V8PerIsolateData::from(isolate)->ensureScriptRegexpContext();
46 v8::Context::Scope contextScope(context); 46 v8::Context::Scope contextScope(context);
47 v8::TryCatch tryCatch(isolate); 47 v8::TryCatch tryCatch(isolate);
48 48
49 unsigned flags = v8::RegExp::kNone; 49 unsigned flags = v8::RegExp::kNone;
50 if (caseSensitivity == TextCaseInsensitive) 50 if (caseSensitivity != TextCaseSensitive)
51 flags |= v8::RegExp::kIgnoreCase; 51 flags |= v8::RegExp::kIgnoreCase;
52 if (multilineMode == MultilineEnabled) 52 if (multilineMode == MultilineEnabled)
53 flags |= v8::RegExp::kMultiline; 53 flags |= v8::RegExp::kMultiline;
54 if (charMode == UTF16) 54 if (charMode == UTF16)
55 flags |= v8::RegExp::kUnicode; 55 flags |= v8::RegExp::kUnicode;
56 56
57 v8::Local<v8::RegExp> regex; 57 v8::Local<v8::RegExp> regex;
58 if (v8::RegExp::New(context, v8String(isolate, pattern), 58 if (v8::RegExp::New(context, v8String(isolate, pattern),
59 static_cast<v8::RegExp::Flags>(flags)) 59 static_cast<v8::RegExp::Flags>(flags))
60 .ToLocal(&regex)) 60 .ToLocal(&regex))
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 v8::Local<v8::Value> match; 119 v8::Local<v8::Value> match;
120 if (!result->Get(context, 0).ToLocal(&match)) 120 if (!result->Get(context, 0).ToLocal(&match))
121 return -1; 121 return -1;
122 *matchLength = match.As<v8::String>()->Length(); 122 *matchLength = match.As<v8::String>()->Length();
123 } 123 }
124 124
125 return matchOffset.As<v8::Int32>()->Value() + startFrom; 125 return matchOffset.As<v8::Int32>()->Value() + startFrom;
126 } 126 }
127 127
128 } // namespace blink 128 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptRegexp.h ('k') | third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698