2009-03-02 Anders Carlsson <andersca@apple.com>
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Mar 2009 00:14:45 +0000 (00:14 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Mar 2009 00:14:45 +0000 (00:14 +0000)
        Reviewed by John Sullivan, Ada Chan.

        Factor loading code out into its own method and get rid of a bunch of goots.

        * Plugins/WebNetscapePluginPackage.mm:
        (-[WebNetscapePluginPackage _tryLoad]):
        (-[WebNetscapePluginPackage load]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@41372 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/mac/ChangeLog
WebKit/mac/Plugins/WebNetscapePluginPackage.mm

index 05d08f6219b2688dd90de31d5f221a20f773da72..7c78e1548d595978c2234d40a02130d0c348a12b 100644 (file)
@@ -1,3 +1,13 @@
+2009-03-02  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by John Sullivan, Ada Chan.
+
+        Factor loading code out into its own method and get rid of a bunch of goots.
+        
+        * Plugins/WebNetscapePluginPackage.mm:
+        (-[WebNetscapePluginPackage _tryLoad]):
+        (-[WebNetscapePluginPackage load]):
+
 2009-03-02  Anders Carlsson  <andersca@apple.com>
 
         Build fix.
index b3ad0bd3311425841874319d86c4e47eb5b2330c..c839206158d634e765ba7952b440102f96ce1ad9 100644 (file)
@@ -323,8 +323,8 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
     [self _unloadWithShutdown:YES];
 }
 
-- (BOOL)load
-{    
+- (BOOL)_tryLoad
+{
     NP_GetEntryPointsFuncPtr NP_GetEntryPoints = NULL;
     NP_InitializeFuncPtr NP_Initialize = NULL;
     NPError npErr;
@@ -347,7 +347,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
     if (isBundle) {
 #endif
         if (!CFBundleLoadExecutable(cfBundle))
-            goto abort;
+            return NO;
 #if !LOG_DISABLED
         currentTime = CFAbsoluteTimeGetCurrent();
         duration = currentTime - start;
@@ -366,7 +366,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
             NP_GetEntryPoints = (NP_GetEntryPointsFuncPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("NP_GetEntryPoints"));
             NP_Shutdown = (NPP_ShutdownProcPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("NP_Shutdown"));
             if (!NP_Initialize || !NP_GetEntryPoints || !NP_Shutdown)
-                goto abort;
+                return NO;
 #ifdef SUPPORT_CFM
         }
     } else {
@@ -586,7 +586,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
         LOG(Plugins, "%f NP_Initialize timing started", initializeStart);
         npErr = NP_Initialize(&browserFuncs);
         if (npErr != NPERR_NO_ERROR)
-            goto abort;
+            return NO;
 #if !LOG_DISABLED
         currentTime = CFAbsoluteTimeGetCurrent();
         duration = currentTime - initializeStart;
@@ -597,7 +597,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
         
         npErr = NP_GetEntryPoints(&pluginFuncs);
         if (npErr != NPERR_NO_ERROR)
-            goto abort;
+            return NO;
         
         pluginSize = pluginFuncs.size;
         pluginVersion = pluginFuncs.version;
@@ -617,9 +617,14 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
 #endif
     LOG(Plugins, "%f Total load time: %f seconds", currentTime, duration);
 
-    return [super load];
+    return YES;
+}
+
+- (BOOL)load
+{    
+    if ([self _tryLoad])
+        return [super load];
 
-abort:
     [self _unloadWithShutdown:NO];
     return NO;
 }