OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 v8::HandleScope handleScope; | 56 v8::HandleScope handleScope; |
57 | 57 |
58 v8::Handle<v8::Context> v8Context = toV8Context(scriptExecutionContext(), m_
worldContext); | 58 v8::Handle<v8::Context> v8Context = toV8Context(scriptExecutionContext(), m_
worldContext); |
59 if (v8Context.IsEmpty()) | 59 if (v8Context.IsEmpty()) |
60 return true; | 60 return true; |
61 | 61 |
62 v8::Context::Scope scope(v8Context); | 62 v8::Context::Scope scope(v8Context); |
63 | 63 |
64 v8::Local<v8::Array> mutationsArray = v8::Array::New(mutations->size()); | 64 v8::Local<v8::Array> mutationsArray = v8::Array::New(mutations->size()); |
65 for (size_t i = 0; i < mutations->size(); ++i) | 65 for (size_t i = 0; i < mutations->size(); ++i) |
66 mutationsArray->Set(v8Integer(i, v8Context->GetIsolate()), toV8(mutation
s->at(i).get(), v8::Handle<v8::Object>(), v8Context->GetIsolate())); | 66 mutationsArray->Set(deprecatedV8Integer(i), toV8(mutations->at(i).get(),
v8::Handle<v8::Object>(), v8Context->GetIsolate())); |
67 | 67 |
68 v8::Handle<v8::Value> observerHandle = toV8(observer, v8::Handle<v8::Object>
(), v8Context->GetIsolate()); | 68 v8::Handle<v8::Value> observerHandle = toV8(observer, v8::Handle<v8::Object>
(), v8Context->GetIsolate()); |
69 if (observerHandle.IsEmpty()) { | 69 if (observerHandle.IsEmpty()) { |
70 if (!isScriptControllerTerminating()) | 70 if (!isScriptControllerTerminating()) |
71 CRASH(); | 71 CRASH(); |
72 return true; | 72 return true; |
73 } | 73 } |
74 | 74 |
75 if (!observerHandle->IsObject()) | 75 if (!observerHandle->IsObject()) |
76 return true; | 76 return true; |
77 | 77 |
78 v8::Handle<v8::Value> argv[] = { | 78 v8::Handle<v8::Value> argv[] = { |
79 mutationsArray, | 79 mutationsArray, |
80 observerHandle | 80 observerHandle |
81 }; | 81 }; |
82 | 82 |
83 bool callbackReturnValue = false; | 83 bool callbackReturnValue = false; |
84 return !invokeCallback(m_callback.get(), v8::Handle<v8::Object>::Cast(observ
erHandle), 2, argv, callbackReturnValue, scriptExecutionContext()); | 84 return !invokeCallback(m_callback.get(), v8::Handle<v8::Object>::Cast(observ
erHandle), 2, argv, callbackReturnValue, scriptExecutionContext()); |
85 } | 85 } |
86 | 86 |
87 } // namespace WebCore | 87 } // namespace WebCore |
OLD | NEW |