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

Side by Side Diff: content/renderer/browser_plugin/browser_plugin.h

Issue 10965017: Browser Plugin: Implement getProcessId (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed Nits Created 8 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_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ 5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_
6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_
7 7
8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h"
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 17 matching lines...) Expand all
28 public: 28 public:
29 // Called only by tests to clean up before we blow away the MockRenderProcess. 29 // Called only by tests to clean up before we blow away the MockRenderProcess.
30 void Cleanup(); 30 void Cleanup();
31 31
32 // Get the src attribute value of the BrowserPlugin instance if the guest 32 // Get the src attribute value of the BrowserPlugin instance if the guest
33 // has not crashed. 33 // has not crashed.
34 std::string GetSrcAttribute() const; 34 std::string GetSrcAttribute() const;
35 // Set the src attribute value of the BrowserPlugin instance and reset 35 // Set the src attribute value of the BrowserPlugin instance and reset
36 // the guest_crashed_ flag. 36 // the guest_crashed_ flag.
37 void SetSrcAttribute(const std::string& src); 37 void SetSrcAttribute(const std::string& src);
38 // Returns the process ID of the current guest.
Charlie Reis 2012/09/21 00:24:06 nit: Chrome's process ID. (Just want to distinguis
Fady Samuel 2012/09/21 14:48:46 Done.
39 int process_id() const { return process_id_; }
38 40
39 // Inform the BrowserPlugin to update its backing store with the pixels in 41 // Inform the BrowserPlugin to update its backing store with the pixels in
40 // its damage buffer. 42 // its damage buffer.
41 void UpdateRect(int message_id, 43 void UpdateRect(int message_id,
42 const BrowserPluginMsg_UpdateRect_Params& params); 44 const BrowserPluginMsg_UpdateRect_Params& params);
43 // Inform the BrowserPlugin that its guest has crashed. 45 // Inform the BrowserPlugin that its guest has crashed.
44 void GuestCrashed(); 46 void GuestCrashed();
45 // Informs the BrowserPlugin that the guest has navigated to a new URL. 47 // Informs the BrowserPlugin that the guest has navigated to a new URL.
46 void DidNavigate(const GURL& url); 48 void DidNavigate(const GURL& url, int process_id);
47 // Tells the BrowserPlugin to advance the focus to the next (or previous) 49 // Tells the BrowserPlugin to advance the focus to the next (or previous)
48 // element. 50 // element.
49 void AdvanceFocus(bool reverse); 51 void AdvanceFocus(bool reverse);
50 52
51 // Indicates whether there are any Javascript listeners attached to a 53 // Indicates whether there are any Javascript listeners attached to a
52 // provided event_name. 54 // provided event_name.
53 bool HasListeners(const std::string& event_name); 55 bool HasListeners(const std::string& event_name);
54 // Add a custom event listener to this BrowserPlugin instance. 56 // Add a custom event listener to this BrowserPlugin instance.
55 bool AddEventListener(const std::string& event_name, 57 bool AddEventListener(const std::string& event_name,
56 v8::Local<v8::Function> function); 58 v8::Local<v8::Function> function);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 TransportDIB* damage_buffer_; 138 TransportDIB* damage_buffer_;
137 gfx::Rect plugin_rect_; 139 gfx::Rect plugin_rect_;
138 // Bitmap for crashed plugin. Lazily initialized, non-owning pointer. 140 // Bitmap for crashed plugin. Lazily initialized, non-owning pointer.
139 SkBitmap* sad_guest_; 141 SkBitmap* sad_guest_;
140 bool guest_crashed_; 142 bool guest_crashed_;
141 bool resize_pending_; 143 bool resize_pending_;
142 // True if we have ever sent a NavigateGuest message to the embedder. 144 // True if we have ever sent a NavigateGuest message to the embedder.
143 bool navigate_src_sent_; 145 bool navigate_src_sent_;
144 int64 parent_frame_; 146 int64 parent_frame_;
145 std::string src_; 147 std::string src_;
148 int process_id_;
146 typedef std::vector<v8::Persistent<v8::Function> > EventListeners; 149 typedef std::vector<v8::Persistent<v8::Function> > EventListeners;
147 typedef std::map<std::string, EventListeners> EventListenerMap; 150 typedef std::map<std::string, EventListeners> EventListenerMap;
148 EventListenerMap event_listener_map_; 151 EventListenerMap event_listener_map_;
149 #if defined(OS_WIN) 152 #if defined(OS_WIN)
150 base::SharedMemory shared_memory_; 153 base::SharedMemory shared_memory_;
151 #endif 154 #endif
152 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); 155 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin);
153 }; 156 };
154 157
155 } // namespace content 158 } // namespace content
156 159
157 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ 160 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698