summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content/browser/plugin_process_host.cc15
-rw-r--r--content/child/npapi/plugin_instance.cc18
-rw-r--r--content/child/npapi/plugin_stream_url.cc27
-rw-r--r--content/child/npapi/plugin_stream_url.h7
-rw-r--r--content/child/npapi/plugin_url_fetcher.cc7
-rw-r--r--content/child/npapi/plugin_url_fetcher.h10
-rw-r--r--content/child/npapi/webplugin_delegate_impl.cc2
7 files changed, 17 insertions, 69 deletions
diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc
index b6d54b9..8aa69dd 100644
--- a/content/browser/plugin_process_host.cc
+++ b/content/browser/plugin_process_host.cc
@@ -205,9 +205,15 @@ bool PluginProcessHost::Init(const WebPluginInfo& info) {
// any associated values) if present in the browser command line
static const char* const kSwitchNames[] = {
switches::kDisableBreakpad,
- switches::kDisableDirectNPAPIRequests,
+#if defined(OS_MACOSX)
+ switches::kDisableCoreAnimationPlugins,
+ switches::kEnableSandboxLogging,
+#endif
switches::kEnableStatsTable,
switches::kFullMemoryCrashReport,
+#if defined(OS_WIN)
+ switches::kHighDPISupport,
+#endif
switches::kLoggingLevel,
switches::kLogPluginMessages,
switches::kNoSandbox,
@@ -215,13 +221,6 @@ bool PluginProcessHost::Init(const WebPluginInfo& info) {
switches::kTestSandbox,
switches::kTraceStartup,
switches::kUseGL,
-#if defined(OS_MACOSX)
- switches::kDisableCoreAnimationPlugins,
- switches::kEnableSandboxLogging,
-#endif
-#if defined(OS_WIN)
- switches::kHighDPISupport,
-#endif
};
cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames,
diff --git a/content/child/npapi/plugin_instance.cc b/content/child/npapi/plugin_instance.cc
index b141c5a..a7e2b94 100644
--- a/content/child/npapi/plugin_instance.cc
+++ b/content/child/npapi/plugin_instance.cc
@@ -5,7 +5,6 @@
#include "content/child/npapi/plugin_instance.h"
#include "base/bind.h"
-#include "base/command_line.h"
#include "base/file_util.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/string_number_conversions.h"
@@ -19,7 +18,6 @@
#include "content/child/npapi/webplugin_delegate.h"
#include "content/child/npapi/webplugin_resource_client.h"
#include "content/public/common/content_constants.h"
-#include "content/public/common/content_switches.h"
#include "net/base/escape.h"
#if defined(OS_MACOSX)
@@ -559,18 +557,10 @@ void PluginInstance::RequestRead(NPStream* stream, NPByteRange* range_list) {
// is called on it.
plugin_stream->set_seekable(true);
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableDirectNPAPIRequests)) {
- pending_range_requests_[++next_range_request_id_] = plugin_stream;
- webplugin_->InitiateHTTPRangeRequest(
- stream->url, range_info.c_str(), next_range_request_id_);
- return;
- } else {
- PluginStreamUrl* plugin_stream_url =
- static_cast<PluginStreamUrl*>(plugin_stream);
- plugin_stream_url->FetchRange(range_info);
- return;
- }
+ pending_range_requests_[++next_range_request_id_] = plugin_stream;
+ webplugin_->InitiateHTTPRangeRequest(
+ stream->url, range_info.c_str(), next_range_request_id_);
+ return;
}
}
NOTREACHED();
diff --git a/content/child/npapi/plugin_stream_url.cc b/content/child/npapi/plugin_stream_url.cc
index 84490d7..d042e1c 100644
--- a/content/child/npapi/plugin_stream_url.cc
+++ b/content/child/npapi/plugin_stream_url.cc
@@ -6,7 +6,6 @@
#include <algorithm>
-#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "content/child/npapi/plugin_host.h"
#include "content/child/npapi/plugin_instance.h"
@@ -43,17 +42,6 @@ void PluginStreamUrl::URLRedirectResponse(bool allow) {
UpdateUrl(pending_redirect_url_.c_str());
}
-void PluginStreamUrl::FetchRange(const std::string& range) {
- PluginURLFetcher* range_fetcher = new PluginURLFetcher(
- this, url_, plugin_url_fetcher_->first_party_for_cookies(), "GET", NULL,
- 0, plugin_url_fetcher_->referrer(), range, false, false,
- plugin_url_fetcher_->origin_pid(),
- plugin_url_fetcher_->render_frame_id(),
- plugin_url_fetcher_->render_view_id(), id_,
- plugin_url_fetcher_->copy_stream_data());
- range_request_fetchers_.push_back(range_fetcher);
-}
-
bool PluginStreamUrl::Close(NPReason reason) {
// Protect the stream against it being destroyed or the whole plugin instance
// being destroyed within the destroy stream handler.
@@ -83,10 +71,7 @@ void PluginStreamUrl::CancelRequest() {
for (size_t i = 0; i < range_requests_.size(); ++i)
instance()->webplugin()->CancelResource(range_requests_[i]);
}
-
range_requests_.clear();
-
- STLDeleteElements(&range_request_fetchers_);
}
void PluginStreamUrl::WillSendRequest(const GURL& url, int http_status_code) {
@@ -180,8 +165,6 @@ PluginStreamUrl::~PluginStreamUrl() {
if (!plugin_url_fetcher_.get() && instance() && instance()->webplugin()) {
instance()->webplugin()->ResourceClientDeleted(AsResourceClient());
}
-
- STLDeleteElements(&range_request_fetchers_);
}
void PluginStreamUrl::AddRangeRequestResourceId(unsigned long resource_id) {
@@ -193,11 +176,11 @@ void PluginStreamUrl::SetDeferLoading(bool value) {
// If we determined that the request had failed via the HTTP headers in the
// response then we send out a failure notification to the plugin process, as
// certain plugins don't handle HTTP failure codes correctly.
- if (plugin_url_fetcher_.get()) {
- if (!value && plugin_url_fetcher_->pending_failure_notification()) {
- // This object may be deleted now.
- DidFail(id_);
- }
+ if (!value &&
+ plugin_url_fetcher_.get() &&
+ plugin_url_fetcher_->pending_failure_notification()) {
+ // This object may be deleted now.
+ DidFail(id_);
return;
}
if (id_ > 0)
diff --git a/content/child/npapi/plugin_stream_url.h b/content/child/npapi/plugin_stream_url.h
index f63593d..3b52d85 100644
--- a/content/child/npapi/plugin_stream_url.h
+++ b/content/child/npapi/plugin_stream_url.h
@@ -34,8 +34,6 @@ class PluginStreamUrl : public PluginStream,
void URLRedirectResponse(bool allow);
- void FetchRange(const std::string& range);
-
// Stop sending the stream to the client.
// Overrides the base Close so we can cancel our fetching the URL if
// it is still loading.
@@ -71,14 +69,9 @@ class PluginStreamUrl : public PluginStream,
GURL url_;
unsigned long id_;
-
// Ids of additional resources requested via range requests issued on
// seekable streams.
- // This is used when we're loading resources through the renderer, i.e. not
- // using plugin_url_fetcher_.
std::vector<unsigned long> range_requests_;
- // This is used when we're using plugin_url_fetcher_.
- std::vector<PluginURLFetcher*> range_request_fetchers_;
// If the plugin participates in HTTP URL redirect handling then this member
// holds the url being redirected to while we wait for the plugin to make a
diff --git a/content/child/npapi/plugin_url_fetcher.cc b/content/child/npapi/plugin_url_fetcher.cc
index 0b5d6eb..6695f76 100644
--- a/content/child/npapi/plugin_url_fetcher.cc
+++ b/content/child/npapi/plugin_url_fetcher.cc
@@ -81,7 +81,6 @@ PluginURLFetcher::PluginURLFetcher(PluginStreamUrl* plugin_stream,
const char* buf,
unsigned int len,
const GURL& referrer,
- const std::string& range,
bool notify_redirects,
bool is_plugin_src_load,
int origin_pid,
@@ -96,9 +95,6 @@ PluginURLFetcher::PluginURLFetcher(PluginStreamUrl* plugin_stream,
referrer_(referrer),
notify_redirects_(notify_redirects),
is_plugin_src_load_(is_plugin_src_load),
- origin_pid_(origin_pid),
- render_frame_id_(render_frame_id),
- render_view_id_(render_view_id),
resource_id_(resource_id),
copy_stream_data_(copy_stream_data),
data_offset_(0),
@@ -137,9 +133,6 @@ PluginURLFetcher::PluginURLFetcher(PluginStreamUrl* plugin_stream,
request_info.headers += "\r\n";
request_info.headers += "Content-Type: application/x-www-form-urlencoded";
}
- } else {
- if (!range.empty())
- request_info.headers = std::string("Range: ") + range;
}
bridge_.reset(ChildThread::current()->resource_dispatcher()->CreateBridge(
diff --git a/content/child/npapi/plugin_url_fetcher.h b/content/child/npapi/plugin_url_fetcher.h
index dca40ec..4e5e2ff 100644
--- a/content/child/npapi/plugin_url_fetcher.h
+++ b/content/child/npapi/plugin_url_fetcher.h
@@ -29,7 +29,6 @@ class PluginURLFetcher : public webkit_glue::ResourceLoaderBridge::Peer {
const char* buf,
unsigned int len,
const GURL& referrer,
- const std::string& range,
bool notify_redirects,
bool is_plugin_src_load,
int origin_pid,
@@ -45,12 +44,6 @@ class PluginURLFetcher : public webkit_glue::ResourceLoaderBridge::Peer {
// Called with the plugin's reply to NPP_URLRedirectNotify.
void URLRedirectResponse(bool allow);
- GURL first_party_for_cookies() { return first_party_for_cookies_; }
- GURL referrer() { return referrer_; }
- int origin_pid() { return origin_pid_; }
- int render_frame_id() { return render_frame_id_; }
- int render_view_id() { return render_view_id_; }
- bool copy_stream_data() { return copy_stream_data_; }
bool pending_failure_notification() { return pending_failure_notification_; }
private:
@@ -81,9 +74,6 @@ class PluginURLFetcher : public webkit_glue::ResourceLoaderBridge::Peer {
GURL referrer_;
bool notify_redirects_;
bool is_plugin_src_load_;
- int origin_pid_;
- int render_frame_id_;
- int render_view_id_;
unsigned long resource_id_;
bool copy_stream_data_;
int64 data_offset_;
diff --git a/content/child/npapi/webplugin_delegate_impl.cc b/content/child/npapi/webplugin_delegate_impl.cc
index e53cbc3..c904278 100644
--- a/content/child/npapi/webplugin_delegate_impl.cc
+++ b/content/child/npapi/webplugin_delegate_impl.cc
@@ -325,7 +325,7 @@ void WebPluginDelegateImpl::FetchURL(unsigned long resource_id,
bool copy_stream_data = !!(quirks_ & PLUGIN_QUIRK_COPY_STREAM_DATA);
plugin_stream->SetPluginURLFetcher(new PluginURLFetcher(
plugin_stream, url, first_party_for_cookies, method, buf, len,
- referrer, std::string(), notify_redirects, is_plugin_src_load, origin_pid,
+ referrer, notify_redirects, is_plugin_src_load, origin_pid,
render_frame_id, render_view_id, resource_id, copy_stream_data));
}