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

Unified Diff: cc/output/copy_output_request.h

Issue 2652343003: Replace source pointer in cc::CopyOutputRequest with a base::UnguessableToken (Closed)
Patch Set: c Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: cc/output/copy_output_request.h
diff --git a/cc/output/copy_output_request.h b/cc/output/copy_output_request.h
index 4ce583ac48dcb70ef545e48255f2187aacb87f3f..8ef6a108df339e8ac3397b84d5951654ab67c877 100644
--- a/cc/output/copy_output_request.h
+++ b/cc/output/copy_output_request.h
@@ -9,6 +9,8 @@
#include "base/callback.h"
#include "base/memory/ptr_util.h"
+#include "base/optional.h"
+#include "base/unguessable_token.h"
#include "cc/base/cc_export.h"
#include "cc/resources/single_release_callback.h"
#include "cc/resources/texture_mailbox.h"
@@ -43,11 +45,12 @@ class CC_EXPORT CopyOutputRequest {
bool IsEmpty() const { return result_callback_.is_null(); }
- // Optionally specify the source of this copy request. If set when this copy
+ // Optionally specify the source of this copy request. If set when this copy
// request is submitted to a layer, a prior uncommitted copy request from the
- // same |source| will be aborted.
- void set_source(void* source) { source_ = source; }
- void* source() const { return source_; }
+ // same source will be aborted.
+ void set_source(base::UnguessableToken source) { source_ = source; }
Fady Samuel 2017/01/26 21:22:42 const base::UnguessableToken&
Saman Sami 2017/01/26 21:47:27 Done.
+ bool has_source() const { return source_.has_value(); }
+ base::UnguessableToken source() const { return *source_; }
Fady Samuel 2017/01/26 21:22:42 const base::UnguessableToken&
Saman Sami 2017/01/26 21:47:27 Done.
bool force_bitmap_result() const { return force_bitmap_result_; }
@@ -82,7 +85,7 @@ class CC_EXPORT CopyOutputRequest {
CopyOutputRequest(bool force_bitmap_result,
const CopyOutputRequestCallback& result_callback);
- void* source_;
+ base::Optional<base::UnguessableToken> source_;
bool force_bitmap_result_;
bool has_area_;
bool has_texture_mailbox_;

Powered by Google App Engine
This is Rietveld 408576698