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 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 } | 288 } |
289 | 289 |
290 bool Notification::requireInteraction() const | 290 bool Notification::requireInteraction() const |
291 { | 291 { |
292 return m_data.requireInteraction; | 292 return m_data.requireInteraction; |
293 } | 293 } |
294 | 294 |
295 ScriptValue Notification::data(ScriptState* scriptState) | 295 ScriptValue Notification::data(ScriptState* scriptState) |
296 { | 296 { |
297 if (m_developerData.isEmpty()) { | 297 if (m_developerData.isEmpty()) { |
298 RefPtr<SerializedScriptValue> serializedValue; | |
299 | |
300 const WebVector<char>& serializedData = m_data.data; | 298 const WebVector<char>& serializedData = m_data.data; |
301 if (serializedData.size()) | 299 RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::c
reate(serializedData.data(), serializedData.size()); |
302 serializedValue = SerializedScriptValueFactory::instance().createFro
mWireBytes(serializedData.data(), serializedData.size()); | |
303 else | |
304 serializedValue = SerializedScriptValueFactory::instance().create(); | |
305 | |
306 m_developerData = ScriptValue(scriptState, serializedValue->deserialize(
scriptState->isolate())); | 300 m_developerData = ScriptValue(scriptState, serializedValue->deserialize(
scriptState->isolate())); |
307 } | 301 } |
308 | 302 |
309 return m_developerData; | 303 return m_developerData; |
310 } | 304 } |
311 | 305 |
312 HeapVector<NotificationAction> Notification::actions() const | 306 HeapVector<NotificationAction> Notification::actions() const |
313 { | 307 { |
314 HeapVector<NotificationAction> actions; | 308 HeapVector<NotificationAction> actions; |
315 actions.grow(m_data.actions.size()); | 309 actions.grow(m_data.actions.size()); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 | 403 |
410 DEFINE_TRACE(Notification) | 404 DEFINE_TRACE(Notification) |
411 { | 405 { |
412 visitor->trace(m_prepareShowMethodRunner); | 406 visitor->trace(m_prepareShowMethodRunner); |
413 visitor->trace(m_loader); | 407 visitor->trace(m_loader); |
414 EventTargetWithInlineData::trace(visitor); | 408 EventTargetWithInlineData::trace(visitor); |
415 ActiveDOMObject::trace(visitor); | 409 ActiveDOMObject::trace(visitor); |
416 } | 410 } |
417 | 411 |
418 } // namespace blink | 412 } // namespace blink |
OLD | NEW |