using content::BrowserThread;
using content::ResourceRequestInfo;
+using content::ResourceType;
using extensions::Extension;
using extensions::SharedModuleInfo;
}
virtual void Start() OVERRIDE {
+ request_timer_.reset(new base::ElapsedTimer());
base::FilePath* read_file_path = new base::FilePath;
base::Time* last_modified_time = new base::Time();
bool posted = BrowserThread::PostBlockingPoolTaskAndReply(
virtual ~URLRequestExtensionJob() {
UMA_HISTOGRAM_COUNTS("ExtensionUrlRequest.TotalKbRead", bytes_read_ / 1024);
UMA_HISTOGRAM_COUNTS("ExtensionUrlRequest.SeekPosition", seek_position_);
+ if (request_timer_.get())
+ UMA_HISTOGRAM_TIMES("ExtensionUrlRequest.Latency",
+ request_timer_->Elapsed());
}
void OnFilePathAndLastModifiedTimeRead(base::FilePath* read_file_path,
scoped_refptr<ContentVerifyJob> verify_job_;
+ scoped_ptr<base::ElapsedTimer> request_timer_;
+
// The position we seeked to in the file.
int64 seek_position_;
// Only allow incognito toplevel navigations to extension resources in
// split mode. In spanning mode, the extension must run in a single process,
// and an incognito tab prevents that.
- if (info->GetResourceType() == ResourceType::MAIN_FRAME) {
+ if (info->GetResourceType() == content::RESOURCE_TYPE_MAIN_FRAME) {
const Extension* extension =
extension_info_map->extensions().GetByID(extension_id);
return extension && extensions::IncognitoInfo::IsSplitMode(extension);