Bug 30095

Summary: StringImpl needs a method to get an instance for another thread which doesn't copy the underlying buffer.
Product: WebKit Reporter: David Levin <levin>
Component: PlatformAssignee: David Levin <levin>
Status: RESOLVED FIXED    
Severity: Normal CC: jorlow
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Proposed fix. oliver: review+, levin: commit-queue-

David Levin
Reported 2009-10-05 14:51:07 PDT
The primary motivation has been long strings that can be formed in workers which need to be passed to the main thread, but this should benefit other places as well.
Attachments
Proposed fix. (42.66 KB, patch)
2009-10-05 15:26 PDT, David Levin
oliver: review+
levin: commit-queue-
David Levin
Comment 1 2009-10-05 15:26:37 PDT
Created attachment 40667 [details] Proposed fix.
David Levin
Comment 2 2009-10-05 15:40:15 PDT
This is in support of finally implementing WorkerContext::resourceRetrievedByXMLHttpRequest and WorkerContext::scriptImported.
Jeremy Orlow
Comment 3 2009-10-05 15:43:03 PDT
One nit: > diff --git a/WebCore/storage/StorageNamespaceImpl.cpp b/WebCore/storage/StorageNamespaceImpl.cpp > index bc9d90c..ab540f1 100644 > --- a/WebCore/storage/StorageNamespaceImpl.cpp > +++ b/WebCore/storage/StorageNamespaceImpl.cpp > @@ -65,7 +65,7 @@ PassRefPtr<StorageNamespace> StorageNamespaceImpl::sessionStorageNamespace() > > StorageNamespaceImpl::StorageNamespaceImpl(StorageType storageType, const String& path, unsigned quota) > : m_storageType(storageType) > - , m_path(path.copy()) // Copy makes it safe for our other thread to access the path. > + , m_path(path.crossThreadString()) // Make it safe for our other thread to access the path. This comment seems redundant now.
David Levin
Comment 4 2009-10-05 17:47:47 PDT
Comment on attachment 40667 [details] Proposed fix. Just marking as cq- because I want to land this myself.
Mark Rowe (bdash)
Comment 5 2009-10-05 19:12:39 PDT
"call was made threadsafeCopy unless I could show that *threadsafey* wasn't needed."
David Levin
Comment 6 2009-10-06 00:46:26 PDT
Note You need to log in before you can comment on or make changes to this bug.