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

Unified Diff: content/browser/gpu/gpu_process_host.h

Issue 11434072: Send notification from GPU process to browser process of offscreen context creation and destruction… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Worked around stupid compilers. Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_process_host.h
diff --git a/content/browser/gpu/gpu_process_host.h b/content/browser/gpu/gpu_process_host.h
index ab74fed4bbcb520a120512477bd0f6dc0638e04c..7424963bb9edc98e1b405a922917c6b214f7a182 100644
--- a/content/browser/gpu/gpu_process_host.h
+++ b/content/browser/gpu/gpu_process_host.h
@@ -7,6 +7,7 @@
#include <map>
#include <queue>
+#include <set>
#include <string>
#include "base/callback.h"
@@ -18,6 +19,8 @@
#include "content/public/browser/browser_child_process_host_delegate.h"
#include "content/public/browser/gpu_data_manager.h"
#include "content/public/common/gpu_info.h"
+#include "googleurl/src/gurl.h"
+#include "gpu/command_buffer/common/constants.h"
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_sender.h"
#include "ui/gfx/native_widget_types.h"
@@ -141,7 +144,11 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate,
void OnCommandBufferCreated(const int32 route_id);
void OnDestroyCommandBuffer(int32 surface_id);
void OnImageCreated(const gfx::Size size);
-
+ void OnDidCreateOffscreenContext(const GURL& url);
+ void OnDidLoseContext(bool offscreen,
+ gpu::error::ContextLostReason reason,
+ const GURL& url);
+ void OnDidDestroyOffscreenContext(const GURL& url);
#if defined(OS_MACOSX)
void OnAcceleratedSurfaceBuffersSwapped(
const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params);
@@ -170,6 +177,8 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate,
void CreateImageError(const CreateImageCallback& callback,
const gfx::Size size);
+ void BlockLiveOffscreenContexts();
+
// The serial number of the GpuProcessHost / GpuProcessHostUIShim pair.
int host_id_;
@@ -226,6 +235,13 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate,
scoped_ptr<BrowserChildProcessHostImpl> process_;
+ // Track the URLs of the pages which have live offscreen contexts,
+ // assumed to be associated with untrusted content such as WebGL.
+ // For best robustness, when any context lost notification is
+ // received, assume all of these URLs are guilty, and block
+ // automatic execution of 3D content from those domains.
+ std::multiset<GURL> urls_with_live_offscreen_contexts_;
+
DISALLOW_COPY_AND_ASSIGN(GpuProcessHost);
};
« no previous file with comments | « no previous file | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698