Hello andreip,

I'd like you to do a code review.  Please execute
        g4 diff -c 9465330

or point your web browser to
        http://mondrian/9465330

to review the following code:

Change 9465330 by stevebl...@steveblock-gears3 on 2008/12/18 15:02:31 *pending*

        Adds exported function to be called by Opera. Mailed on behalf of Opera.
        
        R=andreip
        [email protected],[email protected]
        DELTA=26  (25 added, 0 deleted, 1 changed)
        OCL=9465330

Affected files ...

... //depot/googleclient/gears/opensource/gears/base/npapi/module.cc#7 edit
... //depot/googleclient/gears/opensource/gears/base/npapi/module.h#6 edit

26 delta lines: 25 added, 0 deleted, 1 changed

Also consider running:
        g4 lint -c 9465330

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 9465330 by stevebl...@steveblock-gears3 on 2008/12/18 15:02:31 *pending*

        Adds exported function to be called by Opera. Mailed on behalf of Opera.

Affected files ...

... //depot/googleclient/gears/opensource/gears/base/npapi/module.cc#7 edit
... //depot/googleclient/gears/opensource/gears/base/npapi/module.h#6 edit

==== //depot/googleclient/gears/opensource/gears/base/npapi/module.cc#7 - 
c:\MyDocs\Gears3/googleclient/gears/opensource/gears/base/npapi/module.cc ====
# action=edit type=text
--- googleclient/gears/opensource/gears/base/npapi/module.cc    2008-11-10 
14:29:58.000000000 +0000
+++ googleclient/gears/opensource/gears/base/npapi/module.cc    2008-12-18 
15:02:32.000000000 +0000
@@ -47,12 +47,18 @@
 #include "gears/base/safari/npapi_patches.h" 
 #endif
 #include "gears/base/npapi/module.h"
+#ifdef BROWSER_OPERA
+#include "gears/base/npapi/plugin.h"
+#include "gears/base/opera/opera_utils.h"
+#include "gears/localserver/opera/opera_local_server_impl.h"
+#include "third_party/opera/opera_callback_api.h"
+#endif  // BROWSER_OPERA
 
 #ifndef HIBYTE
 #define HIBYTE(x) ((((uint32)(x)) & 0xff00) >> 8)
 #endif
 
-#ifdef BROWSER_WEBKIT
+#if defined(BROWSER_WEBKIT) || defined(BROWSER_OPERA)
 static bool g_allow_npinit = true;
 #else
 static bool g_allow_npinit = false;
@@ -185,6 +191,18 @@
 }
 #endif
 
+#ifdef BROWSER_OPERA
+void OP_Initialize(OperaGearsAPI *opera_instance, OperaCallbacks *callbacks) {
+  LOG16((L"OP_Initialize called\n"));
+
+  OperaUtils::Init(opera_instance, 
ThreadMessageQueue::GetInstance()->GetCurrentThreadId());
+
+  callbacks->create_worker = OperaUtils::CreateWorkerThread;
+  callbacks->clone_object = PluginBase::CloneObject;;
+  callbacks->open_settings_dialog = OperaUtils::OpenSettingsDialog;
+  callbacks->local_server_init = OperaLocalServerImpl::Create;
+}
+#endif  // BROWSER_OPERA
 
 #ifdef WIN32
 BOOL MyDllMain(HANDLE instance, DWORD reason, LPVOID reserved) {
==== //depot/googleclient/gears/opensource/gears/base/npapi/module.h#6 - 
c:\MyDocs\Gears3/googleclient/gears/opensource/gears/base/npapi/module.h ====
# action=edit type=text
--- googleclient/gears/opensource/gears/base/npapi/module.h     2008-11-10 
14:29:58.000000000 +0000
+++ googleclient/gears/opensource/gears/base/npapi/module.h     2008-12-18 
15:02:34.000000000 +0000
@@ -38,4 +38,11 @@
 // js_runner_np.cc.
 void NotifyNPInstanceDestroyed(NPP instance);
 
+#ifdef BROWSER_OPERA
+class OperaGearsAPI;
+struct OperaCallbacks;
+// exported function to do initialization from the Opera browser
+extern "C" __declspec(dllexport) void OP_Initialize(OperaGearsAPI 
*opera_instance, OperaCallbacks *callbacks);
+#endif  // BROWSER_OPERA
+
 #endif  // GEARS_BASE_NPAPI_MODULE_H__

Reply via email to