Datasets:
project string | commit_id string | target int64 | func string | cwe string | big_vul_idx string | idx int64 | hash string | size float64 | message string | dataset string |
|---|---|---|---|---|---|---|---|---|---|---|
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 1 | void UpdateNetworkManagerStatus() {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this,
&NetworkLibraryImpl::UpdateNetworkManagerStatus));
return;
}
SystemInfo* sys... | 183616 | 4,681 | 176851565339666412051409584687167623341 | null | null | null | |
Chrome | 610f904d8215075c4681be4eb413f4348860bf9f | 1 | int64 ClientUsageTracker::GetCachedHostUsage(const std::string& host) {
HostUsageMap::const_iterator found = cached_usage_.find(host);
if (found == cached_usage_.end())
return 0;
int64 usage = 0;
const UsageMap& map = found->second;
for (UsageMap::const_iterator iter = map.begin();
iter != map.... | 183644 | 4,706 | 81607632977134860466801081500022041763 | null | null | null | |
Chrome | 45bae236b03f577ed6682ef4c7ef3ee006de5e5a | 1 | void AddInstallerCopyTasks(const InstallerState& installer_state,
const FilePath& setup_path,
const FilePath& archive_path,
const FilePath& temp_path,
const Version& new_version,
WorkIt... | 184084 | 5,095 | 296073909617636686988193993551614228480 | null | null | null | |
Chrome | 3c1864079c441ea2e08f882acaaf441f78a6de3d | 1 | bool decode(ArgumentDecoder* decoder, RetainPtr<CFURLRef>& result)
{
RetainPtr<CFURLRef> baseURL;
bool hasBaseURL;
if (!decoder->decodeBool(hasBaseURL))
return false;
if (hasBaseURL) {
if (!decode(decoder, baseURL))
return false;
}
RetainPtr<CFStringRef> string;
... | 184202 | 5,194 | 130336217108486797871218257624771528040 | null | null | null | |
Chrome | 2bfb2b8299e2fb6a432390a93a99a85fed1d29c9 | 1 | void WebProcessProxy::addExistingWebPage(WebPageProxy* webPage, uint64_t pageID)
{
m_pageMap.set(pageID, webPage);
globalPageMap().set(pageID, webPage);
#if PLATFORM(MAC)
if (pageIsProcessSuppressible(webPage));
m_processSuppressiblePages.add(pageID);
updateProcessSuppressionState();
#endi... | 184482 | 5,440 | 110522851826911328048375980316968416017 | null | null | null | |
Chrome | 6d067124e87295721c62a77f0610e4b37f6098ad | 1 | v8::Handle<v8::Value> V8ThrowException::createDOMException(v8::Isolate* isolate, int ec, const String& sanitizedMessage, const String& unsanitizedMessage, const v8::Handle<v8::Object>& creationContext)
{
if (ec <= 0 || v8::V8::IsExecutionTerminating())
return v8Undefined();
ASSERT(ec == SecurityError |... | 185956 | 6,754 | 165916481135831373002300240035909386676 | null | null | null | |
Chrome | fb83de09f2c986ee91741f3a2776feea0e18e3f6 | 1 | void OverlayWindowViews::OnGestureEvent(ui::GestureEvent* event) {
if (event->type() != ui::ET_GESTURE_TAP)
return;
hide_controls_timer_.Reset();
if (!GetControlsScrimLayer()->visible()) {
UpdateControlsVisibility(true);
return;
}
if (GetCloseControlsBounds().Contains(event->location())) {
... | 186551 | 7,290 | 303506592678362065050884877503185093458 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | std::string CellularNetwork::ActivationStateToString(
ActivationState activation_state) {
switch (activation_state) {
case ACTIVATION_STATE_ACTIVATED:
return l10n_util::GetStringUTF8(
IDS_CHROMEOS_NETWORK_ACTIVATION_STATE_ACTIVATED);
break;
case ACTIVATION_STATE_ACTIVATING:
ret... | 100204 | 90,104 | 157999551299079595602783012275458877113 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void AddCellularDataPlanObserver(CellularDataPlanObserver* observer) {
if (!data_plan_observers_.HasObserver(observer))
data_plan_observers_.AddObserver(observer);
}
| 100205 | 90,105 | 309963211831686180665706939295472305039 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void AddNetworkManagerObserver(NetworkManagerObserver* observer) {
if (!network_manager_observers_.HasObserver(observer))
network_manager_observers_.AddObserver(observer);
}
| 100206 | 90,106 | 87001527718495044750268083261840873231 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void AddNetworkManagerObserver(NetworkManagerObserver* observer) {}
| 100207 | 90,107 | 42101612285565483690010476549071312560 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void AddNetworkObserver(const std::string& service_path,
NetworkObserver* observer) {
DCHECK(observer);
if (!EnsureCrosLoaded())
return;
NetworkObserverMap::iterator iter = network_observers_.find(service_path);
NetworkObserverList* oblist;
if (iter ... | 100208 | 90,108 | 155839336240772552856521786526032784186 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void AddNetworkObserver(const std::string& service_path,
NetworkObserver* observer) {}
| 100209 | 90,109 | 45531431629127569521371400434506842684 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | CellularNetwork::CellularNetwork()
: WirelessNetwork(),
activation_state_(ACTIVATION_STATE_UNKNOWN),
network_technology_(NETWORK_TECHNOLOGY_UNKNOWN),
roaming_state_(ROAMING_STATE_UNKNOWN),
restricted_pool_(false),
prl_version_(0) {
type_ = TYPE_CELLULAR;
}
| 100210 | 90,110 | 252380351537756827079597733078591804638 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | CellularNetwork::CellularNetwork(const CellularNetwork& network)
: WirelessNetwork(network) {
activation_state_ = network.activation_state();
network_technology_ = network.network_technology();
roaming_state_ = network.roaming_state();
restricted_pool_ = network.restricted_pool();
service_name_ = network.... | 100211 | 90,111 | 167652839328409751861146595622280623032 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | CellularNetwork::CellularNetwork(const ServiceInfo* service)
: WirelessNetwork(service) {
service_name_ = SafeString(service->name);
activation_state_ = service->activation_state;
network_technology_ = service->network_technology;
roaming_state_ = service->roaming_state;
restricted_pool_ = service->restri... | 100212 | 90,112 | 267750053852824637328044170290841582743 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | void Network::Clear() {
state_ = STATE_UNKNOWN;
error_ = ERROR_UNKNOWN;
service_path_.clear();
device_path_.clear();
ip_address_.clear();
is_active_ = false;
}
| 100213 | 90,113 | 244571999020376687978447508599531047774 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | void WirelessNetwork::Clear() {
Network::Clear();
name_.clear();
strength_ = 0;
auto_connect_ = false;
favorite_ = false;
}
| 100214 | 90,114 | 175615932126770035292404464450595702434 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | void CellularNetwork::Clear() {
WirelessNetwork::Clear();
activation_state_ = ACTIVATION_STATE_UNKNOWN;
roaming_state_ = ROAMING_STATE_UNKNOWN;
network_technology_ = NETWORK_TECHNOLOGY_UNKNOWN;
restricted_pool_ = false;
service_name_.clear();
operator_name_.clear();
operator_code_.clear();
payment_url... | 100215 | 90,115 | 186556904507780151535559211245330379193 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | void WifiNetwork::Clear() {
WirelessNetwork::Clear();
encryption_ = SECURITY_NONE;
passphrase_.clear();
identity_.clear();
cert_path_.clear();
}
| 100216 | 90,116 | 318898463832164494496758719947387970905 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | void ClearNetworks() {
if (ethernet_)
delete ethernet_;
ethernet_ = NULL;
wifi_ = NULL;
cellular_ = NULL;
STLDeleteElements(&wifi_networks_);
wifi_networks_.clear();
STLDeleteElements(&cellular_networks_);
cellular_networks_.clear();
STLDeleteElements(&remembered_wifi_network... | 100217 | 90,117 | 100738864938815938949255162727268172419 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void ConnectToWifiNetwork(const WifiNetwork* network,
const std::string& password,
const std::string& identity,
const std::string& certpath) {
DCHECK(network);
if (!EnsureCrosLoaded())
ret... | 100220 | 90,118 | 15685958005356315142055036861470092720 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void ConnectToWifiNetwork(ConnectionSecurity security,
const std::string& ssid,
const std::string& password,
const std::string& identity,
const std::string& certpath,... | 100221 | 90,119 | 200790263612330962385368027947917410629 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void ConnectToWifiNetwork(const WifiNetwork* network,
const std::string& password,
const std::string& identity,
const std::string& certpath) {}
| 100222 | 90,120 | 262656762509779546039061619870740592916 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void ConnectToWifiNetwork(ConnectionSecurity security,
const std::string& ssid,
const std::string& password,
const std::string& identity,
const std::string& certpath,... | 100223 | 90,121 | 6707875500153624124655977289587329099 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | bool Connected() const {
return ethernet_connected() || wifi_connected() || cellular_connected();
}
| 100224 | 90,122 | 186253347372044473031316286851156345047 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | bool Connected() const { return true; }
| 100225 | 90,123 | 146011116526572789061152536462200738837 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | bool Connecting() const {
return ethernet_connecting() || wifi_connecting() || cellular_connecting();
}
| 100226 | 90,124 | 183209889232426848387724540393569800353 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | bool Connecting() const { return false; }
| 100227 | 90,125 | 225410887447383169752678129476690049671 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void DisconnectFromWirelessNetwork(const WirelessNetwork* network) {
DCHECK(network);
if (!EnsureCrosLoaded() || !network)
return;
if (DisconnectFromNetwork(network->service_path().c_str())) {
if (network->type() == TYPE_WIFI) {
WifiNetwork* wifi = GetWirelessNetworkByPath(
... | 100229 | 90,126 | 206941887053772269686805518431414489437 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void DisconnectFromWirelessNetwork(const WirelessNetwork* network) {}
| 100230 | 90,127 | 266455875333630270384089647731569112707 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void EnableCellularNetworkDevice(bool enable) {
EnableNetworkDeviceType(TYPE_CELLULAR, enable);
}
| 100231 | 90,128 | 61589371471429597435607274070303664472 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void EnableEthernetNetworkDevice(bool enable) {
EnableNetworkDeviceType(TYPE_ETHERNET, enable);
}
| 100233 | 90,129 | 84254815677886177831832712432794013605 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void EnableEthernetNetworkDevice(bool enable) {}
| 100234 | 90,130 | 274671827729876532508071326219645317041 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | void EnableNetworkDeviceType(ConnectionType device, bool enable) {
if (!EnsureCrosLoaded())
return;
if (enable && (enabled_devices_ & (1 << device))) {
LOG(WARNING) << "Trying to enable a device that's already enabled: "
<< device;
return;
}
if (!enable && !(enabl... | 100235 | 90,131 | 107957117492822003232975999681691493975 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void EnableOfflineMode(bool enable) {
if (!EnsureCrosLoaded())
return;
if (enable && offline_mode_) {
VLOG(1) << "Trying to enable offline mode when it's already enabled.";
return;
}
if (!enable && !offline_mode_) {
VLOG(1) << "Trying to disable offline mode when it's ... | 100236 | 90,132 | 135406634521258702153013213647483120094 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void EnableOfflineMode(bool enable) {}
| 100237 | 90,133 | 46899092895460312038724768261213276710 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void EnableWifiNetworkDevice(bool enable) {
EnableNetworkDeviceType(TYPE_WIFI, enable);
}
| 100238 | 90,134 | 11803922121700414865976478735405877412 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual CellularNetwork* FindCellularNetworkByPath(
const std::string& path) { return NULL; }
| 100242 | 90,135 | 169727144667576244060636458569764624984 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual WifiNetwork* FindWifiNetworkByPath(
const std::string& path) {
return GetWirelessNetworkByPath(wifi_networks_, path);
}
| 100243 | 90,136 | 208250587198073239598113354489423397552 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual WifiNetwork* FindWifiNetworkByPath(
const std::string& path) { return NULL; }
| 100244 | 90,137 | 137353046969598023496203562144449106790 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void ForgetWifiNetwork(const std::string& service_path) {
if (!EnsureCrosLoaded())
return;
if (DeleteRememberedService(service_path.c_str())) {
for (WifiNetworkVector::iterator iter =
remembered_wifi_networks_.begin();
iter != remembered_wifi_networks_.end();
... | 100245 | 90,138 | 172150592111709056096815297096246337263 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | std::string CellularNetwork::GetActivationStateString() const {
return ActivationStateToString(this->activation_state_);
}
| 100247 | 90,139 | 229737994156723362985251717887716369331 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | std::string WifiNetwork::GetEncryptionString() {
switch (encryption_) {
case SECURITY_UNKNOWN:
break;
case SECURITY_NONE:
return "";
case SECURITY_WEP:
return "WEP";
case SECURITY_WPA:
return "WPA";
case SECURITY_RSN:
return "RSN";
case SECURITY_8021X:
retur... | 100248 | 90,140 | 327494090980129871900814097035373985360 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | std::string Network::GetErrorString() const {
switch (error_) {
case ERROR_UNKNOWN:
return l10n_util::GetStringUTF8(IDS_CHROMEOS_NETWORK_ERROR_UNKNOWN);
case ERROR_OUT_OF_RANGE:
return l10n_util::GetStringUTF8(IDS_CHROMEOS_NETWORK_ERROR_OUT_OF_RANGE);
case ERROR_PIN_MISSING:
return l10n_... | 100249 | 90,141 | 90387433064655559862207825115909648697 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual std::string GetHtmlInfo(int refresh) {
std::string output;
output.append("<html><head><title>About Network</title>");
if (refresh > 0)
output.append("<meta http-equiv=\"refresh\" content=\"" +
base::IntToString(refresh) + "\"/>");
output.append("</head><body>");
if (refresh... | 100250 | 90,142 | 142770398384310073293835235988098047483 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual std::string GetHtmlInfo(int refresh) { return std::string(); }
| 100251 | 90,143 | 66925089768019925140231724655329202898 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual NetworkIPConfigVector GetIPConfigs(const std::string& device_path,
std::string* hardware_address) {
hardware_address->clear();
NetworkIPConfigVector ipconfig_vector;
if (EnsureCrosLoaded() && !device_path.empty()) {
IPConfigStatus* ipconfig_status... | 100252 | 90,144 | 140283104987390884386890026908528199718 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual NetworkIPConfigVector GetIPConfigs(const std::string& device_path,
std::string* hardware_address) {
hardware_address->clear();
return NetworkIPConfigVector();
}
| 100253 | 90,145 | 271187531437847626523649610335869410321 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | NetworkLibrary* NetworkLibrary::GetImpl(bool stub) {
if (stub)
return new NetworkLibraryStubImpl();
else
return new NetworkLibraryImpl();
}
| 100254 | 90,146 | 9082810096392208570408210979217450220 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | std::string CellularNetwork::GetRoamingStateString() const {
switch (this->roaming_state_) {
case ROAMING_STATE_HOME:
return l10n_util::GetStringUTF8(
IDS_CHROMEOS_NETWORK_ROAMING_STATE_HOME);
break;
case ROAMING_STATE_ROAMING:
return l10n_util::GetStringUTF8(
IDS_CHROMEO... | 100256 | 90,147 | 72467369506769717092083373186802673469 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | std::string Network::GetStateString() const {
switch (state_) {
case STATE_UNKNOWN:
return l10n_util::GetStringUTF8(IDS_CHROMEOS_NETWORK_STATE_UNKNOWN);
case STATE_IDLE:
return l10n_util::GetStringUTF8(IDS_CHROMEOS_NETWORK_STATE_IDLE);
case STATE_CARRIER:
return l10n_util::GetStringUTF8(... | 100257 | 90,148 | 236088130014265375580788110944577340295 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual bool GetWifiAccessPoints(WifiAccessPointVector* result) {
if (!EnsureCrosLoaded())
return false;
DeviceNetworkList* network_list = GetDeviceNetworkList();
if (network_list == NULL)
return false;
result->clear();
result->reserve(network_list->network_size);
const base::Time ... | 100258 | 90,149 | 331136930360542672624148076920600155951 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual bool GetWifiAccessPoints(WifiAccessPointVector* result) {
return false;
}
| 100259 | 90,150 | 169181197170185483620298714421309974470 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | WifiNetwork* GetWifiNetworkByName(const std::string& name) {
for (size_t i = 0; i < wifi_networks_.size(); ++i) {
if (wifi_networks_[i]->name().compare(name) == 0) {
return wifi_networks_[i];
}
}
return NULL;
}
| 100260 | 90,151 | 73544466230153682261995075015447722214 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | template<typename T> T GetWirelessNetworkByPath(
std::vector<T>& networks, const std::string& path) {
typedef typename std::vector<T>::iterator iter_t;
iter_t iter = std::find_if(networks.begin(), networks.end(),
WirelessNetwork::ServicePathEq(path));
return (iter != n... | 100261 | 90,152 | 112041072654314796205064754415290612968 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | template<typename T> const T GetWirelessNetworkByPath(
const std::vector<T>& networks, const std::string& path) const {
typedef typename std::vector<T>::const_iterator iter_t;
iter_t iter = std::find_if(networks.begin(), networks.end(),
WirelessNetwork::ServicePathEq(path)... | 100262 | 90,153 | 311275032166277241385568275723465014260 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | const std::string& IPAddress() const {
const Network* active = active_network();
if (active != NULL)
return active->ip_address();
if (ethernet_)
return ethernet_->ip_address();
static std::string null_address("0.0.0.0");
return null_address;
}
| 100263 | 90,154 | 175578860822119675295487810040318228651 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | const std::string& IPAddress() const { return ip_address_; }
| 100264 | 90,155 | 112572501574773710308430208778388548631 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | void Init() {
VLOG(1) << "Getting initial CrOS network info.";
UpdateSystemInfo();
}
| 100265 | 90,156 | 18821535876858130091201121271351724462 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | void InitTestData() {
ethernet_ = new EthernetNetwork();
ethernet_->set_connected(true);
ethernet_->set_service_path("eth1");
STLDeleteElements(&wifi_networks_);
wifi_networks_.clear();
WifiNetwork* wifi1 = new WifiNetwork();
wifi1->set_service_path("fw1");
wifi1->set_name("Fake Wifi ... | 100266 | 90,157 | 167100198236684029863041891519429049805 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | bool WifiNetwork::IsCertificateLoaded() const {
static const std::string settings_string("SETTINGS:");
static const std::string pkcs11_key("key_id");
if (cert_path_.find(settings_string) == 0) {
std::string::size_type idx = cert_path_.find(pkcs11_key);
if (idx != std::string::npos)
idx = cert_path_.... | 100267 | 90,158 | 132690335736935728948742779437175557994 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | Network::Network(const Network& network) {
service_path_ = network.service_path();
device_path_ = network.device_path();
ip_address_ = network.ip_address();
type_ = network.type();
state_ = network.state();
error_ = network.error();
}
| 100268 | 90,159 | 79820405273639067626751173570153768379 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | Network::Network(const ServiceInfo* service) {
type_ = service->type;
state_ = service->state;
error_ = service->error;
service_path_ = SafeString(service->service_path);
device_path_ = SafeString(service->device_path);
is_active_ = service->is_active;
ip_address_.clear();
if (EnsureCrosLoaded() && conn... | 100269 | 90,160 | 115211557826920068666282813044348220689 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | NetworkLibraryImpl()
: network_manager_monitor_(NULL),
data_plan_monitor_(NULL),
ethernet_(NULL),
wifi_(NULL),
cellular_(NULL),
available_devices_(0),
enabled_devices_(0),
connected_devices_(0),
offline_mode_(false) {
if (EnsureCrosLoaded()) {
... | 100270 | 90,161 | 143922874751952932618520217243251316994 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | NetworkObserverList(NetworkLibraryImpl* library,
const std::string& service_path) {
network_monitor_ = MonitorNetworkService(&NetworkStatusChangedHandler,
service_path.c_str(),
library);
}... | 100273 | 90,162 | 286359904974810435114420047143325166709 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | static void NetworkStatusChangedHandler(void* object,
const char* path,
const char* key,
const Value* value) {
NetworkLibraryImpl* networklib = static_cast<NetworkLibraryImpl*>(o... | 100274 | 90,163 | 156818042270159240803621782352740583177 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | void NotifyNetworkChanged(Network* network) {
DCHECK(network);
NetworkObserverMap::const_iterator iter = network_observers_.find(
network->service_path());
if (iter != network_observers_.end()) {
FOR_EACH_OBSERVER(NetworkObserver,
*(iter->second),
... | 100276 | 90,164 | 250190812877619623108397662051110321846 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | static ActivationState ParseActivationState(
const std::string& activation_state) {
if (activation_state == kActivationStateActivated)
return ACTIVATION_STATE_ACTIVATED;
if (activation_state == kActivationStateActivating)
return ACTIVATION_STATE_ACTIVATING;
if (activation_state == kActivationStateNotA... | 100278 | 90,165 | 2263283871812024506837222820762880493 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | static NetworkTechnology ParseNetworkTechnology(
const std::string& technology) {
if (technology == kNetworkTechnology1Xrtt)
return NETWORK_TECHNOLOGY_1XRTT;
if (technology == kNetworkTechnologyEvdo)
return NETWORK_TECHNOLOGY_EVDO;
if (technology == kNetworkTechnologyGprs)
return NETWORK_TECHNOL... | 100279 | 90,166 | 70423057784816375318496886225400622269 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | static NetworkRoamingState ParseRoamingState(
const std::string& roaming_state) {
if (roaming_state == kRoamingStateHome)
return ROAMING_STATE_HOME;
if (roaming_state == kRoamingStateRoaming)
return ROAMING_STATE_ROAMING;
if (roaming_state == kRoamingStateUnknown)
return ROAMING_STATE_UNKNOWN;
... | 100280 | 90,167 | 169360571090743759335727748954157843372 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | static ConnectionState ParseState(const std::string& state) {
if (state == kStateIdle)
return STATE_IDLE;
if (state == kStateCarrier)
return STATE_CARRIER;
if (state == kStateAssociation)
return STATE_ASSOCIATION;
if (state == kStateConfiguration)
return STATE_CONFIGURATION;
if (state == kStat... | 100281 | 90,168 | 251788502362499443908390417562018916699 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | static void ParseSystem(SystemInfo* system,
EthernetNetwork** ethernet,
WifiNetworkVector* wifi_networks,
CellularNetworkVector* cellular_networks,
WifiNetworkVector* remembered_wifi_networks) {
DVLOG(1) << "ParseSystem:";
DCHECK(!(*ethernet));
for (int i = 0; i < system->service_s... | 100282 | 90,169 | 139591473638713483225834677538000176518 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void RefreshCellularDataPlans(const CellularNetwork* network) {
DCHECK(network);
if (!EnsureCrosLoaded() || !network)
return;
RequestCellularDataPlanUpdate(network->service_path().c_str());
}
| 100283 | 90,170 | 192023471038669764462312151482168767035 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void RefreshCellularDataPlans(const CellularNetwork* network) {}
| 100284 | 90,171 | 1344039349509197250511103621414184218 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void RemoveCellularDataPlanObserver(
CellularDataPlanObserver* observer) {
data_plan_observers_.RemoveObserver(observer);
}
| 100285 | 90,172 | 128012247756471413099948233504593029179 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void RemoveCellularDataPlanObserver(
CellularDataPlanObserver* observer) {}
| 100286 | 90,173 | 326605952219915541290676799521107486709 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void RemoveNetworkManagerObserver(NetworkManagerObserver* observer) {
network_manager_observers_.RemoveObserver(observer);
}
| 100287 | 90,174 | 84021511120076170317381110119111726128 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void RemoveNetworkManagerObserver(NetworkManagerObserver* observer) {}
| 100288 | 90,175 | 188078969887004784933846867006847293478 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void RemoveNetworkObserver(const std::string& service_path,
NetworkObserver* observer) {
DCHECK(observer);
DCHECK(service_path.size());
NetworkObserverMap::iterator map_iter =
network_observers_.find(service_path);
if (map_iter != network_observers_... | 100289 | 90,176 | 336457699653405749829736007091205651060 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void RemoveNetworkObserver(const std::string& service_path,
NetworkObserver* observer) {}
| 100290 | 90,177 | 265584246525361761487834738573697965315 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void RemoveObserverForAllNetworks(NetworkObserver* observer) {
DCHECK(observer);
NetworkObserverMap::iterator map_iter = network_observers_.begin();
while (map_iter != network_observers_.end()) {
map_iter->second->RemoveObserver(observer);
if (!map_iter->second->size()) {
delet... | 100291 | 90,178 | 132020087194084352171344353105175776893 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void RemoveObserverForAllNetworks(NetworkObserver* observer) {}
| 100292 | 90,179 | 335871092068222919601041216359378500853 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void RequestWifiScan() {
if (EnsureCrosLoaded()) {
RequestScan(TYPE_WIFI);
}
}
| 100293 | 90,180 | 158605175287867623724443683482048266773 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void RequestWifiScan() {}
| 100294 | 90,181 | 133494885761794120629418394600028454305 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | static std::string SafeString(const char* s) {
return s ? std::string(s) : std::string();
}
| 100295 | 90,182 | 256469361676011650220103312527764840555 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void SaveCellularNetwork(const CellularNetwork* network) {
DCHECK(network);
if (!EnsureCrosLoaded() || !network)
return;
SetAutoConnect(network->service_path().c_str(), network->auto_connect());
}
| 100296 | 90,183 | 18052166127905443907886215124543640249 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void SaveCellularNetwork(const CellularNetwork* network) {}
| 100297 | 90,184 | 290365002596864568049132297052182761427 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void SaveWifiNetwork(const WifiNetwork* network) {
DCHECK(network);
if (!EnsureCrosLoaded() || !network)
return;
SetPassphrase(
network->service_path().c_str(), network->passphrase().c_str());
SetIdentity(network->service_path().c_str(),
network->identity().c_str());
... | 100298 | 90,185 | 187762036778343741480065721462308461509 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | virtual void SaveWifiNetwork(const WifiNetwork* network) {}
| 100299 | 90,186 | 60417940634069856342372753963354729577 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | bool CellularNetwork::StartActivation() const {
if (!EnsureCrosLoaded())
return false;
return ActivateCellularModem(service_path_.c_str(), NULL);
}
| 100300 | 90,187 | 29134216652527605034546796435589062062 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | static std::string ToHtmlTableHeader(Network* network) {
std::string str;
if (network->type() == TYPE_WIFI || network->type() == TYPE_CELLULAR) {
str += WrapWithTH("Name") + WrapWithTH("Auto-Connect") +
WrapWithTH("Strength");
if (network->type() == TYPE_WIFI)
str += WrapWithTH("Encryption") +... | 100301 | 90,188 | 28300095032241660466710277877439715114 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | static std::string ToHtmlTableRow(Network* network) {
std::string str;
if (network->type() == TYPE_WIFI || network->type() == TYPE_CELLULAR) {
WirelessNetwork* wireless = static_cast<WirelessNetwork*>(network);
str += WrapWithTD(wireless->name()) +
WrapWithTD(base::IntToString(wireless->auto_connect... | 100302 | 90,189 | 235327246348549741713310867075211976376 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | void UpdateCellularDataPlan(const CellularDataPlanList* data_plans) {
DCHECK(cellular_);
cellular_->SetDataPlans(data_plans);
NotifyCellularDataPlanChanged();
}
| 100303 | 90,190 | 60042064533955413446770488547406494975 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | void UpdateNetworkStatus(const char* path,
const char* key,
const Value* value) {
if (key == NULL || value == NULL)
return;
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
... | 100304 | 90,191 | 202171820087218295250180860651225849540 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | void UpdateSystemInfo() {
if (EnsureCrosLoaded()) {
UpdateNetworkManagerStatus();
}
}
| 100305 | 90,192 | 296030291345733783356589835512482813346 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | WifiNetwork::WifiNetwork()
: WirelessNetwork(),
encryption_(SECURITY_NONE) {
type_ = TYPE_WIFI;
}
| 100307 | 90,193 | 218491153610312572633321573714082095111 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | WifiNetwork::WifiNetwork(const WifiNetwork& network)
: WirelessNetwork(network) {
encryption_ = network.encryption();
passphrase_ = network.passphrase();
identity_ = network.identity();
cert_path_ = network.cert_path();
}
| 100308 | 90,194 | 25337486204639895975858093365695802736 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | WirelessNetwork::WirelessNetwork(const WirelessNetwork& network)
: Network(network) {
name_ = network.name();
strength_ = network.strength();
auto_connect_ = network.auto_connect();
favorite_ = network.favorite();
}
| 100310 | 90,195 | 272714074412331977900264541901799847304 | null | null | null | |
Chrome | a3e2afaedd8190398ae45ccef34fcdee00fb19aa | 0 | WirelessNetwork::WirelessNetwork(const ServiceInfo* service)
: Network(service) {
name_ = SafeString(service->name);
strength_ = service->strength;
auto_connect_ = service->auto_connect;
favorite_ = service->favorite;
}
| 100311 | 90,196 | 294814854141559750146399729545177466489 | null | null | null |
PrimeVul Original Test Dataset
Overview
This dataset contains the original test split from the PrimeVul dataset, provided for reproducibility purposes. The data is sourced from the paper "PrimeVul: Vulnerability Detection with Code Language Models: How Far Are We?" and includes both the default (single functions) and paired (vulnerable/non-vulnerable pairs) configurations.
Citation
If you use this dataset, please cite the original PrimeVul paper:
@article{primevul2024,
title={PrimeVul: Vulnerability Detection with Code Language Models: How Far Are We?},
author={[Authors from the original paper]},
journal={arXiv preprint arXiv:2403.18624},
year={2024},
url={https://arxiv.org/abs/2403.18624}
}
Dataset Configurations
- Description: Single function vulnerability detection dataset
- Size: 25,911 test samples
- Format: Each sample contains a single code function with binary vulnerability label
- Fields:
project: Source project namecommit_id: Git commit hashtarget: Binary label (0=non-vulnerable, 1=vulnerable)func: Source code functioncwe: Common Weakness Enumeration categoriesidx: Unique sample identifierhash: Function hash- Additional metadata fields
Data Source
The original JSONL files are available from the PrimeVul authors at:
- Google Drive: https://drive.google.com/drive/folders/19iLaNDS0z99N8kB_jBRTmDLehwZBolMY
- GitHub Repository: https://github.com/DLVulDet/PrimeVul
Data Format
This dataset provides the test splits in Parquet format for easy loading with HuggingFace datasets. The original data was in JSONL format and has been converted while preserving all original fields and values.
Usage
from datasets import load_dataset
# Login using e.g. `huggingface-cli login` to access this dataset
ds = load_dataset("Code-TREAT/PrimeVul_original")
Purpose
This dataset is provided by the Code-TREAT project to ensure reproducibility and consistency in vulnerability detection research. By providing the exact test splits used in evaluations, researchers can:
- Reproduce results from papers using this dataset
- Compare methods fairly using identical test data
- Validate new approaches against established benchmarks
License
Please refer to the original PrimeVul repository for licensing information: https://github.com/DLVulDet/PrimeVul
Acknowledgments
We thank the authors of PrimeVul for making their dataset publicly available and for their contributions to vulnerability detection research.
Contact
For questions about this dataset distribution, please refer to the original PrimeVul repository or the Code-TREAT project.
- Downloads last month
- 6