- Restore original file permissions after patching a file (issue #387).

- Add the ability to selectively apply patches based on the presence of an environment variable (issue #388).
- Add a patch to disable scrollbar bounce and scrollbar overlay on Lion based on the presence of the CEF_SPI_BUILD environment variable (issue #364).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@339 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2011-10-25 16:36:38 +00:00
parent 7a91ff899f
commit df921942ea
4 changed files with 94 additions and 23 deletions

View File

@ -1,12 +1,30 @@
# An element of this array associates a patch file with a target directory.
# All paths in the patch file must be relative to that directory. Each patch
# file entry for source code changes should be proceeded by the code review
# or bug report link that it relates to.
patches = {
# Each map in the list associates a patch file name with a target path and
# optional condition. All paths in the patch file must be relative to the
# target path. Each map should include a comment linking to the code review
# or bug report that the patch relates to. If a condition is provided the
# patch will only be applied if an environment variable with the specified
# name exists.
patches = [
{
# http://codereview.chromium.org/8086022/
'build' : '../build/',
'name': 'build',
'path': '../build/',
},
{
# http://codereview.chromium.org/6730028/
'base' : '../base/',
'name': 'base',
'path': '../base/',
},
{
# http://code.google.com/p/gyp/issues/detail?id=223
'tools_gyp' : '../tools/gyp/',
}
'name': 'tools_gyp',
'path': '../tools/gyp/',
},
{
# http://code.google.com/p/chromiumembedded/issues/detail?id=364
'name': 'spi_webcore_364',
'path': '../third_party/WebKit/Source/WebCore/',
'condition': 'CEF_SPI_BUILD',
},
]

View File

@ -0,0 +1,35 @@
Index: page/FrameView.cpp
===================================================================
--- page/FrameView.cpp (revision 97950)
+++ page/FrameView.cpp (working copy)
@@ -152,10 +152,12 @@
m_page = page;
m_page->addScrollableArea(this);
+#if 0
if (m_frame == m_page->mainFrame()) {
ScrollableArea::setVerticalScrollElasticity(ScrollElasticityAllowed);
ScrollableArea::setHorizontalScrollElasticity(ScrollElasticityAllowed);
}
+#endif
}
}
}
Index: platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.mm
===================================================================
--- platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.mm (revision 97950)
+++ platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.mm (working copy)
@@ -356,9 +356,13 @@
bool isScrollbarOverlayAPIAvailable()
{
+#if 0
static bool apiAvailable = [lookUpNSScrollerImpClass() respondsToSelector:@selector(scrollerImpWithStyle:controlSize:horizontal:replacingScrollerImp:)] &&
[lookUpNSScrollerImpPairClass() instancesRespondToSelector:@selector(scrollerStyle)];
return apiAvailable;
+#else
+ return false;
+#endif
}
#endif // USE(WK_SCROLLBAR_PAINTER)

View File

@ -20,7 +20,9 @@ __version__ = "8.12-1"
import copy
import logging
import os
import re
from stat import *
# cStringIO doesn't support unicode in 2.5
from StringIO import StringIO
from logging import debug, info, warning
@ -500,6 +502,9 @@ def patch_stream(instream, hunks):
def patch_hunks(srcname, tgtname, hunks):
# get the current file mode
mode = os.stat(srcname)[ST_MODE]
src = open(srcname, "rb")
tgt = open(tgtname, "wb")
@ -509,6 +514,10 @@ def patch_hunks(srcname, tgtname, hunks):
tgt.close()
src.close()
# restore the file mode
os.chmod(tgtname, mode)
return True

View File

@ -4,7 +4,7 @@
import pickle
from optparse import OptionParser
import os.path
import os
import sys
from file_util import *
from patch_util import *
@ -51,13 +51,22 @@ else:
execfile(options.patchconfig, scope)
patches = scope["patches"]
for name in patches.keys():
file = patchdir+'patches/'+name+'.patch'
for patch in patches:
file = patchdir+'patches/'+patch['name']+'.patch'
dopatch = True
if 'condition' in patch:
# Check that the environment variable is set.
if patch['condition'] not in os.environ:
sys.stderr.write('Skipping patch file '+file+'\n')
dopatch = False
if dopatch:
if not os.path.isfile(file):
sys.stderr.write('Patch file '+file+' does not exist.\n')
else:
sys.stderr.write('Reading patch file '+file+'\n')
dir = patches[name]
dir = patch['path']
patchObj = from_file(file)
patchObj.apply(dir)