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

Unified Diff: third_party/WebKit/Source/platform/TraceEvent.h

Issue 1916703002: Prepare for move-only PassOwnPtr in the remaining directories. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@core1
Patch Set: Merge with trunk. Created 4 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/WebThreadSupportingGC.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/TraceEvent.h
diff --git a/third_party/WebKit/Source/platform/TraceEvent.h b/third_party/WebKit/Source/platform/TraceEvent.h
index c47ac9bb57e52b101515b5984d04796826fe0919..6fca92117a6f99567f523a27d187e4d7855ba686 100644
--- a/third_party/WebKit/Source/platform/TraceEvent.h
+++ b/third_party/WebKit/Source/platform/TraceEvent.h
@@ -442,9 +442,9 @@ template<typename T> struct TracedValueTraits {
template<typename T> struct TracedValueTraits<PassOwnPtr<T>> {
static const bool isTracedValue = std::is_convertible<T*, TracedValue*>::value;
- static PassOwnPtr<TracedValue> moveFromIfTracedValue(const PassOwnPtr<T>& tracedValue)
+ static PassOwnPtr<TracedValue> moveFromIfTracedValue(PassOwnPtr<T>&& tracedValue)
{
- return tracedValue;
+ return std::move(tracedValue);
}
};
@@ -453,9 +453,9 @@ template<typename T> bool isTracedValue(const T&)
return TracedValueTraits<T>::isTracedValue;
}
-template<typename T> PassOwnPtr<TracedValue> moveFromIfTracedValue(const T& value)
+template<typename T> PassOwnPtr<TracedValue> moveFromIfTracedValue(T&& value)
{
- return TracedValueTraits<T>::moveFromIfTracedValue(value);
+ return TracedValueTraits<T>::moveFromIfTracedValue(std::forward<T>(value));
}
// These addTraceEvent template functions are defined here instead of in the
@@ -490,7 +490,7 @@ static inline TraceEventHandle addTraceEvent(
double timestamp,
unsigned flags,
const char* arg1Name,
- const ARG1_TYPE& arg1Val)
+ ARG1_TYPE&& arg1Val)
{
const int numArgs = 1;
unsigned char argTypes[1];
@@ -500,7 +500,7 @@ static inline TraceEventHandle addTraceEvent(
return TRACE_EVENT_API_ADD_TRACE_EVENT(
phase, categoryEnabled, name, scope, id, bindId, timestamp,
numArgs, &arg1Name, argTypes, argValues,
- moveFromIfTracedValue(arg1Val),
+ moveFromIfTracedValue(std::forward<ARG1_TYPE>(arg1Val)),
nullptr,
flags);
}
@@ -521,9 +521,9 @@ static inline TraceEventHandle addTraceEvent(
double timestamp,
unsigned flags,
const char* arg1Name,
- const ARG1_TYPE& arg1Val,
+ ARG1_TYPE&& arg1Val,
const char* arg2Name,
- const ARG2_TYPE& arg2Val)
+ ARG2_TYPE&& arg2Val)
{
const int numArgs = 2;
const char* argNames[2] = { arg1Name, arg2Name };
@@ -535,8 +535,8 @@ static inline TraceEventHandle addTraceEvent(
return TRACE_EVENT_API_ADD_TRACE_EVENT(
phase, categoryEnabled, name, scope, id, bindId, timestamp,
numArgs, argNames, argTypes, argValues,
- moveFromIfTracedValue(arg1Val),
- moveFromIfTracedValue(arg2Val),
+ moveFromIfTracedValue(std::forward<ARG1_TYPE>(arg1Val)),
+ moveFromIfTracedValue(std::forward<ARG2_TYPE>(arg2Val)),
flags);
}
return TRACE_EVENT_API_ADD_TRACE_EVENT(
@@ -566,11 +566,11 @@ static inline TraceEventHandle addTraceEvent(
unsigned long long id,
unsigned flags,
const char* arg1Name,
- const ARG1_TYPE& arg1Val)
+ ARG1_TYPE&& arg1Val)
{
return addTraceEvent(phase, categoryEnabled, name, scope, id,
blink::TraceEvent::noBindId, EventTracer::systemTraceTime(), flags,
- arg1Name, arg1Val);
+ arg1Name, std::forward<ARG1_TYPE>(arg1Val));
}
@@ -583,13 +583,14 @@ static inline TraceEventHandle addTraceEvent(
unsigned long long id,
unsigned flags,
const char* arg1Name,
- const ARG1_TYPE& arg1Val,
+ ARG1_TYPE&& arg1Val,
const char* arg2Name,
- const ARG2_TYPE& arg2Val)
+ ARG2_TYPE&& arg2Val)
{
return addTraceEvent(phase, categoryEnabled, name, scope, id,
blink::TraceEvent::noBindId, EventTracer::systemTraceTime(), flags,
- arg1Name, arg1Val, arg2Name, arg2Val);
+ arg1Name, std::forward<ARG1_TYPE>(arg1Val),
+ arg2Name, std::forward<ARG2_TYPE>(arg2Val));
}
// Used by TRACE_EVENTx macro. Do not use directly.
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/WebThreadSupportingGC.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698