mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-03 12:37:36 +01:00
6a7b6d5038
- Add the printing project and delete duplicated files from the CEF printing directory. - Add media-related projects and support for <video> and <image> tags. - Use WebKit::WebHTTPBody instead of net::UploadData for web requests. - Numerous changes due to continued cleanup of webkit/glue and webkit/api/public. - Use a separate BrowserWebViewDelegate instance for popup windows. libcef: - Add support for printing to file. - Use WebFrame::GetFullPageHtml() instead of webkit_glue::GetDocumentString(). - Parse extra header values in RequestProxy for passing to CefHandler::HandleBeforeResourceLoad(). - Add urlmon.lib dependency in libcef.vsprops. tools: - Add the patch application tool (patcher.py). patch: - New project for applying required patches to the Chromium source tree (issue #47). - Add webkit_glue.patch for http://codereview.chromium.org/160004 cefclient: - Add new test for submitting and handling requests. - Don't change navigation button state for popup windows. - Fix problem on Vista where the string returned by EM_GETLINE is not NULL-terminated. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@32 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
90 lines
2.7 KiB
Python
90 lines
2.7 KiB
Python
# Copyright (c) 2009 The Chromium Embedded Framework Authors. All rights
|
|
# reserved. Use of this source code is governed by a BSD-style license that
|
|
# can be found in the LICENSE file.
|
|
|
|
import pickle
|
|
from optparse import OptionParser
|
|
from os.path import isfile
|
|
import sys
|
|
from file_util import *
|
|
from patch_util import *
|
|
|
|
|
|
# cannot be loaded as a module
|
|
if __name__ != "__main__":
|
|
sys.stderr.write('This file cannot be loaded as a module!')
|
|
sys.exit()
|
|
|
|
|
|
# parse command-line options
|
|
disc = """
|
|
This utility applies patch files.
|
|
"""
|
|
|
|
parser = OptionParser(description=disc)
|
|
parser.add_option('--patch-dir', dest='patchdir', metavar='DIR',
|
|
help='source directory for patch files')
|
|
(options, args) = parser.parse_args()
|
|
|
|
# the patchdir option is required
|
|
if options.patchdir is None:
|
|
parser.print_help(sys.stdout)
|
|
sys.exit()
|
|
|
|
# normalize the directory value
|
|
patchdir = options.patchdir.replace('\\', '/')
|
|
if patchdir[-1] != '/':
|
|
patchdir += '/'
|
|
|
|
# check if the patching should be skipped
|
|
if isfile(patchdir + 'NOPATCH'):
|
|
nopatch = True
|
|
sys.stdout.write('NOPATCH exists -- files have not been patched.\n')
|
|
else:
|
|
nopatch = False
|
|
# locate the patch configuration file
|
|
patchcfg = patchdir + 'patch.cfg'
|
|
if not isfile(patchcfg):
|
|
sys.stderr.write('File '+patchcfg+' does not exist.\n')
|
|
sys.exit()
|
|
|
|
scope = {}
|
|
execfile(patchcfg, scope)
|
|
patches = scope["patches"]
|
|
|
|
for name in patches.keys():
|
|
file = patchdir+'patches/'+name+'.patch'
|
|
if not isfile(file):
|
|
sys.stderr.write('Patch file '+file+' does not exist.\n')
|
|
else:
|
|
sys.stderr.write('Reading patch file '+file+'\n')
|
|
dir = patches[name]
|
|
patchObj = from_file(file)
|
|
patchObj.apply(dir)
|
|
|
|
# read the current include file, if any
|
|
incfile = patchdir + 'patch_state.h'
|
|
if nopatch:
|
|
incnew = """// This file is generated by the patch tool and should not be edited manually.
|
|
#ifndef _PATCH_STATE_H
|
|
#define _PATCH_STATE_H
|
|
// No patches have been applied to the Chromium/WebKit source base.
|
|
#define CEF_PATCHES_APPLIED 0
|
|
#endif // _PATCH_STATE_H
|
|
"""
|
|
else:
|
|
incnew = """// This file is generated by the patch tool and should not be edited manually.
|
|
#ifndef _PATCH_STATE_H
|
|
#define _PATCH_STATE_H
|
|
// Patches have been applied to the Chromium/WebKit source base.
|
|
#define CEF_PATCHES_APPLIED 1
|
|
#endif // _PATCH_STATE_H
|
|
"""
|
|
|
|
inccur = ''
|
|
if isfile(incfile):
|
|
inccur = read_file(incfile)
|
|
|
|
if inccur != incnew:
|
|
sys.stdout.write('Writing file '+incfile+'.\n')
|
|
write_file(incfile, incnew) |