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

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

Issue 2087953004: Switch v8 inspector to stl collections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 V8FunctionCall::V8FunctionCall(V8DebuggerImpl* debugger, v8::Local<v8::Context> context, v8::Local<v8::Value> value, const String16& name) 43 V8FunctionCall::V8FunctionCall(V8DebuggerImpl* debugger, v8::Local<v8::Context> context, v8::Local<v8::Value> value, const String16& name)
44 : m_debugger(debugger) 44 : m_debugger(debugger)
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.append(value); 53 m_arguments.push_back(value);
54 } 54 }
55 55
56 void V8FunctionCall::appendArgument(const String16& argument) 56 void V8FunctionCall::appendArgument(const String16& argument)
57 { 57 {
58 m_arguments.append(toV8String(m_context->GetIsolate(), argument)); 58 m_arguments.push_back(toV8String(m_context->GetIsolate(), argument));
59 } 59 }
60 60
61 void V8FunctionCall::appendArgument(int argument) 61 void V8FunctionCall::appendArgument(int argument)
62 { 62 {
63 m_arguments.append(v8::Number::New(m_context->GetIsolate(), argument)); 63 m_arguments.push_back(v8::Number::New(m_context->GetIsolate(), argument));
64 } 64 }
65 65
66 void V8FunctionCall::appendArgument(bool argument) 66 void V8FunctionCall::appendArgument(bool argument)
67 { 67 {
68 m_arguments.append(argument ? v8::True(m_context->GetIsolate()) : v8::False( m_context->GetIsolate())); 68 m_arguments.push_back(argument ? v8::True(m_context->GetIsolate()) : v8::Fal se(m_context->GetIsolate()));
69 } 69 }
70 70
71 void V8FunctionCall::appendUndefinedArgument() 71 void V8FunctionCall::appendUndefinedArgument()
72 { 72 {
73 m_arguments.append(v8::Undefined(m_context->GetIsolate())); 73 m_arguments.push_back(v8::Undefined(m_context->GetIsolate()));
74 } 74 }
75 75
76 v8::Local<v8::Value> V8FunctionCall::call(bool& hadException, bool reportExcepti ons) 76 v8::Local<v8::Value> V8FunctionCall::call(bool& hadException, bool reportExcepti ons)
77 { 77 {
78 v8::TryCatch tryCatch(m_context->GetIsolate()); 78 v8::TryCatch tryCatch(m_context->GetIsolate());
79 tryCatch.SetVerbose(reportExceptions); 79 tryCatch.SetVerbose(reportExceptions);
80 80
81 v8::Local<v8::Value> result = callWithoutExceptionHandling(); 81 v8::Local<v8::Value> result = callWithoutExceptionHandling();
82 hadException = tryCatch.HasCaught(); 82 hadException = tryCatch.HasCaught();
83 return result; 83 return result;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 v8::Local<v8::Object> thisObject = v8::Local<v8::Object>::Cast(m_value); 116 v8::Local<v8::Object> thisObject = v8::Local<v8::Object>::Cast(m_value);
117 v8::Local<v8::Value> value; 117 v8::Local<v8::Value> value;
118 if (!thisObject->Get(m_context, m_name).ToLocal(&value)) 118 if (!thisObject->Get(m_context, m_name).ToLocal(&value))
119 return v8::Local<v8::Function>(); 119 return v8::Local<v8::Function>();
120 120
121 DCHECK(value->IsFunction()); 121 DCHECK(value->IsFunction());
122 return v8::Local<v8::Function>::Cast(value); 122 return v8::Local<v8::Function>::Cast(value);
123 } 123 }
124 124
125 } // namespace blink 125 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698