| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome_frame/plugin_url_request.h" | 5 #include "chrome_frame/plugin_url_request.h" |
| 6 | 6 |
| 7 #include "chrome/common/automation_messages.h" | 7 #include "chrome/common/automation_messages.h" |
| 8 | 8 |
| 9 PluginUrlRequest::PluginUrlRequest() | 9 PluginUrlRequest::PluginUrlRequest() |
| 10 : delegate_(NULL), | 10 : delegate_(NULL), |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 net::UploadData* upload_data, ResourceType::Type resource_type, | 25 net::UploadData* upload_data, ResourceType::Type resource_type, |
| 26 bool enable_frame_busting, int load_flags) { | 26 bool enable_frame_busting, int load_flags) { |
| 27 delegate_ = delegate; | 27 delegate_ = delegate; |
| 28 remote_request_id_ = remote_request_id; | 28 remote_request_id_ = remote_request_id; |
| 29 url_ = url; | 29 url_ = url; |
| 30 method_ = method; | 30 method_ = method; |
| 31 referrer_ = referrer; | 31 referrer_ = referrer; |
| 32 extra_headers_ = extra_headers; | 32 extra_headers_ = extra_headers; |
| 33 resource_type_ = resource_type; | 33 resource_type_ = resource_type; |
| 34 load_flags_ = load_flags; | 34 load_flags_ = load_flags; |
| 35 enable_frame_busting_ = enable_frame_busting; |
| 35 | 36 |
| 36 if (upload_data) { | 37 if (upload_data) { |
| 37 // We store a pointer to UrlmonUploadDataStream and not net::UploadData | 38 // We store a pointer to UrlmonUploadDataStream and not net::UploadData |
| 38 // since UrlmonUploadDataStream implements thread safe ref counting and | 39 // since UrlmonUploadDataStream implements thread safe ref counting and |
| 39 // UploadData does not. | 40 // UploadData does not. |
| 40 CComObject<UrlmonUploadDataStream>* upload_stream = NULL; | 41 CComObject<UrlmonUploadDataStream>* upload_stream = NULL; |
| 41 HRESULT hr = CComObject<UrlmonUploadDataStream>::CreateInstance( | 42 HRESULT hr = CComObject<UrlmonUploadDataStream>::CreateInstance( |
| 42 &upload_stream); | 43 &upload_stream); |
| 43 if (FAILED(hr)) { | 44 if (FAILED(hr)) { |
| 44 NOTREACHED(); | 45 NOTREACHED(); |
| 45 } else { | 46 } else { |
| 46 upload_stream->AddRef(); | 47 upload_stream->AddRef(); |
| 47 upload_stream->Initialize(upload_data); | 48 if (!upload_stream->Initialize(upload_data)) { |
| 49 upload_stream->Release(); |
| 50 return true; |
| 51 } |
| 52 |
| 48 upload_data_.Attach(upload_stream); | 53 upload_data_.Attach(upload_stream); |
| 49 is_chunked_upload_ = upload_data->is_chunked(); | 54 is_chunked_upload_ = upload_data->is_chunked(); |
| 50 STATSTG stat; | 55 STATSTG stat; |
| 51 upload_stream->Stat(&stat, STATFLAG_NONAME); | 56 upload_stream->Stat(&stat, STATFLAG_NONAME); |
| 52 post_data_len_ = stat.cbSize.QuadPart; | 57 post_data_len_ = stat.cbSize.QuadPart; |
| 53 } | 58 } |
| 54 } | 59 } |
| 55 | 60 |
| 56 enable_frame_busting_ = enable_frame_busting; | |
| 57 | |
| 58 return true; | 61 return true; |
| 59 } | 62 } |
| OLD | NEW |