OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "webkit/glue/plugins/pepper_url_response_info.h" | 5 #include "webkit/glue/plugins/pepper_url_response_info.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ppapi/c/pp_var.h" | 8 #include "ppapi/c/pp_var.h" |
9 #include "third_party/WebKit/WebKit/chromium/public/WebHTTPHeaderVisitor.h" | 9 #include "third_party/WebKit/WebKit/chromium/public/WebHTTPHeaderVisitor.h" |
10 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 } | 85 } |
86 | 86 |
87 URLResponseInfo::~URLResponseInfo() { | 87 URLResponseInfo::~URLResponseInfo() { |
88 } | 88 } |
89 | 89 |
90 // static | 90 // static |
91 const PPB_URLResponseInfo* URLResponseInfo::GetInterface() { | 91 const PPB_URLResponseInfo* URLResponseInfo::GetInterface() { |
92 return &ppb_urlresponseinfo; | 92 return &ppb_urlresponseinfo; |
93 } | 93 } |
94 | 94 |
| 95 URLResponseInfo* URLResponseInfo::AsURLResponseInfo() { |
| 96 return this; |
| 97 } |
| 98 |
95 PP_Var URLResponseInfo::GetProperty(PP_URLResponseProperty property) { | 99 PP_Var URLResponseInfo::GetProperty(PP_URLResponseProperty property) { |
96 switch (property) { | 100 switch (property) { |
97 case PP_URLRESPONSEPROPERTY_URL: | 101 case PP_URLRESPONSEPROPERTY_URL: |
98 return StringVar::StringToPPVar(module(), url_); | 102 return StringVar::StringToPPVar(module(), url_); |
99 case PP_URLRESPONSEPROPERTY_REDIRECTURL: | 103 case PP_URLRESPONSEPROPERTY_REDIRECTURL: |
100 if (IsRedirect(status_code_)) | 104 if (IsRedirect(status_code_)) |
101 return StringVar::StringToPPVar(module(), redirect_url_); | 105 return StringVar::StringToPPVar(module(), redirect_url_); |
102 break; | 106 break; |
103 case PP_URLRESPONSEPROPERTY_REDIRECTMETHOD: | 107 case PP_URLRESPONSEPROPERTY_REDIRECTMETHOD: |
104 if (IsRedirect(status_code_)) | 108 if (IsRedirect(status_code_)) |
(...skipping 23 matching lines...) Expand all Loading... |
128 response.visitHTTPHeaderFields(&flattener); | 132 response.visitHTTPHeaderFields(&flattener); |
129 headers_ = flattener.buffer(); | 133 headers_ = flattener.buffer(); |
130 | 134 |
131 WebString file_path = response.downloadFilePath(); | 135 WebString file_path = response.downloadFilePath(); |
132 if (!file_path.isEmpty()) | 136 if (!file_path.isEmpty()) |
133 body_ = new FileRef(module(), webkit_glue::WebStringToFilePath(file_path)); | 137 body_ = new FileRef(module(), webkit_glue::WebStringToFilePath(file_path)); |
134 return true; | 138 return true; |
135 } | 139 } |
136 | 140 |
137 } // namespace pepper | 141 } // namespace pepper |
OLD | NEW |