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

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: Created 8 years, 1 month 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') | content/browser/gpu/gpu_process_host.cc » ('J')
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..812e7dbd7b994740ebe915886d9b887d98d341cd 100644
--- a/content/browser/gpu/gpu_process_host.h
+++ b/content/browser/gpu/gpu_process_host.h
@@ -18,8 +18,10 @@
#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 "gpu/command_buffer/common/constants.h"
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_sender.h"
+#include "googleurl/src/gurl.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/size.h"
@@ -141,7 +143,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& containing_document_url);
+ void OnDidLoseContext(bool offscreen,
+ gpu::error::ContextLostReason reason,
+ const GURL& containing_document_url);
+ void OnDidDestroyOffscreenContext(const GURL& containing_document_url);
#if defined(OS_MACOSX)
void OnAcceleratedSurfaceBuffersSwapped(
const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params);
@@ -226,6 +232,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') | content/browser/gpu/gpu_process_host.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698