Changeset 150668 in webkit


Ignore:
Timestamp:
May 24, 2013 4:52:21 PM (11 years ago)
Author:
andersca@apple.com
Message:

Remove using namespace std from Mac WebKit1
https://bugs.webkit.org/show_bug.cgi?id=116747

Reviewed by Sam Weinig.

Use explicit std:: qualifiers instead.

  • History/BinaryPropertyList.cpp:

(IntegerArray::deletedValueSize):
(BinaryPropertyListPlan::invalidObjectReference):
(bytesNeeded):

  • History/WebHistory.mm:

(-[WebHistoryPrivate orderedLastVisitedDays]):
(WebHistoryWriter::WebHistoryWriter):

  • History/WebHistoryItem.mm:

(-[WebHistoryItem initFromDictionaryRepresentation:]):

  • Plugins/Hosted/NetscapePluginHostManager.mm:

(WebKit::NetscapePluginHostManager::instantiatePlugin):

  • Plugins/Hosted/NetscapePluginHostProxy.mm:
  • Plugins/Hosted/NetscapePluginInstanceProxy.mm:

(WebKit::NetscapePluginInstanceProxy::LocalObjectMap::idForObject):
(WebKit::NetscapePluginInstanceProxy::wheelEvent):
(WebKit::NetscapePluginInstanceProxy::print):
(WebKit::NetscapePluginInstanceProxy::snapshot):
(WebKit::NetscapePluginInstanceProxy::loadURL):
(WebKit::NetscapePluginInstanceProxy::createBindingsInstance):

  • Plugins/Hosted/ProxyInstance.mm:

(WebKit::ProxyInstance::invoke):
(WebKit::ProxyInstance::supportsInvokeDefaultMethod):
(WebKit::ProxyInstance::supportsConstruct):
(WebKit::ProxyInstance::getPropertyNames):
(WebKit::ProxyInstance::methodNamed):
(WebKit::ProxyInstance::fieldNamed):
(WebKit::ProxyInstance::fieldValue):
(WebKit::ProxyInstance::setFieldValue):

  • Plugins/WebBasePluginPackage.mm:

(-[WebBasePluginPackage supportsExtension:]):
(-[WebBasePluginPackage MIMETypeForExtension:]):

  • Plugins/WebNetscapePluginStream.mm:

(WebNetscapePluginStream::deliverData):

  • Plugins/WebNetscapePluginView.mm:

(PluginTimer::start):
(-[WebNetscapePluginView _postURL:target:len:buf:file:notifyData:sendNotification:allowHeaders:]):

  • WebCoreSupport/WebFrameLoaderClient.mm:
  • WebView/WebFrame.mm:
  • WebView/WebHTMLView.mm:

(-[WebHTMLView _adjustedBottomOfPageWithTop:bottom:limit:]):

  • WebView/WebTextCompletionController.mm:

(-[WebTextCompletionController _placePopupWindow:]):

