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

Unified Diff: content/child/blink_platform_impl.cc

Issue 2846843002: [blink] Unique pointers in Platform.h (Closed)
Patch Set: fix compilation (and again) Created 3 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 | « content/child/blink_platform_impl.h ('k') | content/ppapi_plugin/ppapi_blink_platform_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/blink_platform_impl.cc
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc
index 5b03c650cd5294920354c7df334475516b508576..e99bb3f585540547c3f4a1749078355f78baea13 100644
--- a/content/child/blink_platform_impl.cc
+++ b/content/child/blink_platform_impl.cc
@@ -52,6 +52,7 @@
#include "net/base/net_errors.h"
#include "third_party/WebKit/public/platform/WebData.h"
#include "third_party/WebKit/public/platform/WebFloatPoint.h"
+#include "third_party/WebKit/public/platform/WebGestureCurve.h"
#include "third_party/WebKit/public/platform/WebSecurityOrigin.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/WebURL.h"
@@ -402,13 +403,14 @@ WebURLError BlinkPlatformImpl::CancelledError(
return CreateWebURLError(unreachableURL, false, net::ERR_ABORTED);
}
-blink::WebThread* BlinkPlatformImpl::CreateThread(const char* name) {
+std::unique_ptr<blink::WebThread> BlinkPlatformImpl::CreateThread(
+ const char* name) {
std::unique_ptr<blink::scheduler::WebThreadBase> thread =
blink::scheduler::WebThreadBase::CreateWorkerThread(
name, base::Thread::Options());
thread->Init();
WaitUntilWebThreadTLSUpdate(thread.get());
- return thread.release();
+ return std::move(thread);
}
void BlinkPlatformImpl::SetCompositorThread(
@@ -681,14 +683,15 @@ blink::WebThread* BlinkPlatformImpl::CompositorThread() const {
return compositor_thread_;
}
-blink::WebGestureCurve* BlinkPlatformImpl::CreateFlingAnimationCurve(
+std::unique_ptr<blink::WebGestureCurve>
+BlinkPlatformImpl::CreateFlingAnimationCurve(
blink::WebGestureDevice device_source,
const blink::WebFloatPoint& velocity,
const blink::WebSize& cumulative_scroll) {
return ui::WebGestureCurveImpl::CreateFromDefaultPlatformCurve(
- gfx::Vector2dF(velocity.x, velocity.y),
- gfx::Vector2dF(cumulative_scroll.width, cumulative_scroll.height),
- IsMainThread()).release();
+ gfx::Vector2dF(velocity.x, velocity.y),
+ gfx::Vector2dF(cumulative_scroll.width, cumulative_scroll.height),
+ IsMainThread());
}
void BlinkPlatformImpl::DidStartWorkerThread() {
@@ -829,7 +832,7 @@ int BlinkPlatformImpl::DomKeyEnumFromString(const WebString& key_string) {
ui::KeycodeConverter::KeyStringToDomKey(key_string.Utf8()));
}
-blink::WebFeaturePolicy* BlinkPlatformImpl::CreateFeaturePolicy(
+std::unique_ptr<blink::WebFeaturePolicy> BlinkPlatformImpl::CreateFeaturePolicy(
const blink::WebFeaturePolicy* parent_policy,
const blink::WebParsedFeaturePolicy& container_policy,
const blink::WebParsedFeaturePolicy& policy_header,
@@ -838,16 +841,15 @@ blink::WebFeaturePolicy* BlinkPlatformImpl::CreateFeaturePolicy(
static_cast<const FeaturePolicy*>(parent_policy),
FeaturePolicyHeaderFromWeb(container_policy), url::Origin(origin));
policy->SetHeaderPolicy(FeaturePolicyHeaderFromWeb(policy_header));
- return policy.release();
+ return std::move(policy);
}
-blink::WebFeaturePolicy* BlinkPlatformImpl::DuplicateFeaturePolicyWithOrigin(
+std::unique_ptr<blink::WebFeaturePolicy>
+BlinkPlatformImpl::DuplicateFeaturePolicyWithOrigin(
const blink::WebFeaturePolicy& policy,
const blink::WebSecurityOrigin& new_origin) {
- std::unique_ptr<FeaturePolicy> new_policy =
- FeaturePolicy::CreateFromPolicyWithOrigin(
- static_cast<const FeaturePolicy&>(policy), url::Origin(new_origin));
- return new_policy.release();
+ return FeaturePolicy::CreateFromPolicyWithOrigin(
+ static_cast<const FeaturePolicy&>(policy), url::Origin(new_origin));
}
} // namespace content
« no previous file with comments | « content/child/blink_platform_impl.h ('k') | content/ppapi_plugin/ppapi_blink_platform_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698