Hello aa,
I'd like you to do a code review. Please execute
g4 diff -c 10891149
or point your web browser to
http://mondrian/10891149
to review the following code:
Change 10891149 by nigel...@nigeltao-srcgears2 on 2009/04/22 19:27:03 *pending*
Remove the OFFICIAL_BUILD guards around the canvas and drag-and-
drop APIs.
The PNG_NO_READ_PACK and PNG_NO_WRITE_PACK configuration was removed
from Gears' libpng because Skia uses those options.
PRESUBMIT=passed
R=aa
[email protected]
DELTA=168 (57 added, 101 deleted, 10 changed)
OCL=10891149
Affected files ...
... //depot/googleclient/gears/opensource/gears/Makefile#244 edit
... //depot/googleclient/gears/opensource/gears/base/common/base_class.cc#23
edit
... //depot/googleclient/gears/opensource/gears/base/common/base_class.h#27 edit
...
//depot/googleclient/gears/opensource/gears/base/safari/browser_load_hook.mm#15
edit
... //depot/googleclient/gears/opensource/gears/canvas/canvas.cc#29 edit
... //depot/googleclient/gears/opensource/gears/canvas/canvas.h#23 edit
... //depot/googleclient/gears/opensource/gears/desktop/desktop.cc#85 edit
... //depot/googleclient/gears/opensource/gears/desktop/desktop.h#31 edit
...
//depot/googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_ie.cc#13
edit
...
//depot/googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_win32.cc#2
edit
...
//depot/googleclient/gears/opensource/gears/desktop/meta_data_extraction.cc#5
edit
... //depot/googleclient/gears/opensource/gears/factory/factory_ff.cc#4 edit
... //depot/googleclient/gears/opensource/gears/factory/factory_impl.cc#31 edit
... //depot/googleclient/gears/opensource/third_party/libpng/pngusr.h#6 edit
168 delta lines: 57 added, 101 deleted, 10 changed
Also consider running:
g4 lint -c 10891149
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 10891149 by nigel...@nigeltao-srcgears2 on 2009/04/22 19:27:03 *pending*
Remove the OFFICIAL_BUILD guards around the canvas and drag-and-
drop APIs.
The PNG_NO_READ_PACK and PNG_NO_WRITE_PACK configuration was removed
from Gears' libpng because Skia uses those options.
OCL=10891149
Affected files ...
... //depot/googleclient/gears/opensource/gears/Makefile#244 edit
... //depot/googleclient/gears/opensource/gears/base/common/base_class.cc#23
edit
... //depot/googleclient/gears/opensource/gears/base/common/base_class.h#27 edit
...
//depot/googleclient/gears/opensource/gears/base/safari/browser_load_hook.mm#15
edit
... //depot/googleclient/gears/opensource/gears/canvas/canvas.cc#29 edit
... //depot/googleclient/gears/opensource/gears/canvas/canvas.h#23 edit
... //depot/googleclient/gears/opensource/gears/desktop/desktop.cc#85 edit
... //depot/googleclient/gears/opensource/gears/desktop/desktop.h#31 edit
...
//depot/googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_ie.cc#13
edit
...
//depot/googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_win32.cc#2
edit
...
//depot/googleclient/gears/opensource/gears/desktop/meta_data_extraction.cc#5
edit
... //depot/googleclient/gears/opensource/gears/factory/factory_ff.cc#4 edit
... //depot/googleclient/gears/opensource/gears/factory/factory_impl.cc#31 edit
... //depot/googleclient/gears/opensource/third_party/libpng/pngusr.h#6 edit
==== //depot/googleclient/gears/opensource/gears/Makefile#244 -
/home/nigeltao/srcgears2/googleclient/gears/opensource/gears/Makefile ====
# action=edit type=text
--- googleclient/gears/opensource/gears/Makefile 2009-04-22
13:55:35.000000000 +1000
+++ googleclient/gears/opensource/gears/Makefile 2009-04-22
21:12:18.000000000 +1000
@@ -214,7 +214,6 @@
# third_party/libjpeg
ifeq ($(USING_LIBJPEG),1)
-ifneq ($(OFFICIAL_BUILD),1)
ifneq ($(OS),wince)
THIRD_PARTY_VPATH += \
../third_party/libjpeg \
@@ -269,7 +268,6 @@
jmemnobs.c \
$(NULL)
endif # not wince
-endif # not OFFICIAL_BUILD
endif # USING_LIBJPEG
#-----------------------------------------------------------------------------
@@ -297,10 +295,6 @@
pngrtran.c \
pngrutil.c \
$(NULL)
-
-ifeq ($(OFFICIAL_BUILD),1)
- # The following files are not yet needed; exclude them to save size.
-else
# Writing PNGs
THIRD_PARTY_CSRCS += \
pngwio.c \
@@ -308,7 +302,6 @@
pngwtran.c \
pngwutil.c \
$(NULL)
-endif
endif # USING_LIBPNG
#-----------------------------------------------------------------------------
@@ -326,9 +319,6 @@
# third_party/skia
ifeq ($(USING_SKIA),1)
-ifeq ($(OFFICIAL_BUILD),1)
-# The Canvas API is not yet enabled in official builds.
-else
ifneq ($(OS),wince)
ifneq ($(OS),android)
THIRD_PARTY_VPATH += \
@@ -474,7 +464,6 @@
endif # not android
endif # not wince
-endif # OFFICIAL_BUILD
endif # USING_SKIA
#-----------------------------------------------------------------------------
@@ -728,10 +717,6 @@
inffast.c \
inftrees.c \
$(NULL)
-
-ifeq ($(OFFICIAL_BUILD),1)
- # The following files are not yet needed; exclude them to save size.
-else
# Other Algorithms
THIRD_PARTY_CSRCS += \
compress.c \
@@ -744,7 +729,6 @@
gzio.c \
trees.c \
$(NULL)
-endif
endif # USING_ZLIB
#-----------------------------------------------------------------------------
@@ -1271,9 +1255,6 @@
#-----------------------------------------------------------------------------
# canvas
-ifeq ($(OFFICIAL_BUILD),1)
-# The Canvas API is not yet enabled in official builds.
-else
ifneq ($(OS),wince)
ifneq ($(OS),android)
@@ -1285,16 +1266,23 @@
blob_backed_skia_input_stream.cc \
blob_backed_skia_output_stream.cc \
canvas.cc \
+ $(NULL)
+
+ifeq ($(OFFICIAL_BUILD),1)
+# The Canvas rendering API (i.e. 2D context, on-screen DOM element) is not
+# yet enabled in official builds.
+else
+$(BROWSER)_CPPSRCS += \
canvas_rendering_context_2d.cc \
$(NULL)
IE_CPPSRCS += \
canvas_rendering_element_ie.cc \
$(NULL)
+endif # OFFICIAL_BUILD
endif # not android
endif # not wince
-endif # OFFICIAL_BUILD
#-----------------------------------------------------------------------------
# database
@@ -1345,6 +1333,7 @@
desktop_osx.cc \
desktop_win32.cc \
dll_data_wince.cc \
+ drag_and_drop_utils_common.cc \
meta_data_extraction.cc \
shortcut_utils_win32.cc \
$(NULL)
@@ -1361,13 +1350,6 @@
desktop_cr.cc \
$(NULL)
-ifeq ($(OFFICIAL_BUILD),1)
-# The Drag-and-Drop API has not been finalized for official builds.
-else
-$(BROWSER)_CPPSRCS += \
- drag_and_drop_utils_common.cc \
- $(NULL)
-
FF3_CPPSRCS += \
drag_and_drop_utils_ff.cc \
$(NULL)
@@ -1386,7 +1368,6 @@
drag_and_drop_utils_sf.mm \
$(NULL)
-endif # not OFFICIAL_BUILD
endif # not android
NPAPI_JAVASRCS += \
==== //depot/googleclient/gears/opensource/gears/base/common/base_class.cc#23 -
/home/nigeltao/srcgears2/googleclient/gears/opensource/gears/base/common/base_class.cc
====
# action=edit type=text
--- googleclient/gears/opensource/gears/base/common/base_class.cc
2009-04-22 18:41:22.000000000 +1000
+++ googleclient/gears/opensource/gears/base/common/base_class.cc
2009-04-22 19:13:27.000000000 +1000
@@ -34,21 +34,13 @@
#if BROWSER_FF
#include "gears/base/firefox/dom_utils.h"
-#ifdef OFFICIAL_BUILD
- // The Drag-and-Drop API has not been finalized for official builds.
-#else
#if defined(WIN32)
#include "gears/desktop/drag_and_drop_utils_win32.h"
#endif
-#endif
#elif BROWSER_IE && !defined(OS_WINCE)
#include "gears/base/ie/activex_utils.h"
-#ifdef OFFICIAL_BUILD
- // The Drag-and-Drop API has not been finalized for official builds.
-#else
#include "gears/desktop/drag_and_drop_utils_win32.h"
-#endif
#elif BROWSER_IEMOBILE
#include "gears/base/ie/activex_utils.h"
@@ -81,13 +73,9 @@
#endif
#if (BROWSER_IE || BROWSER_FF) && defined(WIN32)
-#ifdef OFFICIAL_BUILD
- // The Drag-and-Drop API has not been finalized for official builds.
-#else
if (!is_worker) {
drop_target_interceptor_.reset(DropTargetInterceptor::Intercept(this));
}
-#endif
#endif
js_runner_->OnModuleEnvironmentAttach();
}
==== //depot/googleclient/gears/opensource/gears/base/common/base_class.h#27 -
/home/nigeltao/srcgears2/googleclient/gears/opensource/gears/base/common/base_class.h
====
# action=edit type=text
--- googleclient/gears/opensource/gears/base/common/base_class.h
2009-04-22 21:06:37.000000000 +1000
+++ googleclient/gears/opensource/gears/base/common/base_class.h
2009-04-22 19:50:08.000000000 +1000
@@ -95,11 +95,7 @@
#endif
#if (BROWSER_IE || BROWSER_FF) && defined(WIN32)
-#ifdef OFFICIAL_BUILD
- // The Drag-and-Drop API has not been finalized for official builds.
-#else
scoped_refptr<DropTargetInterceptor> drop_target_interceptor_;
-#endif
#endif
bool is_worker_;
====
//depot/googleclient/gears/opensource/gears/base/safari/browser_load_hook.mm#15
-
/home/nigeltao/srcgears2/googleclient/gears/opensource/gears/base/safari/browser_load_hook.mm
====
# action=edit type=text
--- googleclient/gears/opensource/gears/base/safari/browser_load_hook.mm
2009-04-22 18:41:23.000000000 +1000
+++ googleclient/gears/opensource/gears/base/safari/browser_load_hook.mm
2009-04-22 19:13:30.000000000 +1000
@@ -110,16 +110,12 @@
LOG(("Gears: notification hook already installed"));
}
-#ifdef OFFICIAL_BUILD
- // The Drag-and-Drop API has not been finalized for official builds.
-#else
LOG(("Gears: Swizzling WebView methods"));
if (!SwizzleWebViewMethods()) {
NSLog(@"Gears: Swizzling WebView methods failed");
return NO;
}
LOG(("Gears: Swizzling WebView methods succeeded"));
-#endif
// If we got here then we loaded OK
LOG(("Loaded Gears version: " PRODUCT_VERSION_STRING_ASCII "\n" ));
==== //depot/googleclient/gears/opensource/gears/canvas/canvas.cc#29 -
/home/nigeltao/srcgears2/googleclient/gears/opensource/gears/canvas/canvas.cc
====
# action=edit type=text
--- googleclient/gears/opensource/gears/canvas/canvas.cc 2009-04-22
13:55:35.000000000 +1000
+++ googleclient/gears/opensource/gears/canvas/canvas.cc 2009-04-22
19:13:33.000000000 +1000
@@ -29,15 +29,19 @@
#include "gears/blob/blob.h"
#include "gears/canvas/blob_backed_skia_input_stream.h"
#include "gears/canvas/blob_backed_skia_output_stream.h"
+#if !defined(OFFICIAL_BUILD)
#include "gears/canvas/canvas_rendering_context_2d.h"
+#endif // !defined(OFFICIAL_BUILD)
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkRect.h"
#include "third_party/skia/include/images/SkImageDecoder.h"
#include "third_party/skia/include/images/SkImageEncoder.h"
+#if !defined(OFFICIAL_BUILD)
#if BROWSER_IE
#include "gears/canvas/canvas_rendering_element_ie.h"
#endif
+#endif // !defined(OFFICIAL_BUILD)
namespace canvas {
const SkBitmap::Config skia_config = SkBitmap::kARGB_8888_Config;
@@ -48,6 +52,7 @@
DECLARE_DISPATCHER(GearsCanvas);
const std::string GearsCanvas::kModuleName("GearsCanvas");
+#if !defined(OFFICIAL_BUILD)
GearsCanvas::GearsCanvas()
: ModuleImplBaseClass(kModuleName),
rendering_context_(NULL) {
@@ -75,16 +80,27 @@
void GearsCanvas::ClearRenderingContextReference() {
rendering_context_ = NULL;
}
+#else // !defined(OFFICIAL_BUILD)
+GearsCanvas::GearsCanvas()
+ : ModuleImplBaseClass(kModuleName) {
+ // Initial dimensions as per the HTML5 canvas spec.
+ ResetCanvas(300, 150);
+}
+
+GearsCanvas::~GearsCanvas() {
+}
+#endif // !defined(OFFICIAL_BUILD)
template<>
void Dispatcher<GearsCanvas>::Init() {
RegisterMethod("crop", &GearsCanvas::Crop);
RegisterMethod("decode", &GearsCanvas::Decode);
RegisterMethod("encode", &GearsCanvas::Encode);
- RegisterMethod("getContext", &GearsCanvas::GetContext);
RegisterMethod("resize", &GearsCanvas::Resize);
RegisterProperty("height", &GearsCanvas::GetHeight, &GearsCanvas::SetHeight);
RegisterProperty("width", &GearsCanvas::GetWidth, &GearsCanvas::SetWidth);
+#if !defined(OFFICIAL_BUILD)
+ RegisterMethod("getContext", &GearsCanvas::GetContext);
// TODO(nigeltao): We need to decide which one of the (off-screen)
// GearsCanvas and the (on-screen) rendering DOM element is the definitive
// one, in terms of width and height. Does modifying the WxH of one
@@ -97,6 +113,7 @@
// fast on all Browser x OS combinations.
RegisterMethod("invalidateRenderingElement",
&GearsCanvas::InvalidateRenderingElement);
+#endif // !defined(OFFICIAL_BUILD)
}
void GearsCanvas::EnsureBitmapPixelsAreAllocated() {
@@ -324,6 +341,7 @@
ResetCanvas(GetWidth(), new_height);
}
+#if !defined(OFFICIAL_BUILD)
void GearsCanvas::GetContext(JsCallContext *context) {
std::string16 context_id;
JsArgument args[] = {
@@ -451,6 +469,7 @@
context->SetException(STRING16(L"Unimplemented"));
#endif
}
+#endif // !defined(OFFICIAL_BUILD)
int GearsCanvas::GetWidth() const {
return skia_bitmap_->width();
==== //depot/googleclient/gears/opensource/gears/canvas/canvas.h#23 -
/home/nigeltao/srcgears2/googleclient/gears/opensource/gears/canvas/canvas.h
====
# action=edit type=text
--- googleclient/gears/opensource/gears/canvas/canvas.h 2009-04-22
11:24:49.000000000 +1000
+++ googleclient/gears/opensource/gears/canvas/canvas.h 2009-04-22
19:13:36.000000000 +1000
@@ -26,8 +26,6 @@
#ifndef GEARS_CANVAS_CANVAS_H__
#define GEARS_CANVAS_CANVAS_H__
-#if !defined(OFFICIAL_BUILD)
-
#include "gears/base/common/base_class.h"
#include "gears/base/common/common.h"
#include "gears/base/common/scoped_refptr.h"
@@ -38,10 +36,14 @@
class SkCanvas;
struct SkIRect;
+#if !defined(OFFICIAL_BUILD)
+// The Canvas rendering API (i.e. 2D context, on-screen DOM element) is not
+// yet enabled in official builds.
#if BROWSER_IE
class CanvasRenderingElementIE;
#endif
class GearsCanvasRenderingContext2D;
+#endif // !defined(OFFICIAL_BUILD)
class GearsCanvas : public ModuleImplBaseClass {
public:
@@ -80,6 +82,7 @@
void SetWidth(JsCallContext *context);
void SetHeight(JsCallContext *context);
+#if !defined(OFFICIAL_BUILD)
// Returns a context object to draw onto the canvas.
// IN: String contextId
// OUT: CanvasRenderingContext2D
@@ -94,13 +97,16 @@
// IN: -
// OUT: -
void InvalidateRenderingElement(JsCallContext *context);
+#endif // !defined(OFFICIAL_BUILD)
// The following are not exported to Javascript.
+#if !defined(OFFICIAL_BUILD)
// Clears the plain pointer to GearsCanvasRenderingContext2D, to prevent a
// dangling pointer. The rendering context will be recreated when needed.
void ClearRenderingContextReference();
+#endif // !defined(OFFICIAL_BUILD)
// Returns true if the rectangle is contained completely within the bounds
// of this bitmap, and has non-negative width and height.
@@ -120,14 +126,16 @@
// pixels have been allocated.
void EnsureBitmapPixelsAreAllocated();
+ // Cannot embed objects directly due to compilation issues; see comment
+ // at top of file.
+ scoped_ptr<SkBitmap> skia_bitmap_;
+
+#if !defined(OFFICIAL_BUILD)
// Can't use a scoped_refptr since that will create a reference cycle.
// Instead, use a plain pointer and clear it when the target is destroyed.
// Recreate this pointer when accessed again. For this to work, we make
// the Context stateless.
GearsCanvasRenderingContext2D *rendering_context_;
- // Cannot embed objects directly due to compilation issues; see comment
- // at top of file.
- scoped_ptr<SkBitmap> skia_bitmap_;
#if BROWSER_IE
// Ideally, this should be a CComPtr<CanvasRenderingElementIE>, but doing
@@ -135,9 +143,9 @@
// and Release this COM object.
CanvasRenderingElementIE *rendering_element_;
#endif
+#endif // !defined(OFFICIAL_BUILD)
DISALLOW_EVIL_CONSTRUCTORS(GearsCanvas);
};
-#endif // !defined(OFFICIAL_BUILD)
#endif // GEARS_CANVAS_CANVAS_H__
==== //depot/googleclient/gears/opensource/gears/desktop/desktop.cc#85 -
/home/nigeltao/srcgears2/googleclient/gears/opensource/gears/desktop/desktop.cc
====
# action=edit type=text
--- googleclient/gears/opensource/gears/desktop/desktop.cc 2009-04-21
17:44:54.000000000 +1000
+++ googleclient/gears/opensource/gears/desktop/desktop.cc 2009-04-22
19:13:39.000000000 +1000
@@ -45,7 +45,6 @@
#endif
#include "gears/blob/blob.h"
#include "gears/blob/blob_interface.h"
-#include "gears/desktop/drag_and_drop_utils_common.h"
#include "gears/desktop/file_dialog.h"
#include "gears/desktop/meta_data_extraction.h"
#include "gears/localserver/common/http_constants.h"
@@ -72,9 +71,6 @@
RegisterMethod("createShortcut", &GearsDesktop::CreateShortcut);
RegisterMethod("openFiles", &GearsDesktop::OpenFiles);
-#ifdef OFFICIAL_BUILD
- // The Drag-and-Drop API has not been finalized for official builds.
-#else
#if GEARS_DRAG_AND_DROP_API_IS_SUPPORTED_FOR_THIS_PLATFORM
// TODO(nigeltao): should acceptDrag be renamed finishDrag??
RegisterMethod("acceptDrag", &GearsDesktop::AcceptDrag);
@@ -82,7 +78,6 @@
RegisterMethod("getDragData", &GearsDesktop::GetDragData);
RegisterMethod("setDragCursor", &GearsDesktop::SetDragCursor);
#endif
-#endif // OFFICIAL_BUILD
}
@@ -871,9 +866,6 @@
return true;
}
-#ifdef OFFICIAL_BUILD
-// The Drag-and-Drop API has not been finalized for official builds.
-#else
#if GEARS_DRAG_AND_DROP_API_IS_SUPPORTED_FOR_THIS_PLATFORM
void GearsDesktop::AcceptDrag(JsCallContext *context) {
if (EnvIsWorker()) {
@@ -1037,4 +1029,3 @@
}
}
#endif // GEARS_DRAG_AND_DROP_API_IS_SUPPORTED_FOR_THIS_PLATFORM
-#endif // OFFICIAL_BUILD
==== //depot/googleclient/gears/opensource/gears/desktop/desktop.h#31 -
/home/nigeltao/srcgears2/googleclient/gears/opensource/gears/desktop/desktop.h
====
# action=edit type=text
--- googleclient/gears/opensource/gears/desktop/desktop.h 2009-04-21
17:44:54.000000000 +1000
+++ googleclient/gears/opensource/gears/desktop/desktop.h 2009-04-22
19:13:42.000000000 +1000
@@ -33,6 +33,7 @@
#include "gears/base/common/common.h"
#include "gears/base/common/permissions_db.h"
#include "gears/base/common/security_model.h"
+#include "gears/desktop/drag_and_drop_utils_common.h"
#include "gears/localserver/common/http_request.h"
#include "third_party/scoped_ptr/scoped_ptr.h"
@@ -170,9 +171,7 @@
// OUT: void
void OpenFiles(JsCallContext *context);
-#if defined(OFFICIAL_BUILD) || defined(OS_ANDROID)
-// The Drag-and-Drop API has not been finalized for official builds.
-#else
+#if GEARS_DRAG_AND_DROP_API_IS_SUPPORTED_FOR_THIS_PLATFORM
// TODO(nigeltao): decide which of AcceptDrag and SetDragCursor to
// keep and which to cull, since they essentially do the same thing (except
// that AcceptDrag takes responsibility for calling event.cancelBubble(true),
====
//depot/googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_ie.cc#13
-
/home/nigeltao/srcgears2/googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_ie.cc
====
# action=edit type=text
--- googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_ie.cc
2009-04-21 17:44:55.000000000 +1000
+++ googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_ie.cc
2009-04-22 19:13:45.000000000 +1000
@@ -23,10 +23,6 @@
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifdef OFFICIAL_BUILD
-// The Drag-and-Drop API has not been finalized for official builds.
-#else
-
#include "gears/desktop/drag_and_drop_utils_common.h"
#if GEARS_DRAG_AND_DROP_API_IS_SUPPORTED_FOR_THIS_PLATFORM
@@ -242,4 +238,3 @@
#endif // GEARS_DRAG_AND_DROP_API_IS_SUPPORTED_FOR_THIS_PLATFORM
-#endif // OFFICIAL_BUILD
====
//depot/googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_win32.cc#2
-
/home/nigeltao/srcgears2/googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_win32.cc
====
# action=edit type=text
--- googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_win32.cc
2009-04-22 13:55:36.000000000 +1000
+++ googleclient/gears/opensource/gears/desktop/drag_and_drop_utils_win32.cc
2009-04-22 19:13:49.000000000 +1000
@@ -22,10 +22,6 @@
// 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.
-
-#ifdef OFFICIAL_BUILD
-// The Drag-and-Drop API has not been finalized for official builds.
-#else
#include "gears/desktop/drag_and_drop_utils_common.h"
#if GEARS_DRAG_AND_DROP_API_IS_SUPPORTED_FOR_THIS_PLATFORM
@@ -295,4 +291,3 @@
#endif // GEARS_DRAG_AND_DROP_API_IS_SUPPORTED_FOR_THIS_PLATFORM
-#endif // OFFICIAL_BUILD
====
//depot/googleclient/gears/opensource/gears/desktop/meta_data_extraction.cc#5 -
/home/nigeltao/srcgears2/googleclient/gears/opensource/gears/desktop/meta_data_extraction.cc
====
# action=edit type=text
--- googleclient/gears/opensource/gears/desktop/meta_data_extraction.cc
2009-04-22 13:55:36.000000000 +1000
+++ googleclient/gears/opensource/gears/desktop/meta_data_extraction.cc
2009-04-22 19:13:52.000000000 +1000
@@ -23,10 +23,6 @@
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifdef OFFICIAL_BUILD
- // The Drag-and-Drop API has not been finalized for official builds.
-#else
-
#include "gears/desktop/drag_and_drop_utils_common.h"
#if GEARS_DRAG_AND_DROP_API_IS_SUPPORTED_FOR_THIS_PLATFORM
@@ -281,4 +277,3 @@
}
#endif // GEARS_DRAG_AND_DROP_API_IS_SUPPORTED_FOR_THIS_PLATFORM
-#endif // OFFICIAL_BUILD
==== //depot/googleclient/gears/opensource/gears/factory/factory_ff.cc#4 -
/home/nigeltao/srcgears2/googleclient/gears/opensource/gears/factory/factory_ff.cc
====
# action=edit type=xtext
--- googleclient/gears/opensource/gears/factory/factory_ff.cc 2009-04-22
18:41:23.000000000 +1000
+++ googleclient/gears/opensource/gears/factory/factory_ff.cc 2009-04-22
19:13:55.000000000 +1000
@@ -59,12 +59,8 @@
NULL, &factory_impl_)) {
return NS_ERROR_FAILURE;
}
-#ifdef OFFICIAL_BUILD
- // The Drag-and-Drop API has not been finalized for official builds.
-#else
#if defined(LINUX) && !defined(OS_MACOSX)
InitializeGtkSignalEmissionHooks();
-#endif
#endif
unload_monitor_.reset(new JsEventMonitor(module_environment->js_runner_,
JSEVENT_UNLOAD, this));
==== //depot/googleclient/gears/opensource/gears/factory/factory_impl.cc#31 -
/home/nigeltao/srcgears2/googleclient/gears/opensource/gears/factory/factory_impl.cc
====
# action=edit type=text
--- googleclient/gears/opensource/gears/factory/factory_impl.cc 2009-04-22
13:55:36.000000000 +1000
+++ googleclient/gears/opensource/gears/factory/factory_impl.cc 2009-04-22
19:46:11.000000000 +1000
@@ -50,19 +50,22 @@
#include "genfiles/product_constants.h"
#include "third_party/scoped_ptr/scoped_ptr.h"
+#if defined(OS_WINCE) || defined(OS_ANDROID)
+// The Canvas API is unimplemented on WinCE and Android.
+#else
+#include "gears/canvas/canvas.h"
+#endif // defined(OS_WINCE) || defined(OS_ANDROID)
+
#ifdef OFFICIAL_BUILD
-// The Canvas, Console and Database2 APIs have not
-// been finalized for official builds.
+// The Console and Database2 APIs have not been finalized for official builds.
#else
#include "gears/database2/manager.h"
#include "gears/dummy/dummy_module.h"
-#ifdef OS_WINCE
-// Furthermore, Canvas and Console are unimplemented for all
-// browsers on WinCE.
-#else
-#include "gears/canvas/canvas.h"
+#if defined(OS_WINCE) || defined(OS_ANDROID)
+// The Console API is unimplemented on WinCE and Android.
+#else
#include "gears/console/console.h"
-#endif // OS_WINCE
+#endif // defined(OS_WINCE) || defined(OS_ANDROID)
#endif // OFFICIAL_BUILD
#ifdef WIN32
@@ -203,9 +206,15 @@
} else if (module_name == STRING16(L"beta.blobbuilder")) {
CreateModule<GearsBlobBuilder>(module_environment_.get(),
context, &object);
+#if defined(OS_WINCE) || defined(OS_ANDROID)
+ // The Canvas API is unimplemented on WinCE and Android.
+#else
+ } else if (module_name == STRING16(L"beta.canvas")) {
+ CreateModule<GearsCanvas>(module_environment_.get(), context, &object);
+#endif // defined(OS_WINCE) || defined(OS_ANDROID)
+
#ifdef OFFICIAL_BUILD
- // The Canvas, Console and Database2 APIs have not
- // been finalized for official builds.
+ // The Console and Database2 APIs have not been finalized for official
builds.
#else
} else if (module_name == STRING16(L"beta.databasemanager")) {
CreateModule<GearsDatabase2Manager>(module_environment_.get(),
@@ -213,14 +222,11 @@
} else if (module_name == STRING16(L"beta.dummymodule")) {
CreateModule<GearsDummyModule>(module_environment_.get(), context,
&object);
#if defined(OS_WINCE) || defined(OS_ANDROID)
- // Furthermore, Canvas and Console are unimplemented for all
- // browsers on WinCE and Android.
-#else
- } else if (module_name == STRING16(L"beta.canvas")) {
- CreateModule<GearsCanvas>(module_environment_.get(), context, &object);
+ // Furthermore, the Console API is unimplemented on WinCE and Android.
+#else
} else if (module_name == STRING16(L"beta.console")) {
CreateModule<GearsConsole>(module_environment_.get(), context, &object);
-#endif // OS_WINCE
+#endif // defined(OS_WINCE) || defined(OS_ANDROID)
#endif // OFFICIAL_BUILD
} else if (module_name == STRING16(L"beta.test")) {
#ifdef USING_CCTESTS
==== //depot/googleclient/gears/opensource/third_party/libpng/pngusr.h#6 -
/home/nigeltao/srcgears2/googleclient/gears/opensource/third_party/libpng/pngusr.h
====
# action=edit type=text
--- googleclient/gears/opensource/third_party/libpng/pngusr.h 2009-04-22
13:55:37.000000000 +1000
+++ googleclient/gears/opensource/third_party/libpng/pngusr.h 2009-04-22
19:13:59.000000000 +1000
@@ -111,10 +111,6 @@
#define PNG_NO_MNG_FEATURES
-#ifdef OFFICIAL_BUILD
-#define PNG_NO_READ_PACK
-#endif
-
// Gears addition: disables verifying the embedded CRCs when reading.
// (Zlib adds a static 8KB table, plus additional code, for CRC support.)
#define GEARS_PNG_NO_READ_VERIFY_CRC
@@ -123,15 +119,11 @@
// Write flags
//
-#ifdef OFFICIAL_BUILD
-#define PNG_NO_WRITE_SUPPORTED
-#else
#ifdef CHROME_PNG_WRITE_SUPPORT
#define PNG_NO_WRITE_BACKGROUND
#define PNG_NO_WRITE_DITHER
#define PNG_NO_WRITE_INVERT
#define PNG_NO_WRITE_SHIFT
-#define PNG_NO_WRITE_PACK
#define PNG_NO_WRITE_PACKSWAP
#define PNG_NO_WRITE_FILLER
#define PNG_NO_WRITE_SWAP_ALPHA
@@ -155,7 +147,6 @@
#define PNG_NO_WRITE_OPT_PLTE
#else
#define PNG_NO_WRITE_SUPPORTED
-#endif
#endif
//#define PNG_NO_SEQUENTIAL_READ_SUPPORTED