Skip to content
Permalink
Browse files
2011-05-02 Adam Barth <abarth@webkit.org>
        Reviewed by David Levin.

        PLATFORM(MAC) should (almost!) build with strict PassOwnPtr
        https://bugs.webkit.org/show_bug.cgi?id=59924

        * css/CSSGrammar.y:
        * platform/graphics/mac/SimpleFontDataMac.mm:
            - Memory management for the font cache is somewhat... complext.
              This will require some careful thought to sort out.
2011-05-02  Adam Barth  <abarth@webkit.org>

        Reviewed by David Levin.

        PLATFORM(MAC) should (almost!) build with strict PassOwnPtr
        https://bugs.webkit.org/show_bug.cgi?id=59924

        * History/WebHistory.mm:
        (-[WebHistory _visitedURL:withTitle:method:wasFailure:increaseVisitCount:]):
        * Plugins/WebBaseNetscapePluginView.mm:
        (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]):
        * WebCoreSupport/WebFrameLoaderClient.mm:
        (WebFrameLoaderClient::savePlatformDataToCachedFrame):
        * WebView/WebView.mm:
        (-[WebView _injectMailQuirksScript]):
        (-[WebView _injectOutlookQuirksScript]):
        (toStringVector):
2011-05-02  Adam Barth  <abarth@webkit.org>

        Reviewed by David Levin.

        PLATFORM(MAC) should (almost!) build with strict PassOwnPtr
        https://bugs.webkit.org/show_bug.cgi?id=59924

        * Platform/CoreIPC/Connection.cpp:
        (CoreIPC::Connection::sendSyncMessage):
        (CoreIPC::Connection::waitForSyncReply):
        (CoreIPC::Connection::dispatchSyncMessage):
        * Platform/CoreIPC/Connection.h:
        (CoreIPC::Connection::Message::releaseArguments):
            - The memory management for this class is very strange.  I wrote a
              large comment.  Hopefully a kind soul will come by and fix it.
        * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
        (WebKit::NetscapePluginModule::unload):
        * UIProcess/API/mac/WKView.mm:
        (-[WKView _setFindIndicator:fadeOut:]):
        * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm:
        (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer):
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::toStringVector):
        * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
        (WebKit::NetscapePluginStream::stop):
        * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
        (WebKit::WebInspectorFrontendClient::WebInspectorFrontendClient):
        * WebProcess/WebPage/DrawingArea.cpp:
        (WebKit::DrawingArea::create):

Canonical link: https://commits.webkit.org/75217@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@85515 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Adam Barth committed May 2, 2011
1 parent 345e971 commit 7fe5da31218204670ef749851b8ac24549d56a03
Showing 18 changed files with 103 additions and 34 deletions.
@@ -1,3 +1,15 @@
2011-05-02 Adam Barth <abarth@webkit.org>

Reviewed by David Levin.

PLATFORM(MAC) should (almost!) build with strict PassOwnPtr
https://bugs.webkit.org/show_bug.cgi?id=59924

* css/CSSGrammar.y:
* platform/graphics/mac/SimpleFontDataMac.mm:
- Memory management for the font cache is somewhat... complext.
This will require some careful thought to sort out.

2011-05-02 Levi Weintraub <leviw@chromium.org>

Reviewed by Eric Seidel.
@@ -1450,7 +1450,7 @@ function:
CSSParser* p = static_cast<CSSParser*>(parser);
CSSParserFunction* f = p->createFloatingFunction();
f->name = $1;
f->args = p->sinkFloatingValueList($3);
f->args = adoptPtr(p->sinkFloatingValueList($3));
$$.id = 0;
$$.unit = CSSParserValue::Function;
$$.function = f;
@@ -1459,7 +1459,7 @@ function:
CSSParser* p = static_cast<CSSParser*>(parser);
CSSParserFunction* f = p->createFloatingFunction();
f->name = $1;
f->args = 0;
f->args = nullptr;
$$.id = 0;
$$.unit = CSSParserValue::Function;
$$.function = f;
@@ -1568,7 +1568,7 @@ calc_function:
CSSParser* p = static_cast<CSSParser*>(parser);
CSSParserFunction* f = p->createFloatingFunction();
f->name = $1;
f->args = p->sinkFloatingValueList($3);
f->args = adoptPtr(p->sinkFloatingValueList($3));
$$.id = 0;
$$.unit = CSSParserValue::Function;
$$.function = f;
@@ -1593,7 +1593,7 @@ min_or_max_function:
CSSParser* p = static_cast<CSSParser*>(parser);
CSSParserFunction* f = p->createFloatingFunction();
f->name = $1;
f->args = p->sinkFloatingValueList($3);
f->args = adoptPtr(p->sinkFloatingValueList($3));
$$.id = 0;
$$.unit = CSSParserValue::Function;
$$.function = f;
@@ -28,6 +28,10 @@
*/

