void V8DOMActivityLogger::setActivityLogger(int worldId, const String& extensionId, PassOwnPtr<V8DOMActivityLogger> logger) { if (worldId) domActivityLoggersForIsolatedWorld().set(worldId, logger); else domActivityLoggersForMainWorld().set(extensionId, logger); }
void V8DOMActivityLogger::setActivityLogger(int worldId, const String& extensionId, std::unique_ptr<V8DOMActivityLogger> logger) { if (worldId) domActivityLoggersForIsolatedWorld().set(worldId, std::move(logger)); else domActivityLoggersForMainWorld().set(extensionId, std::move(logger)); }
V8DOMActivityLogger* V8DOMActivityLogger::activityLogger(int worldId, const String& extensionId) { if (worldId) { DOMActivityLoggerMapForIsolatedWorld& loggers = domActivityLoggersForIsolatedWorld(); DOMActivityLoggerMapForIsolatedWorld::iterator it = loggers.find(worldId); return it == loggers.end() ? 0 : it->value.get(); } if (extensionId.isEmpty()) return 0; DOMActivityLoggerMapForMainWorld& loggers = domActivityLoggersForMainWorld(); DOMActivityLoggerMapForMainWorld::iterator it = loggers.find(extensionId); return it == loggers.end() ? 0 : it->value.get(); }