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

Side by Side Diff: chrome/browser/guestview/guestview.h

Issue 23514016: <webview>: Cleanup WebRequest event listeners when embedder destroyed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More fixes 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 CHROME_BROWSER_GUESTVIEW_GUESTVIEW_H_ 5 #ifndef CHROME_BROWSER_GUESTVIEW_GUESTVIEW_H_
6 #define CHROME_BROWSER_GUESTVIEW_GUESTVIEW_H_ 6 #define CHROME_BROWSER_GUESTVIEW_GUESTVIEW_H_
7 7
8 #include <queue> 8 #include <queue>
9 9
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 // Returns the extension ID of the embedder. 79 // Returns the extension ID of the embedder.
80 const std::string& extension_id() const { return extension_id_; } 80 const std::string& extension_id() const { return extension_id_; }
81 81
82 // Returns the user browser context of the embedder. 82 // Returns the user browser context of the embedder.
83 content::BrowserContext* browser_context() const { return browser_context_; } 83 content::BrowserContext* browser_context() const { return browser_context_; }
84 84
85 // Returns the embedder's process ID. 85 // Returns the embedder's process ID.
86 int embedder_render_process_id() const { return embedder_render_process_id_; } 86 int embedder_render_process_id() const { return embedder_render_process_id_; }
87 87
88 // Returns the embedder's routing ID.
89 int embedder_routing_id() const { return embedder_routing_id_; }
90
91 protected: 88 protected:
92 virtual ~GuestView(); 89 virtual ~GuestView();
93 90
94 // Dispatches an event |event_name| to the embedder with the |event| fields. 91 // Dispatches an event |event_name| to the embedder with the |event| fields.
95 void DispatchEvent(Event* event); 92 void DispatchEvent(Event* event);
96 93
97 private: 94 private:
98 void SendQueuedEvents(); 95 void SendQueuedEvents();
99 96
100 content::WebContents* guest_web_contents_; 97 content::WebContents* guest_web_contents_;
101 content::WebContents* embedder_web_contents_; 98 content::WebContents* embedder_web_contents_;
102 std::string extension_id_; 99 std::string extension_id_;
103 int embedder_render_process_id_; 100 int embedder_render_process_id_;
104 int embedder_routing_id_;
105 content::BrowserContext* browser_context_; 101 content::BrowserContext* browser_context_;
106 // |guest_instance_id_| is a profile-wide unique identifier for a guest 102 // |guest_instance_id_| is a profile-wide unique identifier for a guest
107 // WebContents. 103 // WebContents.
108 const int guest_instance_id_; 104 const int guest_instance_id_;
109 // |view_instance_id_| is an identifier that's unique within a particular 105 // |view_instance_id_| is an identifier that's unique within a particular
110 // embedder RenderViewHost for a particular <*view> instance. 106 // embedder RenderViewHost for a particular <*view> instance.
111 int view_instance_id_; 107 int view_instance_id_;
112 108
113 // This is a queue of Events that are destined to be sent to the embedder once 109 // This is a queue of Events that are destined to be sent to the embedder once
114 // the guest is attached to a particular embedder. 110 // the guest is attached to a particular embedder.
115 std::queue<Event*> pending_events_; 111 std::queue<Event*> pending_events_;
116 112
117 DISALLOW_COPY_AND_ASSIGN(GuestView); 113 DISALLOW_COPY_AND_ASSIGN(GuestView);
118 }; 114 };
119 115
120 #endif // CHROME_BROWSER_GUESTVIEW_GUESTVIEW_H_ 116 #endif // CHROME_BROWSER_GUESTVIEW_GUESTVIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698