OLD | NEW |
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 20 matching lines...) Expand all Loading... |
31 #include "platform/v8_inspector/V8FunctionCall.h" | 31 #include "platform/v8_inspector/V8FunctionCall.h" |
32 | 32 |
33 #include "platform/v8_inspector/V8StringUtil.h" | 33 #include "platform/v8_inspector/V8StringUtil.h" |
34 #include "platform/v8_inspector/public/V8DebuggerClient.h" | 34 #include "platform/v8_inspector/public/V8DebuggerClient.h" |
35 #include "wtf/PassOwnPtr.h" | 35 #include "wtf/PassOwnPtr.h" |
36 | 36 |
37 #include <v8.h> | 37 #include <v8.h> |
38 | 38 |
39 namespace blink { | 39 namespace blink { |
40 | 40 |
41 V8FunctionCall::V8FunctionCall(V8DebuggerClient* client, v8::Local<v8::Context>
context, v8::Local<v8::Value> value, const String& name) | 41 V8FunctionCall::V8FunctionCall(V8DebuggerClient* client, v8::Local<v8::Context>
context, v8::Local<v8::Value> value, const String16& name) |
42 : m_client(client) | 42 : m_client(client) |
43 , m_context(context) | 43 , m_context(context) |
44 , m_name(toV8String(context->GetIsolate(), name)) | 44 , m_name(toV8String(context->GetIsolate(), name)) |
45 , m_value(value) | 45 , m_value(value) |
46 { | 46 { |
47 } | 47 } |
48 | 48 |
49 void V8FunctionCall::appendArgument(v8::Local<v8::Value> value) | 49 void V8FunctionCall::appendArgument(v8::Local<v8::Value> value) |
50 { | 50 { |
51 m_arguments.append(value); | 51 m_arguments.append(value); |
52 } | 52 } |
53 | 53 |
54 void V8FunctionCall::appendArgument(const String& argument) | 54 void V8FunctionCall::appendArgument(const String16& argument) |
55 { | 55 { |
56 m_arguments.append(toV8String(m_context->GetIsolate(), argument)); | 56 m_arguments.append(toV8String(m_context->GetIsolate(), argument)); |
57 } | 57 } |
58 | 58 |
59 void V8FunctionCall::appendArgument(int argument) | 59 void V8FunctionCall::appendArgument(int argument) |
60 { | 60 { |
61 m_arguments.append(v8::Number::New(m_context->GetIsolate(), argument)); | 61 m_arguments.append(v8::Number::New(m_context->GetIsolate(), argument)); |
62 } | 62 } |
63 | 63 |
64 void V8FunctionCall::appendArgument(bool argument) | 64 void V8FunctionCall::appendArgument(bool argument) |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 v8::Local<v8::Object> thisObject = v8::Local<v8::Object>::Cast(m_value); | 115 v8::Local<v8::Object> thisObject = v8::Local<v8::Object>::Cast(m_value); |
116 v8::Local<v8::Value> value; | 116 v8::Local<v8::Value> value; |
117 if (!thisObject->Get(m_context, m_name).ToLocal(&value)) | 117 if (!thisObject->Get(m_context, m_name).ToLocal(&value)) |
118 return v8::Local<v8::Function>(); | 118 return v8::Local<v8::Function>(); |
119 | 119 |
120 ASSERT(value->IsFunction()); | 120 ASSERT(value->IsFunction()); |
121 return v8::Local<v8::Function>::Cast(value); | 121 return v8::Local<v8::Function>::Cast(value); |
122 } | 122 } |
123 | 123 |
124 } // namespace blink | 124 } // namespace blink |
OLD | NEW |