From 3f46545c7f5a2e2a2a7d58898ae945258f4ca6e8 Mon Sep 17 00:00:00 2001
From: Jarred Nicholls <jarred.nicholls@gmail.com>
Date: Tue, 23 Sep 2014 12:37:42 -0400
Subject: [PATCH] <third_party/WebKit> FIXUP: Prevent a python IOError on
 Windows

The scripts for generating and aggregating the v8 bindings all suffer
from an IOError on Windows when doing a shadow build that results in
very large relative paths being used in the generated GYP actions.

Change-Id: I86f57fc94e8ff633e2499a08b8cafa7df9b39210
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
---
 .../bindings/scripts/aggregate_generated_bindings.py      | 2 +-
 .../WebKit/Source/bindings/scripts/code_generator_v8.py   | 3 ++-
 .../WebKit/Source/bindings/scripts/idl_compiler.py        | 8 ++++----
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/chromium/third_party/WebKit/Source/bindings/scripts/aggregate_generated_bindings.py b/chromium/third_party/WebKit/Source/bindings/scripts/aggregate_generated_bindings.py
index 264e069eccd..73dbb31116e 100755
--- a/chromium/third_party/WebKit/Source/bindings/scripts/aggregate_generated_bindings.py
+++ b/chromium/third_party/WebKit/Source/bindings/scripts/aggregate_generated_bindings.py
@@ -222,7 +222,7 @@ def main(args):
                 if hash(meta_data['name']) % total_partitions == partition]
         file_contents = generate_content(component_dir,
                                          files_meta_data_this_partition)
-        write_content(file_contents, file_name)
+        write_content(file_contents, abs(file_name))
 
 
 if __name__ == '__main__':
diff --git a/chromium/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py b/chromium/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py
index 778a87ec79b..021017ac099 100644
--- a/chromium/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py
+++ b/chromium/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py
@@ -77,6 +77,7 @@ from v8_globals import includes, interfaces
 import v8_interface
 import v8_types
 from v8_utilities import capitalize, cpp_name, conditional_string, v8_class_name
+from utilities import abs
 
 
 class CodeGeneratorV8(object):
@@ -197,7 +198,7 @@ def runtime_enabled_if(code, runtime_enabled_function_name):
 def main(argv):
     # If file itself executed, cache templates
     try:
-        cache_dir = argv[1]
+        cache_dir = abs(argv[1])
         dummy_filename = argv[2]
     except IndexError as err:
         print 'Usage: %s CACHE_DIR DUMMY_FILENAME' % argv[0]
diff --git a/chromium/third_party/WebKit/Source/bindings/scripts/idl_compiler.py b/chromium/third_party/WebKit/Source/bindings/scripts/idl_compiler.py
index 6728aff45c1..e1555546ec8 100755
--- a/chromium/third_party/WebKit/Source/bindings/scripts/idl_compiler.py
+++ b/chromium/third_party/WebKit/Source/bindings/scripts/idl_compiler.py
@@ -40,7 +40,7 @@ import sys
 
 from code_generator_v8 import CodeGeneratorV8
 from idl_reader import IdlReader
-from utilities import write_file
+from utilities import write_file, abs
 
 
 def parse_options():
@@ -132,9 +132,9 @@ class IdlCompilerV8(IdlCompiler):
 def main():
     options, idl_filename = parse_options()
     idl_compiler = IdlCompilerV8(
-        options.output_directory,
-        cache_directory=options.cache_directory,
-        interfaces_info_filename=options.interfaces_info_file,
+        abs(options.output_directory),
+        cache_directory=abs(options.cache_directory),
+        interfaces_info_filename=abs(options.interfaces_info_file),
         only_if_changed=options.write_file_only_if_changed)
     idl_compiler.compile_file(idl_filename)
 
-- 
GitLab