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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp

Issue 2004313003: DevTools: migrate from OwnPtr to std::unique_ptr for inspector protocol classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaselined 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/v8_inspector/V8InjectedScriptHost.h" 5 #include "platform/v8_inspector/V8InjectedScriptHost.h"
6 6
7 #include "platform/inspector_protocol/String16.h" 7 #include "platform/inspector_protocol/String16.h"
8 #include "platform/v8_inspector/InjectedScriptNative.h" 8 #include "platform/v8_inspector/InjectedScriptNative.h"
9 #include "platform/v8_inspector/V8Compat.h" 9 #include "platform/v8_inspector/V8Compat.h"
10 #include "platform/v8_inspector/V8DebuggerImpl.h" 10 #include "platform/v8_inspector/V8DebuggerImpl.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 if (info.Length() > 2 && (!info[2]->IsArray() && !info[2]->IsUndefined())) { 164 if (info.Length() > 2 && (!info[2]->IsArray() && !info[2]->IsUndefined())) {
165 NOTREACHED(); 165 NOTREACHED();
166 return; 166 return;
167 } 167 }
168 168
169 v8::Isolate* isolate = info.GetIsolate(); 169 v8::Isolate* isolate = info.GetIsolate();
170 v8::Local<v8::Context> context = isolate->GetCurrentContext(); 170 v8::Local<v8::Context> context = isolate->GetCurrentContext();
171 171
172 v8::Local<v8::Function> function = info[0].As<v8::Function>(); 172 v8::Local<v8::Function> function = info[0].As<v8::Function>();
173 v8::Local<v8::Value> receiver = info[1]; 173 v8::Local<v8::Value> receiver = info[1];
174 OwnPtr<v8::Local<v8::Value>[]> argv = nullptr; 174 std::unique_ptr<v8::Local<v8::Value>[]> argv = nullptr;
175 size_t argc = 0; 175 size_t argc = 0;
176 176
177 if (info.Length() > 2 && info[2]->IsArray()) { 177 if (info.Length() > 2 && info[2]->IsArray()) {
178 v8::Local<v8::Array> arguments = info[2].As<v8::Array>(); 178 v8::Local<v8::Array> arguments = info[2].As<v8::Array>();
179 argc = arguments->Length(); 179 argc = arguments->Length();
180 argv = adoptArrayPtr(new v8::Local<v8::Value>[argc]); 180 argv.reset(new v8::Local<v8::Value>[argc]);
181 for (size_t i = 0; i < argc; ++i) { 181 for (size_t i = 0; i < argc; ++i) {
182 if (!arguments->Get(context, i).ToLocal(&argv[i])) 182 if (!arguments->Get(context, i).ToLocal(&argv[i]))
183 return; 183 return;
184 } 184 }
185 } 185 }
186 186
187 V8DebuggerClient* client = unwrapDebugger(info)->client(); 187 V8DebuggerClient* client = unwrapDebugger(info)->client();
188 client->muteWarningsAndDeprecations(); 188 client->muteWarningsAndDeprecations();
189 189
190 v8::MicrotasksScope microtasks(isolate, v8::MicrotasksScope::kDoNotRunMicrot asks); 190 v8::MicrotasksScope microtasks(isolate, v8::MicrotasksScope::kDoNotRunMicrot asks);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 DCHECK(info.Length() > 0 && info[0]->IsObject()); 236 DCHECK(info.Length() > 0 && info[0]->IsObject());
237 info.GetReturnValue().Set(info[0].As<v8::Object>()->GetPrototype()); 237 info.GetReturnValue().Set(info[0].As<v8::Object>()->GetPrototype());
238 } 238 }
239 239
240 v8::Local<v8::Private> V8Debugger::scopeExtensionPrivate(v8::Isolate* isolate) 240 v8::Local<v8::Private> V8Debugger::scopeExtensionPrivate(v8::Isolate* isolate)
241 { 241 {
242 return v8::Private::ForApi(isolate, toV8StringInternalized(isolate, "V8Debug ger#scopeExtension")); 242 return v8::Private::ForApi(isolate, toV8StringInternalized(isolate, "V8Debug ger#scopeExtension"));
243 } 243 }
244 244
245 } // namespace blink 245 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698