Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: chrome_frame/npapi_url_request.h

Issue 7276037: Remove NPAPI support from Chrome Frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome_frame/np_utils.cc ('k') | chrome_frame/npapi_url_request.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_FRAME_NPAPI_URL_REQUEST_H_
6 #define CHROME_FRAME_NPAPI_URL_REQUEST_H_
7
8 #include <map>
9 #include <string>
10
11 #include "chrome_frame/plugin_url_request.h"
12 #include "third_party/npapi/bindings/npapi.h"
13
14 class NPAPIUrlRequest;
15 class NPAPIUrlRequestManager : public PluginUrlRequestManager,
16 public PluginUrlRequestDelegate {
17 public:
18 NPAPIUrlRequestManager();
19 ~NPAPIUrlRequestManager();
20
21 void set_NPPInstance(NPP instance) {
22 instance_ = instance;
23 }
24
25 // Notifications from the browser. We find the appropriate NPAPIUrlRequest
26 // and forward the call.
27 NPError NewStream(NPMIMEType type, NPStream* stream,
28 NPBool seekable, uint16* stream_type);
29 int32 WriteReady(NPStream* stream);
30 int32 Write(NPStream* stream, int32 offset, int32 len, void* buffer);
31 NPError DestroyStream(NPStream* stream, NPReason reason);
32 void UrlNotify(const char* url, NPReason reason, void* notify_data);
33 void UrlRedirectNotify(const char* url, int status, void* notify_data);
34
35 private:
36 // PluginUrlRequestManager implementation. Called from AutomationClient.
37 virtual PluginUrlRequestManager::ThreadSafeFlags GetThreadSafeFlags();
38 virtual void StartRequest(int request_id,
39 const AutomationURLRequest& request_info);
40 virtual void ReadRequest(int request_id, int bytes_to_read);
41 virtual void EndRequest(int request_id);
42 virtual void DownloadRequestInHost(int request_id) {
43 // Not yet implemented.
44 }
45 virtual void StopAll();
46 virtual void SetCookiesForUrl(const GURL& url, const std::string& cookie);
47 virtual void GetCookiesForUrl(const GURL& url, int cookie_id);
48
49 // Outstanding requests map.
50 typedef std::map<int, scoped_refptr<NPAPIUrlRequest> > RequestMap;
51 RequestMap request_map_;
52
53 scoped_refptr<NPAPIUrlRequest> LookupRequest(int request_id);
54
55 // PluginUrlRequestDelegate implementation. Forwards back to delegate.
56 virtual void OnResponseStarted(int request_id, const char* mime_type,
57 const char* headers, int size, base::Time last_modified,
58 const std::string& redirect_url, int redirect_status,
59 const net::HostPortPair& socket_address);
60 virtual void OnReadComplete(int request_id, const std::string& data);
61 virtual void OnResponseEnd(int request_id,
62 const net::URLRequestStatus& status);
63 virtual void OnCookiesRetrieved(bool success, const GURL& url,
64 const std::string& cookie_string, int cookie_id);
65
66 static inline NPAPIUrlRequest* RequestFromNotifyData(void* notify_data) {
67 return reinterpret_cast<NPAPIUrlRequest*>(notify_data);
68 }
69
70 NPP instance_;
71 };
72
73 #endif // CHROME_FRAME_NPAPI_URL_REQUEST_H_
OLDNEW
« no previous file with comments | « chrome_frame/np_utils.cc ('k') | chrome_frame/npapi_url_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698