[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

kocienda kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:50:19 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 50e1c61f9d3f02ee9f7aaed118b63480d30ce755
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Aug 6 14:45:59 2003 +0000

            Reviewed by Richard
    
    	Plugins in WebKit need to store URLs in the form of "C-style" strings.
    	Create and use a new, improved method to make these strings, and do
    	not traverse through the NSURL absoluteString method, since that can i
    	introduce errors.
    
            * Misc.subproj/WebNSURLExtras.h: Added _web_URLCString method.
            * Misc.subproj/WebNSURLExtras.m:
            (-[NSURL _web_URLCString]): Added.
            * Plugins.subproj/WebBaseNetscapePluginStream.m:
            (-[WebBaseNetscapePluginStream setResponse:]): Call new _web_URLCString method.
            (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): Ditto.
            * Plugins.subproj/WebBaseNetscapePluginView.m:
            (-[WebBaseNetscapePluginView frameStateChanged:]): Ditto.
            (-[WebBaseNetscapePluginView loadPluginRequest:]): Ditto.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4774 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 8529650..1403cb4 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,24 @@
 2003-08-05  Ken Kocienda  <kocienda at apple.com>
 
+        Reviewed by Richard
+
+	Plugins in WebKit need to store URLs in the form of "C-style" strings. 
+	Create and use a new, improved method to make these strings, and do 
+	not traverse through the NSURL absoluteString method, since that can i
+	introduce errors.
+
+        * Misc.subproj/WebNSURLExtras.h: Added _web_URLCString method.
+        * Misc.subproj/WebNSURLExtras.m:
+        (-[NSURL _web_URLCString]): Added.
+        * Plugins.subproj/WebBaseNetscapePluginStream.m:
+        (-[WebBaseNetscapePluginStream setResponse:]): Call new _web_URLCString method.
+        (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): Ditto.
+        * Plugins.subproj/WebBaseNetscapePluginView.m:
+        (-[WebBaseNetscapePluginView frameStateChanged:]): Ditto.
+        (-[WebBaseNetscapePluginView loadPluginRequest:]): Ditto.
+
+2003-08-05  Ken Kocienda  <kocienda at apple.com>
+
         Reviewed by John
 
 	Fix for this bug:
diff --git a/WebKit/Misc.subproj/WebNSURLExtras.h b/WebKit/Misc.subproj/WebNSURLExtras.h
index 69ed706..f6717b5 100644
--- a/WebKit/Misc.subproj/WebNSURLExtras.h
+++ b/WebKit/Misc.subproj/WebNSURLExtras.h
@@ -18,6 +18,7 @@
 
 - (NSString *)_web_displayableString;
 - (int)_web_URLStringLength;
+- (const char *)_web_URLCString;
 
 // FIXME: change these names back to _web_ when identically-named
 // methods are removed from Foundation
diff --git a/WebKit/Misc.subproj/WebNSURLExtras.m b/WebKit/Misc.subproj/WebNSURLExtras.m
index 314b914..86c6024 100644
--- a/WebKit/Misc.subproj/WebNSURLExtras.m
+++ b/WebKit/Misc.subproj/WebNSURLExtras.m
@@ -113,6 +113,14 @@ static inline void ReleaseIfNotNULL(CFTypeRef object)
     return length;
 }
 
+- (const char *)_web_URLCString
+{
+    NSMutableData *data = [NSMutableData data];
+    [data appendData:[self _web_originalData]];
+    [data appendBytes:"\0" length:1];
+    return (const char *)[data bytes];
+ }
+
 - (NSURL *)_webkit_canonicalize
 {
     NSURLRequest *request = [[NSURLRequest alloc] initWithURL:self];
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.m b/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.m
index 1c91d69..27d11b8 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.m
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.m
@@ -7,6 +7,7 @@
 #import <WebKit/WebBaseNetscapePluginView.h>
 #import <WebKit/WebKitLogging.h>
 #import <WebKit/WebNetscapePluginPackage.h>
+#import <WebKit/WebNSURLExtras.h>
 
 #import <Foundation/NSURLResponse.h>
 #import <Foundation/NSURLResponsePrivate.h>
@@ -61,12 +62,8 @@
     [URL release];
     URL = [[r URL] retain];
     
-    NSString *URLString = [URL absoluteString];
-    char *cURL = (char *)malloc([URLString cStringLength]+1);
-    [URLString getCString:cURL];
-
     stream.ndata = self;
-    stream.URL = cURL;
+    stream.URL = strdup([URL _web_URLCString]);
     stream.end = [r expectedContentLength];
     stream.lastmodified = [[r _lastModifiedDate] timeIntervalSince1970];
     stream.notifyData = notifyData;
@@ -182,7 +179,7 @@
     [self destroyStreamWithReason:NPRES_DONE];
     
     if (notifyData) {
-        NPP_URLNotify(instance, [[URL absoluteString] cString], NPRES_DONE, notifyData);
+        NPP_URLNotify(instance, [URL _web_URLCString], NPRES_DONE, notifyData);
         LOG(Plugins, "NPP_URLNotify");
     }
 }
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
index 0998843..29e6f21 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
@@ -945,7 +945,7 @@ typedef struct {
         cAttributes = (char **)malloc(([keys count] + 1) * sizeof(char *));
         cValues = (char **)malloc(([values count] + 1) * sizeof(char *));
         cAttributes[0] = strdup("DOCBASE");
-        cValues[0] = strdup([[baseURL absoluteString] UTF8String]);
+        cValues[0] = strdup([baseURL _web_URLCString]);
         argsCount++;
     } else {
         cAttributes = (char **)malloc([keys count] * sizeof(char *));
@@ -1169,7 +1169,7 @@ typedef struct {
     WebFrameState frameState = [[[notification userInfo] objectForKey:WebCurrentFrameState] intValue];
     if (frameState == WebFrameStateComplete) {
         if (isStarted) {
-            NPP_URLNotify(instance, [[URL absoluteString] cString], NPRES_DONE, notifyData);
+            NPP_URLNotify(instance, [URL _web_URLCString], NPRES_DONE, notifyData);
         }
         [streamNotifications removeObjectForKey:URL];
     }
@@ -1229,7 +1229,7 @@ typedef struct {
         // FIXME: If the result is a string, we probably want to put that string into the frame, just
         // like we do in KHTMLPartBrowserExtension::openURLRequest.
         if (notifyData && isStarted) {
-            NPP_URLNotify(instance, [[URL absoluteString] cString], NPRES_DONE, notifyData);
+            NPP_URLNotify(instance, [URL _web_URLCString], NPRES_DONE, notifyData);
         }
     } else {
         [frame loadRequest:request];

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list