Title: [128182] trunk/Source/WebCore
Revision
128182
Author
[email protected]
Date
2012-09-11 07:18:16 -0700 (Tue, 11 Sep 2012)

Log Message

[Blackberry] use ReadOnlyLatin1String to save a deep copy
https://bugs.webkit.org/show_bug.cgi?id=96364

Patch by Chris Guan <[email protected]> on 2012-09-11
Reviewed by Yong Li.
Internally reviewed by Yong li.

* platform/network/blackberry/NetworkManager.cpp:
(WebCore::NetworkManager::startJob):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (128181 => 128182)


--- trunk/Source/WebCore/ChangeLog	2012-09-11 14:10:48 UTC (rev 128181)
+++ trunk/Source/WebCore/ChangeLog	2012-09-11 14:18:16 UTC (rev 128182)
@@ -1,3 +1,14 @@
+2012-09-11  Chris Guan  <[email protected]>
+
+        [Blackberry] use ReadOnlyLatin1String to save a deep copy
+        https://bugs.webkit.org/show_bug.cgi?id=96364
+
+        Reviewed by Yong Li.
+        Internally reviewed by Yong li.
+
+        * platform/network/blackberry/NetworkManager.cpp:
+        (WebCore::NetworkManager::startJob):
+
 2012-09-11  Sergio Villar Senin  <[email protected]>
 
         [GTK] WebKitGtk+ crashes with non-UTF8 HTTP header names

Modified: trunk/Source/WebCore/platform/network/blackberry/NetworkManager.cpp (128181 => 128182)


--- trunk/Source/WebCore/platform/network/blackberry/NetworkManager.cpp	2012-09-11 14:10:48 UTC (rev 128181)
+++ trunk/Source/WebCore/platform/network/blackberry/NetworkManager.cpp	2012-09-11 14:18:16 UTC (rev 128182)
@@ -25,6 +25,7 @@
 #include "FrameLoaderClientBlackBerry.h"
 #include "NetworkJob.h"
 #include "Page.h"
+#include "ReadOnlyLatin1String.h"
 #include "ResourceHandleInternal.h"
 #include "ResourceRequest.h"
 #include "SecurityOrigin.h"
@@ -77,9 +78,16 @@
 
     BlackBerry::Platform::NetworkRequest platformRequest;
     request.initializePlatformRequest(platformRequest, frame.loader() && frame.loader()->client() && static_cast<FrameLoaderClientBlackBerry*>(frame.loader()->client())->cookiesEnabled(), isInitial, redirectCount);
-    platformRequest.setReferrer(frame.document()->url().string().utf8().data());
-    platformRequest.setSecurityOrigin(frame.document()->securityOrigin()->toRawString().utf8().data());
 
+    const String& documentUrl = frame.document()->url().string();
+    if (!documentUrl.isEmpty()) {
+        ReadOnlyLatin1String referrer(documentUrl);
+        platformRequest.setReferrer(referrer.data(), referrer.length());
+    }
+
+    ReadOnlyLatin1String securityOrigin(frame.document()->securityOrigin()->toRawString());
+    platformRequest.setSecurityOrigin(securityOrigin.data(), securityOrigin.length());
+
     // Attach any applicable auth credentials to the NetworkRequest.
     AuthenticationChallenge& challenge = guardJob->getInternal()->m_currentWebChallenge;
     if (!challenge.isNull()) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to