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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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: third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
index 0c28189f46a62aab95d99d117583718231e7d9c3..1cd98091698f8cc6518345d10f001946387da3c1 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
@@ -58,11 +58,9 @@
#include "public/platform/WebScheduler.h"
#include "public/platform/WebThread.h"
#include "wtf/AddressSanitizer.h"
-#include "wtf/PtrUtil.h"
#include "wtf/RefPtr.h"
#include "wtf/text/WTFString.h"
#include "wtf/typed_arrays/ArrayBufferContents.h"
-#include <memory>
#include <v8-debug.h>
#include <v8-profiler.h>
@@ -125,7 +123,7 @@ static void messageHandlerInMainThread(v8::Local<v8::Message> message, v8::Local
return;
ExecutionContext* context = scriptState->getExecutionContext();
- std::unique_ptr<SourceLocation> location = SourceLocation::fromMessage(isolate, message, context);
+ OwnPtr<SourceLocation> location = SourceLocation::fromMessage(isolate, message, context);
AccessControlStatus accessControlStatus = NotSharableCrossOrigin;
if (message->IsOpaque())
@@ -204,7 +202,7 @@ static void promiseRejectHandler(v8::PromiseRejectMessage data, RejectedPromises
String errorMessage;
AccessControlStatus corsStatus = NotSharableCrossOrigin;
- std::unique_ptr<SourceLocation> location;
+ OwnPtr<SourceLocation> location;
v8::Local<v8::Message> message = v8::Exception::CreateMessage(isolate, exception);
if (!message.IsEmpty()) {
@@ -364,7 +362,7 @@ void V8Initializer::initializeMainThread()
if (RuntimeEnabledFeatures::v8IdleTasksEnabled()) {
WebScheduler* scheduler = Platform::current()->currentThread()->scheduler();
- V8PerIsolateData::enableIdleTasks(isolate, wrapUnique(new V8IdleTaskRunner(scheduler)));
+ V8PerIsolateData::enableIdleTasks(isolate, adoptPtr(new V8IdleTaskRunner(scheduler)));
}
isolate->SetPromiseRejectCallback(promiseRejectHandlerInMainThread);
@@ -373,7 +371,7 @@ void V8Initializer::initializeMainThread()
profiler->SetWrapperClassInfoProvider(WrapperTypeInfo::NodeClassId, &RetainedDOMInfo::createRetainedDOMInfo);
ASSERT(ThreadState::mainThreadState());
- ThreadState::mainThreadState()->addInterruptor(wrapUnique(new V8IsolateInterruptor(isolate)));
+ ThreadState::mainThreadState()->addInterruptor(adoptPtr(new V8IsolateInterruptor(isolate)));
if (RuntimeEnabledFeatures::traceWrappablesEnabled()) {
ThreadState::mainThreadState()->registerTraceDOMWrappers(isolate,
V8GCController::traceDOMWrappers,
@@ -384,7 +382,7 @@ void V8Initializer::initializeMainThread()
nullptr);
}
- V8PerIsolateData::from(isolate)->setThreadDebugger(wrapUnique(new MainThreadDebugger(isolate)));
+ V8PerIsolateData::from(isolate)->setThreadDebugger(adoptPtr(new MainThreadDebugger(isolate)));
}
void V8Initializer::shutdownMainThread()
@@ -419,7 +417,7 @@ static void messageHandlerInWorker(v8::Local<v8::Message> message, v8::Local<v8:
perIsolateData->setReportingException(true);
ExecutionContext* context = scriptState->getExecutionContext();
- std::unique_ptr<SourceLocation> location = SourceLocation::fromMessage(isolate, message, context);
+ OwnPtr<SourceLocation> location = SourceLocation::fromMessage(isolate, message, context);
ErrorEvent* event = ErrorEvent::create(toCoreStringWithNullCheck(message->Get()), std::move(location), &scriptState->world());
AccessControlStatus corsStatus = message->IsSharedCrossOrigin() ? SharableCrossOrigin : NotSharableCrossOrigin;

Powered by Google App Engine
This is Rietveld 408576698