#import "config.h"

// FIXME: Remove this define!
#define LOOSE_PASS_OWN_PTR

#import "SimpleFontData.h"

#import "BlockExceptions.h"
@@ -1,3 +1,21 @@
2011-05-02 Adam Barth <abarth@webkit.org>

Reviewed by David Levin.

PLATFORM(MAC) should (almost!) build with strict PassOwnPtr
https://bugs.webkit.org/show_bug.cgi?id=59924

* History/WebHistory.mm:
(-[WebHistory _visitedURL:withTitle:method:wasFailure:increaseVisitCount:]):
* Plugins/WebBaseNetscapePluginView.mm:
(-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]):
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::savePlatformDataToCachedFrame):
* WebView/WebView.mm:
(-[WebView _injectMailQuirksScript]):
(-[WebView _injectOutlookQuirksScript]):
(toStringVector):

2011-05-02 Sam Weinig <sam@webkit.org>

Reviewed by Adam Barth.
@@ -826,7 +826,7 @@ - (void)_visitedURL:(NSURL *)url withTitle:(NSString *)title method:(NSString *)
if ([method length])
item->setLastVisitWasHTTPNonGet([method caseInsensitiveCompare:@"GET"] && (![[url scheme] caseInsensitiveCompare:@"http"] || ![[url scheme] caseInsensitiveCompare:@"https"]));

item->setRedirectURLs(0);
item->setRedirectURLs(PassOwnPtr<Vector<String> >());

NSArray *entries = [[NSArray alloc] initWithObjects:entry, nil];
[self _sendNotification:WebHistoryItemsAddedNotification entries:entries];
@@ -162,7 +162,7 @@ - (id)initWithFrame:(NSRect)frame
_mode = NP_EMBED;

_loadManually = loadManually;
_haltable = new WebHaltablePlugin(self);
_haltable = adoptPtr(new WebHaltablePlugin(self));
return self;
}

@@ -1205,8 +1205,8 @@ static inline void applyAppleDictionaryApplicationQuirk(WebFrameLoaderClient* cl

void WebFrameLoaderClient::savePlatformDataToCachedFrame(CachedFrame* cachedFrame)
{
WebCachedFramePlatformData* webPlatformData = new WebCachedFramePlatformData([m_webFrame->_private->webFrameView documentView]);
cachedFrame->setCachedFramePlatformData(webPlatformData);
OwnPtr<WebCachedFramePlatformData> webPlatformData = adoptPtr(new WebCachedFramePlatformData([m_webFrame->_private->webFrameView documentView]));
cachedFrame->setCachedFramePlatformData(webPlatformData.release());
}

void WebFrameLoaderClient::transitionToCommittedFromCachedFrame(CachedFrame* cachedFrame)
@@ -642,7 +642,7 @@ - (void)_injectMailQuirksScript
{
static NSString *mailQuirksScriptContents = leakMailQuirksUserScriptContents();
core(self)->group().addUserScriptToWorld(core([WebScriptWorld world]),
mailQuirksScriptContents, KURL(), 0, 0, InjectAtDocumentEnd, InjectInAllFrames);
mailQuirksScriptContents, KURL(), PassOwnPtr<Vector<String> >(), PassOwnPtr<Vector<String> >(), InjectAtDocumentEnd, InjectInAllFrames);
}

static bool needsOutlookQuirksScript()
@@ -663,7 +663,7 @@ -(void)_injectOutlookQuirksScript
{
static NSString *outlookQuirksScriptContents = leakOutlookQuirksUserScriptContents();
core(self)->group().addUserScriptToWorld(core([WebScriptWorld world]),
outlookQuirksScriptContents, KURL(), 0, 0, InjectAtDocumentEnd, InjectInAllFrames);
outlookQuirksScriptContents, KURL(), PassOwnPtr<Vector<String> >(), PassOwnPtr<Vector<String> >(), InjectAtDocumentEnd, InjectInAllFrames);
}

- (void)_commonInitializationWithFrameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews
@@ -2563,14 +2563,14 @@ - (void)_updateActiveState
// Convert the patterns into Vectors.
NSUInteger count = [patterns count];
if (count == 0)
return 0;
Vector<String>* patternsVector = new Vector<String>;
return PassOwnPtr<Vector<String> >();
OwnPtr<Vector<String> > patternsVector = adoptPtr(new Vector<String>);
for (NSUInteger i = 0; i < count; ++i) {
id entry = [patterns objectAtIndex:i];
if ([entry isKindOfClass:[NSString class]])
patternsVector->append(String((NSString*)entry));
}
return patternsVector;
return patternsVector.release();
}

+ (void)_addUserScriptToGroup:(NSString *)groupName world:(WebScriptWorld *)world source:(NSString *)source url:(NSURL *)url
@@ -1,3 +1,33 @@
2011-05-02 Adam Barth <abarth@webkit.org>

Reviewed by David Levin.

PLATFORM(MAC) should (almost!) build with strict PassOwnPtr
https://bugs.webkit.org/show_bug.cgi?id=59924

* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::sendSyncMessage):
(CoreIPC::Connection::waitForSyncReply):
(CoreIPC::Connection::dispatchSyncMessage):
* Platform/CoreIPC/Connection.h:
(CoreIPC::Connection::Message::releaseArguments):
- The memory management for this class is very strange. I wrote a
large comment. Hopefully a kind soul will come by and fix it.
* Shared/Plugins/Netscape/NetscapePluginModule.cpp:
(WebKit::NetscapePluginModule::unload):
* UIProcess/API/mac/WKView.mm:
(-[WKView _setFindIndicator:fadeOut:]):
* WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm:
(WebKit::WebFullScreenManagerMac::setRootFullScreenLayer):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::toStringVector):
* WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
(WebKit::NetscapePluginStream::stop):
* WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
(WebKit::WebInspectorFrontendClient::WebInspectorFrontendClient):
* WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::create):

2011-04-29 Chris Marrin <cmarrin@apple.com>