Location:
trunk/Source/WebKit/mac
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/mac/ChangeLog

    r150665 r150668  
     12013-05-24  Anders Carlsson  <andersca@apple.com>
     2
     3        Remove using namespace std from Mac WebKit1
     4        https://bugs.webkit.org/show_bug.cgi?id=116747
     5
     6        Reviewed by Sam Weinig.
     7
     8        Use explicit std:: qualifiers instead.
     9
     10        * History/BinaryPropertyList.cpp:
     11        (IntegerArray::deletedValueSize):
     12        (BinaryPropertyListPlan::invalidObjectReference):
     13        (bytesNeeded):
     14        * History/WebHistory.mm:
     15        (-[WebHistoryPrivate orderedLastVisitedDays]):
     16        (WebHistoryWriter::WebHistoryWriter):
     17        * History/WebHistoryItem.mm:
     18        (-[WebHistoryItem initFromDictionaryRepresentation:]):
     19        * Plugins/Hosted/NetscapePluginHostManager.mm:
     20        (WebKit::NetscapePluginHostManager::instantiatePlugin):
     21        * Plugins/Hosted/NetscapePluginHostProxy.mm:
     22        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
     23        (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::idForObject):
     24        (WebKit::NetscapePluginInstanceProxy::wheelEvent):
     25        (WebKit::NetscapePluginInstanceProxy::print):
     26        (WebKit::NetscapePluginInstanceProxy::snapshot):
     27        (WebKit::NetscapePluginInstanceProxy::loadURL):
     28        (WebKit::NetscapePluginInstanceProxy::createBindingsInstance):
     29        * Plugins/Hosted/ProxyInstance.mm:
     30        (WebKit::ProxyInstance::invoke):
     31        (WebKit::ProxyInstance::supportsInvokeDefaultMethod):
     32        (WebKit::ProxyInstance::supportsConstruct):
     33        (WebKit::ProxyInstance::getPropertyNames):
     34        (WebKit::ProxyInstance::methodNamed):
     35        (WebKit::ProxyInstance::fieldNamed):
     36        (WebKit::ProxyInstance::fieldValue):
     37        (WebKit::ProxyInstance::setFieldValue):
     38        * Plugins/WebBasePluginPackage.mm:
     39        (-[WebBasePluginPackage supportsExtension:]):
     40        (-[WebBasePluginPackage MIMETypeForExtension:]):
     41        * Plugins/WebNetscapePluginStream.mm:
     42        (WebNetscapePluginStream::deliverData):
     43        * Plugins/WebNetscapePluginView.mm:
     44        (PluginTimer::start):
     45        (-[WebNetscapePluginView _postURL:target:len:buf:file:notifyData:sendNotification:allowHeaders:]):
     46        * WebCoreSupport/WebFrameLoaderClient.mm:
     47        * WebView/WebFrame.mm:
     48        * WebView/WebHTMLView.mm:
     49        (-[WebHTMLView _adjustedBottomOfPageWithTop:bottom:limit:]):
     50        * WebView/WebTextCompletionController.mm:
     51        (-[WebTextCompletionController _placePopupWindow:]):
     52
    1532013-05-24  Anders Carlsson  <andersca@apple.com>
    254
  • trunk/Source/WebKit/mac/History/BinaryPropertyList.cpp

    r150665 r150668  
    3131#include <wtf/text/StringHash.h>
    3232
    33 using namespace std;
    34 
    3533static const size_t headerSize = 8;
    3634static const size_t trailerSize = 32;
     
    6361
    6462private:
    65     static size_t deletedValueSize() { return numeric_limits<size_t>::max(); }
     63    static size_t deletedValueSize() { return std::numeric_limits<size_t>::max(); }
    6664
    6765    friend bool operator==(const IntegerArray&, const IntegerArray&);
     
    139137    void writeStringObject(const char*);
    140138
    141     static ObjectReference invalidObjectReference() { return numeric_limits<ObjectReference>::max(); }
     139    static ObjectReference invalidObjectReference() { return std::numeric_limits<ObjectReference>::max(); }
    142140
    143141    typedef HashMap<IntegerArray, ObjectReference, IntegerArrayHash, IntegerArrayHashTraits> IntegerArrayMap;
     
    415413    ASSERT(count);
    416414    int bytesNeeded = 1;
    417     for (size_t mask = numeric_limits<size_t>::max() << 8; count & mask; mask <<= 8)
     415    for (size_t mask = std::numeric_limits<size_t>::max() << 8; count & mask; mask <<= 8)
    418416        ++bytesNeeded;
    419417    return bytesNeeded;
  • trunk/Source/WebKit/mac/History/WebHistory.mm

    r150665 r150668  
    3838
    3939using namespace WebCore;
    40 using namespace std;
    4140
    4241typedef int64_t WebHistoryDateKey;
     
    445444            daysAsTimeIntervals.append(it->key);
    446445
    447         sort(daysAsTimeIntervals.begin(), daysAsTimeIntervals.end());
     446        std::sort(daysAsTimeIntervals.begin(), daysAsTimeIntervals.end());
    448447        size_t count = daysAsTimeIntervals.size();
    449448        _orderedLastVisitedDays = [[NSMutableArray alloc] initWithCapacity:count];
     
    901900    for (DateToEntriesMap::const_iterator it = m_entriesByDate->begin(); it != end; ++it)
    902901        m_dateKeys.append(it->key);
    903     sort(m_dateKeys.begin(), m_dateKeys.end());
     902    std::sort(m_dateKeys.begin(), m_dateKeys.end());
    904903}
    905904
  • trunk/Source/WebKit/mac/History/WebHistoryItem.mm

    r145789 r150668  
    7474
    7575using namespace WebCore;
    76 using namespace std;
    7776
    7877typedef HashMap<HistoryItem*, WebHistoryItem*> HistoryItemMap;
     
    376375        // Daily and weekly counts < 0 are errors in the data read from disk, so reset to 0.
    377376        for (size_t i = 0; i < coreDailyCounts.size(); ++i)
    378             coreDailyCounts[i] = max([[dailyCounts _webkit_numberAtIndex:i] intValue], 0);
     377            coreDailyCounts[i] = std::max([[dailyCounts _webkit_numberAtIndex:i] intValue], 0);
    379378        for (size_t i = 0; i < coreWeeklyCounts.size(); ++i)
    380             coreWeeklyCounts[i] = max([[weeklyCounts _webkit_numberAtIndex:i] intValue], 0);
     379            coreWeeklyCounts[i] = std::max([[weeklyCounts _webkit_numberAtIndex:i] intValue], 0);
    381380   
    382381        core(_private)->adoptVisitCounts(coreDailyCounts, coreWeeklyCounts);
  • trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm

    r149255 r150668  
    4545}
    4646
    47 using namespace std;
    4847using namespace WebCore;
    4948
     
    269268    }
    270269
    271     auto_ptr<NetscapePluginInstanceProxy::InstantiatePluginReply> reply = instance->waitForReply<NetscapePluginInstanceProxy::InstantiatePluginReply>(requestID);
     270    std::auto_ptr<NetscapePluginInstanceProxy::InstantiatePluginReply> reply = instance->waitForReply<NetscapePluginInstanceProxy::InstantiatePluginReply>(requestID);
    272271    if (!reply.get() || reply->m_resultCode != KERN_SUCCESS) {
    273272        instance->cleanup();
  • trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm

    r149665 r150668  
    4646}
    4747
    48 using namespace std;
    4948using namespace JSC;
    5049using namespace WebCore;
  • trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm

    r149665 r150668  
    7474using namespace JSC;
    7575using namespace JSC::Bindings;
    76 using namespace std;
    7776using namespace WebCore;
    7877
     
    153152
    154153    m_idToJSObjectMap.set(objectID, Strong<JSObject>(vm, object));
    155     m_jsObjectToIDMap.set(object, make_pair(objectID, 1));
     154    m_jsObjectToIDMap.set(object, std::make_pair(objectID, 1));
    156155
    157156    return objectID;
     
    484483                                  [event deltaX], [event deltaY], [event deltaZ]);
    485484   
    486     auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
     485    std::auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
    487486    if (!reply.get() || !reply->m_result)
    488487        return false;
     
    496495    _WKPHPluginInstancePrint(m_pluginHostProxy->port(), m_pluginID, requestID, width, height);
    497496   
    498     auto_ptr<NetscapePluginInstanceProxy::BooleanAndDataReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanAndDataReply>(requestID);
     497    std::auto_ptr<NetscapePluginInstanceProxy::BooleanAndDataReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanAndDataReply>(requestID);
    499498    if (!reply.get() || !reply->m_returnValue)
    500499        return;
     
    519518    _WKPHPluginInstanceSnapshot(m_pluginHostProxy->port(), m_pluginID, requestID, width, height);
    520519   
    521     auto_ptr<NetscapePluginInstanceProxy::BooleanAndDataReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanAndDataReply>(requestID);
     520    std::auto_ptr<NetscapePluginInstanceProxy::BooleanAndDataReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanAndDataReply>(requestID);
    522521    if (!reply.get() || !reply->m_returnValue)
    523522        return;
     
    597596
    598597                    if (contentLength)
    599                         dataLength = min(static_cast<unsigned>([contentLength intValue]), dataLength);
     598                        dataLength = std::min(static_cast<unsigned>([contentLength intValue]), dataLength);
    600599                    [header removeObjectForKey:@"Content-Length"];
    601600
     
    14241423        return 0;
    14251424
    1426     auto_ptr<GetScriptableNPObjectReply> reply = waitForReply<GetScriptableNPObjectReply>(requestID);
     1425    std::auto_ptr<GetScriptableNPObjectReply> reply = waitForReply<GetScriptableNPObjectReply>(requestID);
    14271426    if (!reply.get())
    14281427        return 0;
  • trunk/Source/WebKit/mac/Plugins/Hosted/ProxyInstance.mm

    r148696 r150668  
    4444using namespace JSC;
    4545using namespace JSC::Bindings;
    46 using namespace std;
    4746using namespace WebCore;
    4847
     
    164163    }
    165164   
    166     auto_ptr<NetscapePluginInstanceProxy::BooleanAndDataReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanAndDataReply>(requestID);
     165    std::auto_ptr<NetscapePluginInstanceProxy::BooleanAndDataReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanAndDataReply>(requestID);
    167166    NetscapePluginInstanceProxy::moveGlobalExceptionToExecState(exec);
    168167
     
    243242        return false;
    244243   
    245     auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
     244    std::auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
    246245    if (reply.get() && reply->m_result)
    247246        return true;
     
    267266        return false;
    268267   
    269     auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
     268    std::auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
    270269    if (reply.get() && reply->m_result)
    271270        return true;
     
    321320        return;
    322321   
    323     auto_ptr<NetscapePluginInstanceProxy::BooleanAndDataReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanAndDataReply>(requestID);
     322    std::auto_ptr<NetscapePluginInstanceProxy::BooleanAndDataReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanAndDataReply>(requestID);
    324323    NetscapePluginInstanceProxy::moveGlobalExceptionToExecState(exec);
    325324    if (!reply.get() || !reply->m_returnValue)
     
    368367        return 0;
    369368   
    370     auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
     369    std::auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
    371370    if (!reply.get())
    372371        return 0;
     
    405404        return 0;
    406405   
    407     auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
     406    std::auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
    408407    if (!reply.get())
    409408        return 0;
     
    432431        return jsUndefined();
    433432   
    434     auto_ptr<NetscapePluginInstanceProxy::BooleanAndDataReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanAndDataReply>(requestID);
     433    std::auto_ptr<NetscapePluginInstanceProxy::BooleanAndDataReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanAndDataReply>(requestID);
    435434    NetscapePluginInstanceProxy::moveGlobalExceptionToExecState(exec);
    436435    if (!reply.get() || !reply->m_returnValue)
     
    462461        return;
    463462   
    464     auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
     463    std::auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
    465464    NetscapePluginInstanceProxy::moveGlobalExceptionToExecState(exec);
    466465}
  • trunk/Source/WebKit/mac/Plugins/WebBasePluginPackage.mm

    r150227 r150668  
    6161@end;
    6262
    63 using namespace std;
    6463using namespace WebCore;
    6564
     
    311310        const Vector<String>& extensions = pluginInfo.mimes[i].extensions;
    312311
    313         if (find(extensions.begin(), extensions.end(), extension) != extensions.end())
     312        if (std::find(extensions.begin(), extensions.end(), extension) != extensions.end())
    314313            return YES;
    315314    }
     
    338337        const Vector<String>& extensions = mimeClassInfo.extensions;
    339338
    340         if (find(extensions.begin(), extensions.end(), extension) != extensions.end())
     339        if (std::find(extensions.begin(), extensions.end(), extension) != extensions.end())
    341340            return mimeClassInfo.type;
    342341    }
  • trunk/Source/WebKit/mac/Plugins/WebNetscapePluginStream.mm

    r149423 r150668  
    5555
    5656using namespace WebCore;
    57 using namespace std;
    5857
    5958#define WEB_REASON_NONE -1
     
    524523            break;
    525524        } else {
    526             deliveryBytes = min(deliveryBytes, totalBytes - totalBytesDelivered);
     525            deliveryBytes = std::min(deliveryBytes, totalBytes - totalBytesDelivered);
    527526            NSData *subdata = [m_deliveryData.get() subdataWithRange:NSMakeRange(totalBytesDelivered, deliveryBytes)];
    528527            PluginStopDeferrer deferrer(m_pluginView.get());
     
    533532                return;
    534533            }
    535             deliveryBytes = min<int32_t>(deliveryBytes, [subdata length]);
     534            deliveryBytes = std::min<int32_t>(deliveryBytes, [subdata length]);
    536535            m_offset += deliveryBytes;
    537536            totalBytesDelivered += deliveryBytes;
  • trunk/Source/WebKit/mac/Plugins/WebNetscapePluginView.mm

    r149562 r150668  
    9292using namespace WebCore;
    9393using namespace WebKit;
    94 using namespace std;
    9594
    9695static inline bool isDrawingModelQuickDraw(NPDrawingModel drawingModel)
     
    137136       
    138137        if (throttle)
    139             timeInterval = max(timeInterval, ThrottledTimerInterval);
     138            timeInterval = std::max(timeInterval, ThrottledTimerInterval);
    140139       
    141140        if (m_repeat)
     
    18521851
    18531852                if (contentLength != nil)
    1854                     dataLength = min<unsigned>([contentLength intValue], dataLength);
     1853                    dataLength = std::min<unsigned>([contentLength intValue], dataLength);
    18551854                [header removeObjectForKey:@"Content-Length"];
    18561855
  • trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm

    r150609 r150668  
    141141using namespace WebCore;
    142142using namespace HTMLNames;
    143 using namespace std;
    144143
    145144// For backwards compatibility with older WebKit plug-ins.
  • trunk/Source/WebKit/mac/WebView/WebFrame.mm

    r150353 r150668  
    105105#import <wtf/CurrentTime.h>
    106106
    107 using namespace std;
    108107using namespace WebCore;
    109108using namespace HTMLNames;
  • trunk/Source/WebKit/mac/WebView/WebHTMLView.mm

    r150530 r150668  
    139139using namespace HTMLNames;
    140140using namespace WTF;
    141 using namespace std;
    142141
    143142@interface WebMenuTarget : NSObject {
     
    22162215    // If the new bottom is equal to the old bottom (when both are treated as floats), we just return the original
    22172216    // bottom. This prevents rounding errors that can occur when converting newBottom to a double.
    2218     if (fabs(static_cast<float>(bottom) - newBottom) <= numeric_limits<float>::epsilon())
     2217    if (fabs(static_cast<float>(bottom) - newBottom) <= std::numeric_limits<float>::epsilon())
    22192218        return bottom;
    22202219    else
  • trunk/Source/WebKit/mac/WebView/WebTextCompletionController.mm

    r85864 r150668  
    4242
    4343using namespace WebCore;
    44 using namespace std;
    4544
    4645// This class handles the complete: operation.
     
    149148        maxWidth = ceilf([NSWindow frameRectForContentRect:NSMakeRect(0.0f, 0.0f, maxWidth, 100.0f) styleMask:NSBorderlessWindowMask].size.width);
    150149        maxWidth += 5.0f;
    151         windowFrame.size.width = max(maxWidth, windowFrame.size.width);
    152         maxWidth = min<CGFloat>(400, windowFrame.size.width);
     150        windowFrame.size.width = std::max(maxWidth, windowFrame.size.width);
     151        maxWidth = std::min<CGFloat>(400, windowFrame.size.width);
    153152    }
    154153    [_popupWindow setFrame:windowFrame display:NO];
Note: See TracChangeset for help on using the changeset viewer.