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

Side by Side Diff: content/child/npapi/webplugin_delegate_impl.h

Issue 23503043: Load NPAPI plugin resources through the browser process directly instead of going through the render (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: plumb RenderView's routing IDs Created 7 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ 5 #ifndef CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_
6 #define CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ 6 #define CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 23 matching lines...) Expand all
34 #ifdef __OBJC__ 34 #ifdef __OBJC__
35 @class CALayer; 35 @class CALayer;
36 @class CARenderer; 36 @class CARenderer;
37 #else 37 #else
38 class CALayer; 38 class CALayer;
39 class CARenderer; 39 class CARenderer;
40 #endif 40 #endif
41 #endif 41 #endif
42 42
43 namespace content { 43 namespace content {
44
45 class PluginInstance; 44 class PluginInstance;
45 class WebPlugin;
46 46
47 #if defined(OS_MACOSX) 47 #if defined(OS_MACOSX)
48 class WebPluginAcceleratedSurface; 48 class WebPluginAcceleratedSurface;
49 class ExternalDragTracker; 49 class ExternalDragTracker;
50 #endif // OS_MACOSX 50 #endif // OS_MACOSX
51 51
52 #if defined(OS_WIN) 52 #if defined(OS_WIN)
53 class WebPluginIMEWin; 53 class WebPluginIMEWin;
54 #endif // OS_WIN 54 #endif // OS_WIN
55 55
(...skipping 14 matching lines...) Expand all
70 PLUGIN_QUIRK_WINDOWLESS_INVALIDATE_AFTER_SET_WINDOW = 512, // Linux 70 PLUGIN_QUIRK_WINDOWLESS_INVALIDATE_AFTER_SET_WINDOW = 512, // Linux
71 PLUGIN_QUIRK_NO_WINDOWLESS = 1024, // Windows 71 PLUGIN_QUIRK_NO_WINDOWLESS = 1024, // Windows
72 PLUGIN_QUIRK_PATCH_REGENUMKEYEXW = 2048, // Windows 72 PLUGIN_QUIRK_PATCH_REGENUMKEYEXW = 2048, // Windows
73 PLUGIN_QUIRK_ALWAYS_NOTIFY_SUCCESS = 4096, // Windows 73 PLUGIN_QUIRK_ALWAYS_NOTIFY_SUCCESS = 4096, // Windows
74 PLUGIN_QUIRK_HANDLE_MOUSE_CAPTURE = 16384, // Windows 74 PLUGIN_QUIRK_HANDLE_MOUSE_CAPTURE = 16384, // Windows
75 PLUGIN_QUIRK_WINDOWLESS_NO_RIGHT_CLICK = 32768, // Linux 75 PLUGIN_QUIRK_WINDOWLESS_NO_RIGHT_CLICK = 32768, // Linux
76 PLUGIN_QUIRK_IGNORE_FIRST_SETWINDOW_CALL = 65536, // Windows. 76 PLUGIN_QUIRK_IGNORE_FIRST_SETWINDOW_CALL = 65536, // Windows.
77 PLUGIN_QUIRK_EMULATE_IME = 131072, // Windows. 77 PLUGIN_QUIRK_EMULATE_IME = 131072, // Windows.
78 }; 78 };
79 79
80 static WebPluginDelegateImpl* Create(const base::FilePath& filename, 80 static WebPluginDelegateImpl* Create(WebPlugin* plugin,
81 const base::FilePath& filename,
81 const std::string& mime_type); 82 const std::string& mime_type);
82 83
83 // WebPluginDelegate implementation 84 // WebPluginDelegate implementation
84 virtual bool Initialize(const GURL& url, 85 virtual bool Initialize(const GURL& url,
85 const std::vector<std::string>& arg_names, 86 const std::vector<std::string>& arg_names,
86 const std::vector<std::string>& arg_values, 87 const std::vector<std::string>& arg_values,
87 WebPlugin* plugin,
88 bool load_manually) OVERRIDE; 88 bool load_manually) OVERRIDE;
89 virtual void PluginDestroyed() OVERRIDE; 89 virtual void PluginDestroyed() OVERRIDE;
90 virtual void UpdateGeometry(const gfx::Rect& window_rect, 90 virtual void UpdateGeometry(const gfx::Rect& window_rect,
91 const gfx::Rect& clip_rect) OVERRIDE; 91 const gfx::Rect& clip_rect) OVERRIDE;
92 virtual void Paint(SkCanvas* canvas, const gfx::Rect& rect) OVERRIDE; 92 virtual void Paint(SkCanvas* canvas, const gfx::Rect& rect) OVERRIDE;
93 virtual void SetFocus(bool focused) OVERRIDE; 93 virtual void SetFocus(bool focused) OVERRIDE;
94 virtual bool HandleInputEvent(const WebKit::WebInputEvent& event, 94 virtual bool HandleInputEvent(const WebKit::WebInputEvent& event,
95 WebCursor::CursorInfo* cursor_info) OVERRIDE; 95 WebCursor::CursorInfo* cursor_info) OVERRIDE;
96 virtual NPObject* GetPluginScriptableObject() OVERRIDE; 96 virtual NPObject* GetPluginScriptableObject() OVERRIDE;
97 virtual NPP GetPluginNPP() OVERRIDE; 97 virtual NPP GetPluginNPP() OVERRIDE;
(...skipping 11 matching lines...) Expand all
109 const std::string& headers, 109 const std::string& headers,
110 uint32 expected_length, 110 uint32 expected_length,
111 uint32 last_modified) OVERRIDE; 111 uint32 last_modified) OVERRIDE;
112 virtual void DidReceiveManualData(const char* buffer, int length) OVERRIDE; 112 virtual void DidReceiveManualData(const char* buffer, int length) OVERRIDE;
113 virtual void DidFinishManualLoading() OVERRIDE; 113 virtual void DidFinishManualLoading() OVERRIDE;
114 virtual void DidManualLoadFail() OVERRIDE; 114 virtual void DidManualLoadFail() OVERRIDE;
115 virtual WebPluginResourceClient* CreateResourceClient( 115 virtual WebPluginResourceClient* CreateResourceClient(
116 unsigned long resource_id, const GURL& url, int notify_id) OVERRIDE; 116 unsigned long resource_id, const GURL& url, int notify_id) OVERRIDE;
117 virtual WebPluginResourceClient* CreateSeekableResourceClient( 117 virtual WebPluginResourceClient* CreateSeekableResourceClient(
118 unsigned long resource_id, int range_request_id) OVERRIDE; 118 unsigned long resource_id, int range_request_id) OVERRIDE;
119 virtual void FetchURL(unsigned long resource_id,
120 int notify_id,
121 const GURL& url,
122 const GURL& first_party_for_cookies,
123 const std::string& method,
124 const std::string& post_data,
125 const GURL& referrer,
126 bool notify_redirects,
127 bool is_plugin_src_load) OVERRIDE;
119 // End of WebPluginDelegate implementation. 128 // End of WebPluginDelegate implementation.
120 129
121 gfx::PluginWindowHandle windowed_handle() const { return windowed_handle_; } 130 gfx::PluginWindowHandle windowed_handle() const { return windowed_handle_; }
122 bool IsWindowless() const { return windowless_; } 131 bool IsWindowless() const { return windowless_; }
123 PluginInstance* instance() { return instance_.get(); } 132 PluginInstance* instance() { return instance_.get(); }
124 gfx::Rect GetRect() const { return window_rect_; } 133 gfx::Rect GetRect() const { return window_rect_; }
125 gfx::Rect GetClipRect() const { return clip_rect_; } 134 gfx::Rect GetClipRect() const { return clip_rect_; }
126 135
127 // Returns the path for the library implementing this plugin. 136 // Returns the path for the library implementing this plugin.
128 base::FilePath GetPluginPath(); 137 base::FilePath GetPluginPath();
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 #if defined(USE_X11) 195 #if defined(USE_X11)
187 void SetWindowlessShmPixmap(XID shm_pixmap) { 196 void SetWindowlessShmPixmap(XID shm_pixmap) {
188 windowless_shm_pixmap_ = shm_pixmap; 197 windowless_shm_pixmap_ = shm_pixmap;
189 } 198 }
190 #endif 199 #endif
191 200
192 private: 201 private:
193 friend class base::DeleteHelper<WebPluginDelegateImpl>; 202 friend class base::DeleteHelper<WebPluginDelegateImpl>;
194 friend class WebPluginDelegate; 203 friend class WebPluginDelegate;
195 204
196 explicit WebPluginDelegateImpl(PluginInstance* instance); 205 WebPluginDelegateImpl(WebPlugin* plugin, PluginInstance* instance);
197 virtual ~WebPluginDelegateImpl(); 206 virtual ~WebPluginDelegateImpl();
198 207
199 // Called by Initialize() for platform-specific initialization. 208 // Called by Initialize() for platform-specific initialization.
200 // If this returns false, the plugin shouldn't be started--see Initialize(). 209 // If this returns false, the plugin shouldn't be started--see Initialize().
201 bool PlatformInitialize(); 210 bool PlatformInitialize();
202 211
203 // Called by DestroyInstance(), used for platform-specific destruction. 212 // Called by DestroyInstance(), used for platform-specific destruction.
204 void PlatformDestroyInstance(); 213 void PlatformDestroyInstance();
205 214
206 //-------------------------- 215 //--------------------------
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 488
480 // True if NPP_New did not return an error. 489 // True if NPP_New did not return an error.
481 bool creation_succeeded_; 490 bool creation_succeeded_;
482 491
483 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); 492 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl);
484 }; 493 };
485 494
486 } // namespace content 495 } // namespace content
487 496
488 #endif // CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ 497 #endif // CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698