| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 static unsigned s_observerPriority = 0; | 48 static unsigned s_observerPriority = 0; |
| 49 | 49 |
| 50 struct MutationObserver::ObserverLessThan { | 50 struct MutationObserver::ObserverLessThan { |
| 51 bool operator()(const RefPtr<MutationObserver>& lhs, const RefPtr<MutationOb
server>& rhs) | 51 bool operator()(const RefPtr<MutationObserver>& lhs, const RefPtr<MutationOb
server>& rhs) |
| 52 { | 52 { |
| 53 return lhs->m_priority < rhs->m_priority; | 53 return lhs->m_priority < rhs->m_priority; |
| 54 } | 54 } |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 PassRefPtr<MutationObserver> MutationObserver::create(PassRefPtr<MutationCallbac
k> callback) | 57 PassRefPtr<MutationObserver> MutationObserver::create(PassOwnPtr<MutationCallbac
k> callback) |
| 58 { | 58 { |
| 59 ASSERT(isMainThread()); | 59 ASSERT(isMainThread()); |
| 60 return adoptRef(new MutationObserver(callback)); | 60 return adoptRef(new MutationObserver(callback)); |
| 61 } | 61 } |
| 62 | 62 |
| 63 MutationObserver::MutationObserver(PassRefPtr<MutationCallback> callback) | 63 MutationObserver::MutationObserver(PassOwnPtr<MutationCallback> callback) |
| 64 : m_callback(callback) | 64 : m_callback(callback) |
| 65 , m_priority(s_observerPriority++) | 65 , m_priority(s_observerPriority++) |
| 66 { | 66 { |
| 67 ScriptWrappable::init(this); | 67 ScriptWrappable::init(this); |
| 68 } | 68 } |
| 69 | 69 |
| 70 MutationObserver::~MutationObserver() | 70 MutationObserver::~MutationObserver() |
| 71 { | 71 { |
| 72 ASSERT(m_registrations.isEmpty()); | 72 ASSERT(m_registrations.isEmpty()); |
| 73 } | 73 } |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 observers[i]->deliver(); | 257 observers[i]->deliver(); |
| 258 else | 258 else |
| 259 suspendedMutationObservers().add(observers[i]); | 259 suspendedMutationObservers().add(observers[i]); |
| 260 } | 260 } |
| 261 } | 261 } |
| 262 | 262 |
| 263 deliveryInProgress = false; | 263 deliveryInProgress = false; |
| 264 } | 264 } |
| 265 | 265 |
| 266 } // namespace WebCore | 266 } // namespace WebCore |
| OLD | NEW |