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 "third_party/ppapi/c/pp_var.h" | 8 #include "third_party/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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 bool URLResponseInfo::Initialize(const WebURLResponse& response) { | 104 bool URLResponseInfo::Initialize(const WebURLResponse& response) { |
105 url_ = response.url().spec(); | 105 url_ = response.url().spec(); |
106 status_code_ = response.httpStatusCode(); | 106 status_code_ = response.httpStatusCode(); |
107 | 107 |
108 HeaderFlattener flattener; | 108 HeaderFlattener flattener; |
109 response.visitHTTPHeaderFields(&flattener); | 109 response.visitHTTPHeaderFields(&flattener); |
110 headers_ = flattener.buffer(); | 110 headers_ = flattener.buffer(); |
111 | 111 |
112 WebString file_path = response.downloadFilePath(); | 112 WebString file_path = response.downloadFilePath(); |
113 if (!file_path.isNull()) | 113 if (!file_path.isEmpty()) |
114 body_ = new FileRef(module(), webkit_glue::WebStringToFilePath(file_path)); | 114 body_ = new FileRef(module(), webkit_glue::WebStringToFilePath(file_path)); |
115 return true; | 115 return true; |
116 } | 116 } |
117 | 117 |
118 } // namespace pepper | 118 } // namespace pepper |
OLD | NEW |