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

Unified Diff: include/v8.h

Issue 1801203002: Parser: Make skipping HTML comments optional. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. Created 4 years, 9 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 | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 6f2bba09bf14d88060da0225f417f3d7b40df098..dee44687f0daed664a62a929fdacf951349018f8 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -1005,28 +1005,31 @@ class ScriptOriginOptions {
public:
V8_INLINE ScriptOriginOptions(bool is_embedder_debug_script = false,
bool is_shared_cross_origin = false,
- bool is_opaque = false)
+ bool is_opaque = false,
+ bool allow_html_comments = false)
: flags_((is_embedder_debug_script ? kIsEmbedderDebugScript : 0) |
(is_shared_cross_origin ? kIsSharedCrossOrigin : 0) |
- (is_opaque ? kIsOpaque : 0)) {}
+ (is_opaque ? kIsOpaque : 0) |
+ (allow_html_comments ? kAllowHtmlComments : 0)) {}
V8_INLINE ScriptOriginOptions(int flags)
- : flags_(flags &
- (kIsEmbedderDebugScript | kIsSharedCrossOrigin | kIsOpaque)) {}
- bool IsEmbedderDebugScript() const {
- return (flags_ & kIsEmbedderDebugScript) != 0;
- }
- bool IsSharedCrossOrigin() const {
- return (flags_ & kIsSharedCrossOrigin) != 0;
- }
- bool IsOpaque() const { return (flags_ & kIsOpaque) != 0; }
+ : flags_(flags & (kIsEmbedderDebugScript | kIsSharedCrossOrigin |
+ kIsOpaque | kAllowHtmlComments)) {}
+ bool IsEmbedderDebugScript() const { return HasFlag(kIsEmbedderDebugScript); }
+ bool IsSharedCrossOrigin() const { return HasFlag(kIsSharedCrossOrigin); }
+ bool IsOpaque() const { return HasFlag(kIsOpaque); }
+ bool AllowHtmlComments() const { return HasFlag(kAllowHtmlComments); }
int Flags() const { return flags_; }
private:
enum {
kIsEmbedderDebugScript = 1,
kIsSharedCrossOrigin = 1 << 1,
- kIsOpaque = 1 << 2
+ kIsOpaque = 1 << 2,
+ kAllowHtmlComments = 1 << 3
};
+
+ inline bool HasFlag(int flag) const { return (flags_ & flag) != 0; }
+
const int flags_;
};
@@ -1043,7 +1046,8 @@ class ScriptOrigin {
Local<Integer> script_id = Local<Integer>(),
Local<Boolean> resource_is_embedder_debug_script = Local<Boolean>(),
Local<Value> source_map_url = Local<Value>(),
- Local<Boolean> resource_is_opaque = Local<Boolean>());
+ Local<Boolean> resource_is_opaque = Local<Boolean>(),
+ Local<Boolean> allow_html_comments = Local<Boolean>());
V8_INLINE Local<Value> ResourceName() const;
V8_INLINE Local<Integer> ResourceLineOffset() const;
V8_INLINE Local<Integer> ResourceColumnOffset() const;
@@ -7828,7 +7832,8 @@ ScriptOrigin::ScriptOrigin(Local<Value> resource_name,
Local<Integer> script_id,
Local<Boolean> resource_is_embedder_debug_script,
Local<Value> source_map_url,
- Local<Boolean> resource_is_opaque)
+ Local<Boolean> resource_is_opaque,
+ Local<Boolean> allow_html_comments)
: resource_name_(resource_name),
resource_line_offset_(resource_line_offset),
resource_column_offset_(resource_column_offset),
@@ -7836,7 +7841,8 @@ ScriptOrigin::ScriptOrigin(Local<Value> resource_name,
resource_is_embedder_debug_script->IsTrue(),
!resource_is_shared_cross_origin.IsEmpty() &&
resource_is_shared_cross_origin->IsTrue(),
- !resource_is_opaque.IsEmpty() && resource_is_opaque->IsTrue()),
+ !resource_is_opaque.IsEmpty() && resource_is_opaque->IsTrue(),
+ allow_html_comments.IsEmpty() || allow_html_comments->IsTrue()),
script_id_(script_id),
source_map_url_(source_map_url) {}
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698