OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_COMMON_RESOURCE_TYPE_H__ | 5 #ifndef WEBKIT_COMMON_RESOURCE_TYPE_H__ |
6 #define WEBKIT_COMMON_RESOURCE_TYPE_H__ | 6 #define WEBKIT_COMMON_RESOURCE_TYPE_H__ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 9 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
10 #include "webkit/common/webkit_common_export.h" | 10 #include "webkit/common/webkit_common_export.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 SUB_RESOURCE, // an "other" subresource. | 23 SUB_RESOURCE, // an "other" subresource. |
24 OBJECT, // an object (or embed) tag for a plugin, | 24 OBJECT, // an object (or embed) tag for a plugin, |
25 // or a resource that a plugin requested. | 25 // or a resource that a plugin requested. |
26 MEDIA, // a media resource. | 26 MEDIA, // a media resource. |
27 WORKER, // the main resource of a dedicated worker. | 27 WORKER, // the main resource of a dedicated worker. |
28 SHARED_WORKER, // the main resource of a shared worker. | 28 SHARED_WORKER, // the main resource of a shared worker. |
29 PREFETCH, // an explicitly requested prefetch | 29 PREFETCH, // an explicitly requested prefetch |
30 FAVICON, // a favicon | 30 FAVICON, // a favicon |
31 XHR, // a XMLHttpRequest | 31 XHR, // a XMLHttpRequest |
32 PING, // a ping request for <a ping> | 32 PING, // a ping request for <a ping> |
| 33 SERVICE_WORKER, // the main resource of a service worker. |
33 LAST_TYPE // Place holder so we don't need to change ValidType | 34 LAST_TYPE // Place holder so we don't need to change ValidType |
34 // everytime. | 35 // everytime. |
35 }; | 36 }; |
36 | 37 |
37 static bool ValidType(int32 type) { | 38 static bool ValidType(int32 type) { |
38 return type >= MAIN_FRAME && type < LAST_TYPE; | 39 return type >= MAIN_FRAME && type < LAST_TYPE; |
39 } | 40 } |
40 | 41 |
41 static Type FromInt(int32 type) { | 42 static Type FromInt(int32 type) { |
42 return static_cast<Type>(type); | 43 return static_cast<Type>(type); |
(...skipping 19 matching lines...) Expand all Loading... |
62 type == WORKER || | 63 type == WORKER || |
63 type == XHR; | 64 type == XHR; |
64 } | 65 } |
65 | 66 |
66 private: | 67 private: |
67 // Don't instantiate this class. | 68 // Don't instantiate this class. |
68 ResourceType(); | 69 ResourceType(); |
69 ~ResourceType(); | 70 ~ResourceType(); |
70 }; | 71 }; |
71 #endif // WEBKIT_COMMON_RESOURCE_TYPE_H__ | 72 #endif // WEBKIT_COMMON_RESOURCE_TYPE_H__ |
OLD | NEW |