Reviewed by Simon Fraser.
@@ -387,15 +387,15 @@ PassOwnPtr<ArgumentDecoder> Connection::sendSyncMessage(MessageID messageID, uin

if (!isValid()) {
didFailToSendSyncMessage();
return 0;
return PassOwnPtr<ArgumentDecoder>();
}

// Push the pending sync reply information on our stack.
{
MutexLocker locker(m_syncReplyStateMutex);
if (!m_shouldWaitForSyncReplies) {
didFailToSendSyncMessage();
return 0;
return PassOwnPtr<ArgumentDecoder>();
}

m_pendingSyncReplies.append(PendingSyncReply(syncRequestID));
@@ -457,7 +457,7 @@ PassOwnPtr<ArgumentDecoder> Connection::waitForSyncReply(uint64_t syncRequestID,
// If that happens, we need to stop waiting, or we'll hang since we won't get
// any more incoming messages.
if (!isValid())
return 0;
return PassOwnPtr<ArgumentDecoder>();

// We didn't find a sync reply yet, keep waiting.
#if PLATFORM(WIN)
@@ -471,7 +471,7 @@ PassOwnPtr<ArgumentDecoder> Connection::waitForSyncReply(uint64_t syncRequestID,
if (m_client)
m_client->syncMessageSendTimedOut(this);

return 0;
return PassOwnPtr<ArgumentDecoder>();
}

void Connection::processIncomingSyncReply(PassOwnPtr<ArgumentDecoder> arguments)
@@ -626,10 +626,10 @@ void Connection::dispatchSyncMessage(MessageID messageID, ArgumentDecoder* argum
}

// Create our reply encoder.
ArgumentEncoder* replyEncoder = ArgumentEncoder::create(syncRequestID).leakPtr();
OwnPtr<ArgumentEncoder> replyEncoder = ArgumentEncoder::create(syncRequestID);

// Hand off both the decoder and encoder to the client..
SyncReplyMode syncReplyMode = m_client->didReceiveSyncMessage(this, messageID, arguments, replyEncoder);
// Hand off both the decoder and encoder to the client.
SyncReplyMode syncReplyMode = m_client->didReceiveSyncMessage(this, messageID, arguments, replyEncoder.get());

// FIXME: If the message was invalid, we should send back a SyncMessageError.
ASSERT(!arguments->isInvalid());
@@ -641,7 +641,7 @@ void Connection::dispatchSyncMessage(MessageID messageID, ArgumentDecoder* argum
}

// Send the reply.
sendSyncReply(replyEncoder);
sendSyncReply(replyEncoder.release());
}

void Connection::didFailToSendSyncMessage()
@@ -185,14 +185,19 @@ class Connection : public ThreadSafeRefCounted<Connection> {

PassOwnPtr<T> releaseArguments()
{
T* arguments = m_arguments;
OwnPtr<T> arguments = adoptPtr(m_arguments);
m_arguments = 0;

return arguments;
return arguments.release();
}

private:
MessageID m_messageID;
// The memory management of this class is very unusual. The class acts
// as if it has an owning reference to m_arguments (e.g., accepting a
// PassOwnPtr in its constructor) in all ways except that it does not
// deallocate m_arguments on destruction.
// FIXME: Does this leak m_arguments on destruction?
T* m_arguments;
};

@@ -256,7 +256,7 @@ void NetscapePluginModule::unload()
{
ASSERT(!m_isInitialized);

m_module = 0;
m_module = nullptr;
}

} // namespace WebKit
@@ -2202,7 +2202,7 @@ - (void)_toolTipChangedFrom:(NSString *)oldToolTip to:(NSString *)newToolTip
- (void)_setFindIndicator:(PassRefPtr<FindIndicator>)findIndicator fadeOut:(BOOL)fadeOut
{
if (!findIndicator) {
_data->_findIndicatorWindow = 0;
_data->_findIndicatorWindow = nullptr;
return;
}

@@ -140,7 +140,7 @@ - (void)invalidate
m_page->send(Messages::WebFullScreenManagerProxy::ExitAcceleratedCompositingMode());
if (m_rootLayer) {
m_rootLayer->removeAllChildren();
m_rootLayer = 0;
m_rootLayer = nullptr;
}
return;
}
@@ -212,20 +212,20 @@ bool InjectedBundle::isPageBoxVisible(WebFrame* frame, int pageIndex)
static PassOwnPtr<Vector<String> > toStringVector(ImmutableArray* patterns)
{
if (!patterns)
return 0;
return PassOwnPtr<Vector<String> >();

size_t size = patterns->size();
if (!size)
return 0;
return PassOwnPtr<Vector<String> >();

Vector<String>* patternsVector = new Vector<String>;
OwnPtr<Vector<String> > patternsVector = adoptPtr(new Vector<String>);
patternsVector->reserveInitialCapacity(size);
for (size_t i = 0; i < size; ++i) {
WebString* entry = patterns->at<WebString>(i);
if (entry)
patternsVector->uncheckedAppend(entry->string());
}
return patternsVector;
return patternsVector.release();
}

void InjectedBundle::addUserScript(WebPageGroupProxy* pageGroup, InjectedBundleScriptWorld* scriptWorld, const String& source, const String& url, ImmutableArray* whitelist, ImmutableArray* blacklist, WebCore::UserScriptInjectionTime injectionTime, WebCore::UserContentInjectedFrames injectedFrames)
@@ -293,7 +293,7 @@ void NetscapePluginStream::stop(NPReason reason)
return;
}

m_deliveryData = 0;
m_deliveryData = nullptr;
m_deliveryDataTimer.stop();

if (m_transferMode == NP_ASFILE || m_transferMode == NP_ASFILEONLY) {
@@ -40,7 +40,7 @@ using namespace WebCore;
namespace WebKit {

WebInspectorFrontendClient::WebInspectorFrontendClient(WebPage* page, WebPage* inspectorPage)
: InspectorFrontendClientLocal(page->corePage()->inspectorController(), inspectorPage->corePage(), new Settings())
: InspectorFrontendClientLocal(page->corePage()->inspectorController(), inspectorPage->corePage(), adoptPtr(new Settings()))
, m_page(page)
{
}
@@ -48,7 +48,7 @@ PassOwnPtr<DrawingArea> DrawingArea::create(WebPage* webPage, const WebPageCreat
#if PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(QT)
return DrawingAreaImpl::create(webPage, parameters);
#else
return 0;
return PassOwnPtr<DrawingArea>();
#endif
case DrawingAreaTypeChunkedUpdate:
return adoptPtr(new ChunkedUpdateDrawingArea(webPage));
@@ -58,7 +58,7 @@ PassOwnPtr<DrawingArea> DrawingArea::create(WebPage* webPage, const WebPageCreat
#endif
}

return 0;
return PassOwnPtr<DrawingArea>();
}

DrawingArea::DrawingArea(DrawingAreaType type, WebPage* webPage)

0 comments on commit 7fe5da3

Please sign in to comment.