android_webview
ash
base
breakpad
build
cc
chrome
chrome_frame
cfinstall
common
crash_reporting
infobars
installer_util
locales
ready_mode
resources
test
tools
CFInstall.js
CFInstance.js
DEPS
OWNERS
bho.cc
bho.h
bho.rgs
bho_loader.cc
bho_loader.h
bind_context_info.cc
bind_context_info.h
bind_status_callback_impl.cc
bind_status_callback_impl.h
buggy_bho_handling.cc
buggy_bho_handling.h
chrome_active_document.cc
chrome_active_document.h
chrome_active_document.rgs
chrome_frame.croc
chrome_frame.gyp
chrome_frame_activex.cc
chrome_frame_activex.h
chrome_frame_activex.rgs
chrome_frame_activex_base.h
chrome_frame_automation.cc
chrome_frame_automation.h
chrome_frame_delegate.cc
chrome_frame_delegate.h
chrome_frame_elevation.rgs
chrome_frame_helper_dll.cc
chrome_frame_helper_dll.def
chrome_frame_helper_main.cc
chrome_frame_helper_util.cc
chrome_frame_helper_util.h
chrome_frame_helper_version.rc
chrome_frame_launcher.gyp
chrome_frame_npapi.rgs
chrome_frame_plugin.cc
chrome_frame_plugin.h
chrome_frame_reporting.cc
chrome_frame_reporting.h
chrome_frame_unittest_main.cc
chrome_launcher.cc
chrome_launcher.h
chrome_launcher_main.cc
chrome_launcher_unittest.cc
chrome_launcher_utils.cc
chrome_launcher_utils.h
chrome_launcher_version.rc
chrome_protocol.cc
chrome_protocol.h
chrome_protocol.rgs
chrome_tab.cc
chrome_tab.def
chrome_tab.idl
chrome_tab.rgs
chrome_tab_version.rc
chrome_tab_version.rc.version
com_message_event.cc
com_message_event.h
com_type_info_holder.cc
com_type_info_holder.h
combine_libs.py
crash_server_init.cc
crash_server_init.h
custom_sync_call_context.cc
custom_sync_call_context.h
delete_chrome_history.cc
delete_chrome_history.h
dll_redirector.cc
dll_redirector.h
event_hooker.cc
event_hooker.h
exception_barrier.cc
exception_barrier.h
exception_barrier_lowlevel.asm
extra_system_apis.h
find_dialog.cc
find_dialog.h
frame.html
frame_w_controls.html
function_stub.cc
function_stub.h
function_stub_unittest.cc
host.html
host_w_controls.html
html_private_window_impl.h
html_utils.cc
html_utils.h
html_window_impl.h
http_negotiate.cc
http_negotiate.h
ie8_types.h
iids.cc
metrics_service.cc
metrics_service.h
navigation_constraints.cc
navigation_constraints.h
plugin_url_request.cc
plugin_url_request.h
policy_settings.cc
policy_settings.h
precompiled.cc
precompiled.h
protocol_sink_wrap.cc
protocol_sink_wrap.h
register_bho.rgs
registry_list_preferences_holder.cc
registry_list_preferences_holder.h
registry_watcher.cc
registry_watcher.h
renderer_glue.cc
resource.h
simple_resource_loader.cc
simple_resource_loader.h
smoke_test.bat
stream_impl.cc
stream_impl.h
support.gyp
sync_msg_reply_dispatcher.cc
sync_msg_reply_dispatcher.h
task_marshaller.cc
task_marshaller.h
test_utils.cc
test_utils.h
unittest_precompile.cc
unittest_precompile.h
update_launcher.cc
update_launcher.h
urlmon_bind_status_callback.cc
urlmon_bind_status_callback.h
urlmon_moniker.cc
urlmon_moniker.h
urlmon_upload_data_stream.cc
urlmon_upload_data_stream.h
urlmon_upload_data_stream_unittest.cc
urlmon_url_request.cc
urlmon_url_request.h
urlmon_url_request_private.h
utils.cc
utils.h
vtable_patch_manager.cc
vtable_patch_manager.h
vtable_patch_manager_unittest.cc
chromeos
cloud_print
content
courgette
crypto
dbus
google_apis
google_update
gpu
ipc
jingle
media
native_client_sdk
net
ppapi
printing
remoting
rlz
sandbox
sdch
skia
sql
sync
testing
third_party
tools
ui
webkit
win8
.DEPS.git
.gitignore
AUTHORS
Android.mk
DEPS
LICENSE
LICENSE.chromium_os
OWNERS
PRESUBMIT.py
WATCHLISTS
codereview.settings

ResetOffset(), GetContentLength() and IsInMemory() are moved from UploadData to UploadDataStream. This is an intermediate step to make simlar change to UploadElement BUG=72001 TEST=net_unittests Review URL: https://chromiumcodereview.appspot.com/10878082 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154594 0039d316-1c4b-4281-b951-d872f2087c98
60 lines
1.9 KiB
C++
60 lines
1.9 KiB
C++
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "chrome_frame/plugin_url_request.h"
|
|
|
|
#include "chrome/common/automation_messages.h"
|
|
|
|
PluginUrlRequest::PluginUrlRequest()
|
|
: delegate_(NULL),
|
|
remote_request_id_(-1),
|
|
post_data_len_(0),
|
|
enable_frame_busting_(false),
|
|
resource_type_(ResourceType::MAIN_FRAME),
|
|
load_flags_(0),
|
|
is_chunked_upload_(false) {
|
|
}
|
|
|
|
PluginUrlRequest::~PluginUrlRequest() {
|
|
}
|
|
|
|
bool PluginUrlRequest::Initialize(PluginUrlRequestDelegate* delegate,
|
|
int remote_request_id, const std::string& url, const std::string& method,
|
|
const std::string& referrer, const std::string& extra_headers,
|
|
net::UploadData* upload_data, ResourceType::Type resource_type,
|
|
bool enable_frame_busting, int load_flags) {
|
|
delegate_ = delegate;
|
|
remote_request_id_ = remote_request_id;
|
|
url_ = url;
|
|
method_ = method;
|
|
referrer_ = referrer;
|
|
extra_headers_ = extra_headers;
|
|
resource_type_ = resource_type;
|
|
load_flags_ = load_flags;
|
|
|
|
if (upload_data) {
|
|
// We store a pointer to UrlmonUploadDataStream and not net::UploadData
|
|
// since UrlmonUploadDataStream implements thread safe ref counting and
|
|
// UploadData does not.
|
|
CComObject<UrlmonUploadDataStream>* upload_stream = NULL;
|
|
HRESULT hr = CComObject<UrlmonUploadDataStream>::CreateInstance(
|
|
&upload_stream);
|
|
if (FAILED(hr)) {
|
|
NOTREACHED();
|
|
} else {
|
|
upload_stream->AddRef();
|
|
upload_stream->Initialize(upload_data);
|
|
upload_data_.Attach(upload_stream);
|
|
is_chunked_upload_ = upload_data->is_chunked();
|
|
STATSTG stat;
|
|
upload_stream->Stat(&stat, STATFLAG_NONAME);
|
|
post_data_len_ = stat.cbSize.QuadPart;
|
|
}
|
|
}
|
|
|
|
enable_frame_busting_ = enable_frame_busting;
|
|
|
|
return true;
|
|
}
|