UserScriptListener::UserScriptListener()
: user_scripts_ready_(false) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
+ registrar_.Add(this,
+ chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
content::NotificationService::AllSources());
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
content::NotificationService::AllSources());
bool UserScriptListener::ShouldDelayRequest(const GURL& url,
ResourceType::Type resource_type) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
// If it's a frame load, then we need to check the URL against the list of
// user scripts to see if we need to wait.
}
void UserScriptListener::CheckIfAllUserScriptsReady() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
bool was_ready = user_scripts_ready_;
user_scripts_ready_ = true;
}
void UserScriptListener::UserScriptsReady(void* profile_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
profile_data_[profile_id].user_scripts_ready = true;
CheckIfAllUserScriptsReady();
}
void UserScriptListener::ProfileDestroyed(void* profile_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
profile_data_.erase(profile_id);
// We may have deleted the only profile we were waiting on.
void UserScriptListener::AppendNewURLPatterns(void* profile_id,
const URLPatterns& new_patterns) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
user_scripts_ready_ = false;
void UserScriptListener::ReplaceURLPatterns(void* profile_id,
const URLPatterns& patterns) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
ProfileData& data = profile_data_[profile_id];
data.url_patterns = patterns;
void UserScriptListener::CollectURLPatterns(const Extension* extension,
URLPatterns* patterns) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
const UserScriptList& scripts =
ContentScriptsInfo::GetContentScripts(extension);
void UserScriptListener::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
switch (type) {
- case chrome::NOTIFICATION_EXTENSION_LOADED: {
+ case chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: {
Profile* profile = content::Source<Profile>(source).ptr();
const Extension* extension =
content::Details<const Extension>(details).ptr();