resource_type.h revision 5f1c94371a64b3196d4be9466099bb892df9b88e
1// Copyright 2014 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#ifndef CONTENT_PUBLIC_COMMON_RESOURCE_TYPE_H_ 6#define CONTENT_PUBLIC_COMMON_RESOURCE_TYPE_H_ 7 8#include "content/common/content_export.h" 9 10namespace content { 11 12// Used in histograms, so please add new types at the end, and rename unused 13// entries to RESOURCETYPE_UNUSED_0, etc... 14enum ResourceType { 15 RESOURCE_TYPE_MAIN_FRAME = 0, // top level page 16 RESOURCE_TYPE_SUB_FRAME, // frame or iframe 17 RESOURCE_TYPE_STYLESHEET, // a CSS stylesheet 18 RESOURCE_TYPE_SCRIPT, // an external script 19 RESOURCE_TYPE_IMAGE, // an image (jpg/gif/png/etc) 20 RESOURCE_TYPE_FONT_RESOURCE, // a font 21 RESOURCE_TYPE_SUB_RESOURCE, // an "other" subresource. 22 RESOURCE_TYPE_OBJECT, // an object (or embed) tag for a plugin, 23 // or a resource that a plugin requested. 24 RESOURCE_TYPE_MEDIA, // a media resource. 25 RESOURCE_TYPE_WORKER, // the main resource of a dedicated worker. 26 RESOURCE_TYPE_SHARED_WORKER, // the main resource of a shared worker. 27 RESOURCE_TYPE_PREFETCH, // an explicitly requested prefetch 28 RESOURCE_TYPE_FAVICON, // a favicon 29 RESOURCE_TYPE_XHR, // a XMLHttpRequest 30 RESOURCE_TYPE_PING, // a ping request for <a ping> 31 RESOURCE_TYPE_SERVICE_WORKER, // the main resource of a service worker. 32 RESOURCE_TYPE_LAST_TYPE 33}; 34 35CONTENT_EXPORT bool IsResourceTypeFrame(ResourceType type); 36 37} // namespace content 38 39#endif // CONTENT_PUBLIC_COMMON_RESOURCE_TYPE_H_ 40