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

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

Issue 2199943004: [DevTools] Rename V8Debugger to V8Inspector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/V8DebuggerImpl.h" 35 #include "platform/v8_inspector/V8InspectorImpl.h"
36 #include "platform/v8_inspector/V8StringUtil.h" 36 #include "platform/v8_inspector/V8StringUtil.h"
37 #include "platform/v8_inspector/public/V8DebuggerClient.h" 37 #include "platform/v8_inspector/public/V8InspectorClient.h"
38 38
39 #include <v8.h> 39 #include <v8.h>
40 40
41 namespace blink { 41 namespace blink {
42 42
43 V8FunctionCall::V8FunctionCall(V8DebuggerImpl* debugger, v8::Local<v8::Context> context, v8::Local<v8::Value> value, const String16& name) 43 V8FunctionCall::V8FunctionCall(V8InspectorImpl* inspector, v8::Local<v8::Context > context, v8::Local<v8::Value> value, const String16& name)
44 : m_debugger(debugger) 44 : m_inspector(inspector)
45 , m_context(context) 45 , m_context(context)
46 , m_name(toV8String(context->GetIsolate(), name)) 46 , m_name(toV8String(context->GetIsolate(), name))
47 , m_value(value) 47 , m_value(value)
48 { 48 {
49 } 49 }
50 50
51 void V8FunctionCall::appendArgument(v8::Local<v8::Value> value) 51 void V8FunctionCall::appendArgument(v8::Local<v8::Value> value)
52 { 52 {
53 m_arguments.push_back(value); 53 m_arguments.push_back(value);
54 } 54 }
(...skipping 19 matching lines...) Expand all
74 tryCatch.SetVerbose(reportExceptions); 74 tryCatch.SetVerbose(reportExceptions);
75 75
76 v8::Local<v8::Value> result = callWithoutExceptionHandling(); 76 v8::Local<v8::Value> result = callWithoutExceptionHandling();
77 hadException = tryCatch.HasCaught(); 77 hadException = tryCatch.HasCaught();
78 return result; 78 return result;
79 } 79 }
80 80
81 v8::Local<v8::Value> V8FunctionCall::callWithoutExceptionHandling() 81 v8::Local<v8::Value> V8FunctionCall::callWithoutExceptionHandling()
82 { 82 {
83 // TODO(dgozman): get rid of this check. 83 // TODO(dgozman): get rid of this check.
84 if (!m_debugger->client()->isExecutionAllowed()) 84 if (!m_inspector->client()->isExecutionAllowed())
85 return v8::Local<v8::Value>(); 85 return v8::Local<v8::Value>();
86 86
87 v8::Local<v8::Object> thisObject = v8::Local<v8::Object>::Cast(m_value); 87 v8::Local<v8::Object> thisObject = v8::Local<v8::Object>::Cast(m_value);
88 v8::Local<v8::Value> value; 88 v8::Local<v8::Value> value;
89 if (!thisObject->Get(m_context, m_name).ToLocal(&value)) 89 if (!thisObject->Get(m_context, m_name).ToLocal(&value))
90 return v8::Local<v8::Value>(); 90 return v8::Local<v8::Value>();
91 91
92 DCHECK(value->IsFunction()); 92 DCHECK(value->IsFunction());
93 93
94 v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(value); 94 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()]); 95 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) { 96 for (size_t i = 0; i < m_arguments.size(); ++i) {
97 info[i] = m_arguments[i]; 97 info[i] = m_arguments[i];
98 DCHECK(!info[i].IsEmpty()); 98 DCHECK(!info[i].IsEmpty());
99 } 99 }
100 100
101 int contextGroupId = V8DebuggerImpl::getGroupId(m_context); 101 int contextGroupId = V8InspectorImpl::getGroupId(m_context);
102 if (contextGroupId) 102 if (contextGroupId)
103 m_debugger->client()->muteWarningsAndDeprecations(contextGroupId); 103 m_inspector->client()->muteWarningsAndDeprecations(contextGroupId);
104 v8::MicrotasksScope microtasksScope(m_context->GetIsolate(), v8::MicrotasksS cope::kDoNotRunMicrotasks); 104 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()); 105 v8::MaybeLocal<v8::Value> maybeResult = function->Call(m_context, thisObject , m_arguments.size(), info.get());
106 if (contextGroupId) 106 if (contextGroupId)
107 m_debugger->client()->unmuteWarningsAndDeprecations(contextGroupId); 107 m_inspector->client()->unmuteWarningsAndDeprecations(contextGroupId);
108 108
109 v8::Local<v8::Value> result; 109 v8::Local<v8::Value> result;
110 if (!maybeResult.ToLocal(&result)) 110 if (!maybeResult.ToLocal(&result))
111 return v8::Local<v8::Value>(); 111 return v8::Local<v8::Value>();
112 return result; 112 return result;
113 } 113 }
114 114
115 } // namespace blink 115 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698