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

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

Issue 285333003: Support exposing Mojo services between render frames, render threads, and their respective hosts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 6 years, 6 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 (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_RENDER_THREAD_IMPL_H_ 5 #ifndef CONTENT_RENDERER_RENDER_THREAD_IMPL_H_
6 #define CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ 6 #define CONTENT_RENDERER_RENDER_THREAD_IMPL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 virtual void SetIdleNotificationDelayInMs( 158 virtual void SetIdleNotificationDelayInMs(
159 int64 idle_notification_delay_in_ms) OVERRIDE; 159 int64 idle_notification_delay_in_ms) OVERRIDE;
160 virtual void UpdateHistograms(int sequence_number) OVERRIDE; 160 virtual void UpdateHistograms(int sequence_number) OVERRIDE;
161 virtual int PostTaskToAllWebWorkers(const base::Closure& closure) OVERRIDE; 161 virtual int PostTaskToAllWebWorkers(const base::Closure& closure) OVERRIDE;
162 virtual bool ResolveProxy(const GURL& url, std::string* proxy_list) OVERRIDE; 162 virtual bool ResolveProxy(const GURL& url, std::string* proxy_list) OVERRIDE;
163 virtual base::WaitableEvent* GetShutdownEvent() OVERRIDE; 163 virtual base::WaitableEvent* GetShutdownEvent() OVERRIDE;
164 #if defined(OS_WIN) 164 #if defined(OS_WIN)
165 virtual void PreCacheFont(const LOGFONT& log_font) OVERRIDE; 165 virtual void PreCacheFont(const LOGFONT& log_font) OVERRIDE;
166 virtual void ReleaseCachedFonts() OVERRIDE; 166 virtual void ReleaseCachedFonts() OVERRIDE;
167 #endif 167 #endif
168 virtual ServiceRegistry* GetServiceRegistry() OVERRIDE;
168 169
169 // Synchronously establish a channel to the GPU plugin if not previously 170 // Synchronously establish a channel to the GPU plugin if not previously
170 // established or if it has been lost (for example if the GPU plugin crashed). 171 // established or if it has been lost (for example if the GPU plugin crashed).
171 // If there is a pending asynchronous request, it will be completed by the 172 // If there is a pending asynchronous request, it will be completed by the
172 // time this routine returns. 173 // time this routine returns.
173 GpuChannelHost* EstablishGpuChannelSync(CauseForGpuLaunch); 174 GpuChannelHost* EstablishGpuChannelSync(CauseForGpuLaunch);
174 175
175 176
176 // These methods modify how the next message is sent. Normally, when sending 177 // These methods modify how the next message is sent. Normally, when sending
177 // a synchronous message that runs a nested message loop, we need to suspend 178 // a synchronous message that runs a nested message loop, we need to suspend
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 // Called by a RenderWidget when it is created or destroyed. This 388 // Called by a RenderWidget when it is created or destroyed. This
388 // allows the process to know when there are no visible widgets. 389 // allows the process to know when there are no visible widgets.
389 void WidgetCreated(); 390 void WidgetCreated();
390 void WidgetDestroyed(); 391 void WidgetDestroyed();
391 void WidgetHidden(); 392 void WidgetHidden();
392 void WidgetRestored(); 393 void WidgetRestored();
393 394
394 void AddEmbeddedWorkerRoute(int32 routing_id, IPC::Listener* listener); 395 void AddEmbeddedWorkerRoute(int32 routing_id, IPC::Listener* listener);
395 void RemoveEmbeddedWorkerRoute(int32 routing_id); 396 void RemoveEmbeddedWorkerRoute(int32 routing_id);
396 397
398 void RegisterPendingRenderFrameConnect(int routing_id,
399 mojo::ScopedMessagePipeHandle handle);
400
397 private: 401 private:
398 // ChildThread 402 // ChildThread
399 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; 403 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE;
400 404
401 // GpuChannelHostFactory implementation: 405 // GpuChannelHostFactory implementation:
402 virtual bool IsMainThread() OVERRIDE; 406 virtual bool IsMainThread() OVERRIDE;
403 virtual base::MessageLoop* GetMainLoop() OVERRIDE; 407 virtual base::MessageLoop* GetMainLoop() OVERRIDE;
404 virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() OVERRIDE; 408 virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() OVERRIDE;
405 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory( 409 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory(
406 size_t size) OVERRIDE; 410 size_t size) OVERRIDE;
407 virtual bool CreateViewCommandBuffer( 411 virtual bool CreateViewCommandBuffer(
408 int32 surface_id, 412 int32 surface_id,
409 const GPUCreateCommandBufferConfig& init_params, 413 const GPUCreateCommandBufferConfig& init_params,
410 int32 route_id) OVERRIDE; 414 int32 route_id) OVERRIDE;
411 virtual void CreateImage( 415 virtual void CreateImage(
412 gfx::PluginWindowHandle window, 416 gfx::PluginWindowHandle window,
413 int32 image_id, 417 int32 image_id,
414 const CreateImageCallback& callback) OVERRIDE; 418 const CreateImageCallback& callback) OVERRIDE;
415 virtual void DeleteImage(int32 image_id, int32 sync_point) OVERRIDE; 419 virtual void DeleteImage(int32 image_id, int32 sync_point) OVERRIDE;
416 virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( 420 virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer(
417 size_t width, 421 size_t width,
418 size_t height, 422 size_t height,
419 unsigned internalformat, 423 unsigned internalformat,
420 unsigned usage) OVERRIDE; 424 unsigned usage) OVERRIDE;
421 425
422 // mojo::ServiceProvider implementation:
423 virtual void ConnectToService(
424 const mojo::String& service_url,
425 const mojo::String& service_name,
426 mojo::ScopedMessagePipeHandle message_pipe,
427 const mojo::String& requestor_url) OVERRIDE;
428
429 void Init(); 426 void Init();
430 427
431 void OnSetZoomLevelForCurrentURL(const std::string& scheme, 428 void OnSetZoomLevelForCurrentURL(const std::string& scheme,
432 const std::string& host, 429 const std::string& host,
433 double zoom_level); 430 double zoom_level);
434 void OnCreateNewView(const ViewMsg_New_Params& params); 431 void OnCreateNewView(const ViewMsg_New_Params& params);
435 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id); 432 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id);
436 void OnPurgePluginListCache(bool reload_pages); 433 void OnPurgePluginListCache(bool reload_pages);
437 void OnNetworkTypeChanged(net::NetworkChangeNotifier::ConnectionType type); 434 void OnNetworkTypeChanged(net::NetworkChangeNotifier::ConnectionType type);
438 void OnGetAccessibilityTree(); 435 void OnGetAccessibilityTree();
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 // Compositor settings 558 // Compositor settings
562 bool is_gpu_rasterization_enabled_; 559 bool is_gpu_rasterization_enabled_;
563 bool is_gpu_rasterization_forced_; 560 bool is_gpu_rasterization_forced_;
564 bool is_impl_side_painting_enabled_; 561 bool is_impl_side_painting_enabled_;
565 bool is_low_res_tiling_enabled_; 562 bool is_low_res_tiling_enabled_;
566 bool is_lcd_text_enabled_; 563 bool is_lcd_text_enabled_;
567 bool is_distance_field_text_enabled_; 564 bool is_distance_field_text_enabled_;
568 bool is_zero_copy_enabled_; 565 bool is_zero_copy_enabled_;
569 bool is_one_copy_enabled_; 566 bool is_one_copy_enabled_;
570 567
568 std::map<int, mojo::MessagePipeHandle> pending_render_frame_connects_;
569
571 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); 570 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl);
572 }; 571 };
573 572
574 } // namespace content 573 } // namespace content
575 574
576 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ 575 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698