| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_PUBLIC_COMMON_RESOURCE_TYPE_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_RESOURCE_TYPE_H_ |
| 6 #define CONTENT_PUBLIC_COMMON_RESOURCE_TYPE_H_ | 6 #define CONTENT_PUBLIC_COMMON_RESOURCE_TYPE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 10 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 SHARED_WORKER, // the main resource of a shared worker. | 30 SHARED_WORKER, // the main resource of a shared worker. |
| 31 PREFETCH, // an explicitly requested prefetch | 31 PREFETCH, // an explicitly requested prefetch |
| 32 FAVICON, // a favicon | 32 FAVICON, // a favicon |
| 33 XHR, // a XMLHttpRequest | 33 XHR, // a XMLHttpRequest |
| 34 PING, // a ping request for <a ping> | 34 PING, // a ping request for <a ping> |
| 35 SERVICE_WORKER, // the main resource of a service worker. | 35 SERVICE_WORKER, // the main resource of a service worker. |
| 36 LAST_TYPE // Place holder so we don't need to change ValidType | 36 LAST_TYPE // Place holder so we don't need to change ValidType |
| 37 // everytime. | 37 // everytime. |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 static Type FromTargetType(blink::WebURLRequest::TargetType type); | 40 static Type FromWebURLRequest(const blink::WebURLRequest& request); |
| 41 | 41 |
| 42 static bool ValidType(int32 type) { | 42 static bool ValidType(int32 type) { |
| 43 return type >= MAIN_FRAME && type < LAST_TYPE; | 43 return type >= MAIN_FRAME && type < LAST_TYPE; |
| 44 } | 44 } |
| 45 | 45 |
| 46 static Type FromInt(int32 type) { | 46 static Type FromInt(int32 type) { |
| 47 return static_cast<Type>(type); | 47 return static_cast<Type>(type); |
| 48 } | 48 } |
| 49 | 49 |
| 50 static bool IsFrame(ResourceType::Type type) { | 50 static bool IsFrame(ResourceType::Type type) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 69 type == XHR; | 69 type == XHR; |
| 70 } | 70 } |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 DISALLOW_COPY_AND_ASSIGN(ResourceType); | 73 DISALLOW_COPY_AND_ASSIGN(ResourceType); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 } // namespace content | 76 } // namespace content |
| 77 | 77 |
| 78 #endif // CONTENT_PUBLIC_COMMON_RESOURCE_TYPE_H_ | 78 #endif // CONTENT_PUBLIC_COMMON_RESOURCE_TYPE_H_ |
| OLD | NEW |