OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. | 5 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. |
6 | 6 |
7 #include "webkit/glue/weburlloader_impl.h" | 7 #include "webkit/glue/weburlloader_impl.h" |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 private: | 98 private: |
99 int load_flags_; | 99 int load_flags_; |
100 std::string buffer_; | 100 std::string buffer_; |
101 bool has_accept_header_; | 101 bool has_accept_header_; |
102 }; | 102 }; |
103 | 103 |
104 ResourceType::Type FromTargetType(WebURLRequest::TargetType type) { | 104 ResourceType::Type FromTargetType(WebURLRequest::TargetType type) { |
105 switch (type) { | 105 switch (type) { |
106 case WebURLRequest::TargetIsMainFrame: | 106 case WebURLRequest::TargetIsMainFrame: |
107 return ResourceType::MAIN_FRAME; | 107 return ResourceType::MAIN_FRAME; |
108 case WebURLRequest::TargetIsSubFrame: | 108 case WebURLRequest::TargetIsSubframe: |
109 return ResourceType::SUB_FRAME; | 109 return ResourceType::SUB_FRAME; |
110 case WebURLRequest::TargetIsSubResource: | 110 case WebURLRequest::TargetIsSubresource: |
111 return ResourceType::SUB_RESOURCE; | 111 return ResourceType::SUB_RESOURCE; |
| 112 case WebURLRequest::TargetIsStyleSheet: |
| 113 return ResourceType::STYLESHEET; |
| 114 case WebURLRequest::TargetIsScript: |
| 115 return ResourceType::SCRIPT; |
| 116 case WebURLRequest::TargetIsFontResource: |
| 117 return ResourceType::FONT_RESOURCE; |
| 118 case WebURLRequest::TargetIsImage: |
| 119 return ResourceType::IMAGE; |
112 case WebURLRequest::TargetIsObject: | 120 case WebURLRequest::TargetIsObject: |
113 return ResourceType::OBJECT; | 121 return ResourceType::OBJECT; |
114 case WebURLRequest::TargetIsMedia: | 122 case WebURLRequest::TargetIsMedia: |
115 return ResourceType::MEDIA; | 123 return ResourceType::MEDIA; |
116 default: | 124 default: |
117 NOTREACHED(); | 125 NOTREACHED(); |
118 return ResourceType::SUB_RESOURCE; | 126 return ResourceType::SUB_RESOURCE; |
119 } | 127 } |
120 } | 128 } |
121 | 129 |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 | 593 |
586 void WebURLLoaderImpl::cancel() { | 594 void WebURLLoaderImpl::cancel() { |
587 context_->Cancel(); | 595 context_->Cancel(); |
588 } | 596 } |
589 | 597 |
590 void WebURLLoaderImpl::setDefersLoading(bool value) { | 598 void WebURLLoaderImpl::setDefersLoading(bool value) { |
591 context_->SetDefersLoading(value); | 599 context_->SetDefersLoading(value); |
592 } | 600 } |
593 | 601 |
594 } // namespace webkit_glue | 602 } // namespace webkit_glue |
OLD | NEW |