Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Side by Side Diff: content/public/common/resource_type.h

Issue 409593002: Get ResourceType from WebURLRequest rather than TargetType. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Windows. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | content/public/common/resource_type.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | content/public/common/resource_type.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698