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

Side by Side Diff: chrome/renderer/render_thread.h

Issue 3210007: Add support for a "split" incognito behavior for extensions. (Closed)
Patch Set: latest Created 10 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
« no previous file with comments | « chrome/renderer/mock_render_thread.h ('k') | chrome/renderer/render_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_RENDERER_RENDER_THREAD_H_ 5 #ifndef CHROME_RENDERER_RENDER_THREAD_H_
6 #define CHROME_RENDERER_RENDER_THREAD_H_ 6 #define CHROME_RENDERER_RENDER_THREAD_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 virtual void AddFilter(IPC::ChannelProxy::MessageFilter* filter) = 0; 103 virtual void AddFilter(IPC::ChannelProxy::MessageFilter* filter) = 0;
104 virtual void RemoveFilter(IPC::ChannelProxy::MessageFilter* filter) = 0; 104 virtual void RemoveFilter(IPC::ChannelProxy::MessageFilter* filter) = 0;
105 105
106 // Called by a RenderWidget when it is hidden or restored. 106 // Called by a RenderWidget when it is hidden or restored.
107 virtual void WidgetHidden() = 0; 107 virtual void WidgetHidden() = 0;
108 virtual void WidgetRestored() = 0; 108 virtual void WidgetRestored() = 0;
109 109
110 // True if this process should be treated as an extension process. 110 // True if this process should be treated as an extension process.
111 virtual bool IsExtensionProcess() const = 0; 111 virtual bool IsExtensionProcess() const = 0;
112
113 // True if this process is running in an incognito profile.
114 virtual bool IsIncognitoProcess() const = 0;
112 }; 115 };
113 116
114 // The RenderThread class represents a background thread where RenderView 117 // The RenderThread class represents a background thread where RenderView
115 // instances live. The RenderThread supports an API that is used by its 118 // instances live. The RenderThread supports an API that is used by its
116 // consumer to talk indirectly to the RenderViews and supporting objects. 119 // consumer to talk indirectly to the RenderViews and supporting objects.
117 // Likewise, it provides an API for the RenderViews to talk back to the main 120 // Likewise, it provides an API for the RenderViews to talk back to the main
118 // process (i.e., their corresponding TabContents). 121 // process (i.e., their corresponding TabContents).
119 // 122 //
120 // Most of the communication occurs in the form of IPC messages. They are 123 // Most of the communication occurs in the form of IPC messages. They are
121 // routed to the RenderThread according to the routing IDs of the messages. 124 // routed to the RenderThread according to the routing IDs of the messages.
(...skipping 20 matching lines...) Expand all
142 static int32 RoutingIDForCurrentContext(); 145 static int32 RoutingIDForCurrentContext();
143 146
144 // Overridden from RenderThreadBase. 147 // Overridden from RenderThreadBase.
145 virtual bool Send(IPC::Message* msg); 148 virtual bool Send(IPC::Message* msg);
146 virtual void AddRoute(int32 routing_id, IPC::Channel::Listener* listener); 149 virtual void AddRoute(int32 routing_id, IPC::Channel::Listener* listener);
147 virtual void RemoveRoute(int32 routing_id); 150 virtual void RemoveRoute(int32 routing_id);
148 virtual void AddFilter(IPC::ChannelProxy::MessageFilter* filter); 151 virtual void AddFilter(IPC::ChannelProxy::MessageFilter* filter);
149 virtual void RemoveFilter(IPC::ChannelProxy::MessageFilter* filter); 152 virtual void RemoveFilter(IPC::ChannelProxy::MessageFilter* filter);
150 virtual void WidgetHidden(); 153 virtual void WidgetHidden();
151 virtual void WidgetRestored(); 154 virtual void WidgetRestored();
155 virtual bool IsExtensionProcess() const { return is_extension_process_; }
156 virtual bool IsIncognitoProcess() const { return is_incognito_process_; }
152 157
153 // These methods modify how the next message is sent. Normally, when sending 158 // These methods modify how the next message is sent. Normally, when sending
154 // a synchronous message that runs a nested message loop, we need to suspend 159 // a synchronous message that runs a nested message loop, we need to suspend
155 // callbacks into WebKit. This involves disabling timers and deferring 160 // callbacks into WebKit. This involves disabling timers and deferring
156 // resource loads. However, there are exceptions when we need to customize 161 // resource loads. However, there are exceptions when we need to customize
157 // the behavior. 162 // the behavior.
158 void DoNotSuspendWebKitSharedTimer(); 163 void DoNotSuspendWebKitSharedTimer();
159 void DoNotNotifyWebKitOfModalLoop(); 164 void DoNotNotifyWebKitOfModalLoop();
160 165
161 VisitedLinkSlave* visited_link_slave() const { 166 VisitedLinkSlave* visited_link_slave() const {
(...skipping 11 matching lines...) Expand all
173 IndexedDBDispatcher* indexed_db_dispatcher() const { 178 IndexedDBDispatcher* indexed_db_dispatcher() const {
174 return indexed_db_dispatcher_.get(); 179 return indexed_db_dispatcher_.get();
175 } 180 }
176 181
177 SpellCheck* spellchecker() const { 182 SpellCheck* spellchecker() const {
178 return spellchecker_.get(); 183 return spellchecker_.get();
179 } 184 }
180 185
181 bool plugin_refresh_allowed() const { return plugin_refresh_allowed_; } 186 bool plugin_refresh_allowed() const { return plugin_refresh_allowed_; }
182 187
183 virtual bool IsExtensionProcess() const { return is_extension_process_; }
184
185 bool is_incognito_process() const { return is_incognito_process_; }
186
187 // Do DNS prefetch resolution of a hostname. 188 // Do DNS prefetch resolution of a hostname.
188 void Resolve(const char* name, size_t length); 189 void Resolve(const char* name, size_t length);
189 190
190 // Send all the Histogram data to browser. 191 // Send all the Histogram data to browser.
191 void SendHistograms(int sequence_number); 192 void SendHistograms(int sequence_number);
192 193
193 // Invokes InformHostOfCacheStats after a short delay. Used to move this 194 // Invokes InformHostOfCacheStats after a short delay. Used to move this
194 // bookkeeping operation off the critical latency path. 195 // bookkeeping operation off the critical latency path.
195 void InformHostOfCacheStatsLater(); 196 void InformHostOfCacheStatsLater();
196 197
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 const std::vector<std::string>& page_actions); 249 const std::vector<std::string>& page_actions);
249 void OnDOMStorageEvent(const ViewMsg_DOMStorageEvent_Params& params); 250 void OnDOMStorageEvent(const ViewMsg_DOMStorageEvent_Params& params);
250 void OnExtensionSetAPIPermissions( 251 void OnExtensionSetAPIPermissions(
251 const std::string& extension_id, 252 const std::string& extension_id,
252 const std::vector<std::string>& permissions); 253 const std::vector<std::string>& permissions);
253 void OnExtensionSetHostPermissions( 254 void OnExtensionSetHostPermissions(
254 const GURL& extension_url, 255 const GURL& extension_url,
255 const std::vector<URLPattern>& permissions); 256 const std::vector<URLPattern>& permissions);
256 void OnExtensionSetIncognitoEnabled( 257 void OnExtensionSetIncognitoEnabled(
257 const std::string& extension_id, 258 const std::string& extension_id,
258 bool enabled); 259 bool enabled,
260 bool incognito_split_mode);
259 void OnSetNextPageID(int32 next_page_id); 261 void OnSetNextPageID(int32 next_page_id);
260 void OnSetIsIncognitoProcess(bool is_incognito_process); 262 void OnSetIsIncognitoProcess(bool is_incognito_process);
261 void OnSetCSSColors(const std::vector<CSSColors::CSSColorMapping>& colors); 263 void OnSetCSSColors(const std::vector<CSSColors::CSSColorMapping>& colors);
262 void OnCreateNewView(const ViewMsg_New_Params& params); 264 void OnCreateNewView(const ViewMsg_New_Params& params);
263 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id); 265 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id);
264 void OnSetCacheCapacities(size_t min_dead_capacity, 266 void OnSetCacheCapacities(size_t min_dead_capacity,
265 size_t max_dead_capacity, 267 size_t max_dead_capacity,
266 size_t capacity); 268 size_t capacity);
267 void OnGetCacheResourceStats(); 269 void OnGetCacheResourceStats();
268 270
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 // The channel from the renderer process to the GPU process. 364 // The channel from the renderer process to the GPU process.
363 scoped_refptr<GpuChannelHost> gpu_channel_; 365 scoped_refptr<GpuChannelHost> gpu_channel_;
364 366
365 // A lazily initiated thread on which file operations are run. 367 // A lazily initiated thread on which file operations are run.
366 scoped_ptr<base::Thread> file_thread_; 368 scoped_ptr<base::Thread> file_thread_;
367 369
368 DISALLOW_COPY_AND_ASSIGN(RenderThread); 370 DISALLOW_COPY_AND_ASSIGN(RenderThread);
369 }; 371 };
370 372
371 #endif // CHROME_RENDERER_RENDER_THREAD_H_ 373 #endif // CHROME_RENDERER_RENDER_THREAD_H_
OLDNEW
« no previous file with comments | « chrome/renderer/mock_render_thread.h ('k') | chrome/renderer/render_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698