summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-22 23:31:29 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-22 23:31:29 +0000
commit4f1efc89c3983d87c07a74f47bd111067e8c870a (patch)
treee7eee84b1c020e35fc5c6a49df534cbdd05efcbb
parent503631cfa06aaae686f2e9a6f55ebc1859e8dab3 (diff)
downloadchromium_src-4f1efc89c3983d87c07a74f47bd111067e8c870a.zip
chromium_src-4f1efc89c3983d87c07a74f47bd111067e8c870a.tar.gz
chromium_src-4f1efc89c3983d87c07a74f47bd111067e8c870a.tar.bz2
- Lots of removed whitespace at the end of the line
- ifdef out windows specific calls - fix simple compiler warnings Review URL: http://codereview.chromium.org/7886 Patch from icefox. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3794 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/glue/SConscript8
-rw-r--r--webkit/glue/plugins/plugin_host.cc96
-rw-r--r--webkit/glue/plugins/plugin_host.h14
-rw-r--r--webkit/glue/plugins/plugin_instance.cc24
-rw-r--r--webkit/glue/plugins/plugin_instance.h58
-rw-r--r--webkit/glue/plugins/plugin_stream.cc2
-rw-r--r--webkit/glue/plugins/plugin_stream.h4
-rw-r--r--webkit/glue/plugins/plugin_stream_url.h14
8 files changed, 127 insertions, 93 deletions
diff --git a/webkit/glue/SConscript b/webkit/glue/SConscript
index f1a4c38..e4f7317 100644
--- a/webkit/glue/SConscript
+++ b/webkit/glue/SConscript
@@ -45,6 +45,10 @@ input_files = [
'npruntime_util.cc',
'password_autocomplete_listener.cc',
'password_form_dom_manager.cc',
+ 'plugins/plugin_host.cc',
+ 'plugins/plugin_instance.cc',
+ 'plugins/plugin_string_stream.cc',
+ 'plugins/plugin_stream_url.cc',
'resource_fetcher.cc',
'resource_handle_impl.cc',
'searchable_form_data.cc',
@@ -73,13 +77,9 @@ if env['PLATFORM'] == 'win32':
'$PENDING_DIR/AccessibleDocument.cpp',
'glue_accessibility.cc',
'plugins/mozilla_extensions.cc',
- 'plugins/plugin_host.cc',
- 'plugins/plugin_instance.cc',
'plugins/plugin_lib.cc',
'plugins/plugin_list.cc',
'plugins/plugin_stream.cc',
- 'plugins/plugin_stream_url.cc',
- 'plugins/plugin_string_stream.cc',
'plugins/webplugin_delegate_impl.cc',
'webdropdata.cc',
'webinputevent_win.cc',
diff --git a/webkit/glue/plugins/plugin_host.cc b/webkit/glue/plugins/plugin_host.cc
index a3e4232..66750ac 100644
--- a/webkit/glue/plugins/plugin_host.cc
+++ b/webkit/glue/plugins/plugin_host.cc
@@ -143,21 +143,21 @@ bool PluginHost::SetPostData(const char *buf,
std::vector<std::string>* names,
std::vector<std::string>* values,
std::vector<char>* body) {
- // Use a state table to do the parsing. Whitespace must be
+ // Use a state table to do the parsing. Whitespace must be
// trimmed after the fact if desired. In our case, we actually
// don't care about the whitespace, because we're just going to
// pass this back into another POST. This function strips out the
// "Content-length" header and does not append it to the request.
- //
+ //
// This parser takes action only on state changes.
//
// Transition table:
// : \n NULL Other
// 0 GetHeader 1 2 4 0
- // 1 GetValue 1 0 3 1
+ // 1 GetValue 1 0 3 1
// 2 GetData 2 2 3 2
- // 3 DONE
+ // 3 DONE
// 4 ERR
//
enum { INPUT_COLON=0, INPUT_NEWLINE, INPUT_NULL, INPUT_OTHER };
@@ -177,17 +177,17 @@ bool PluginHost::SetPostData(const char *buf,
// Translate the current character into an input
// for the state table.
switch (*ptr) {
- case ':' :
- input = INPUT_COLON;
+ case ':' :
+ input = INPUT_COLON;
break;
- case '\n':
- input = INPUT_NEWLINE;
+ case '\n':
+ input = INPUT_NEWLINE;
break;
- case 0 :
- input = INPUT_NULL;
+ case 0 :
+ input = INPUT_NULL;
break;
- default :
- input = INPUT_OTHER;
+ default :
+ input = INPUT_OTHER;
break;
}
@@ -201,7 +201,7 @@ bool PluginHost::SetPostData(const char *buf,
value = std::string(start, ptr - start);
TrimWhitespace(value, TRIM_ALL, &value);
// If the name field is empty, we'll skip this header
- // but we won't error out.
+ // but we won't error out.
if (!name.empty() && name != "content-length") {
names->push_back(name);
values->push_back(value);
@@ -213,7 +213,7 @@ bool PluginHost::SetPostData(const char *buf,
name = StringToLowerASCII(std::string(start, ptr - start));
TrimWhitespace(name, TRIM_ALL, &name);
start = ptr + 1;
- break;
+ break;
case GETDATA:
{
// Finished headers, now get body
@@ -233,7 +233,7 @@ bool PluginHost::SetPostData(const char *buf,
done = true;
break;
}
- }
+ }
state = newstate;
ptr++;
} while (!done);
@@ -299,7 +299,7 @@ NPError NPN_RequestRead(NPStream* stream, NPByteRange* range_list) {
return NPERR_GENERIC_ERROR;
}
- scoped_refptr<NPAPI::PluginInstance> plugin =
+ scoped_refptr<NPAPI::PluginInstance> plugin =
reinterpret_cast<NPAPI::PluginInstance*>(stream->ndata);
if (!plugin.get()) {
return NPERR_GENERIC_ERROR;
@@ -316,9 +316,9 @@ static bool IsJavaScriptUrl(const std::string& url) {
// Generic form of GetURL for common code between
// GetURL() and GetURLNotify().
static NPError GetURLNotify(NPP id,
- const char* url,
+ const char* url,
const char* target,
- bool notify,
+ bool notify,
void* notify_data) {
if (!url)
return NPERR_INVALID_URL;
@@ -327,14 +327,14 @@ static NPError GetURLNotify(NPP id,
scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id);
if (plugin.get()) {
- plugin->webplugin()->HandleURLRequest("GET",
- is_javascript_url,
- target,
- 0,
- 0,
- false,
- notify,
- url,
+ plugin->webplugin()->HandleURLRequest("GET",
+ is_javascript_url,
+ target,
+ 0,
+ 0,
+ false,
+ notify,
+ url,
notify_data,
plugin->popups_allowed());
} else {
@@ -344,27 +344,27 @@ static NPError GetURLNotify(NPP id,
return NPERR_NO_ERROR;
}
-// Requests creation of a new stream with the contents of the
+// Requests creation of a new stream with the contents of the
// specified URL; gets notification of the result.
NPError NPN_GetURLNotify(NPP id,
- const char* url,
+ const char* url,
const char* target,
void* notify_data) {
- // This is identical to NPN_GetURL, but after finishing, the
- // browser will call NPP_URLNotify to inform the plugin that
+ // This is identical to NPN_GetURL, but after finishing, the
+ // browser will call NPP_URLNotify to inform the plugin that
// it has completed.
- // According to the NPAPI documentation, if target == _self
- // or a parent to _self, the browser should return NPERR_INVALID_PARAM,
+ // According to the NPAPI documentation, if target == _self
+ // or a parent to _self, the browser should return NPERR_INVALID_PARAM,
// because it can't notify the plugin once deleted. This is
// absolutely false; firefox doesn't do this, and Flash relies on
// being able to use this.
// Also according to the NPAPI documentation, we should return
// NPERR_INVALID_URL if the url requested is not valid. However,
- // this would require that we synchronously start fetching the
+ // this would require that we synchronously start fetching the
// URL. That just isn't practical. As such, there really is
- // no way to return this error. From looking at the Firefox
+ // no way to return this error. From looking at the Firefox
// implementation, it doesn't look like Firefox does this either.
return GetURLNotify(id, url, target, true, notify_data);
@@ -377,9 +377,9 @@ NPError NPN_GetURL(NPP id, const char* url, const char* target) {
//
// If target == null, the browser fetches content and streams to plugin.
// otherwise, the browser loads content into an existing browser frame.
- // If the target is the window/frame containing the plugin, the plugin
+ // If the target is the window/frame containing the plugin, the plugin
// may be destroyed.
- // If the target is _blank, a mailto: or news: url open content in a new
+ // If the target is _blank, a mailto: or news: url open content in a new
// browser window
// If the target is _self, no other instance of the plugin is created. The
// plugin continues to operate in its own window
@@ -504,21 +504,21 @@ NPError NPN_PostURL(NPP id,
// POSTs data to an URL, either from a temp file or a buffer.
// If file is true, buf contains a temp file (which host will delete after
// completing), and len contains the length of the filename.
- // If file is false, buf contains the data to send, and len contains the
+ // If file is false, buf contains the data to send, and len contains the
// length of the buffer
//
- // If target is null,
+ // If target is null,
// server response is returned to the plugin
// If target is _current, _self, or _top,
// server response is written to the plugin window and plugin is unloaded.
// If target is _new or _blank,
// server response is written to a new browser window
- // If target is an existing frame,
+ // If target is an existing frame,
// server response goes to that frame.
//
// For protocols other than FTP
// file uploads must be line-end converted from \r\n to \n
- //
+ //
// Note: you cannot specify headers (even a blank line) in a memory buffer,
// use NPN_PostURLNotify
@@ -529,9 +529,9 @@ NPError NPN_NewStream(NPP id,
NPMIMEType type,
const char* target,
NPStream** stream) {
- // Requests creation of a new data stream produced by the plugin,
+ // Requests creation of a new data stream produced by the plugin,
// consumed by the browser.
- //
+ //
// Browser should put this stream into a window target.
//
// TODO: implement me
@@ -588,6 +588,7 @@ void NPN_Status(NPP id, const char* message) {
}
void NPN_InvalidateRect(NPP id, NPRect *invalidRect) {
+#if defined(OS_WIN)
// Invalidates specified drawing area prior to repainting or refreshing a
// windowless plugin
@@ -596,8 +597,8 @@ void NPN_InvalidateRect(NPP id, NPRect *invalidRect) {
// pass an update event or a paint message to the plug-in. After calling
// this method, the plug-in recieves a paint message asynchronously.
- // The browser redraws invalid areas of the document and any windowless
- // plug-ins at regularly timed intervals. To force a paint message, the
+ // The browser redraws invalid areas of the document and any windowless
+ // plug-ins at regularly timed intervals. To force a paint message, the
// plug-in can call NPN_ForceRedraw after calling this method.
scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id);
@@ -623,6 +624,9 @@ void NPN_InvalidateRect(NPP id, NPRect *invalidRect) {
plugin->webplugin()->Invalidate();
}
}
+#else
+ NOTIMPLEMENTED();
+#endif
}
void NPN_InvalidateRegion(NPP id, NPRegion invalidRegion) {
@@ -707,10 +711,14 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void *value) {
}
case NPNVnetscapeWindow:
{
+#if defined(OS_WIN)
scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id);
HWND handle = plugin->window_handle();
*((void**)value) = (void*)handle;
rv = NPERR_NO_ERROR;
+#else
+ NOTIMPLEMENTED();
+#endif
break;
}
case NPNVjavascriptEnabledBool:
diff --git a/webkit/glue/plugins/plugin_host.h b/webkit/glue/plugins/plugin_host.h
index be12d5e..acf0bad9 100644
--- a/webkit/glue/plugins/plugin_host.h
+++ b/webkit/glue/plugins/plugin_host.h
@@ -19,11 +19,11 @@ namespace NPAPI
class PluginInstance;
// The Plugin Host implements the NPN_xxx functions for NPAPI plugins.
-// These are the functions exposed from the Plugin Host for use
+// These are the functions exposed from the Plugin Host for use
// by the Plugin.
//
-// The PluginHost is managed as a singleton. This isn't strictly
-// necessary, but since the callback functions are all global C
+// The PluginHost is managed as a singleton. This isn't strictly
+// necessary, but since the callback functions are all global C
// functions, there is really no point in having per-instance PluginHosts.
class PluginHost : public base::RefCounted<PluginHost> {
public:
@@ -31,13 +31,13 @@ class PluginHost : public base::RefCounted<PluginHost> {
// must call deref() when finished with the object.
static PluginHost *Singleton();
virtual ~PluginHost();
-
+
// The table of functions provided to the plugin.
NPNetscapeFuncs *host_functions() { return &host_funcs_; }
- // Helper function for parsing post headers, and applying attributes
- // to the stream. NPAPI post data include headers + data combined.
- // This function parses it out and adds it to the stream in a WebKit
+ // Helper function for parsing post headers, and applying attributes
+ // to the stream. NPAPI post data include headers + data combined.
+ // This function parses it out and adds it to the stream in a WebKit
// style.
static bool SetPostData(const char *buf,
uint32 length,
diff --git a/webkit/glue/plugins/plugin_instance.cc b/webkit/glue/plugins/plugin_instance.cc
index e6d5087..ca34639 100644
--- a/webkit/glue/plugins/plugin_instance.cc
+++ b/webkit/glue/plugins/plugin_instance.cc
@@ -14,7 +14,9 @@
#include "webkit/glue/plugins/plugin_lib.h"
#include "webkit/glue/plugins/plugin_stream_url.h"
#include "webkit/glue/plugins/plugin_string_stream.h"
+#if defined(OS_WIN)
#include "webkit/glue/plugins/mozilla_extensions.h"
+#endif
#include "net/base/escape.h"
namespace NPAPI
@@ -28,15 +30,17 @@ PluginInstance::PluginInstance(PluginLib *plugin, const std::string &mime_type)
npp_(0),
host_(PluginHost::Singleton()),
npp_functions_(plugin->functions()),
+#if defined(OS_WIN)
hwnd_(0),
+#endif
windowless_(false),
transparent_(true),
- mime_type_(mime_type),
webplugin_(0),
+ mime_type_(mime_type),
+ get_notify_data_(NULL),
use_mozilla_user_agent_(false),
message_loop_(MessageLoop::current()),
load_manually_(false),
- get_notify_data_(NULL),
in_close_streams_(false) {
npp_ = new NPP_t();
npp_->ndata = 0;
@@ -120,6 +124,7 @@ void PluginInstance::CloseStreams() {
in_close_streams_ = false;
}
+#if defined(OS_WIN)
bool PluginInstance::HandleEvent(UINT message, WPARAM wParam, LPARAM lParam) {
if (!windowless_)
return false;
@@ -130,6 +135,7 @@ bool PluginInstance::HandleEvent(UINT message, WPARAM wParam, LPARAM lParam) {
windowEvent.wParam = static_cast<uint32>(wParam);
return NPP_HandleEvent(&windowEvent) != 0;
}
+#endif
bool PluginInstance::Start(const GURL& url,
char** const param_names,
@@ -203,11 +209,13 @@ void PluginInstance::NPP_Destroy() {
DCHECK(savedData == 0);
}
+#if defined(OS_WIN)
// Clean up back references to this instance if any
if (mozilla_extenstions_) {
mozilla_extenstions_->DetachFromInstance();
mozilla_extenstions_ = NULL;
}
+#endif
}
NPError PluginInstance::NPP_SetWindow(NPWindow *window) {
@@ -395,7 +403,8 @@ void PluginInstance::PluginThreadAsyncCall(void (*func)(void *),
void PluginInstance::OnPluginThreadAsyncCall(void (*func)(void *),
void *userData) {
- // We are invoking an arbitrary callback provided by a third
+#if defined(OS_WIN)
+ // We are invoking an arbitrary callback provided by a third
// party plugin. It's better to wrap this into an exception
// block to protect us from crashes.
__try {
@@ -404,6 +413,9 @@ void PluginInstance::OnPluginThreadAsyncCall(void (*func)(void *),
// Maybe we can disable a crashing plugin.
// But for now, just continue.
}
+#else
+ NOTIMPLEMENTED();
+#endif
}
PluginInstance* PluginInstance::SetInitializingInstance(
@@ -421,6 +433,7 @@ PluginInstance* PluginInstance::GetInitializingInstance() {
}
NPError PluginInstance::GetServiceManager(void** service_manager) {
+#if defined(OS_WIN)
if (!mozilla_extenstions_) {
mozilla_extenstions_ = new MozillaExtensionApi(this);
}
@@ -428,6 +441,9 @@ NPError PluginInstance::GetServiceManager(void** service_manager) {
DCHECK(mozilla_extenstions_);
mozilla_extenstions_->QueryInterface(nsIServiceManager::GetIID(),
service_manager);
+#else
+ NOTIMPLEMENTED();
+#endif
return NPERR_NO_ERROR;
}
@@ -477,7 +493,7 @@ void PluginInstance::RequestRead(NPStream* stream, NPByteRange* range_list) {
webplugin_->InitiateHTTPRangeRequest(
stream->url, range_info.c_str(),
plugin_stream,
- plugin_stream->notify_needed(),
+ plugin_stream->notify_needed(),
plugin_stream->notify_data());
break;
}
diff --git a/webkit/glue/plugins/plugin_instance.h b/webkit/glue/plugins/plugin_instance.h
index 9765fef..824c557 100644
--- a/webkit/glue/plugins/plugin_instance.h
+++ b/webkit/glue/plugins/plugin_instance.h
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// TODO: Need to deal with NPAPI's NPSavedData.
+// TODO: Need to deal with NPAPI's NPSavedData.
// I haven't seen plugins use it yet.
#ifndef WEBKIT_GLUE_PLUGIN_PLUGIN_INSTANCE_H__
@@ -42,23 +42,23 @@ class PluginInstance : public base::RefCounted<PluginInstance> {
virtual ~PluginInstance();
// Activates the instance by calling NPP_New.
- // This should be called after our instance is all
+ // This should be called after our instance is all
// setup from the host side and we are ready to receive
- // requests from the plugin. We must not call any
- // functions on the plugin instance until start has
+ // requests from the plugin. We must not call any
+ // functions on the plugin instance until start has
// been called.
//
// url: The instance URL.
- // param_names: the list of names of attributes passed via the
+ // param_names: the list of names of attributes passed via the
// element.
// param_values: the list of values corresponding to param_names
// param_count: number of attributes
// load_manually: if true indicates that the plugin data would be passed
- // from webkit. if false indicates that the plugin should
+ // from webkit. if false indicates that the plugin should
// download the data.
// This also controls whether the plugin is instantiated as
// a full page plugin (NP_FULL) or embedded (NP_EMBED)
- //
+ //
bool Start(const GURL& url,
char** const param_names,
char** const param_values,
@@ -68,16 +68,18 @@ class PluginInstance : public base::RefCounted<PluginInstance> {
// NPAPI's instance identifier for this instance
NPP npp() { return npp_; }
- // Get/Set for the instance's HWND.
+#if defined(OS_WIN)
+ // Get/Set for the instance's HWND.
HWND window_handle() { return hwnd_; }
void set_window_handle(HWND value) { hwnd_ = value; }
+#endif
// Get/Set whether this instance is in Windowless mode.
// Default is false.
bool windowless() { return windowless_; }
void set_windowless(bool value) { windowless_ = value; }
- // Get/Set whether this instance is transparent.
+ // Get/Set whether this instance is transparent.
// This only applies to windowless plugins. Transparent
// plugins require that webkit paint the background.
// Default is true.
@@ -93,9 +95,11 @@ class PluginInstance : public base::RefCounted<PluginInstance> {
NPAPI::PluginLib* plugin_lib() { return plugin_; }
+#if defined(OS_WIN)
// Handles a windows native message which this PluginInstance should deal
// with. Returns true if the event is handled, false otherwise.
bool HandleEvent(UINT message, WPARAM wParam, LPARAM lParam);
+#endif
// Creates a stream for sending an URL. If notify_needed
// is true, it will send a notification to the plugin
@@ -104,27 +108,27 @@ class PluginInstance : public base::RefCounted<PluginInstance> {
// url, or false if it's for a url that the plugin
// fetched through NPN_GetUrl[Notify].
PluginStreamUrl *CreateStream(int resource_id,
- const std::string &url,
- const std::string &mime_type,
+ const std::string &url,
+ const std::string &mime_type,
bool notify_needed,
void *notify_data);
// Convenience function for sending a stream from a URL to this instance.
- // URL can be a relative or a fully qualified url.
+ // URL can be a relative or a fully qualified url.
void SendStream(const std::string& url, bool notify_needed,
void* notify_data);
// For each instance, we track all streams. When the
- // instance closes, all remaining streams are also
+ // instance closes, all remaining streams are also
// closed. All streams associated with this instance
- // should call AddStream so that they can be cleaned
+ // should call AddStream so that they can be cleaned
// up when the instance shuts down.
void AddStream(PluginStream* stream);
- // This is called when a stream is closed. We remove the stream from the
+ // This is called when a stream is closed. We remove the stream from the
// list, which releases the reference maintained to the stream.
void RemoveStream(PluginStream* stream);
- // Closes all open streams on this instance.
+ // Closes all open streams on this instance.
void CloseStreams();
// Have the plugin create it's script object.
@@ -183,7 +187,7 @@ class PluginInstance : public base::RefCounted<PluginInstance> {
void PushPopupsEnabledState(bool enabled);
void PopPopupsEnabledState();
- bool popups_allowed() const {
+ bool popups_allowed() const {
return popups_enabled_stack_.empty() ? false : popups_enabled_stack_.top();
}
@@ -199,18 +203,18 @@ class PluginInstance : public base::RefCounted<PluginInstance> {
// The real player plugin dll(nppl3260) when loaded by firefox is loaded via
// the NS COM API which is analogous to win32 COM. So the NPAPI functions in
// the plugin are invoked via an interface by firefox. The plugin instance
- // handle which is passed to every NPAPI method is owned by the real player
+ // handle which is passed to every NPAPI method is owned by the real player
// plugin, i.e. it expects the ndata member to point to a structure which
// it knows about. Eventually it dereferences this structure and compares
// a member variable at offset 0x24(Version 6.0.11.2888) /2D (Version
// 6.0.11.3088) with 0 and on failing this check, takes a different code
// path which causes a crash. Safari and Opera work with version 6.0.11.2888
// by chance as their ndata structure contains a 0 at the location which real
- // player checks:(. They crash with version 6.0.11.3088 as well. The
- // following member just adds a 96 byte padding to our PluginInstance class
- // which is passed in the ndata member. This magic number works correctly on
- // Vista with UAC on or off :(.
- // NOTE: Please dont change the ordering of the member variables
+ // player checks:(. They crash with version 6.0.11.3088 as well. The
+ // following member just adds a 96 byte padding to our PluginInstance class
+ // which is passed in the ndata member. This magic number works correctly on
+ // Vista with UAC on or off :(.
+ // NOTE: Please dont change the ordering of the member variables
// New members should be added after this padding array.
// TODO(iyengar) : Disassemble the Realplayer ndata structure and look into
// the possiblity of conforming to it (http://b/issue?id=936667). We
@@ -221,7 +225,9 @@ class PluginInstance : public base::RefCounted<PluginInstance> {
scoped_refptr<PluginHost> host_;
NPPluginFuncs* npp_functions_;
std::vector<scoped_refptr<PluginStream> > open_streams_;
+#if defined(OS_WIN)
HWND hwnd_;
+#endif
bool windowless_;
bool transparent_;
WebPlugin* webplugin_;
@@ -229,12 +235,14 @@ class PluginInstance : public base::RefCounted<PluginInstance> {
GURL get_url_;
void* get_notify_data_;
bool use_mozilla_user_agent_;
+#if defined(OS_WIN)
scoped_refptr<MozillaExtensionApi> mozilla_extenstions_;
+#endif
MessageLoop* message_loop_;
// Using TLS to store PluginInstance object during its creation.
- // We need to pass this instance to the service manager
+ // We need to pass this instance to the service manager
// (MozillaExtensionApi) created as a result of NPN_GetValue
- // in the context of NP_Initialize.
+ // in the context of NP_Initialize.
static ThreadLocalStorage::Slot plugin_instance_tls_index_;
scoped_refptr<PluginStreamUrl> plugin_data_stream_;
GURL instance_url_;
diff --git a/webkit/glue/plugins/plugin_stream.cc b/webkit/glue/plugins/plugin_stream.cc
index 1d00b25..855c3fc 100644
--- a/webkit/glue/plugins/plugin_stream.cc
+++ b/webkit/glue/plugins/plugin_stream.cc
@@ -115,7 +115,7 @@ int PluginStream::Write(const char *buffer, const int length,
// to each stream, we'll return failure.
DCHECK(opened_);
- if (WriteToFile(buffer, length) &&
+ if (WriteToFile(buffer, length) &&
WriteToPlugin(buffer, length, data_offset))
return length;
diff --git a/webkit/glue/plugins/plugin_stream.h b/webkit/glue/plugins/plugin_stream.h
index be9a594..c79fa47 100644
--- a/webkit/glue/plugins/plugin_stream.h
+++ b/webkit/glue/plugins/plugin_stream.h
@@ -79,7 +79,7 @@ class PluginStream : public base::RefCounted<PluginStream> {
bool open() { return opened_; }
private:
- // Open a temporary file for this stream.
+ // Open a temporary file for this stream.
// If successful, will set temp_file_name_, temp_file_handle_, and
// return true.
bool OpenTempFile();
@@ -113,8 +113,10 @@ class PluginStream : public base::RefCounted<PluginStream> {
bool close_on_write_data_;
uint16 requested_plugin_mode_;
bool opened_;
+#if defined(OS_WIN)
char temp_file_name_[MAX_PATH];
HANDLE temp_file_handle_;
+#endif
std::vector<char> delivery_data_;
int data_offset_;
bool seekable_stream_;
diff --git a/webkit/glue/plugins/plugin_stream_url.h b/webkit/glue/plugins/plugin_stream_url.h
index 17213a2..1f8c4c5 100644
--- a/webkit/glue/plugins/plugin_stream_url.h
+++ b/webkit/glue/plugins/plugin_stream_url.h
@@ -15,16 +15,16 @@ namespace NPAPI {
class PluginInstance;
// A NPAPI Stream based on a URL.
-class PluginStreamUrl : public PluginStream,
+class PluginStreamUrl : public PluginStream,
public WebPluginResourceClient {
public:
// Create a new stream for sending to the plugin by fetching
- // a URL. If notifyNeeded is set, then the plugin will be notified
+ // a URL. If notifyNeeded is set, then the plugin will be notified
// when the stream has been fully sent to the plugin. Initialize
- // must be called before the object is used.
+ // must be called before the object is used.
PluginStreamUrl(int resource_id,
- const GURL &url,
- PluginInstance *instance,
+ const GURL &url,
+ PluginInstance *instance,
bool notify_needed,
void *notify_data);
virtual ~PluginStreamUrl();
@@ -34,8 +34,8 @@ class PluginStreamUrl : public PluginStream,
// it is still loading.
virtual bool Close(NPReason reason);
- virtual WebPluginResourceClient* AsResourceClient() {
- return static_cast<WebPluginResourceClient*>(this);
+ virtual WebPluginResourceClient* AsResourceClient() {
+ return static_cast<WebPluginResourceClient*>(this);
}
virtual void CancelRequest();