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

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

Issue 23694031: Fix race conditions in window snapshot code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporated enne and jbauman's feedback. 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_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>
11 11
12 #include "base/memory/memory_pressure_listener.h" 12 #include "base/memory/memory_pressure_listener.h"
13 #include "base/observer_list.h" 13 #include "base/observer_list.h"
14 #include "base/process/process_handle.h"
14 #include "base/strings/string16.h" 15 #include "base/strings/string16.h"
15 #include "base/timer/timer.h" 16 #include "base/timer/timer.h"
16 #include "build/build_config.h" 17 #include "build/build_config.h"
17 #include "content/child/child_thread.h" 18 #include "content/child/child_thread.h"
18 #include "content/common/content_export.h" 19 #include "content/common/content_export.h"
19 #include "content/common/gpu/client/gpu_channel_host.h" 20 #include "content/common/gpu/client/gpu_channel_host.h"
20 #include "content/common/gpu/gpu_process_launch_causes.h" 21 #include "content/common/gpu/gpu_process_launch_causes.h"
21 #include "content/public/renderer/render_thread.h" 22 #include "content/public/renderer/render_thread.h"
22 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h" 23 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h"
23 #include "ipc/ipc_channel_proxy.h" 24 #include "ipc/ipc_channel_proxy.h"
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 HistogramCustomizer* histogram_customizer() { 342 HistogramCustomizer* histogram_customizer() {
342 return &histogram_customizer_; 343 return &histogram_customizer_;
343 } 344 }
344 345
345 void SetFlingCurveParameters(const std::vector<float>& new_touchpad, 346 void SetFlingCurveParameters(const std::vector<float>& new_touchpad,
346 const std::vector<float>& new_touchscreen); 347 const std::vector<float>& new_touchscreen);
347 348
348 // Retrieve current gamepad data. 349 // Retrieve current gamepad data.
349 void SampleGamepads(WebKit::WebGamepads* data); 350 void SampleGamepads(WebKit::WebGamepads* data);
350 351
352 // Get the browser process's notion of the renderer process's ID.
353 // This is the first argument to RenderWidgetHost::FromID. Ideally
354 // this would be available on all platforms via base::Process.
355 base::ProcessId renderer_process_id() const;
356
351 private: 357 private:
352 // ChildThread 358 // ChildThread
353 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; 359 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE;
354 360
355 // GpuChannelHostFactory implementation: 361 // GpuChannelHostFactory implementation:
356 virtual bool IsMainThread() OVERRIDE; 362 virtual bool IsMainThread() OVERRIDE;
357 virtual base::MessageLoop* GetMainLoop() OVERRIDE; 363 virtual base::MessageLoop* GetMainLoop() OVERRIDE;
358 virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() OVERRIDE; 364 virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() OVERRIDE;
359 virtual base::WaitableEvent* GetShutDownEvent() OVERRIDE; 365 virtual base::WaitableEvent* GetShutDownEvent() OVERRIDE;
360 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory( 366 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory(
(...skipping 11 matching lines...) Expand all
372 378
373 void OnSetZoomLevelForCurrentURL(const std::string& scheme, 379 void OnSetZoomLevelForCurrentURL(const std::string& scheme,
374 const std::string& host, 380 const std::string& host,
375 double zoom_level); 381 double zoom_level);
376 void OnCreateNewView(const ViewMsg_New_Params& params); 382 void OnCreateNewView(const ViewMsg_New_Params& params);
377 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id); 383 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id);
378 void OnPurgePluginListCache(bool reload_pages); 384 void OnPurgePluginListCache(bool reload_pages);
379 void OnNetworkStateChanged(bool online); 385 void OnNetworkStateChanged(bool online);
380 void OnGetAccessibilityTree(); 386 void OnGetAccessibilityTree();
381 void OnTempCrashWithData(const GURL& data); 387 void OnTempCrashWithData(const GURL& data);
388 void OnSetRendererProcessID(int64 process_id);
382 void OnSetWebKitSharedTimersSuspended(bool suspend); 389 void OnSetWebKitSharedTimersSuspended(bool suspend);
383 void OnMemoryPressure( 390 void OnMemoryPressure(
384 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); 391 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
385 392
386 void IdleHandlerInForegroundTab(); 393 void IdleHandlerInForegroundTab();
387 394
388 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateOffscreenContext3d(); 395 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateOffscreenContext3d();
389 396
390 // These objects live solely on the render thread. 397 // These objects live solely on the render thread.
391 scoped_ptr<AppCacheDispatcher> appcache_dispatcher_; 398 scoped_ptr<AppCacheDispatcher> appcache_dispatcher_;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 scoped_ptr<media::AudioHardwareConfig> audio_hardware_config_; 491 scoped_ptr<media::AudioHardwareConfig> audio_hardware_config_;
485 492
486 HistogramCustomizer histogram_customizer_; 493 HistogramCustomizer histogram_customizer_;
487 494
488 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; 495 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_;
489 496
490 scoped_ptr<WebRTCIdentityService> webrtc_identity_service_; 497 scoped_ptr<WebRTCIdentityService> webrtc_identity_service_;
491 498
492 scoped_ptr<GamepadSharedMemoryReader> gamepad_shared_memory_reader_; 499 scoped_ptr<GamepadSharedMemoryReader> gamepad_shared_memory_reader_;
493 500
501 base::ProcessId renderer_process_id_;
502
494 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); 503 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl);
495 }; 504 };
496 505
497 } // namespace content 506 } // namespace content
498 507
499 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ 508 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698