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

Side by Side Diff: include/v8.h

Issue 20646006: Pipe a script's CORS status through V8 during compilation. (Closed) Base URL: https://chromium.googlesource.com/external/v8.git@master
Patch Set: rebaseline. Created 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 935
936 936
937 /** 937 /**
938 * The origin, within a file, of a script. 938 * The origin, within a file, of a script.
939 */ 939 */
940 class ScriptOrigin { 940 class ScriptOrigin {
941 public: 941 public:
942 V8_INLINE(ScriptOrigin( 942 V8_INLINE(ScriptOrigin(
943 Handle<Value> resource_name, 943 Handle<Value> resource_name,
944 Handle<Integer> resource_line_offset = Handle<Integer>(), 944 Handle<Integer> resource_line_offset = Handle<Integer>(),
945 Handle<Integer> resource_column_offset = Handle<Integer>())) 945 Handle<Integer> resource_column_offset = Handle<Integer>(),
946 Handle<Boolean> resource_passed_access_check = Handle<Boolean>()))
Michael Starzinger 2013/07/30 09:52:55 The term "access check" is already used in the API
Mike West 2013/07/30 10:01:58 The goal is to allow the embedder to determine whe
Mike West 2013/07/30 10:22:43 How about "resource_is_shared_cross_origin" and "S
Michael Starzinger 2013/07/30 10:27:10 Yep, SGTM, I am fine with that.
946 : resource_name_(resource_name), 947 : resource_name_(resource_name),
947 resource_line_offset_(resource_line_offset), 948 resource_line_offset_(resource_line_offset),
948 resource_column_offset_(resource_column_offset) { } 949 resource_column_offset_(resource_column_offset),
950 resource_passed_access_check_(resource_passed_access_check) { }
949 V8_INLINE(Handle<Value> ResourceName() const); 951 V8_INLINE(Handle<Value> ResourceName() const);
950 V8_INLINE(Handle<Integer> ResourceLineOffset() const); 952 V8_INLINE(Handle<Integer> ResourceLineOffset() const);
951 V8_INLINE(Handle<Integer> ResourceColumnOffset() const); 953 V8_INLINE(Handle<Integer> ResourceColumnOffset() const);
954 V8_INLINE(Handle<Boolean> ResourcePassedAccessCheck() const);
952 private: 955 private:
953 Handle<Value> resource_name_; 956 Handle<Value> resource_name_;
954 Handle<Integer> resource_line_offset_; 957 Handle<Integer> resource_line_offset_;
955 Handle<Integer> resource_column_offset_; 958 Handle<Integer> resource_column_offset_;
959 Handle<Boolean> resource_passed_access_check_;
956 }; 960 };
957 961
958 962
959 /** 963 /**
960 * A compiled JavaScript script. 964 * A compiled JavaScript script.
961 */ 965 */
962 class V8EXPORT Script { 966 class V8EXPORT Script {
963 public: 967 public:
964 /** 968 /**
965 * Compiles the specified script (context-independent). 969 * Compiles the specified script (context-independent).
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 * the error occurred. 1127 * the error occurred.
1124 */ 1128 */
1125 int GetStartColumn() const; 1129 int GetStartColumn() const;
1126 1130
1127 /** 1131 /**
1128 * Returns the index within the line of the last character where 1132 * Returns the index within the line of the last character where
1129 * the error occurred. 1133 * the error occurred.
1130 */ 1134 */
1131 int GetEndColumn() const; 1135 int GetEndColumn() const;
1132 1136
1137 /**
1138 * Returns true if the script in which the exception occurred passed
1139 * cross-origin access control checks when originally loaded.
Michael Starzinger 2013/07/30 09:52:55 nit: Can we rephrase the documentation for this me
Mike West 2013/07/30 10:01:58 Will do.
1140 */
1141 bool DidPassAccessCheck() const;
Michael Starzinger 2013/07/30 09:52:55 nit: In light of the above two comments, could I c
1142
1133 // TODO(1245381): Print to a string instead of on a FILE. 1143 // TODO(1245381): Print to a string instead of on a FILE.
1134 static void PrintCurrentStackTrace(FILE* out); 1144 static void PrintCurrentStackTrace(FILE* out);
1135 1145
1136 static const int kNoLineNumberInfo = 0; 1146 static const int kNoLineNumberInfo = 0;
1137 static const int kNoColumnInfo = 0; 1147 static const int kNoColumnInfo = 0;
1138 }; 1148 };
1139 1149
1140 1150
1141 /** 1151 /**
1142 * Representation of a JavaScript stack trace. The information collected is a 1152 * Representation of a JavaScript stack trace. The information collected is a
(...skipping 4826 matching lines...) Expand 10 before | Expand all | Expand 10 after
5969 5979
5970 Handle<Integer> ScriptOrigin::ResourceLineOffset() const { 5980 Handle<Integer> ScriptOrigin::ResourceLineOffset() const {
5971 return resource_line_offset_; 5981 return resource_line_offset_;
5972 } 5982 }
5973 5983
5974 5984
5975 Handle<Integer> ScriptOrigin::ResourceColumnOffset() const { 5985 Handle<Integer> ScriptOrigin::ResourceColumnOffset() const {
5976 return resource_column_offset_; 5986 return resource_column_offset_;
5977 } 5987 }
5978 5988
5989 Handle<Boolean> ScriptOrigin::ResourcePassedAccessCheck() const {
5990 return resource_passed_access_check_;
5991 }
5992
5979 5993
5980 Handle<Boolean> Boolean::New(bool value) { 5994 Handle<Boolean> Boolean::New(bool value) {
5981 return value ? True() : False(); 5995 return value ? True() : False();
5982 } 5996 }
5983 5997
5984 5998
5985 void Template::Set(const char* name, v8::Handle<Data> value) { 5999 void Template::Set(const char* name, v8::Handle<Data> value) {
5986 Set(v8::String::New(name), value); 6000 Set(v8::String::New(name), value);
5987 } 6001 }
5988 6002
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
6481 6495
6482 6496
6483 } // namespace v8 6497 } // namespace v8
6484 6498
6485 6499
6486 #undef V8EXPORT 6500 #undef V8EXPORT
6487 #undef TYPE_CHECK 6501 #undef TYPE_CHECK
6488 6502
6489 6503
6490 #endif // V8_H_ 6504 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698