Commit 4528ddaf authored by Johannes Henkel's avatar Johannes Henkel Committed by Commit Bot

[DevTools] Roll inspector_protocol for v8.

New revision: 2039736177ee11d96a096cdab9c58cc1d78faa43

This modifies roll.py to update namespaces and header guards.
Also I'm removing --reverse, to avoid making this more complicated.

third_party/encoding/encoding{.h,cc} are already up to date,
since I manually propaged them earlier. So this is why this change
is only updating the template.

Change-Id: I5ddb075c9d6dad28b5665348023860683e964841
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1596392Reviewed-by: 's avatarDmitry Gozman <dgozman@chromium.org>
Commit-Queue: Johannes Henkel <johannes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61253}
parent a1c23ec8
......@@ -2,7 +2,7 @@ Name: inspector protocol
Short Name: inspector_protocol
URL: https://chromium.googlesource.com/deps/inspector_protocol/
Version: 0
Revision: 8c3f1afc2dc5b8588bc2dc5f12a93255383d7236
Revision: 2039736177ee11d96a096cdab9c58cc1d78faa43
License: BSD
License File: LICENSE
Security Critical: no
......
......@@ -90,6 +90,8 @@ std::string Status::ToASCIIString() const {
case Error::CBOR_ENVELOPE_SIZE_LIMIT_EXCEEDED:
return ToASCIIString("CBOR: envelope size limit exceeded");
}
// Some compilers can't figure out that we can't get here.
return "INVALID ERROR CODE";
}
std::string Status::ToASCIIString(const char* msg) const {
......@@ -1145,20 +1147,21 @@ enum class Container {
class State {
public:
explicit State(Container container) : container_(container) {}
void StartElement(std::vector<uint8_t>* out) {
// FIXME!!!
}
void StartElement(std::string* out) {
void StartElement(std::vector<uint8_t>* out) { StartElementTmpl(out); }
void StartElement(std::string* out) { StartElementTmpl(out); }
Container container() const { return container_; }
private:
template <typename C>
void StartElementTmpl(C* out) {
assert(container_ != Container::NONE || size_ == 0);
if (size_ != 0) {
char delim = (!(size_ & 1) || container_ == Container::ARRAY) ? ',' : ':';
out->append(1, delim);
out->push_back(delim);
}
++size_;
}
Container container() const { return container_; }
private:
Container container_ = Container::NONE;
int size_ = 0;
};
......
......@@ -95,11 +95,6 @@ def main(argv):
parser.add_argument("--v8_src_downstream",
help="The V8 src tree.",
default="~/v8/v8")
parser.add_argument('--reverse', dest='reverse', action='store_true',
help=("Whether to roll the opposite direction, from "
"V8 (downstream) to inspector_protocol "
"(upstream)."))
parser.set_defaults(reverse=False)
parser.add_argument('--force', dest='force', action='store_true',
help=("Whether to carry out the modifications "
"in the destination tree."))
......@@ -116,14 +111,9 @@ def main(argv):
# Check that the destination Git repo isn't at the master branch - it's
# generally a bad idea to check into the master branch, so we catch this
# common pilot error here early.
if args.reverse:
CheckRepoIsNotAtMasterBranch(upstream)
src_dir = os.path.join(downstream, 'third_party/inspector_protocol')
dest_dir = upstream
else:
CheckRepoIsNotAtMasterBranch(downstream)
src_dir = upstream
dest_dir = os.path.join(downstream, 'third_party/inspector_protocol')
CheckRepoIsNotAtMasterBranch(downstream)
src_dir = upstream
dest_dir = os.path.join(downstream, 'third_party/inspector_protocol')
print('Rolling %s into %s ...' % (src_dir, dest_dir))
src_files = set(FindFilesToSyncIn(src_dir))
dest_files = set(FindFilesToSyncIn(dest_dir))
......@@ -143,20 +133,26 @@ def main(argv):
sys.exit(1)
print('You said --force ... as you wish, modifying the destination.')
for f in to_add + to_copy:
shutil.copyfile(os.path.join(src_dir, f), os.path.join(dest_dir, f))
contents = open(os.path.join(src_dir, f)).read()
contents = contents.replace(
'INSPECTOR_PROTOCOL_ENCODING_ENCODING_H_',
'V8_INSPECTOR_PROTOCOL_ENCODING_ENCODING_H_')
contents = contents.replace(
'namespace inspector_protocol_encoding',
'namespace v8_inspector_protocol_encoding')
open(os.path.join(dest_dir, f), 'w').write(contents)
shutil.copymode(os.path.join(src_dir, f), os.path.join(dest_dir, f))
for f in to_delete:
os.unlink(os.path.join(dest_dir, f))
if not args.reverse:
head_revision = GetHeadRevision(upstream)
lines = open(os.path.join(dest_dir, 'README.v8')).readlines()
f = open(os.path.join(dest_dir, 'README.v8'), 'w')
for line in lines:
if line.startswith('Revision: '):
f.write('Revision: %s' % head_revision)
else:
f.write(line)
f.close()
head_revision = GetHeadRevision(upstream)
lines = open(os.path.join(dest_dir, 'README.v8')).readlines()
f = open(os.path.join(dest_dir, 'README.v8'), 'w')
for line in lines:
if line.startswith('Revision: '):
f.write('Revision: %s' % head_revision)
else:
f.write(line)
f.close()
if __name__ == '__main__':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment