Hello andreip,
I'd like you to do a code review. Please execute
g4 diff -c 9505817
or point your web browser to
http://mondrian/9505817
to review the following code:
Change 9505817 by stevebl...@steveblock-gears2 on 2008/12/22 21:18:22 *pending*
Uses BROWSER_CHROME rather than BROWSER_NPAPI && WIN32 to avoid
inadvertant matching of Opera, which also defines these flags.
R=andreip
[email protected]
DELTA=17 (1 added, 0 deleted, 16 changed)
OCL=9505817
Affected files ...
... //depot/googleclient/gears/opensource/gears/base/common/thread_locals.cc#5
edit
... //depot/googleclient/gears/opensource/gears/base/common/thread_locals.h#5
edit
...
//depot/googleclient/gears/opensource/gears/localserver/common/critical_section.h#2
edit
... //depot/googleclient/gears/opensource/gears/timer/timer.cc#5 edit
... //depot/googleclient/gears/opensource/gears/timer/timer.h#6 edit
17 delta lines: 1 added, 0 deleted, 16 changed
Also consider running:
g4 lint -c 9505817
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 9505817 by stevebl...@steveblock-gears2 on 2008/12/22 21:18:22 *pending*
Uses BROWSER_CHROME rather than BROWSER_NPAPI && WIN32 to avoid
inadvertant matching of Opera, which also defines these flags.
Affected files ...
... //depot/googleclient/gears/opensource/gears/base/common/thread_locals.cc#5
edit
... //depot/googleclient/gears/opensource/gears/base/common/thread_locals.h#5
edit
...
//depot/googleclient/gears/opensource/gears/localserver/common/critical_section.h#2
edit
... //depot/googleclient/gears/opensource/gears/timer/timer.cc#5 edit
... //depot/googleclient/gears/opensource/gears/timer/timer.h#6 edit
==== //depot/googleclient/gears/opensource/gears/base/common/thread_locals.cc#5
-
c:\MyDocs\Gears2/googleclient/gears/opensource/gears/base/common/thread_locals.cc
====
# action=edit type=text
--- googleclient/gears/opensource/gears/base/common/thread_locals.cc
2008-12-22 21:18:17.000000000 +0000
+++ googleclient/gears/opensource/gears/base/common/thread_locals.cc
2008-12-23 10:08:56.000000000 +0000
@@ -29,14 +29,15 @@
#include "gears/base/common/atomic_ops.h"
// TODO(mpcomplete): implement these.
-#if BROWSER_NPAPI && defined(WIN32)
+#if BROWSER_CHROME
#define BROWSER_IE 1
#endif
// TODO(michaeln): figure out if it's safe to initialize this tls_index_ here
or
// not. It's set in when DllMain(processAttached) is called, will initializing
// it via the CRT squash that value set via DllMain?
-#if BROWSER_IE
+#if BROWSER_IE || BROWSER_OPERA
+// For IE, IE Mobile and Opera, we use the platform type and value.
#ifdef OS_WINCE
// On Windows Mobile 5 TLS_OUT_OF_INDEXES is undefined.
// On Windows Mobile 6 TLS_OUT_OF_INDEXES is defined to 0xffffffff
@@ -172,7 +173,7 @@
// SetTlsEntries
//------------------------------------------------------------------------------
void ThreadLocals::SetTlsEntries(Entry* entries) {
-#if BROWSER_IE
+#if BROWSER_IE || BROWSER_OPERA
::TlsSetValue(tls_index_, entries);
#elif BROWSER_FF
PR_SetThreadPrivate(tls_index_, entries);
@@ -187,7 +188,7 @@
// GetTlsEntries
//------------------------------------------------------------------------------
ThreadLocals::Entry* ThreadLocals::GetTlsEntries() {
-#if BROWSER_IE
+#if BROWSER_IE || BROWSER_OPERA
return reinterpret_cast<Entry*>(TlsGetValue(tls_index_));
#elif BROWSER_FF
return reinterpret_cast<Entry*>(PR_GetThreadPrivate(tls_index_));
@@ -198,7 +199,7 @@
}
-#if BROWSER_IE
+#if BROWSER_IE || BROWSER_OPERA
//------------------------------------------------------------------------------
// HandleProcessAttached
==== //depot/googleclient/gears/opensource/gears/base/common/thread_locals.h#5
-
c:\MyDocs\Gears2/googleclient/gears/opensource/gears/base/common/thread_locals.h
====
# action=edit type=text
--- googleclient/gears/opensource/gears/base/common/thread_locals.h
2008-12-22 21:18:17.000000000 +0000
+++ googleclient/gears/opensource/gears/base/common/thread_locals.h
2008-12-22 23:23:11.000000000 +0000
@@ -34,7 +34,7 @@
#endif
// TODO(mpcomplete): implement these.
-#if BROWSER_NPAPI && defined(WIN32)
+#if BROWSER_CHROME
#define BROWSER_IE 1
#endif
@@ -109,7 +109,7 @@
static void SetTlsEntries(Entry* map);
static Entry* GetTlsEntries();
-#if BROWSER_IE
+#if BROWSER_IE || BROWSER_OPERA
// We use one thread-local storage slot from the OS and keeps a map
// in that slot. This is the index of that slot as returned by TlsAlloc.
static DWORD tls_index_;
@@ -198,7 +198,7 @@
};
// TODO(mpcomplete): remove.
-#if BROWSER_NPAPI
+#if BROWSER_CHROME
#undef BROWSER_IE
#endif
====
//depot/googleclient/gears/opensource/gears/localserver/common/critical_section.h#2
-
c:\MyDocs\Gears2/googleclient/gears/opensource/gears/localserver/common/critical_section.h
====
# action=edit type=text
--- googleclient/gears/opensource/gears/localserver/common/critical_section.h
2008-12-22 21:18:17.000000000 +0000
+++ googleclient/gears/opensource/gears/localserver/common/critical_section.h
2008-12-22 22:57:00.000000000 +0000
@@ -36,13 +36,13 @@
#define GEARS_LOCALSERVER_COMMON_CRITICAL_SECTION_H__
// TODO(mpcomplete): implement these.
-#if BROWSER_NPAPI && defined(WIN32)
+#if BROWSER_CHROME
#define BROWSER_IE 1
#endif
-#if BROWSER_IE
+#if BROWSER_IE || BROWSER_OPERA
//------------------------------------------------------------------------------
-// BROWSER_IE
+// BROWSER_IE || BROWSER_OPERA
//------------------------------------------------------------------------------
#include <atlsync.h>
@@ -132,7 +132,7 @@
#endif
// TODO(mpcomplete): remove
-#if BROWSER_NPAPI
+#if BROWSER_CHROME
#undef BROWSER_IE
#endif
==== //depot/googleclient/gears/opensource/gears/timer/timer.cc#5 -
c:\MyDocs\Gears2/googleclient/gears/opensource/gears/timer/timer.cc ====
# action=edit type=text
--- googleclient/gears/opensource/gears/timer/timer.cc 2008-12-22
21:18:17.000000000 +0000
+++ googleclient/gears/opensource/gears/timer/timer.cc 2008-12-22
21:22:00.000000000 +0000
@@ -34,7 +34,7 @@
#include "gears/base/common/js_types.h"
// TODO(mpcomplete): remove when we have a cross-platform timer abstraction
-#if BROWSER_NPAPI && defined(WIN32)
+#if BROWSER_CHROME
#define OS_ANDROID 1
#endif
==== //depot/googleclient/gears/opensource/gears/timer/timer.h#6 -
c:\MyDocs\Gears2/googleclient/gears/opensource/gears/timer/timer.h ====
# action=edit type=text
--- googleclient/gears/opensource/gears/timer/timer.h 2008-12-22
21:18:17.000000000 +0000
+++ googleclient/gears/opensource/gears/timer/timer.h 2008-12-22
21:22:43.000000000 +0000
@@ -42,7 +42,7 @@
#include "gears/base/common/scoped_token.h"
// TODO(mpcomplete): remove when we have a cross-platform timer abstraction
-#if BROWSER_NPAPI && defined(WIN32)
+#if BROWSER_CHROME
#define OS_ANDROID 1
#endif
@@ -234,8 +234,8 @@
};
// TODO(mpcomplete): remove when we have a cross-platform timer abstraction
-#if BROWSER_NPAPI && defined(WIN32)
-#undef BROWSER_IE
+#if BROWSER_CHROME
+#undef OS_ANDROID
#endif
#endif // GEARS_TIMER_TIMER_H__