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

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

Issue 2205913002: [DevTools] Split a part of V8Inspector into V8Debugger. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v8-inspector-rename
Patch Set: context scope! Created 4 years, 4 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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "platform/v8_inspector/V8FunctionCall.h" 31 #include "platform/v8_inspector/V8FunctionCall.h"
32 32
33 #include "platform/inspector_protocol/Platform.h" 33 #include "platform/inspector_protocol/Platform.h"
34 #include "platform/v8_inspector/V8Compat.h" 34 #include "platform/v8_inspector/V8Compat.h"
35 #include "platform/v8_inspector/V8Debugger.h"
35 #include "platform/v8_inspector/V8InspectorImpl.h" 36 #include "platform/v8_inspector/V8InspectorImpl.h"
36 #include "platform/v8_inspector/V8StringUtil.h" 37 #include "platform/v8_inspector/V8StringUtil.h"
37 #include "platform/v8_inspector/public/V8InspectorClient.h" 38 #include "platform/v8_inspector/public/V8InspectorClient.h"
38 39
39 #include <v8.h> 40 #include <v8.h>
40 41
41 namespace blink { 42 namespace blink {
42 43
43 V8FunctionCall::V8FunctionCall(V8InspectorImpl* inspector, v8::Local<v8::Context > context, v8::Local<v8::Value> value, const String16& name) 44 V8FunctionCall::V8FunctionCall(V8InspectorImpl* inspector, v8::Local<v8::Context > context, v8::Local<v8::Value> value, const String16& name)
44 : m_inspector(inspector) 45 : m_inspector(inspector)
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 92
92 DCHECK(value->IsFunction()); 93 DCHECK(value->IsFunction());
93 94
94 v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(value); 95 v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(value);
95 std::unique_ptr<v8::Local<v8::Value>[]> info(new v8::Local<v8::Value>[m_argu ments.size()]); 96 std::unique_ptr<v8::Local<v8::Value>[]> info(new v8::Local<v8::Value>[m_argu ments.size()]);
96 for (size_t i = 0; i < m_arguments.size(); ++i) { 97 for (size_t i = 0; i < m_arguments.size(); ++i) {
97 info[i] = m_arguments[i]; 98 info[i] = m_arguments[i];
98 DCHECK(!info[i].IsEmpty()); 99 DCHECK(!info[i].IsEmpty());
99 } 100 }
100 101
101 int contextGroupId = V8InspectorImpl::getGroupId(m_context); 102 int contextGroupId = V8Debugger::getGroupId(m_context);
102 if (contextGroupId) 103 if (contextGroupId)
103 m_inspector->client()->muteWarningsAndDeprecations(contextGroupId); 104 m_inspector->client()->muteWarningsAndDeprecations(contextGroupId);
104 v8::MicrotasksScope microtasksScope(m_context->GetIsolate(), v8::MicrotasksS cope::kDoNotRunMicrotasks); 105 v8::MicrotasksScope microtasksScope(m_context->GetIsolate(), v8::MicrotasksS cope::kDoNotRunMicrotasks);
105 v8::MaybeLocal<v8::Value> maybeResult = function->Call(m_context, thisObject , m_arguments.size(), info.get()); 106 v8::MaybeLocal<v8::Value> maybeResult = function->Call(m_context, thisObject , m_arguments.size(), info.get());
106 if (contextGroupId) 107 if (contextGroupId)
107 m_inspector->client()->unmuteWarningsAndDeprecations(contextGroupId); 108 m_inspector->client()->unmuteWarningsAndDeprecations(contextGroupId);
108 109
109 v8::Local<v8::Value> result; 110 v8::Local<v8::Value> result;
110 if (!maybeResult.ToLocal(&result)) 111 if (!maybeResult.ToLocal(&result))
111 return v8::Local<v8::Value>(); 112 return v8::Local<v8::Value>();
112 return result; 113 return result;
113 } 114 }
114 115
115 } // namespace blink 116 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698