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

Side by Side Diff: webkit/glue/plugins/pepper_url_response_info.cc

Issue 3053009: Pepper stream-to-file plumbing.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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 | « webkit/glue/plugins/pepper_url_request_info.cc ('k') | webkit/glue/resource_loader_bridge.h » ('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 (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"
11 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" 11 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h"
12 #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h" 12 #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h"
13 #include "webkit/glue/plugins/pepper_file_ref.h" 13 #include "webkit/glue/plugins/pepper_file_ref.h"
14 #include "webkit/glue/plugins/pepper_var.h" 14 #include "webkit/glue/plugins/pepper_var.h"
15 #include "webkit/glue/webkit_glue.h"
15 16
16 using WebKit::WebHTTPHeaderVisitor; 17 using WebKit::WebHTTPHeaderVisitor;
17 using WebKit::WebString; 18 using WebKit::WebString;
18 using WebKit::WebURLResponse; 19 using WebKit::WebURLResponse;
19 20
20 namespace pepper { 21 namespace pepper {
21 22
22 namespace { 23 namespace {
23 24
24 class HeaderFlattener : public WebHTTPHeaderVisitor { 25 class HeaderFlattener : public WebHTTPHeaderVisitor {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 101 }
101 } 102 }
102 103
103 bool URLResponseInfo::Initialize(const WebURLResponse& response) { 104 bool URLResponseInfo::Initialize(const WebURLResponse& response) {
104 url_ = response.url().spec(); 105 url_ = response.url().spec();
105 status_code_ = response.httpStatusCode(); 106 status_code_ = response.httpStatusCode();
106 107
107 HeaderFlattener flattener; 108 HeaderFlattener flattener;
108 response.visitHTTPHeaderFields(&flattener); 109 response.visitHTTPHeaderFields(&flattener);
109 headers_ = flattener.buffer(); 110 headers_ = flattener.buffer();
111
112 WebString file_path = response.downloadFilePath();
113 if (!file_path.isNull())
114 body_ = new FileRef(module(), webkit_glue::WebStringToFilePath(file_path));
110 return true; 115 return true;
111 } 116 }
112 117
113 } // namespace pepper 118 } // namespace pepper
OLDNEW
« no previous file with comments | « webkit/glue/plugins/pepper_url_request_info.cc ('k') | webkit/glue/resource_loader_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698