Hello iyengar,
I'd like you to do a code review. Please execute
g4 diff -c 9743833
or point your web browser to
http://mondrian/9743833
to review the following code:
Change 9743833 by mpcompl...@mpcomplete-gears on 2009/01/15 15:24:17 *pending*
Fixes to support statically linking in Chrome:
- munge a bunch of symbols to have a "gears_" prefix to avoid conflicts.
- Change pngusr.h to have the same #defines as Chrome's pngusr.h.
R=iyengar
[email protected]
DELTA=116 (102 added, 14 deleted, 0 changed)
OCL=9743833
Affected files ...
... //depot/googleclient/gears/opensource/gears/base/chrome/static_lib.h#1 add
... //depot/googleclient/gears/opensource/gears/base/common/basictypes.h#4 edit
... //depot/googleclient/gears/opensource/third_party/libpng/pngusr.h#5 edit
116 delta lines: 102 added, 14 deleted, 0 changed
Also consider running:
g4 lint -c 9743833
which verifies that the changelist doesn't introduce new style violations.
If you can't do the review, please let me know as soon as possible. During
your review, please ensure that all new code has corresponding unit tests and
that existing unit tests are updated appropriately. Visit
http://www/eng/code_review.html for more information.
This is a semiautomated message from "g4 mail". Complaints or suggestions?
Mail [email protected].
Change 9743833 by mpcompl...@mpcomplete-gears on 2009/01/15 15:24:17 *pending*
Fixes to support statically linking in Chrome:
- munge a bunch of symbols to have a "gears_" prefix to avoid conflicts.
- Change pngusr.h to have the same #defines as Chrome's pngusr.h.
Affected files ...
... //depot/googleclient/gears/opensource/gears/base/chrome/static_lib.h#1 add
... //depot/googleclient/gears/opensource/gears/base/common/basictypes.h#4 edit
... //depot/googleclient/gears/opensource/third_party/libpng/pngusr.h#5 edit
==== //depot/googleclient/gears/opensource/gears/base/chrome/static_lib.h#1 -
C:\src\gears/googleclient/gears/opensource/gears/base/chrome/static_lib.h ====
# action=add type=text
--- /dev/null 1969-12-31 16:00:00.000000000 -0800
+++ googleclient/gears/opensource/gears/base/chrome/static_lib.h
2009-01-15 15:22:52.000000000 -0800
@@ -0,0 +1,77 @@
+// Copyright 2008, Google Inc.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
notice,
+// this list of conditions and the following disclaimer in the
documentation
+// and/or other materials provided with the distribution.
+// 3. Neither the name of Google Inc. nor the names of its contributors may be
+// used to endorse or promote products derived from this software without
+// specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// This file contains symbol redefinitions to avoid conflicts with Chrome when
+// statically linking.
+
+#ifndef GEARS_BASE_COMMON_STATIC_LIB_H__
+#define GEARS_BASE_COMMON_STATIC_LIB_H__
+
+#define GetV8Context gears_GetV8Context
+#define WrapNPObject gears_WrapNPObject
+#define NPScriptObjectClass gears_NPScriptObjectClass
+#define NPN_GetStringIdentifier gears_NPN_GetStringIdentifier
+#define NPN_GetStringIdentifiers gears_NPN_GetStringIdentifiers
+#define NPN_GetIntIdentifier gears_NPN_GetIntIdentifier
+#define NPN_IdentifierIsString gears_NPN_IdentifierIsString
+#define NPN_UTF8FromIdentifier gears_NPN_UTF8FromIdentifier
+#define NPN_IntFromIdentifier gears_NPN_IntFromIdentifier
+#define NPN_CreateObject gears_NPN_CreateObject
+#define NPN_RetainObject gears_NPN_RetainObject
+#define NPN_ReleaseObject gears_NPN_ReleaseObject
+#define NPN_Invoke gears_NPN_Invoke
+#define NPN_InvokeDefault gears_NPN_InvokeDefault
+#define NPN_Evaluate gears_NPN_Evaluate
+#define NPN_GetProperty gears_NPN_GetProperty
+#define NPN_SetProperty gears_NPN_SetProperty
+#define NPN_RemoveProperty gears_NPN_RemoveProperty
+#define NPN_HasProperty gears_NPN_HasProperty
+#define NPN_HasMethod gears_NPN_HasMethod
+#define NPN_ReleaseVariantValue gears_NPN_ReleaseVariantValue
+#define NPN_SetException gears_NPN_SetException
+#define NPN_Enumerate gears_NPN_Enumerate
+#define NPN_MemAlloc gears_NPN_MemAlloc
+#define NPN_MemFree gears_NPN_MemFree
+#define NPN_MemFlush gears_NPN_MemFlush
+#define NPN_ReloadPlugins gears_NPN_ReloadPlugins
+#define NPN_RequestRead gears_NPN_RequestRead
+#define NPN_GetURLNotify gears_NPN_GetURLNotify
+#define NPN_GetURL gears_NPN_GetURL
+#define NPN_PostURLNotify gears_NPN_PostURLNotify
+#define NPN_PostURL gears_NPN_PostURL
+#define NPN_NewStream gears_NPN_NewStream
+#define NPN_Write gears_NPN_Write
+#define NPN_DestroyStream gears_NPN_DestroyStream
+#define NPN_UserAgent gears_NPN_UserAgent
+#define NPN_Status gears_NPN_Status
+#define NPN_InvalidateRect gears_NPN_InvalidateRect
+#define NPN_InvalidateRegion gears_NPN_InvalidateRegion
+#define NPN_ForceRedraw gears_NPN_ForceRedraw
+#define NPN_GetValue gears_NPN_GetValue
+#define NPN_SetValue gears_NPN_SetValue
+#define SQLStatement gears_SQLStatement
+#define DllMain gears_DllMain
+
+#endif // GEARS_BASE_COMMON_STATIC_LIB_H__
==== //depot/googleclient/gears/opensource/gears/base/common/basictypes.h#4 -
C:\src\gears/googleclient/gears/opensource/gears/base/common/basictypes.h ====
# action=edit type=text
--- googleclient/gears/opensource/gears/base/common/basictypes.h
2009-01-15 15:24:25.000000000 -0800
+++ googleclient/gears/opensource/gears/base/common/basictypes.h
2009-01-15 15:21:49.000000000 -0800
@@ -88,6 +88,11 @@
#else
typedef unsigned long long uint64;
#endif /* _MSC_VER */
+
+#if GEARS_STATIC_LIB
+#include "gears/base/chrome/static_lib.h"
+#endif
+
#endif /* BROWSER_* */
//------------------------------------------------------------------------------
==== //depot/googleclient/gears/opensource/third_party/libpng/pngusr.h#5 -
C:\src\gears/googleclient/gears/opensource/third_party/libpng/pngusr.h ====
# action=edit type=text
--- googleclient/gears/opensource/third_party/libpng/pngusr.h 2009-01-15
15:24:25.000000000 -0800
+++ googleclient/gears/opensource/third_party/libpng/pngusr.h 2009-01-15
15:21:04.000000000 -0800
@@ -42,22 +42,38 @@
#define abort() exit(EXIT_FAILURE)
#endif
+#if GEARS_STATIC_LIB
+// Changes to get Skia to compile:
+// TODO(cprince): Remove these from Skia instead?
+#define PNG_NO_HANDLE_AS_UNKNOWN
+#define PNG_NO_READ_sBIT
+#define PNG_NO_READ_FILLER
+#define PNG_NO_READ_UNKNOWN_CHUNKS
+#define PNG_NO_READ_USER_CHUNKS
+#else
+#define PNG_NO_ERROR_TEXT
+#define PNG_NO_WARNINGS
+#define PNG_NO_WARN_UNINITIALIZED_ROW
+#define PNG_NO_READ_GAMMA
+#define PNG_NO_READ_gAMA
+
+// TODO(mpcomplete): this is used by libgd. Static-linking only works in
+// official builds, where libgd is not used. Fix this.
+#define PNG_NO_INFO_IMAGE
+#endif
+
#define PNG_NO_GLOBAL_ARRAYS
#define PNG_NO_USER_TRANSFORM_PTR
#define PNG_NO_CONSOLE_IO
#define PNG_NO_ZALLOC_ZERO
#define PNG_NO_ERROR_NUMBERS
#define PNG_NO_EASY_ACCESS
-#define PNG_NO_WARN_UNINITIALIZED_ROW
-#define PNG_NO_WARNINGS
#ifdef PNG_NO_WARNINGS
#define png_warning(s1,s2) (void)""
#define png_chunk_warning(s1,s2) (void)""
#endif // PNG_NO_WARNINGS
-#define PNG_NO_ERROR_TEXT
-
#ifdef PNG_NO_ERROR_TEXT
#define png_error(s1,s2) png_err(s1)
#define png_chunk_error(s1,s2) png_err(s1)
@@ -67,7 +83,6 @@
// Read flags
//
-#define PNG_NO_READ_GAMMA
#define PNG_NO_READ_BACKGROUND
#define PNG_NO_READ_DITHER
#define PNG_NO_READ_INVERT
@@ -80,7 +95,6 @@
#define PNG_NO_READ_USER_TRANSFORM
#define PNG_NO_READ_bKGD
#define PNG_NO_READ_cHRM
-#define PNG_NO_READ_gAMA
#define PNG_NO_READ_hIST
#define PNG_NO_READ_iCCP
#define PNG_NO_READ_oFFs
@@ -95,14 +109,6 @@
#define PNG_NO_FIXED_POINT_SUPPORTED
#define PNG_NO_READ_OPT_PLTE
#define PNG_NO_MNG_FEATURES
-
-// Changes to get Skia to compile:
-// TODO(cprince): Remove these from Skia instead?
-// #define PNG_NO_HANDLE_AS_UNKNOWN
-// #define PNG_NO_READ_sBIT
-// #define PNG_NO_READ_FILLER
-// #define PNG_NO_READ_UNKNOWN_CHUNKS
-// #define PNG_NO_READ_USER_CHUNKS
#ifdef OFFICIAL_BUILD