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

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

Issue 1767883002: DevTools: generate string16-based handlers for v8_inspector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/PromiseTracker.h" 5 #include "platform/v8_inspector/PromiseTracker.h"
6 6
7 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" 7 #include "platform/v8_inspector/V8DebuggerAgentImpl.h"
8 #include "platform/v8_inspector/V8StackTraceImpl.h" 8 #include "platform/v8_inspector/V8StackTraceImpl.h"
9 #include "platform/v8_inspector/public/V8DebuggerClient.h" 9 #include "platform/v8_inspector/public/V8DebuggerClient.h"
10 #include "wtf/PassOwnPtr.h" 10 #include "wtf/PassOwnPtr.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 } 101 }
102 102
103 void PromiseTracker::didReceiveV8PromiseEvent(v8::Local<v8::Context> context, v8 ::Local<v8::Object> promise, v8::Local<v8::Value> parentPromise, int status) 103 void PromiseTracker::didReceiveV8PromiseEvent(v8::Local<v8::Context> context, v8 ::Local<v8::Object> promise, v8::Local<v8::Value> parentPromise, int status)
104 { 104 {
105 ASSERT(isEnabled()); 105 ASSERT(isEnabled());
106 ASSERT(!context.IsEmpty()); 106 ASSERT(!context.IsEmpty());
107 107
108 bool isNewPromise = false; 108 bool isNewPromise = false;
109 int id = promiseId(promise, &isNewPromise); 109 int id = promiseId(promise, &isNewPromise);
110 110
111 String eventType = isNewPromise ? Debugger::PromiseUpdated::EventTypeEnum::N ew : Debugger::PromiseUpdated::EventTypeEnum::Update; 111 String16 eventType = isNewPromise ? Debugger::PromiseUpdated::EventTypeEnum: :New : Debugger::PromiseUpdated::EventTypeEnum::Update;
112 112
113 String promiseStatus; 113 String16 promiseStatus;
114 switch (status) { 114 switch (status) {
115 case 0: 115 case 0:
116 promiseStatus = Debugger::PromiseDetails::StatusEnum::Pending; 116 promiseStatus = Debugger::PromiseDetails::StatusEnum::Pending;
117 break; 117 break;
118 case 1: 118 case 1:
119 promiseStatus = Debugger::PromiseDetails::StatusEnum::Resolved; 119 promiseStatus = Debugger::PromiseDetails::StatusEnum::Resolved;
120 break; 120 break;
121 default: 121 default:
122 promiseStatus = Debugger::PromiseDetails::StatusEnum::Rejected; 122 promiseStatus = Debugger::PromiseDetails::StatusEnum::Rejected;
123 }; 123 };
(...skipping 26 matching lines...) Expand all
150 } 150 }
151 151
152 v8::Local<v8::Object> PromiseTracker::promiseById(int promiseId) 152 v8::Local<v8::Object> PromiseTracker::promiseById(int promiseId)
153 { 153 {
154 ASSERT(isEnabled()); 154 ASSERT(isEnabled());
155 PromiseWrapper* wrapper = m_idToPromise.get(promiseId); 155 PromiseWrapper* wrapper = m_idToPromise.get(promiseId);
156 return wrapper ? wrapper->m_promise.Get(m_isolate) : v8::Local<v8::Object>() ; 156 return wrapper ? wrapper->m_promise.Get(m_isolate) : v8::Local<v8::Object>() ;
157 } 157 }
158 158
159 } // namespace blink 159 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698