blob: ee9f9da1f0f029caa77c4865d7e6ec420aa654af (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
// Copyright (c) 2006-2008 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.
#ifndef WEBKIT_GLUE_PLUGIN_PLUGIN_STREAM_URL_H__
#define WEBKIT_GLUE_PLUGIN_PLUGIN_STREAM_URL_H__
#include "webkit/glue/webplugin.h"
#include "webkit/glue/plugins/plugin_stream.h"
#include "googleurl/src/gurl.h"
namespace NPAPI {
class PluginInstance;
// A NPAPI Stream based on a URL.
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
// when the stream has been fully sent to the plugin. Initialize
// must be called before the object is used.
PluginStreamUrl(int resource_id,
const GURL &url,
PluginInstance *instance,
bool notify_needed,
void *notify_data);
virtual ~PluginStreamUrl();
// Stop sending the stream to the client.
// Overrides the base Close so we can cancel our fetching the URL if
// it is still loading.
bool Close(NPReason reason);
//
// WebPluginResourceClient methods
//
void WillSendRequest(const GURL& url);
void DidReceiveResponse(const std::string& mime_type,
const std::string& headers,
uint32 expected_length,
uint32 last_modified,
bool* cancel);
void DidReceiveData(const char* buffer, int length);
void DidFinishLoading();
void DidFail();
private:
GURL url_;
int id_;
DISALLOW_EVIL_CONSTRUCTORS(PluginStreamUrl);
};
} // namespace NPAPI
#endif // WEBKIT_GLUE_PLUGIN_PLUGIN_STREAM_URL_H__
|