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
0
static std::string WrapWithTD(std::string text) { return "<td>" + text + "</td>"; }
100312
90,197
279042938259629419465158688971741419146
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
static std::string WrapWithTH(std::string text) { return "<th>" + text + "</th>"; }
100313
90,198
33095532493839343295615512154477736734
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual const Network* active_network() const { if (ethernet_ && ethernet_->is_active()) return ethernet_; if (wifi_ && wifi_->is_active()) return wifi_; if (cellular_ && cellular_->is_active()) return cellular_; return NULL; }
100314
90,199
269181639513276212716850937126808657266
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual const Network* active_network() const { return NULL; }
100315
90,200
145850559596126707232896900541221207763
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool cellular_available() const { return available_devices_ & (1 << TYPE_CELLULAR); }
100316
90,201
213272664818758994194432017180596717795
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool cellular_available() const { return false; }
100317
90,202
221401499329158998478723337366295111452
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool cellular_connected() const { return cellular_ ? cellular_->connected() : false; }
100318
90,203
287082237234088545187222248777754647386
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool cellular_connected() const { return false; }
100319
90,204
133149125104571059477041885686468324953
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool cellular_connecting() const { return cellular_ ? cellular_->connecting() : false; }
100320
90,205
189520770739438028044277145781804036798
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool cellular_connecting() const { return false; }
100321
90,206
46380415176425915869116457505056279830
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool cellular_enabled() const { return enabled_devices_ & (1 << TYPE_CELLULAR); }
100322
90,207
42601664283188356226221907924846011973
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual CellularNetwork* cellular_network() { return cellular_; }
100324
90,208
54638329184912889680813767157889956868
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual const CellularNetworkVector& cellular_networks() const { return cellular_networks_; }
100326
90,209
312163355245018182699944029344164182822
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
CellularNetwork::DataLeft CellularNetwork::data_left() const { if (data_plans_.empty()) return DATA_NORMAL; const CellularDataPlan& plan(data_plans_[0]); if (plan.plan_type == CELLULAR_DATA_PLAN_UNLIMITED) { base::TimeDelta remaining = plan.plan_end_time - plan.update_time; if (remaining <= base::TimeDelta::FromSeconds(0)) return DATA_NONE; else if (remaining <= base::TimeDelta::FromSeconds(kCellularDataVeryLowSecs)) return DATA_VERY_LOW; else if (remaining <= base::TimeDelta::FromSeconds(kCellularDataLowSecs)) return DATA_LOW; else return DATA_NORMAL; } else if (plan.plan_type == CELLULAR_DATA_PLAN_METERED_PAID || plan.plan_type == CELLULAR_DATA_PLAN_METERED_BASE) { int64 remaining = plan.plan_data_bytes - plan.data_bytes_used; if (remaining <= 0) return DATA_NONE; else if (remaining <= kCellularDataVeryLowBytes) return DATA_VERY_LOW; else if (remaining <= kCellularDataLowBytes) return DATA_LOW; else return DATA_NORMAL; } return DATA_NORMAL; }
100327
90,210
209064183846525572630730932639718627907
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool ethernet_available() const { return true; }
100329
90,211
291476119899890813310690668825748945146
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool ethernet_connected() const { return ethernet_ ? ethernet_->connected() : false; }
100330
90,212
166705136626264002243550559890047844661
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool ethernet_connected() const { return true; }
100331
90,213
38268524440283116256234294056822334052
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool ethernet_connecting() const { return false; }
100333
90,214
97883714936450999128875407444974195924
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool ethernet_enabled() const { return enabled_devices_ & (1 << TYPE_ETHERNET); }
100334
90,215
278733723714642899114391261315102079811
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool ethernet_enabled() const { return true; }
100335
90,216
157068080178047397382830296335805036625
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual EthernetNetwork* ethernet_network() { return ethernet_; }
100336
90,217
246356565290336106712428109482616977040
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool has_cellular_networks() const { return cellular_networks_.begin() != cellular_networks_.end(); }
100338
90,218
165114074431011224452094363737422850170
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
bool CellularNetwork::is_gsm() const { return network_technology_ != NETWORK_TECHNOLOGY_EVDO && network_technology_ != NETWORK_TECHNOLOGY_1XRTT && network_technology_ != NETWORK_TECHNOLOGY_UNKNOWN; }
100339
90,219
106195039363271921436986624072162545087
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool offline_mode() const { return offline_mode_; }
100340
90,220
282909895462511186375896670487056151291
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool offline_mode() const { return false; }
100341
90,221
114262220064832965948791448080890862046
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual const WifiNetworkVector& remembered_wifi_networks() const { return remembered_wifi_networks_; }
100342
90,222
103061422617783678510633694060449189310
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual const WifiNetworkVector& remembered_wifi_networks() const { return wifi_networks_; }
100343
90,223
79323308133975459470928249489853840648
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool wifi_available() const { return available_devices_ & (1 << TYPE_WIFI); }
100344
90,224
226315973824881959437856633924685238390
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool wifi_available() const { return false; }
100345
90,225
201656941190855222558438637225125857264
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool wifi_connected() const { return false; }
100346
90,226
264680042538187081774791962967617522013
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool wifi_connecting() const { return wifi_ ? wifi_->connecting() : false; }
100347
90,227
30315062717860103674240366073592034580
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool wifi_connecting() const { return false; }
100348
90,228
225440400449884495075596154526819448090
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool wifi_enabled() const { return enabled_devices_ & (1 << TYPE_WIFI); }
100349
90,229
306789236183611861060016847929432740803
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool wifi_enabled() const { return false; }
100350
90,230
315990588359522531602147267268260513830
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual WifiNetwork* wifi_network() { return wifi_; }
100351
90,231
292121976081459324280482185456539485326
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual const WifiNetworkVector& wifi_networks() const { return wifi_networks_; }
100353
90,232
114031375059448787243703492565404506042
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
CellularNetwork::~CellularNetwork() { }
100354
90,233
44861271533799614438267842736787973066
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
~NetworkLibraryImpl() { network_manager_observers_.Clear(); if (network_manager_monitor_) DisconnectPropertyChangeMonitor(network_manager_monitor_); data_plan_observers_.Clear(); if (data_plan_monitor_) DisconnectDataPlanUpdateMonitor(data_plan_monitor_); STLDeleteValues(&network_observers_); ClearNetworks(); }
100355
90,234
312935633555380726391402607011658090892
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
~NetworkLibraryStubImpl() { if (ethernet_) delete ethernet_; }
100356
90,235
250987366564575109273869948743187776891
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual ~NetworkObserverList() { if (network_monitor_) DisconnectPropertyChangeMonitor(network_monitor_); }
100357
90,236
181491715909117854050694875420055789013
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
bool AddCallback(GetUsageAndQuotaCallback* callback, bool unlimited) { if (unlimited) unlimited_callbacks_.push_back(callback); else callbacks_.push_back(callback); return (callbacks_.size() + unlimited_callbacks_.size() == 1); }
100986
90,744
313420704568810887906547397256111052121
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
bool AppendEntry(const TableEntry& entry) { entries_.push_back(entry); return true; }
100987
90,745
307339813018656501036295024482944125143
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void CallCallbacksAndClear( CallbackList* callbacks, QuotaStatusCode status, int64 usage, int64 quota) { for (CallbackList::iterator iter = callbacks->begin(); iter != callbacks->end(); ++iter) { (*iter)->Run(status, usage, quota); delete *iter; } callbacks->clear(); }
100989
90,746
327582708117730851529206974492433349378
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void CheckCompleted() { if (--waiting_callbacks_ <= 0) { DispatchCallbacks(); DCHECK(callbacks_.empty()); DCHECK(unlimited_callbacks_.empty()); UsageAndQuotaDispatcherTaskMap& dispatcher_map = manager()->usage_and_quota_dispatchers_; DCHECK(dispatcher_map.find(std::make_pair(host_, type_)) != dispatcher_map.end()); dispatcher_map.erase(std::make_pair(host_, type_)); CallCompleted(); } }
100990
90,747
148572310129738398065015210471287227285
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void CountOriginType(const std::set<GURL>& origins, SpecialStoragePolicy* policy, size_t* protected_origins, size_t* unlimited_origins) { DCHECK(protected_origins); DCHECK(unlimited_origins); *protected_origins = 0; *unlimited_origins = 0; if (!policy) return; for (std::set<GURL>::const_iterator itr = origins.begin(); itr != origins.end(); ++itr) { if (policy->IsStorageProtected(*itr)) ++*protected_origins; if (policy->IsStorageUnlimited(*itr)) ++*unlimited_origins; } }
100991
90,748
263838896275333699402102571041761400329
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
QuotaManager::UsageAndQuotaDispatcherTask::Create( QuotaManager* manager, const std::string& host, StorageType type) { switch (type) { case kStorageTypeTemporary: return new UsageAndQuotaDispatcherTaskForTemporary( manager, host); case kStorageTypePersistent: return new UsageAndQuotaDispatcherTaskForPersistent( manager, host); default: NOTREACHED(); } return NULL; }
100992
90,749
11655697028438862518783283652154191374
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::DeleteOnCorrectThread() const { if (!io_thread_->BelongsToCurrentThread()) { io_thread_->DeleteSoon(FROM_HERE, this); return; } delete this; }
100994
90,750
194694018397823581007027637006945256693
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::DeleteOriginData( const GURL& origin, StorageType type, StatusCallback* callback) { LazyInitialize(); if (origin.is_empty() || clients_.empty()) { callback->Run(kQuotaStatusOk); delete callback; return; } OriginDataDeleter* deleter = new OriginDataDeleter(this, origin, type, callback); deleter->Start(); }
100995
90,751
50697353275698862315880738220838271309
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
DeleteOriginInfo( QuotaManager* manager, const GURL& origin, StorageType type) : DatabaseTaskBase(manager), origin_(origin), type_(type) {}
100997
90,752
132694291741080881118914350788991078920
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void DidDeleteOriginData(QuotaStatusCode status) { DCHECK_GT(remaining_clients_, 0); if (status != kQuotaStatusOk) ++error_count_; if (--remaining_clients_ == 0) CallCompleted(); }
100998
90,753
74424777116610544739453975505352142615
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::DidGetAvailableSpaceForEviction( QuotaStatusCode status, int64 available_space) { eviction_context_.get_usage_and_quota_callback->Run(status, eviction_context_.usage, eviction_context_.unlimited_usage, eviction_context_.quota, available_space); eviction_context_.get_usage_and_quota_callback.reset(); }
100999
90,754
248811612533279145554760152084266463556
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::DidGetDatabaseLRUOrigin(const GURL& origin) { if (origins_in_use_.find(origin) != origins_in_use_.end() || access_notified_origins_.find(origin) != access_notified_origins_.end()) lru_origin_callback_->Run(GURL()); else lru_origin_callback_->Run(origin); access_notified_origins_.clear(); lru_origin_callback_.reset(); }
101000
90,755
209212595961147690532304882308693133018
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void DidGetGlobalQuota(QuotaStatusCode status, StorageType type, int64 quota) { DCHECK_EQ(type_, type); quota_status_ = status; quota_ = quota; CheckCompleted(); }
101001
90,756
67619737782262437040030552175594518304
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::DidGetGlobalQuotaForEviction( QuotaStatusCode status, StorageType type, int64 quota) { DCHECK_EQ(type, kStorageTypeTemporary); if (status != kQuotaStatusOk) { eviction_context_.get_usage_and_quota_callback->Run( status, 0, 0, 0, 0); eviction_context_.get_usage_and_quota_callback.reset(); return; } eviction_context_.quota = quota; GetAvailableSpace(callback_factory_. NewCallback(&QuotaManager::DidGetAvailableSpaceForEviction)); }
101002
90,757
73902260731127566473681993102179495566
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void DidGetGlobalUsage(StorageType type, int64 usage, int64 unlimited_usage) { DCHECK_EQ(type_, type); DCHECK_GE(usage, unlimited_usage); global_usage_ = usage; global_unlimited_usage_ = unlimited_usage; CheckCompleted(); }
101003
90,758
148662033733834297707551964929546258790
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::DidGetGlobalUsageForEviction( StorageType type, int64 usage, int64 unlimited_usage) { DCHECK_EQ(type, kStorageTypeTemporary); DCHECK_GE(usage, unlimited_usage); eviction_context_.usage = usage; eviction_context_.unlimited_usage = unlimited_usage; GetTemporaryGlobalQuota(callback_factory_. NewCallback(&QuotaManager::DidGetGlobalQuotaForEviction)); }
101004
90,759
39781210246832507956246248400932525809
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void DidGetHostQuota(QuotaStatusCode status, const std::string& host, StorageType type, int64 quota) { DCHECK_EQ(host_, host); DCHECK_EQ(type_, type); quota_status_ = status; quota_ = quota; CheckCompleted(); }
101005
90,760
249249268185568584978919409733863694328
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void DidGetHostUsage(const std::string& host, StorageType type, int64 usage) { DCHECK_EQ(host_, host); DCHECK_EQ(type_, type); host_usage_ = usage; CheckCompleted(); }
101006
90,761
153307760280501904782560465995530991282
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::DidGetPersistentGlobalUsageForHistogram( StorageType type, int64 usage, int64 unlimited_usage) { UMA_HISTOGRAM_MBYTES("Quota.GlobalUsageOfPersistentStorage", usage); std::set<GURL> origins; GetCachedOrigins(type, &origins); size_t num_origins = origins.size(); size_t protected_origins = 0; size_t unlimited_origins = 0; CountOriginType(origins, special_storage_policy_, &protected_origins, &unlimited_origins); UMA_HISTOGRAM_COUNTS("Quota.NumberOfPersistentStorageOrigins", num_origins); UMA_HISTOGRAM_COUNTS("Quota.NumberOfProtectedPersistentStorageOrigins", protected_origins); UMA_HISTOGRAM_COUNTS("Quota.NumberOfUnlimitedPersistentStorageOrigins", unlimited_origins); }
101007
90,762
339810394295014963710196902159451461642
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::DidInitializeTemporaryGlobalQuota(int64 quota) { temporary_global_quota_ = quota; temporary_global_quota_callbacks_.Run( db_disabled_ ? kQuotaErrorInvalidAccess : kQuotaStatusOk, kStorageTypeTemporary, quota); if (db_disabled_ || eviction_disabled_) return; if (!need_initialize_origins_) { StartEviction(); return; } temporary_usage_tracker_->GetGlobalUsage(callback_factory_.NewCallback( &QuotaManager::DidRunInitialGetTemporaryGlobalUsage)); }
101008
90,763
114691950704021047139992113503797439355
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::DidRunInitialGetTemporaryGlobalUsage( StorageType type, int64 usage_unused, int64 unlimited_usage_unused) { DCHECK_EQ(type, kStorageTypeTemporary); scoped_refptr<InitializeTemporaryOriginsInfoTask> task( new InitializeTemporaryOriginsInfoTask( this, temporary_usage_tracker_.get())); task->Start(); }
101010
90,764
128863188654262671546175341888049822799
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::DumpOriginInfoTable( DumpOriginInfoTableCallback* callback) { make_scoped_refptr(new DumpOriginInfoTableTask(this, callback))->Start(); }
101011
90,765
281688961499754124975729062201954438833
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
DumpOriginInfoTableTask( QuotaManager* manager, Callback* callback) : DatabaseTaskBase(manager), callback_(callback) { }
101012
90,766
178825154621281486347076974420621593072
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::DumpQuotaTable(DumpQuotaTableCallback* callback) { make_scoped_refptr(new DumpQuotaTableTask(this, callback))->Start(); }
101013
90,767
163929154421901946457470443734408778956
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
DumpQuotaTableTask( QuotaManager* manager, Callback* callback) : DatabaseTaskBase(manager), callback_(callback) { }
101014
90,768
110828305326309333119489401726006292485
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::EvictOriginData( const GURL& origin, StorageType type, EvictOriginDataCallback* callback) { DCHECK(io_thread_->BelongsToCurrentThread()); DCHECK_EQ(type, kStorageTypeTemporary); eviction_context_.evicted_origin = origin; eviction_context_.evicted_type = type; eviction_context_.evict_origin_data_callback.reset(callback); DeleteOriginData(origin, type, callback_factory_.NewCallback( &QuotaManager::DidOriginDataEvicted)); }
101015
90,769
327019380456822149374510910028755875776
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::GetAvailableSpace(AvailableSpaceCallback* callback) { scoped_refptr<AvailableSpaceQueryTask> task( new AvailableSpaceQueryTask(this, db_thread_, profile_path_, callback)); task->Start(); }
101016
90,770
62780769679022690605095257699983134486
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::GetCachedOrigins( StorageType type, std::set<GURL>* origins) { DCHECK(origins); LazyInitialize(); switch (type) { case kStorageTypeTemporary: DCHECK(temporary_usage_tracker_.get()); temporary_usage_tracker_->GetCachedOrigins(origins); return; case kStorageTypePersistent: DCHECK(persistent_usage_tracker_.get()); persistent_usage_tracker_->GetCachedOrigins(origins); return; default: NOTREACHED(); } }
101017
90,771
27289923227497969660813251341230930782
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::GetGlobalUsage( StorageType type, GlobalUsageCallback* callback) { LazyInitialize(); GetUsageTracker(type)->GetGlobalUsage(callback); }
101018
90,772
191323255900110242792556979411512288875
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::GetHostUsage(const std::string& host, StorageType type, HostUsageCallback* callback) { LazyInitialize(); GetUsageTracker(type)->GetHostUsage(host, callback); }
101019
90,773
90494783228422910301087869921905072402
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
int64 GetInitialTemporaryStorageQuotaSize(const FilePath& path, bool is_incognito) { int64 free_space = base::SysInfo::AmountOfFreeDiskSpace(path); UMA_HISTOGRAM_MBYTES("Quota.FreeDiskSpaceForProfile", free_space); if (free_space < QuotaManager::kTemporaryStorageQuotaDefaultSize * 2) return 0; if (is_incognito) return QuotaManager::kIncognitoDefaultTemporaryQuota; if (free_space < QuotaManager::kTemporaryStorageQuotaDefaultSize * 20) return QuotaManager::kTemporaryStorageQuotaDefaultSize; if (free_space < QuotaManager::kTemporaryStorageQuotaMaxSize * 20) return free_space / 20; return QuotaManager::kTemporaryStorageQuotaMaxSize; }
101020
90,774
242328016993890528781162060067419095694
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::GetLRUOrigin( StorageType type, GetLRUOriginCallback* callback) { LazyInitialize(); DCHECK(!lru_origin_callback_.get()); lru_origin_callback_.reset(callback); if (db_disabled_) { lru_origin_callback_->Run(GURL()); lru_origin_callback_.reset(); return; } scoped_refptr<GetLRUOriginTask> task(new GetLRUOriginTask( this, type, origins_in_use_, origins_in_error_, callback_factory_.NewCallback( &QuotaManager::DidGetDatabaseLRUOrigin))); task->Start(); }
101021
90,775
258079462779138348157629131810173670816
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
GetLRUOriginTask( QuotaManager* manager, StorageType type, const std::map<GURL, int>& origins_in_use, const std::map<GURL, int>& origins_in_error, GetLRUOriginCallback *callback) : DatabaseTaskBase(manager), type_(type), callback_(callback), special_storage_policy_(manager->special_storage_policy_) { for (std::map<GURL, int>::const_iterator p = origins_in_use.begin(); p != origins_in_use.end(); ++p) { if (p->second > 0) exceptions_.insert(p->first); } for (std::map<GURL, int>::const_iterator p = origins_in_error.begin(); p != origins_in_error.end(); ++p) { if (p->second > QuotaManager::kThresholdOfErrorsToBeBlacklisted) exceptions_.insert(p->first); } }
101022
90,776
23387619246406948721113475005150979957
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
GetModifiedSinceTask( QuotaManager* manager, StorageType type, base::Time modified_since, GetOriginsCallback* callback) : DatabaseTaskBase(manager), type_(type), modified_since_(modified_since), callback_(callback) {}
101023
90,777
258934187394422467714937818083579496286
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::GetOriginsModifiedSince( StorageType type, base::Time modified_since, GetOriginsCallback* callback) { LazyInitialize(); make_scoped_refptr(new GetModifiedSinceTask( this, type, modified_since, callback))->Start(); }
101024
90,778
24252562577154596580883309757764203339
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
GetPersistentHostQuotaTask( QuotaManager* manager, const std::string& host, HostQuotaCallback* callback) : DatabaseTaskBase(manager), host_(host), quota_(-1), callback_(callback) { }
101026
90,779
251992998040415676563856538584425501949
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::GetStatistics( std::map<std::string, std::string>* statistics) { DCHECK(statistics); if (temporary_storage_evictor_.get()) { std::map<std::string, int64> stats; temporary_storage_evictor_->GetStatistics(&stats); for (std::map<std::string, int64>::iterator p = stats.begin(); p != stats.end(); ++p) (*statistics)[p->first] = base::Int64ToString(p->second); } }
101027
90,780
173284876750638511348608058573338344158
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::GetTemporaryGlobalQuota(QuotaCallback* callback) { LazyInitialize(); if (temporary_global_quota_ >= 0) { callback->Run(kQuotaStatusOk, kStorageTypeTemporary, temporary_global_quota_); delete callback; return; } temporary_global_quota_callbacks_.Add(callback); }
101028
90,781
144533993526458761269662025264674182611
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::GetUsageAndQuota( const GURL& origin, StorageType type, GetUsageAndQuotaCallback* callback_ptr) { scoped_ptr<GetUsageAndQuotaCallback> callback(callback_ptr); LazyInitialize(); if (type == kStorageTypeUnknown) { callback->Run(kQuotaErrorNotSupported, 0, 0); return; } std::string host = net::GetHostOrSpecFromURL(origin); UsageAndQuotaDispatcherTaskMap::iterator found = usage_and_quota_dispatchers_.find(std::make_pair(host, type)); if (found == usage_and_quota_dispatchers_.end()) { UsageAndQuotaDispatcherTask* dispatcher = UsageAndQuotaDispatcherTask::Create(this, host, type); found = usage_and_quota_dispatchers_.insert( std::make_pair(std::make_pair(host, type), dispatcher)).first; } if (found->second->AddCallback( callback.release(), IsStorageUnlimited(origin))) { found->second->Start(); } }
101029
90,782
171904758439228466330229687266385770000
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::GetUsageAndQuotaForEviction( GetUsageAndQuotaForEvictionCallback* callback) { DCHECK(io_thread_->BelongsToCurrentThread()); DCHECK(!eviction_context_.get_usage_and_quota_callback.get()); eviction_context_.get_usage_and_quota_callback.reset(callback); GetGlobalUsage(kStorageTypeTemporary, callback_factory_. NewCallback(&QuotaManager::DidGetGlobalUsageForEviction)); }
101030
90,783
204292679821485068766825869431951377485
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
UsageTracker* QuotaManager::GetUsageTracker(StorageType type) const { switch (type) { case kStorageTypeTemporary: return temporary_usage_tracker_.get(); case kStorageTypePersistent: return persistent_usage_tracker_.get(); default: NOTREACHED(); } return NULL; }
101031
90,784
197318871524365267474981181132778403076
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
InitializeTask( QuotaManager* manager, const FilePath& profile_path, bool is_incognito) : DatabaseTaskBase(manager), profile_path_(profile_path), is_incognito_(is_incognito), need_initialize_origins_(false), temporary_storage_quota_(-1) { }
101032
90,785
103971347941958379279062275571432785916
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
InitializeTemporaryOriginsInfoTask( QuotaManager* manager, UsageTracker* temporary_usage_tracker) : DatabaseTaskBase(manager), has_registered_origins_(false) { DCHECK(temporary_usage_tracker); temporary_usage_tracker->GetCachedOrigins(&origins_); }
101033
90,786
197142863775431967456572118162176178633
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::LazyInitialize() { DCHECK(io_thread_->BelongsToCurrentThread()); if (database_.get()) { return; } database_.reset(new QuotaDatabase(is_incognito_ ? FilePath() : profile_path_.AppendASCII(kDatabaseName))); temporary_usage_tracker_.reset( new UsageTracker(clients_, kStorageTypeTemporary, special_storage_policy_)); persistent_usage_tracker_.reset( new UsageTracker(clients_, kStorageTypePersistent, special_storage_policy_)); scoped_refptr<InitializeTask> task( new InitializeTask(this, profile_path_, is_incognito_)); task->Start(); }
101034
90,787
124733973258362125569086318784114569582
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
QuotaCallback* NewWaitableGlobalQuotaCallback() { ++waiting_callbacks_; return callback_factory_.NewCallback( &UsageAndQuotaDispatcherTask::DidGetGlobalQuota); }
101035
90,788
122018911051347542413056658199521102557
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
GlobalUsageCallback* NewWaitableGlobalUsageCallback() { ++waiting_callbacks_; return callback_factory_.NewCallback( &UsageAndQuotaDispatcherTask::DidGetGlobalUsage); }
101036
90,789
327829511280689427137325844698412968707
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
HostQuotaCallback* NewWaitableHostQuotaCallback() { ++waiting_callbacks_; return callback_factory_.NewCallback( &UsageAndQuotaDispatcherTask::DidGetHostQuota); }
101037
90,790
218820954619124863047598629637118808089
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
HostUsageCallback* NewWaitableHostUsageCallback() { ++waiting_callbacks_; return callback_factory_.NewCallback( &UsageAndQuotaDispatcherTask::DidGetHostUsage); }
101038
90,791
117415106590818281717238636248522323465
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::NotifyOriginInUse(const GURL& origin) { DCHECK(io_thread_->BelongsToCurrentThread()); origins_in_use_[origin]++; }
101039
90,792
215518428491782704244018389404726968831
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManagerProxy::NotifyOriginInUse( const GURL& origin) { if (!io_thread_->BelongsToCurrentThread()) { io_thread_->PostTask(FROM_HERE, NewRunnableMethod( this, &QuotaManagerProxy::NotifyOriginInUse, origin)); return; } if (manager_) manager_->NotifyOriginInUse(origin); }
101040
90,793
160640124173154759068791533389516975701
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::NotifyOriginNoLongerInUse(const GURL& origin) { DCHECK(io_thread_->BelongsToCurrentThread()); DCHECK(IsOriginInUse(origin)); int& count = origins_in_use_[origin]; if (--count == 0) origins_in_use_.erase(origin); }
101041
90,794
84361882183150304284961125764036587123
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManagerProxy::NotifyOriginNoLongerInUse( const GURL& origin) { if (!io_thread_->BelongsToCurrentThread()) { io_thread_->PostTask(FROM_HERE, NewRunnableMethod( this, &QuotaManagerProxy::NotifyOriginNoLongerInUse, origin)); return; } if (manager_) manager_->NotifyOriginNoLongerInUse(origin); }
101042
90,795
327625148079625516808929449478892416112
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::NotifyStorageAccessed( QuotaClient::ID client_id, const GURL& origin, StorageType type) { NotifyStorageAccessedInternal(client_id, origin, type, base::Time::Now()); }
101043
90,796
305571421961188120092946982154626999134
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManagerProxy::NotifyStorageAccessed( QuotaClient::ID client_id, const GURL& origin, StorageType type) { if (!io_thread_->BelongsToCurrentThread()) { io_thread_->PostTask(FROM_HERE, NewRunnableMethod( this, &QuotaManagerProxy::NotifyStorageAccessed, client_id, origin, type)); return; } if (manager_) manager_->NotifyStorageAccessed(client_id, origin, type); }
101044
90,797
2415655322353766858093454752961201494
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::NotifyStorageAccessedInternal( QuotaClient::ID client_id, const GURL& origin, StorageType type, base::Time accessed_time) { LazyInitialize(); if (type == kStorageTypeTemporary && lru_origin_callback_.get()) { access_notified_origins_.insert(origin); } if (db_disabled_) return; make_scoped_refptr(new UpdateAccessTimeTask( this, origin, type, accessed_time))->Start(); }
101045
90,798
292760840787736205173151519776324633837
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::NotifyStorageModified( QuotaClient::ID client_id, const GURL& origin, StorageType type, int64 delta) { NotifyStorageModifiedInternal(client_id, origin, type, delta, base::Time::Now()); }
101046
90,799
93731825377943637169856749643166432398
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManagerProxy::NotifyStorageModified( QuotaClient::ID client_id, const GURL& origin, StorageType type, int64 delta) { if (!io_thread_->BelongsToCurrentThread()) { io_thread_->PostTask(FROM_HERE, NewRunnableMethod( this, &QuotaManagerProxy::NotifyStorageModified, client_id, origin, type, delta)); return; } if (manager_) manager_->NotifyStorageModified(client_id, origin, type, delta); }
101047
90,800
335249459186985506926645896426831351769
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::NotifyStorageModifiedInternal( QuotaClient::ID client_id, const GURL& origin, StorageType type, int64 delta, base::Time modified_time) { LazyInitialize(); GetUsageTracker(type)->UpdateUsageCache(client_id, origin, delta); make_scoped_refptr(new UpdateModifiedTimeTask( this, origin, type, modified_time))->Start(); }
101048
90,801
227220688259312366621650254427124215668
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
OriginDataDeleter(QuotaManager* manager, const GURL& origin, StorageType type, StatusCallback* callback) : QuotaTask(manager), origin_(origin), type_(type), error_count_(0), remaining_clients_(-1), callback_(callback), callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {}
101049
90,802
226575916387463698453899571733608421320
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
QuotaManager::QuotaManager(bool is_incognito, const FilePath& profile_path, base::MessageLoopProxy* io_thread, base::MessageLoopProxy* db_thread, SpecialStoragePolicy* special_storage_policy) : is_incognito_(is_incognito), profile_path_(profile_path), proxy_(new QuotaManagerProxy( ALLOW_THIS_IN_INITIALIZER_LIST(this), io_thread)), db_disabled_(false), eviction_disabled_(false), io_thread_(io_thread), db_thread_(db_thread), need_initialize_origins_(false), temporary_global_quota_(-1), special_storage_policy_(special_storage_policy), callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { }
101050
90,803
66822147442835316903561281364663121929
null
null
null