Commit 94f29690 authored by tzik's avatar tzik Committed by Commit Bot

Replace PassRefPtr with RefPtr in Blink platform/{a,b,e}*

PassRefPtr is now an alias of RefPtr. This CL inlines the alias to the
users in platform/{a,b,e}* for PassRefPtr removal.

Bug: 494719
Change-Id: I852aaf96ebef5ca5bf84f4aee0aafae01982e3c9
Reviewed-on: https://chromium-review.googlesource.com/668301Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502193}
parent b79686c7
......@@ -37,7 +37,7 @@ CompositorFloatAnimationCurve::KeyframesForTesting() const {
return keyframes;
}
PassRefPtr<TimingFunction>
RefPtr<TimingFunction>
CompositorFloatAnimationCurve::GetTimingFunctionForTesting() const {
return CreateCompositorTimingFunctionFromCC(
curve_->timing_function_for_testing());
......
......@@ -11,8 +11,8 @@
#include "platform/animation/CompositorFloatKeyframe.h"
#include "platform/animation/TimingFunction.h"
#include "platform/wtf/Noncopyable.h"
#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/PtrUtil.h"
#include "platform/wtf/RefPtr.h"
#include "platform/wtf/Vector.h"
namespace cc {
......@@ -51,7 +51,7 @@ class PLATFORM_EXPORT CompositorFloatAnimationCurve
using Keyframes = Vector<std::unique_ptr<CompositorFloatKeyframe>>;
Keyframes KeyframesForTesting() const;
PassRefPtr<TimingFunction> GetTimingFunctionForTesting() const;
RefPtr<TimingFunction> GetTimingFunctionForTesting() const;
private:
CompositorFloatAnimationCurve();
......
......@@ -8,8 +8,7 @@
namespace blink {
PassRefPtr<TimingFunction> CompositorKeyframe::GetTimingFunctionForTesting()
const {
RefPtr<TimingFunction> CompositorKeyframe::GetTimingFunctionForTesting() const {
return CreateCompositorTimingFunctionFromCC(CcTimingFunction());
}
......
......@@ -6,7 +6,7 @@
#define CompositorKeyframe_h
#include "platform/PlatformExport.h"
#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/RefPtr.h"
namespace cc {
class TimingFunction;
......@@ -22,7 +22,7 @@ class PLATFORM_EXPORT CompositorKeyframe {
virtual double Time() const = 0;
PassRefPtr<TimingFunction> GetTimingFunctionForTesting() const;
RefPtr<TimingFunction> GetTimingFunctionForTesting() const;
private:
virtual const cc::TimingFunction* CcTimingFunction() const = 0;
......
......@@ -158,7 +158,7 @@ std::unique_ptr<cc::TimingFunction> FramesTimingFunction::CloneToCC() const {
return frames_->Clone();
}
PassRefPtr<TimingFunction> CreateCompositorTimingFunctionFromCC(
RefPtr<TimingFunction> CreateCompositorTimingFunctionFromCC(
const cc::TimingFunction* timing_function) {
if (!timing_function)
return LinearTimingFunction::Shared();
......
......@@ -29,8 +29,8 @@
#include "platform/PlatformExport.h"
#include "platform/runtime_enabled_features.h"
#include "platform/wtf/Assertions.h"
#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/RefCounted.h"
#include "platform/wtf/RefPtr.h"
#include "platform/wtf/StdLibExtras.h"
#include "platform/wtf/text/WTFString.h"
......@@ -88,10 +88,10 @@ class PLATFORM_EXPORT CubicBezierTimingFunction final : public TimingFunction {
public:
using EaseType = cc::CubicBezierTimingFunction::EaseType;
static PassRefPtr<CubicBezierTimingFunction> Create(double x1,
double y1,
double x2,
double y2) {
static RefPtr<CubicBezierTimingFunction> Create(double x1,
double y1,
double x2,
double y2) {
return AdoptRef(new CubicBezierTimingFunction(x1, y1, x2, y2));
}
......@@ -153,8 +153,8 @@ class PLATFORM_EXPORT StepsTimingFunction final : public TimingFunction {
public:
using StepPosition = cc::StepsTimingFunction::StepPosition;
static PassRefPtr<StepsTimingFunction> Create(int steps,
StepPosition step_position) {
static RefPtr<StepsTimingFunction> Create(int steps,
StepPosition step_position) {
return AdoptRef(new StepsTimingFunction(steps, step_position));
}
......@@ -198,7 +198,7 @@ class PLATFORM_EXPORT StepsTimingFunction final : public TimingFunction {
class PLATFORM_EXPORT FramesTimingFunction final : public TimingFunction {
public:
static PassRefPtr<FramesTimingFunction> Create(int frames) {
static RefPtr<FramesTimingFunction> Create(int frames) {
return AdoptRef(new FramesTimingFunction(frames));
}
......@@ -222,7 +222,7 @@ class PLATFORM_EXPORT FramesTimingFunction final : public TimingFunction {
std::unique_ptr<cc::FramesTimingFunction> frames_;
};
PLATFORM_EXPORT PassRefPtr<TimingFunction> CreateCompositorTimingFunctionFromCC(
PLATFORM_EXPORT RefPtr<TimingFunction> CreateCompositorTimingFunctionFromCC(
const cc::TimingFunction*);
PLATFORM_EXPORT bool operator==(const LinearTimingFunction&,
......
......@@ -47,9 +47,9 @@ using namespace VectorMath;
const unsigned kMaxBusChannels = 32;
PassRefPtr<AudioBus> AudioBus::Create(unsigned number_of_channels,
size_t length,
bool allocate) {
RefPtr<AudioBus> AudioBus::Create(unsigned number_of_channels,
size_t length,
bool allocate) {
DCHECK_LE(number_of_channels, kMaxBusChannels);
if (number_of_channels > kMaxBusChannels)
return nullptr;
......@@ -185,10 +185,9 @@ bool AudioBus::TopologyMatches(const AudioBus& bus) const {
return true;
}
PassRefPtr<AudioBus> AudioBus::CreateBufferFromRange(
const AudioBus* source_buffer,
unsigned start_frame,
unsigned end_frame) {
RefPtr<AudioBus> AudioBus::CreateBufferFromRange(const AudioBus* source_buffer,
unsigned start_frame,
unsigned end_frame) {
size_t number_of_source_frames = source_buffer->length();
unsigned number_of_channels = source_buffer->NumberOfChannels();
......@@ -625,7 +624,7 @@ void AudioBus::CopyWithSampleAccurateGainValuesFrom(
}
}
PassRefPtr<AudioBus> AudioBus::CreateBySampleRateConverting(
RefPtr<AudioBus> AudioBus::CreateBySampleRateConverting(
const AudioBus* source_bus,
bool mix_to_mono,
double new_sample_rate) {
......@@ -694,8 +693,7 @@ PassRefPtr<AudioBus> AudioBus::CreateBySampleRateConverting(
return destination_bus;
}
PassRefPtr<AudioBus> AudioBus::CreateByMixingToMono(
const AudioBus* source_bus) {
RefPtr<AudioBus> AudioBus::CreateByMixingToMono(const AudioBus* source_bus) {
if (source_bus->IsSilent())
return Create(1, source_bus->length());
......@@ -739,15 +737,15 @@ void AudioBus::ClearSilentFlag() {
channels_[i]->ClearSilentFlag();
}
PassRefPtr<AudioBus> DecodeAudioFileData(const char* data, size_t size) {
RefPtr<AudioBus> DecodeAudioFileData(const char* data, size_t size) {
WebAudioBus web_audio_bus;
if (Platform::Current()->DecodeAudioFileData(&web_audio_bus, data, size))
return web_audio_bus.Release();
return nullptr;
}
PassRefPtr<AudioBus> AudioBus::GetDataResource(const char* name,
float sample_rate) {
RefPtr<AudioBus> AudioBus::GetDataResource(const char* name,
float sample_rate) {
const WebData& resource = Platform::Current()->GetDataResource(name);
if (resource.IsEmpty())
return nullptr;
......@@ -772,10 +770,10 @@ PassRefPtr<AudioBus> AudioBus::GetDataResource(const char* name,
sample_rate);
}
PassRefPtr<AudioBus> CreateBusFromInMemoryAudioFile(const void* data,
size_t data_size,
bool mix_to_mono,
float sample_rate) {
RefPtr<AudioBus> CreateBusFromInMemoryAudioFile(const void* data,
size_t data_size,
bool mix_to_mono,
float sample_rate) {
RefPtr<AudioBus> audio_bus =
DecodeAudioFileData(static_cast<const char*>(data), data_size);
if (!audio_bus.Get())
......
......@@ -69,9 +69,9 @@ class PLATFORM_EXPORT AudioBus : public ThreadSafeRefCounted<AudioBus> {
// case the AudioChannels will memory-manage their own storage. If allocate
// is false then setChannelMemory() has to be called later on for each
// channel before the AudioBus is useable...
static PassRefPtr<AudioBus> Create(unsigned number_of_channels,
size_t length,
bool allocate = true);
static RefPtr<AudioBus> Create(unsigned number_of_channels,
size_t length,
bool allocate = true);
// Tells the given channel to use an externally allocated buffer.
void SetChannelMemory(unsigned channel_index, float* storage, size_t length);
......@@ -111,17 +111,16 @@ class PLATFORM_EXPORT AudioBus : public ThreadSafeRefCounted<AudioBus> {
// Creates a new buffer from a range in the source buffer.
// 0 may be returned if the range does not fit in the sourceBuffer
static PassRefPtr<AudioBus> CreateBufferFromRange(
const AudioBus* source_buffer,
unsigned start_frame,
unsigned end_frame);
static RefPtr<AudioBus> CreateBufferFromRange(const AudioBus* source_buffer,
unsigned start_frame,
unsigned end_frame);
// Creates a new AudioBus by sample-rate converting sourceBus to the
// newSampleRate.
// setSampleRate() must have been previously called on sourceBus.
// Note: sample-rate conversion is already handled in the file-reading code
// for the mac port, so we don't need this.
static PassRefPtr<AudioBus> CreateBySampleRateConverting(
static RefPtr<AudioBus> CreateBySampleRateConverting(
const AudioBus* source_bus,
bool mix_to_mono,
double new_sample_rate);
......@@ -129,7 +128,7 @@ class PLATFORM_EXPORT AudioBus : public ThreadSafeRefCounted<AudioBus> {
// Creates a new AudioBus by mixing all the channels down to mono.
// If sourceBus is already mono, then the returned AudioBus will simply be a
// copy.
static PassRefPtr<AudioBus> CreateByMixingToMono(const AudioBus* source_bus);
static RefPtr<AudioBus> CreateByMixingToMono(const AudioBus* source_bus);
// Scales all samples by the same amount.
void Scale(float scale);
......@@ -169,8 +168,7 @@ class PLATFORM_EXPORT AudioBus : public ThreadSafeRefCounted<AudioBus> {
// Makes maximum absolute value == 1.0 (if possible).
void Normalize();
static PassRefPtr<AudioBus> GetDataResource(const char* name,
float sample_rate);
static RefPtr<AudioBus> GetDataResource(const char* name, float sample_rate);
protected:
AudioBus() {}
......
......@@ -134,10 +134,9 @@ void AudioDestination::Render(const WebVector<float*>& destination_data,
if (worklet_backing_thread_) {
worklet_backing_thread_->GetWebTaskRunner()->PostTask(
BLINK_FROM_HERE,
CrossThreadBind(&AudioDestination::RequestRender,
WrapPassRefPtr(this), number_of_frames,
frames_to_render, delay, delay_timestamp,
prior_frames_skipped));
CrossThreadBind(&AudioDestination::RequestRender, WrapRefPtr(this),
number_of_frames, frames_to_render, delay,
delay_timestamp, prior_frames_skipped));
} else {
// Otherwise use the single-thread rendering with AudioDeviceThread.
RequestRender(number_of_frames, frames_to_render, delay,
......
......@@ -30,7 +30,7 @@
#define AudioFileReader_h
#include "platform/PlatformExport.h"
#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/RefPtr.h"
namespace blink {
......@@ -42,16 +42,15 @@ class AudioBus;
// doesn't already match the file's sample-rate). The created buffer will have
// its sample-rate set correctly to the result.
PLATFORM_EXPORT PassRefPtr<AudioBus> CreateBusFromInMemoryAudioFile(
PLATFORM_EXPORT RefPtr<AudioBus> CreateBusFromInMemoryAudioFile(
const void* data,
size_t data_size,
bool mix_to_mono,
float sample_rate);
PLATFORM_EXPORT PassRefPtr<AudioBus> CreateBusFromAudioFile(
const char* file_path,
bool mix_to_mono,
float sample_rate);
PLATFORM_EXPORT RefPtr<AudioBus> CreateBusFromAudioFile(const char* file_path,
bool mix_to_mono,
float sample_rate);
// May pass in 0.0 for sampleRate in which case it will use the AudioBus's
// sampleRate
......
......@@ -34,7 +34,7 @@
#include "platform/wtf/Allocator.h"
#include "platform/wtf/Forward.h"
#include "platform/wtf/Noncopyable.h"
#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/RefPtr.h"
#include "platform/wtf/Vector.h"
namespace blink {
......
......@@ -46,7 +46,7 @@ static LoaderMap& GetLoaderMap() {
return *map;
}
PassRefPtr<HRTFDatabaseLoader>
RefPtr<HRTFDatabaseLoader>
HRTFDatabaseLoader::CreateAndLoadAsynchronouslyIfNecessary(float sample_rate) {
DCHECK(IsMainThread());
......
......@@ -50,7 +50,7 @@ class PLATFORM_EXPORT HRTFDatabaseLoader final
// time).
// Returns the HRTFDatabaseLoader.
// Must be called from the main thread.
static PassRefPtr<HRTFDatabaseLoader> CreateAndLoadAsynchronouslyIfNecessary(
static RefPtr<HRTFDatabaseLoader> CreateAndLoadAsynchronouslyIfNecessary(
float sample_rate);
// Both constructor and destructor must be called from the main thread.
......
......@@ -65,7 +65,7 @@ const int kElevationIndexTable[kElevationIndexTableSize] = {
// Lazily load a concatenated HRTF database for given subject and store it in a
// local hash table to ensure quick efficient future retrievals.
static PassRefPtr<AudioBus> GetConcatenatedImpulseResponsesForSubject(
static RefPtr<AudioBus> GetConcatenatedImpulseResponsesForSubject(
const String& subject_name) {
typedef HashMap<String, RefPtr<AudioBus>> AudioBusMap;
DEFINE_THREAD_SAFE_STATIC_LOCAL(AudioBusMap, audio_bus_map, ());
......
......@@ -33,7 +33,6 @@
#include "platform/audio/HRTFKernel.h"
#include "platform/wtf/Allocator.h"
#include "platform/wtf/Noncopyable.h"
#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/RefPtr.h"
#include "platform/wtf/text/CString.h"
#include "platform/wtf/text/WTFString.h"
......
......@@ -63,8 +63,8 @@ static bool IsMainWorldId(int world_id) {
}
#endif
PassRefPtr<DOMWrapperWorld> DOMWrapperWorld::Create(v8::Isolate* isolate,
WorldType world_type) {
RefPtr<DOMWrapperWorld> DOMWrapperWorld::Create(v8::Isolate* isolate,
WorldType world_type) {
DCHECK_NE(WorldType::kIsolated, world_type);
int world_id = GenerateWorldIdForType(world_type);
if (world_id == kInvalidWorldId)
......@@ -150,7 +150,7 @@ void DOMWrapperWorld::Dispose() {
GetWorldMap().erase(world_id_);
}
PassRefPtr<DOMWrapperWorld> DOMWrapperWorld::EnsureIsolatedWorld(
RefPtr<DOMWrapperWorld> DOMWrapperWorld::EnsureIsolatedWorld(
v8::Isolate* isolate,
int world_id) {
#if DCHECK_IS_ON()
......@@ -185,7 +185,7 @@ SecurityOrigin* DOMWrapperWorld::IsolatedWorldSecurityOrigin() {
void DOMWrapperWorld::SetIsolatedWorldSecurityOrigin(
int world_id,
PassRefPtr<SecurityOrigin> security_origin) {
RefPtr<SecurityOrigin> security_origin) {
#if DCHECK_IS_ON()
DCHECK(IsIsolatedWorldId(world_id));
#endif
......
......@@ -36,7 +36,6 @@
#include "platform/PlatformExport.h"
#include "platform/bindings/ScriptState.h"
#include "platform/weborigin/SecurityOrigin.h"
#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/RefCounted.h"
#include "platform/wtf/RefPtr.h"
#include "public/platform/WebIsolatedWorldIds.h"
......@@ -78,11 +77,11 @@ class PLATFORM_EXPORT DOMWrapperWorld : public RefCounted<DOMWrapperWorld> {
// Creates a world other than IsolatedWorld. Note this can return nullptr if
// GenerateWorldIdForType fails to allocate a valid id.
static PassRefPtr<DOMWrapperWorld> Create(v8::Isolate*, WorldType);
static RefPtr<DOMWrapperWorld> Create(v8::Isolate*, WorldType);
// Ensures an IsolatedWorld for |worldId|.
static PassRefPtr<DOMWrapperWorld> EnsureIsolatedWorld(v8::Isolate*,
int world_id);
static RefPtr<DOMWrapperWorld> EnsureIsolatedWorld(v8::Isolate*,
int world_id);
~DOMWrapperWorld();
void Dispose();
......@@ -113,7 +112,7 @@ class PLATFORM_EXPORT DOMWrapperWorld : public RefCounted<DOMWrapperWorld> {
// origin. XMLHttpRequest instances used in that world will be considered
// to come from that origin, not the frame's.
static void SetIsolatedWorldSecurityOrigin(int world_id,
PassRefPtr<SecurityOrigin>);
RefPtr<SecurityOrigin>);
SecurityOrigin* IsolatedWorldSecurityOrigin();
// Associated an isolated world with a Content Security Policy. Resources
......
......@@ -8,8 +8,8 @@
namespace blink {
PassRefPtr<ScriptState> ScriptState::Create(v8::Local<v8::Context> context,
PassRefPtr<DOMWrapperWorld> world) {
RefPtr<ScriptState> ScriptState::Create(v8::Local<v8::Context> context,
RefPtr<DOMWrapperWorld> world) {
RefPtr<ScriptState> script_state =
AdoptRef(new ScriptState(context, std::move(world)));
// This ref() is for keeping this ScriptState alive as long as the v8::Context
......@@ -29,7 +29,7 @@ static void ContextCollectedCallback(
}
ScriptState::ScriptState(v8::Local<v8::Context> context,
PassRefPtr<DOMWrapperWorld> world)
RefPtr<DOMWrapperWorld> world)
: isolate_(context->GetIsolate()),
context_(isolate_, context),
world_(std::move(world)),
......
......@@ -88,8 +88,8 @@ class PLATFORM_EXPORT ScriptState : public RefCounted<ScriptState> {
v8::Local<v8::Context> context_;
};
static PassRefPtr<ScriptState> Create(v8::Local<v8::Context>,
PassRefPtr<DOMWrapperWorld>);
static RefPtr<ScriptState> Create(v8::Local<v8::Context>,
RefPtr<DOMWrapperWorld>);
virtual ~ScriptState();
static ScriptState* Current(v8::Isolate* isolate) // DEPRECATED
......@@ -146,7 +146,7 @@ class PLATFORM_EXPORT ScriptState : public RefCounted<ScriptState> {
void DisposePerContextData();
protected:
ScriptState(v8::Local<v8::Context>, PassRefPtr<DOMWrapperWorld>);
ScriptState(v8::Local<v8::Context>, RefPtr<DOMWrapperWorld>);
private:
v8::Isolate* isolate_;
......
......@@ -32,8 +32,8 @@
#define SharedPersistent_h
#include "platform/bindings/ScopedPersistent.h"
#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/RefCounted.h"
#include "platform/wtf/RefPtr.h"
#include "v8/include/v8.h"
namespace blink {
......@@ -46,8 +46,8 @@ class SharedPersistent : public RefCounted<SharedPersistent<T>> {
WTF_MAKE_NONCOPYABLE(SharedPersistent);
public:
static PassRefPtr<SharedPersistent<T>> Create(v8::Local<T> value,
v8::Isolate* isolate) {
static RefPtr<SharedPersistent<T>> Create(v8::Local<T> value,
v8::Isolate* isolate) {
return AdoptRef(new SharedPersistent<T>(value, isolate));
}
......
......@@ -39,7 +39,6 @@
#include "platform/blob/BlobRegistry.h"
#include "platform/runtime_enabled_features.h"
#include "platform/text/LineEnding.h"
#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/PtrUtil.h"
#include "platform/wtf/RefPtr.h"
#include "platform/wtf/Vector.h"
......@@ -145,7 +144,7 @@ void BlobData::SetContentType(const String& content_type) {
content_type_ = "";
}
void BlobData::AppendData(PassRefPtr<RawData> data,
void BlobData::AppendData(RefPtr<RawData> data,
long long offset,
long long length) {
DCHECK_EQ(file_composition_, FileCompositionStatus::NO_UNKNOWN_SIZE_FILES)
......@@ -168,7 +167,7 @@ void BlobData::AppendFile(const String& path,
BlobDataItem(path, offset, length, expected_modification_time));
}
void BlobData::AppendBlob(PassRefPtr<BlobDataHandle> data_handle,
void BlobData::AppendBlob(RefPtr<BlobDataHandle> data_handle,
long long offset,
long long length) {
DCHECK_EQ(file_composition_, FileCompositionStatus::NO_UNKNOWN_SIZE_FILES)
......
......@@ -47,7 +47,7 @@ class BlobDataHandle;
class PLATFORM_EXPORT RawData : public ThreadSafeRefCounted<RawData> {
public:
static PassRefPtr<RawData> Create() { return AdoptRef(new RawData()); }
static RefPtr<RawData> Create() { return AdoptRef(new RawData()); }
void DetachFromCurrentThread();
......@@ -73,7 +73,7 @@ struct PLATFORM_EXPORT BlobDataItem {
expected_modification_time(InvalidFileTime()) {}
// Constructor for String type (complete string).
explicit BlobDataItem(PassRefPtr<RawData> data)
explicit BlobDataItem(RefPtr<RawData> data)
: type(kData),
data(std::move(data)),
offset(0),
......@@ -100,7 +100,7 @@ struct PLATFORM_EXPORT BlobDataItem {
expected_modification_time(expected_modification_time) {}
// Constructor for Blob type.
BlobDataItem(PassRefPtr<BlobDataHandle> blob_data_handle,
BlobDataItem(RefPtr<BlobDataHandle> blob_data_handle,
long long offset,
long long length)
: type(kBlob),
......@@ -138,7 +138,7 @@ struct PLATFORM_EXPORT BlobDataItem {
friend class BlobData;
// Constructor for String type (partial string).
BlobDataItem(PassRefPtr<RawData> data, long long offset, long long length)
BlobDataItem(RefPtr<RawData> data, long long offset, long long length)
: type(kData),
data(std::move(data)),
offset(offset),
......@@ -176,7 +176,7 @@ class PLATFORM_EXPORT BlobData {
const BlobDataItemList& Items() const { return items_; }
void AppendBytes(const void*, size_t length);
void AppendData(PassRefPtr<RawData>, long long offset, long long length);
void AppendData(RefPtr<RawData>, long long offset, long long length);
void AppendFile(const String& path,
long long offset,
long long length,
......@@ -184,9 +184,7 @@ class PLATFORM_EXPORT BlobData {
// The given blob must not be a file with unknown size. Please use the
// File::appendTo instead.
void AppendBlob(PassRefPtr<BlobDataHandle>,
long long offset,
long long length);
void AppendBlob(RefPtr<BlobDataHandle>, long long offset, long long length);
void AppendFileSystemURL(const KURL&,
long long offset,
long long length,
......@@ -224,24 +222,24 @@ class PLATFORM_EXPORT BlobDataHandle
: public ThreadSafeRefCounted<BlobDataHandle> {
public:
// For empty blob construction.
static PassRefPtr<BlobDataHandle> Create() {
static RefPtr<BlobDataHandle> Create() {
return AdoptRef(new BlobDataHandle());
}
// For initial creation.
static PassRefPtr<BlobDataHandle> Create(std::unique_ptr<BlobData> data,
long long size) {
static RefPtr<BlobDataHandle> Create(std::unique_ptr<BlobData> data,
long long size) {
return AdoptRef(new BlobDataHandle(std::move(data), size));
}
// For deserialization of script values and ipc messages.
static PassRefPtr<BlobDataHandle> Create(const String& uuid,
const String& type,
long long size) {
static RefPtr<BlobDataHandle> Create(const String& uuid,
const String& type,
long long size) {
return AdoptRef(new BlobDataHandle(uuid, type, size));
}
static PassRefPtr<BlobDataHandle> Create(
static RefPtr<BlobDataHandle> Create(
const String& uuid,
const String& type,
long long size,
......
......@@ -103,7 +103,7 @@ void BlobRegistry::RemoveBlobDataRef(const String& uuid) {
void BlobRegistry::RegisterPublicBlobURL(SecurityOrigin* origin,
const KURL& url,
PassRefPtr<BlobDataHandle> handle) {
RefPtr<BlobDataHandle> handle) {
SaveToOriginMap(origin, url);
GetBlobRegistry()->RegisterPublicBlobURL(url, handle->Uuid());
}
......
......@@ -35,7 +35,7 @@
#include "platform/PlatformExport.h"
#include "platform/wtf/Allocator.h"
#include "platform/wtf/Forward.h"
#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/RefPtr.h"
namespace blink {
......@@ -55,7 +55,7 @@ class PLATFORM_EXPORT BlobRegistry {
static void RemoveBlobDataRef(const String& uuid);
static void RegisterPublicBlobURL(SecurityOrigin*,
const KURL&,
PassRefPtr<BlobDataHandle>);
RefPtr<BlobDataHandle>);
static void RevokePublicBlobURL(const KURL&);
};
......
......@@ -25,7 +25,6 @@
#include "public/platform/WebAudioBus.h"
#include "platform/audio/AudioBus.h"
#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/RefPtr.h"
namespace blink {
......
......@@ -13,7 +13,7 @@ namespace blink {
class WebContentSettingCallbacksPrivate
: public RefCounted<WebContentSettingCallbacksPrivate> {
public:
static PassRefPtr<WebContentSettingCallbacksPrivate> Create(
static RefPtr<WebContentSettingCallbacksPrivate> Create(
std::unique_ptr<ContentSettingCallbacks> callbacks) {
return AdoptRef(
new WebContentSettingCallbacksPrivate(std::move(callbacks)));
......
......@@ -82,7 +82,7 @@ bool WebCryptoResult::Cancelled() const {
}
WebCryptoResult::WebCryptoResult(CryptoResult* impl,
PassRefPtr<CryptoResultCancel> cancel)
RefPtr<CryptoResultCancel> cancel)
: impl_(impl), cancel_(std::move(cancel)) {
DCHECK(impl_.Get());
DCHECK(cancel_.Get());
......
......@@ -33,9 +33,9 @@
#include <memory>
#include "platform/AsyncFileSystemCallbacks.h"
#include "platform/FileMetadata.h"
#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/PtrUtil.h"
#include "platform/wtf/RefCounted.h"
#include "platform/wtf/RefPtr.h"
#include "public/platform/WebFileInfo.h"
#include "public/platform/WebFileSystem.h"
#include "public/platform/WebFileSystemEntry.h"
......@@ -47,7 +47,7 @@ namespace blink {
class WebFileSystemCallbacksPrivate
: public RefCounted<WebFileSystemCallbacksPrivate> {
public:
static PassRefPtr<WebFileSystemCallbacksPrivate> Create(
static RefPtr<WebFileSystemCallbacksPrivate> Create(
std::unique_ptr<AsyncFileSystemCallbacks> callbacks) {
return AdoptRef(new WebFileSystemCallbacksPrivate(std::move(callbacks)));
}
......
......@@ -35,7 +35,7 @@
#include "platform/SharedBuffer.h"
#include "platform/graphics/Image.h"
#include "platform/image-decoders/ImageDecoder.h"
#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/RefPtr.h"
#include "platform/wtf/Vector.h"
#include "public/platform/WebData.h"
#include "public/platform/WebSize.h"
......@@ -126,7 +126,7 @@ WebSize WebImage::Size() const {
return WebSize(bitmap_.width(), bitmap_.height());
}
WebImage::WebImage(PassRefPtr<Image> image) {
WebImage::WebImage(RefPtr<Image> image) {
if (!image)
return;
......
......@@ -31,7 +31,7 @@
#include "public/platform/WebMediaConstraints.h"
#include <math.h>
#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/RefPtr.h"
#include "platform/wtf/ThreadSafeRefCounted.h"
#include "platform/wtf/text/StringBuilder.h"
#include "platform/wtf/text/WTFString.h"
......@@ -75,8 +75,8 @@ void MaybeEmitNamedBoolean(StringBuilder& builder,
class WebMediaConstraintsPrivate final
: public ThreadSafeRefCounted<WebMediaConstraintsPrivate> {
public:
static PassRefPtr<WebMediaConstraintsPrivate> Create();
static PassRefPtr<WebMediaConstraintsPrivate> Create(
static RefPtr<WebMediaConstraintsPrivate> Create();
static RefPtr<WebMediaConstraintsPrivate> Create(
const WebMediaTrackConstraintSet& basic,
const WebVector<WebMediaTrackConstraintSet>& advanced);
......@@ -94,13 +94,13 @@ class WebMediaConstraintsPrivate final
WebVector<WebMediaTrackConstraintSet> advanced_;
};
PassRefPtr<WebMediaConstraintsPrivate> WebMediaConstraintsPrivate::Create() {
RefPtr<WebMediaConstraintsPrivate> WebMediaConstraintsPrivate::Create() {
WebMediaTrackConstraintSet basic;
WebVector<WebMediaTrackConstraintSet> advanced;
return AdoptRef(new WebMediaConstraintsPrivate(basic, advanced));
}
PassRefPtr<WebMediaConstraintsPrivate> WebMediaConstraintsPrivate::Create(
RefPtr<WebMediaConstraintsPrivate> WebMediaConstraintsPrivate::Create(
const WebMediaTrackConstraintSet& basic,
const WebVector<WebMediaTrackConstraintSet>& advanced) {
return AdoptRef(new WebMediaConstraintsPrivate(basic, advanced));
......
......@@ -25,8 +25,8 @@
#include "public/platform/WebMediaDeviceInfo.h"
#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/RefCounted.h"
#include "platform/wtf/RefPtr.h"
#include "public/platform/WebString.h"
namespace blink {
......@@ -34,7 +34,7 @@ namespace blink {
class WebMediaDeviceInfoPrivate final
: public RefCounted<WebMediaDeviceInfoPrivate> {
public:
static PassRefPtr<WebMediaDeviceInfoPrivate> Create(
static RefPtr<WebMediaDeviceInfoPrivate> Create(
const WebString& device_id,
WebMediaDeviceInfo::MediaDeviceKind,
const WebString& label,
......@@ -57,7 +57,7 @@ class WebMediaDeviceInfoPrivate final
WebString group_id_;
};
PassRefPtr<WebMediaDeviceInfoPrivate> WebMediaDeviceInfoPrivate::Create(
RefPtr<WebMediaDeviceInfoPrivate> WebMediaDeviceInfoPrivate::Create(
const WebString& device_id,
WebMediaDeviceInfo::MediaDeviceKind kind,
const WebString& label,
......
......@@ -32,8 +32,8 @@
#include <memory>
#include "platform/Prerender.h"
#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/PtrUtil.h"
#include "platform/wtf/RefPtr.h"
namespace blink {
......@@ -41,7 +41,7 @@ namespace {
class PrerenderExtraDataContainer : public Prerender::ExtraData {
public:
static PassRefPtr<PrerenderExtraDataContainer> Create(
static RefPtr<PrerenderExtraDataContainer> Create(
WebPrerender::ExtraData* extra_data) {
return AdoptRef(new PrerenderExtraDataContainer(extra_data));
}
......
......@@ -30,8 +30,8 @@
#include "public/platform/WebRTCICECandidate.h"
#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/RefCounted.h"
#include "platform/wtf/RefPtr.h"
#include "public/platform/WebString.h"
namespace blink {
......@@ -39,7 +39,7 @@ namespace blink {
class WebRTCICECandidatePrivate final
: public RefCounted<WebRTCICECandidatePrivate> {
public:
static PassRefPtr<WebRTCICECandidatePrivate> Create(
static RefPtr<WebRTCICECandidatePrivate> Create(
const WebString& candidate,
const WebString& sdp_mid,
unsigned short sdp_m_line_index) {
......
......@@ -30,8 +30,8 @@
#include "public/platform/WebRTCSessionDescription.h"
#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/RefCounted.h"
#include "platform/wtf/RefPtr.h"
#include "public/platform/WebString.h"
namespace blink {
......@@ -39,9 +39,8 @@ namespace blink {
class WebRTCSessionDescriptionPrivate final
: public RefCounted<WebRTCSessionDescriptionPrivate> {
public:
static PassRefPtr<WebRTCSessionDescriptionPrivate> Create(
const WebString& type,
const WebString& sdp);
static RefPtr<WebRTCSessionDescriptionPrivate> Create(const WebString& type,
const WebString& sdp);
WebString GetType() { return type_; }
void SetType(const WebString& type) { type_ = type; }
......@@ -56,9 +55,9 @@ class WebRTCSessionDescriptionPrivate final
WebString sdp_;
};
PassRefPtr<WebRTCSessionDescriptionPrivate>
WebRTCSessionDescriptionPrivate::Create(const WebString& type,
const WebString& sdp) {
RefPtr<WebRTCSessionDescriptionPrivate> WebRTCSessionDescriptionPrivate::Create(
const WebString& type,
const WebString& sdp) {
return AdoptRef(new WebRTCSessionDescriptionPrivate(type, sdp));
}
......
......@@ -119,7 +119,7 @@ void WebServiceWorkerRequest::SetBlob(
BlobDataHandle::Create(uuid, String(), size, std::move(blob_info));
}
PassRefPtr<BlobDataHandle> WebServiceWorkerRequest::GetBlobDataHandle() const {
RefPtr<BlobDataHandle> WebServiceWorkerRequest::GetBlobDataHandle() const {
return private_->blob_data_handle;
}
......
......@@ -182,11 +182,11 @@ const HTTPHeaderMap& WebServiceWorkerResponse::Headers() const {
}
void WebServiceWorkerResponse::SetBlobDataHandle(
PassRefPtr<BlobDataHandle> blob_data_handle) {
RefPtr<BlobDataHandle> blob_data_handle) {
private_->blob_data_handle = std::move(blob_data_handle);
}
PassRefPtr<BlobDataHandle> WebServiceWorkerResponse::GetBlobDataHandle() const {
RefPtr<BlobDataHandle> WebServiceWorkerResponse::GetBlobDataHandle() const {
return private_->blob_data_handle;
}
......
......@@ -26,7 +26,6 @@
#include "public/platform/WebSpeechSynthesisUtterance.h"
#include "platform/speech/PlatformSpeechSynthesisUtterance.h"
#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/RefPtr.h"
namespace blink {
......
......@@ -26,7 +26,7 @@
#include "public/platform/WebSpeechSynthesisVoice.h"
#include "platform/speech/PlatformSpeechSynthesisVoice.h"
#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/RefPtr.h"
namespace blink {
......
......@@ -59,7 +59,7 @@ const char* WebThreadSafeData::Data() const {
return private_->data();
}
WebThreadSafeData::WebThreadSafeData(PassRefPtr<RawData> data)
WebThreadSafeData::WebThreadSafeData(RefPtr<RawData> data)
: private_(std::move(data)) {}
WebThreadSafeData::WebThreadSafeData(RefPtr<RawData>&& data)
......@@ -75,7 +75,7 @@ WebThreadSafeData& WebThreadSafeData::operator=(
return *this;
}
WebThreadSafeData& WebThreadSafeData::operator=(PassRefPtr<RawData> data) {
WebThreadSafeData& WebThreadSafeData::operator=(RefPtr<RawData> data) {
private_ = std::move(data);
return *this;
}
......
......@@ -175,16 +175,16 @@ void WebURLLoadTiming::SetPushEnd(double end) {
private_->SetPushEnd(end);
}
WebURLLoadTiming::WebURLLoadTiming(PassRefPtr<ResourceLoadTiming> value)
WebURLLoadTiming::WebURLLoadTiming(RefPtr<ResourceLoadTiming> value)
: private_(std::move(value)) {}
WebURLLoadTiming& WebURLLoadTiming::operator=(
PassRefPtr<ResourceLoadTiming> value) {
RefPtr<ResourceLoadTiming> value) {
private_ = std::move(value);
return *this;
}
WebURLLoadTiming::operator PassRefPtr<ResourceLoadTiming>() const {
WebURLLoadTiming::operator RefPtr<ResourceLoadTiming>() const {
return private_.Get();
}
......
......@@ -47,7 +47,7 @@ namespace {
class URLRequestExtraDataContainer : public ResourceRequest::ExtraData {
public:
static PassRefPtr<URLRequestExtraDataContainer> Create(
static RefPtr<URLRequestExtraDataContainer> Create(
WebURLRequest::ExtraData* extra_data) {
return AdoptRef(new URLRequestExtraDataContainer(extra_data));
}
......
......@@ -49,7 +49,7 @@ namespace {
class URLResponseExtraDataContainer : public ResourceResponse::ExtraData {
public:
static PassRefPtr<URLResponseExtraDataContainer> Create(
static RefPtr<URLResponseExtraDataContainer> Create(
WebURLResponse::ExtraData* extra_data) {
return AdoptRef(new URLResponseExtraDataContainer(extra_data));
}
......@@ -125,8 +125,7 @@ void WebURLResponse::SetConnectionReused(bool connection_reused) {
}
void WebURLResponse::SetLoadTiming(const WebURLLoadTiming& timing) {
RefPtr<ResourceLoadTiming> load_timing =
PassRefPtr<ResourceLoadTiming>(timing);
RefPtr<ResourceLoadTiming> load_timing = RefPtr<ResourceLoadTiming>(timing);
resource_response_->SetResourceLoadTiming(std::move(load_timing));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment