WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch for landing
bug-138646-20141117141608.patch (text/plain), 17.11 KB, created by
Gyuyoung Kim
on 2014-11-16 21:15:46 PST
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Gyuyoung Kim
Created:
2014-11-16 21:15:46 PST
Size:
17.11 KB
patch
obsolete
>Subversion Revision: 176168 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c6ac50e7869930036de248f607a8b416dd37abc1..4a72c08f498fd504a67ee5cc5c02c994a651a10a 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,42 @@ >+2014-11-16 Gyuyoung Kim <gyuyoung.kim@samsung.com> >+ >+ Move WebCore/loader to std::unique_ptr >+ https://bugs.webkit.org/show_bug.cgi?id=138646 >+ >+ Reviewed by Chris Dumez. >+ >+ Replace OwnPtr with std::unique_ptr<> and std::make_unique<>. >+ However this patch leaves ResourceRequest::adopt() because this need >+ to be handled by different patch. >+ >+ No new tests, no behavior changes. >+ >+ * loader/DocumentThreadableLoader.cpp: >+ (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest): >+ (WebCore::DocumentThreadableLoader::preflightSuccess): >+ * loader/DocumentThreadableLoader.h: >+ * loader/SubresourceLoader.cpp: >+ (WebCore::SubresourceLoader::SubresourceLoader): >+ (WebCore::SubresourceLoader::didReceiveResponse): >+ (WebCore::SubresourceLoader::notifyDone): >+ * loader/SubresourceLoader.h: >+ * loader/TextTrackLoader.h: >+ * loader/appcache/ApplicationCacheHost.h: >+ * loader/appcache/ApplicationCacheStorage.cpp: >+ (WebCore::ApplicationCacheStorage::storeCopyOfCache): >+ * loader/archive/cf/LegacyWebArchive.cpp: >+ (WebCore::LegacyWebArchive::create): >+ * loader/cache/CachedResourceLoader.cpp: >+ (WebCore::CachedResourceLoader::requestPreload): >+ (WebCore::CachedResourceLoader::clearPreloads): >+ (WebCore::CachedResourceLoader::printPreloadStats): >+ * loader/cache/CachedResourceLoader.h: >+ * loader/icon/IconDatabase.cpp: >+ (WebCore::IconDatabase::deleteAllPreparedStatements): >+ (WebCore::readySQLiteStatement): >+ * loader/icon/IconDatabase.h: >+ * loader/icon/IconRecord.h: >+ > 2014-11-16 Chris Dumez <cdumez@apple.com> > > Move 'vertical-align' CSS property to the new StyleBuilder >diff --git a/Source/WebCore/loader/DocumentThreadableLoader.cpp b/Source/WebCore/loader/DocumentThreadableLoader.cpp >index 58c5b9f60fa1b0ce1436871ab9488436922c87c2..00064794555a4dc55debfd2bc3fc6113b1671c68 100644 >--- a/Source/WebCore/loader/DocumentThreadableLoader.cpp >+++ b/Source/WebCore/loader/DocumentThreadableLoader.cpp >@@ -98,14 +98,14 @@ void DocumentThreadableLoader::makeCrossOriginAccessRequest(const ResourceReques > { > ASSERT(m_options.crossOriginRequestPolicy == UseAccessControl); > >- OwnPtr<ResourceRequest> crossOriginRequest = adoptPtr(new ResourceRequest(request)); >+ auto crossOriginRequest = std::make_unique<ResourceRequest>(request); > updateRequestForAccessControl(*crossOriginRequest, securityOrigin(), m_options.allowCredentials()); > > if ((m_options.preflightPolicy == ConsiderPreflight && isSimpleCrossOriginAccessRequest(crossOriginRequest->httpMethod(), crossOriginRequest->httpHeaderFields())) || m_options.preflightPolicy == PreventPreflight) > makeSimpleCrossOriginAccessRequest(*crossOriginRequest); > else { > m_simpleRequest = false; >- m_actualRequest = crossOriginRequest.release(); >+ m_actualRequest = WTF::move(crossOriginRequest); > > if (CrossOriginPreflightResultCache::shared().canSkipPreflight(securityOrigin()->toString(), m_actualRequest->url(), m_options.allowCredentials(), m_actualRequest->httpMethod(), m_actualRequest->httpHeaderFields())) > preflightSuccess(); >@@ -335,7 +335,7 @@ void DocumentThreadableLoader::didFail(unsigned long identifier, const ResourceE > > void DocumentThreadableLoader::preflightSuccess() > { >- OwnPtr<ResourceRequest> actualRequest; >+ std::unique_ptr<ResourceRequest> actualRequest; > actualRequest.swap(m_actualRequest); > > actualRequest->setHTTPOrigin(securityOrigin()->toString()); >diff --git a/Source/WebCore/loader/DocumentThreadableLoader.h b/Source/WebCore/loader/DocumentThreadableLoader.h >index fabcd3d26d5a8c868a6993c8d48cefbabdbd7be9..2a3f2f0271656fec2d083e6ad56b32d16b40d333 100644 >--- a/Source/WebCore/loader/DocumentThreadableLoader.h >+++ b/Source/WebCore/loader/DocumentThreadableLoader.h >@@ -36,7 +36,6 @@ > #include "FrameLoaderTypes.h" > #include "ThreadableLoader.h" > #include <wtf/Forward.h> >-#include <wtf/OwnPtr.h> > #include <wtf/PassRefPtr.h> > #include <wtf/RefCounted.h> > #include <wtf/RefPtr.h> >@@ -106,7 +105,7 @@ namespace WebCore { > bool m_sameOriginRequest; > bool m_simpleRequest; > bool m_async; >- OwnPtr<ResourceRequest> m_actualRequest; // non-null during Access Control preflight checks >+ std::unique_ptr<ResourceRequest> m_actualRequest; // non-null during Access Control preflight checks > }; > > } // namespace WebCore >diff --git a/Source/WebCore/loader/SubresourceLoader.cpp b/Source/WebCore/loader/SubresourceLoader.cpp >index 206dd22b6332ac5f10962e86942b79089e3932ce..e15bdfbcd5fd3a2c547612efdbe846bfd6d7a0ea 100644 >--- a/Source/WebCore/loader/SubresourceLoader.cpp >+++ b/Source/WebCore/loader/SubresourceLoader.cpp >@@ -68,7 +68,7 @@ SubresourceLoader::SubresourceLoader(Frame* frame, CachedResource* resource, con > , m_resource(resource) > , m_loadingMultipartContent(false) > , m_state(Uninitialized) >- , m_requestCountTracker(adoptPtr(new RequestCountTracker(frame->document()->cachedResourceLoader(), resource))) >+ , m_requestCountTracker(std::make_unique<RequestCountTracker>(frame->document()->cachedResourceLoader(), resource)) > { > #ifndef NDEBUG > subresourceLoaderCounter.increment(); >@@ -225,7 +225,7 @@ void SubresourceLoader::didReceiveResponse(const ResourceResponse& response) > m_loadingMultipartContent = true; > > // We don't count multiParts in a CachedResourceLoader's request count >- m_requestCountTracker.clear(); >+ m_requestCountTracker = nullptr; > if (!m_resource->isImage()) { > cancel(); > return; >@@ -380,7 +380,7 @@ void SubresourceLoader::notifyDone() > if (reachedTerminalState()) > return; > >- m_requestCountTracker.clear(); >+ m_requestCountTracker = nullptr; > #if PLATFORM(IOS) > m_documentLoader->cachedResourceLoader().loadDone(m_resource, m_state != CancelledWhileInitializing); > #else >diff --git a/Source/WebCore/loader/SubresourceLoader.h b/Source/WebCore/loader/SubresourceLoader.h >index 303ffd9abd7b1bb4d092d18019d6b1115e914289..c21f1293426a795be4c14d1bd0e21996770579f9 100644 >--- a/Source/WebCore/loader/SubresourceLoader.h >+++ b/Source/WebCore/loader/SubresourceLoader.h >@@ -121,7 +121,7 @@ private: > CachedResource* m_resource; > bool m_loadingMultipartContent; > SubresourceLoaderState m_state; >- OwnPtr<RequestCountTracker> m_requestCountTracker; >+ std::unique_ptr<RequestCountTracker> m_requestCountTracker; > }; > > } >diff --git a/Source/WebCore/loader/TextTrackLoader.h b/Source/WebCore/loader/TextTrackLoader.h >index 187ffbefb28e4bcc3f830ce09393c28e539d4a49..82754dfe5010298a1f7044d2d5cdbff490ae171b 100644 >--- a/Source/WebCore/loader/TextTrackLoader.h >+++ b/Source/WebCore/loader/TextTrackLoader.h >@@ -33,7 +33,6 @@ > #include "Timer.h" > #include "WebVTTParser.h" > #include <memory> >-#include <wtf/OwnPtr.h> > > namespace WebCore { > >diff --git a/Source/WebCore/loader/appcache/ApplicationCacheHost.h b/Source/WebCore/loader/appcache/ApplicationCacheHost.h >index 86c17740e9b54c093128183fdb014a0ec12cf7df..3ddf6941513ceefa8593f6e93cd1be8082daec3c 100644 >--- a/Source/WebCore/loader/appcache/ApplicationCacheHost.h >+++ b/Source/WebCore/loader/appcache/ApplicationCacheHost.h >@@ -33,7 +33,6 @@ > > #include "URL.h" > #include <wtf/Deque.h> >-#include <wtf/OwnPtr.h> > #include <wtf/PassRefPtr.h> > #include <wtf/RefPtr.h> > #include <wtf/Vector.h> >diff --git a/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp b/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp >index f079a3bd60f35174a8dad88f16fb1136d628d3ea..0462c4b6ddc813d6b337d723514130a3e043389e 100644 >--- a/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp >+++ b/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp >@@ -1357,10 +1357,10 @@ bool ApplicationCacheStorage::storeCopyOfCache(const String& cacheDirectory, App > > cacheCopy->addResource(resourceCopy.release()); > } >- >+ > // Now create a new cache group. >- OwnPtr<ApplicationCacheGroup> groupCopy(adoptPtr(new ApplicationCacheGroup(cache->group()->manifestURL(), true))); >- >+ auto groupCopy = std::make_unique<ApplicationCacheGroup>(cache->group()->manifestURL(), true); >+ > groupCopy->setNewestCache(cacheCopy); > > ApplicationCacheStorage copyStorage; >diff --git a/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp b/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp >index 972346a0083ba6e44e3e24824ceaa34d0a371e24..5c94069bbd26b3e47194a741f8d465c1a1768099 100644 >--- a/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp >+++ b/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp >@@ -437,12 +437,12 @@ PassRefPtr<LegacyWebArchive> LegacyWebArchive::create(Node* node, std::function< > // If the page was loaded with javascript enabled, we don't want to archive <noscript> tags > // In practice we don't actually know whether scripting was enabled when the page was originally loaded > // but we can approximate that by checking if scripting is enabled right now. >- OwnPtr<Vector<QualifiedName>> tagNamesToFilter; >+ std::unique_ptr<Vector<QualifiedName>> tagNamesToFilter; > if (frame->page() && frame->page()->settings().isScriptEnabled()) { >- tagNamesToFilter = adoptPtr(new Vector<QualifiedName>); >+ tagNamesToFilter = std::make_unique<Vector<QualifiedName>>(); > tagNamesToFilter->append(HTMLNames::noscriptTag); > } >- >+ > Vector<Node*> nodeList; > String markupString = createMarkup(*node, IncludeNode, &nodeList, DoNotResolveURLs, tagNamesToFilter.get()); > Node::NodeType nodeType = node->nodeType(); >diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.cpp b/Source/WebCore/loader/cache/CachedResourceLoader.cpp >index a70c8625203048c740547d0dd87e05f9fabce23c..ab590df3d26d510115390272b3d542b30af96744 100644 >--- a/Source/WebCore/loader/cache/CachedResourceLoader.cpp >+++ b/Source/WebCore/loader/cache/CachedResourceLoader.cpp >@@ -877,7 +877,7 @@ void CachedResourceLoader::requestPreload(CachedResource::Type type, CachedResou > resource->increasePreloadCount(); > > if (!m_preloads) >- m_preloads = adoptPtr(new ListHashSet<CachedResource*>); >+ m_preloads = std::make_unique<ListHashSet<CachedResource*>>(); > m_preloads->add(resource.get()); > > #if PRELOAD_DEBUG >@@ -923,7 +923,7 @@ void CachedResourceLoader::clearPreloads() > if (!deleted && res->preloadResult() == CachedResource::PreloadNotReferenced) > memoryCache()->remove(res); > } >- m_preloads.clear(); >+ m_preloads = nullptr; > } > > void CachedResourceLoader::clearPendingPreloads() >@@ -969,7 +969,7 @@ void CachedResourceLoader::printPreloadStats() > > res->decreasePreloadCount(); > } >- m_preloads.clear(); >+ m_preloads = nullptr; > > if (scripts) > printf("SCRIPTS: %d (%d hits, hit rate %d%%)\n", scripts, scripts - scriptMisses, (scripts - scriptMisses) * 100 / scripts); >diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.h b/Source/WebCore/loader/cache/CachedResourceLoader.h >index 66a812dd029f62f0872d641b0316a66a5faf3c5c..e4ed2feb9d4ab8c9a527edb5d96a492718120bf7 100644 >--- a/Source/WebCore/loader/cache/CachedResourceLoader.h >+++ b/Source/WebCore/loader/cache/CachedResourceLoader.h >@@ -165,7 +165,7 @@ private: > > int m_requestCount; > >- OwnPtr<ListHashSet<CachedResource*>> m_preloads; >+ std::unique_ptr<ListHashSet<CachedResource*>> m_preloads; > struct PendingPreload { > CachedResource::Type m_type; > CachedResourceRequest m_request; >diff --git a/Source/WebCore/loader/icon/IconDatabase.cpp b/Source/WebCore/loader/icon/IconDatabase.cpp >index abcb0cb345afe6096d0f408148b3f925afbedc8c..f10c413d34a1815d426b70dfa0eba1a9cde666ae 100644 >--- a/Source/WebCore/loader/icon/IconDatabase.cpp >+++ b/Source/WebCore/loader/icon/IconDatabase.cpp >@@ -1758,20 +1758,20 @@ void IconDatabase::deleteAllPreparedStatements() > { > ASSERT_ICON_SYNC_THREAD(); > >- m_setIconIDForPageURLStatement.clear(); >- m_removePageURLStatement.clear(); >- m_getIconIDForIconURLStatement.clear(); >- m_getImageDataForIconURLStatement.clear(); >- m_addIconToIconInfoStatement.clear(); >- m_addIconToIconDataStatement.clear(); >- m_getImageDataStatement.clear(); >- m_deletePageURLsForIconURLStatement.clear(); >- m_deleteIconFromIconInfoStatement.clear(); >- m_deleteIconFromIconDataStatement.clear(); >- m_updateIconInfoStatement.clear(); >- m_updateIconDataStatement.clear(); >- m_setIconInfoStatement.clear(); >- m_setIconDataStatement.clear(); >+ m_setIconIDForPageURLStatement = nullptr; >+ m_removePageURLStatement = nullptr; >+ m_getIconIDForIconURLStatement = nullptr; >+ m_getImageDataForIconURLStatement = nullptr; >+ m_addIconToIconInfoStatement = nullptr; >+ m_addIconToIconDataStatement = nullptr; >+ m_getImageDataStatement = nullptr; >+ m_deletePageURLsForIconURLStatement = nullptr; >+ m_deleteIconFromIconInfoStatement = nullptr; >+ m_deleteIconFromIconDataStatement = nullptr; >+ m_updateIconInfoStatement = nullptr; >+ m_updateIconDataStatement = nullptr; >+ m_setIconInfoStatement = nullptr; >+ m_setIconDataStatement = nullptr; > } > > void* IconDatabase::cleanupSyncThread() >@@ -1810,15 +1810,15 @@ void* IconDatabase::cleanupSyncThread() > // 1 - If the SQLDatabase& argument is different, the statement must be destroyed and remade. This happens when the user > // switches to and from private browsing > // 2 - Lazy construction of the Statement in the first place, in case we've never made this query before >-inline void readySQLiteStatement(OwnPtr<SQLiteStatement>& statement, SQLiteDatabase& db, const String& str) >+inline void readySQLiteStatement(std::unique_ptr<SQLiteStatement>& statement, SQLiteDatabase& db, const String& str) > { > if (statement && (statement->database() != &db || statement->isExpired())) { > if (statement->isExpired()) > LOG(IconDatabase, "SQLiteStatement associated with %s is expired", str.ascii().data()); >- statement.clear(); >+ statement = nullptr; > } > if (!statement) { >- statement = adoptPtr(new SQLiteStatement(db, str)); >+ statement = std::make_unique<SQLiteStatement>(db, str); > if (statement->prepare() != SQLResultOk) > LOG_ERROR("Preparing statement %s failed", str.ascii().data()); > } >diff --git a/Source/WebCore/loader/icon/IconDatabase.h b/Source/WebCore/loader/icon/IconDatabase.h >index 4e0490431eeb9991d5e5fc0a31b81a94882382bd..c7d92f2dd921f7e39498f85742470075bfae03be 100644 >--- a/Source/WebCore/loader/icon/IconDatabase.h >+++ b/Source/WebCore/loader/icon/IconDatabase.h >@@ -231,20 +231,20 @@ private: > > SQLiteDatabase m_syncDB; > >- OwnPtr<SQLiteStatement> m_setIconIDForPageURLStatement; >- OwnPtr<SQLiteStatement> m_removePageURLStatement; >- OwnPtr<SQLiteStatement> m_getIconIDForIconURLStatement; >- OwnPtr<SQLiteStatement> m_getImageDataForIconURLStatement; >- OwnPtr<SQLiteStatement> m_addIconToIconInfoStatement; >- OwnPtr<SQLiteStatement> m_addIconToIconDataStatement; >- OwnPtr<SQLiteStatement> m_getImageDataStatement; >- OwnPtr<SQLiteStatement> m_deletePageURLsForIconURLStatement; >- OwnPtr<SQLiteStatement> m_deleteIconFromIconInfoStatement; >- OwnPtr<SQLiteStatement> m_deleteIconFromIconDataStatement; >- OwnPtr<SQLiteStatement> m_updateIconInfoStatement; >- OwnPtr<SQLiteStatement> m_updateIconDataStatement; >- OwnPtr<SQLiteStatement> m_setIconInfoStatement; >- OwnPtr<SQLiteStatement> m_setIconDataStatement; >+ std::unique_ptr<SQLiteStatement> m_setIconIDForPageURLStatement; >+ std::unique_ptr<SQLiteStatement> m_removePageURLStatement; >+ std::unique_ptr<SQLiteStatement> m_getIconIDForIconURLStatement; >+ std::unique_ptr<SQLiteStatement> m_getImageDataForIconURLStatement; >+ std::unique_ptr<SQLiteStatement> m_addIconToIconInfoStatement; >+ std::unique_ptr<SQLiteStatement> m_addIconToIconDataStatement; >+ std::unique_ptr<SQLiteStatement> m_getImageDataStatement; >+ std::unique_ptr<SQLiteStatement> m_deletePageURLsForIconURLStatement; >+ std::unique_ptr<SQLiteStatement> m_deleteIconFromIconInfoStatement; >+ std::unique_ptr<SQLiteStatement> m_deleteIconFromIconDataStatement; >+ std::unique_ptr<SQLiteStatement> m_updateIconInfoStatement; >+ std::unique_ptr<SQLiteStatement> m_updateIconDataStatement; >+ std::unique_ptr<SQLiteStatement> m_setIconInfoStatement; >+ std::unique_ptr<SQLiteStatement> m_setIconDataStatement; > }; > > #endif // !ENABLE(ICONDATABASE) >diff --git a/Source/WebCore/loader/icon/IconRecord.h b/Source/WebCore/loader/icon/IconRecord.h >index bc99b6518186b35f5be572ba42a418367dbf4b25..d40859393482ccf89f31b2e520920acebff91e21 100644 >--- a/Source/WebCore/loader/icon/IconRecord.h >+++ b/Source/WebCore/loader/icon/IconRecord.h >@@ -32,7 +32,6 @@ > #include "PageURLRecord.h" > #include "SharedBuffer.h" > #include <wtf/HashSet.h> >-#include <wtf/OwnPtr.h> > #include <wtf/RefCounted.h> > #include <wtf/text/StringHash.h> > #include <wtf/text/WTFString.h>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 138646
:
241403
|
241414
|
241453
|
241459
|
241523
|
241528
|
241538
|
241551
|
241553
| 241692