| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2012 Ericsson AB. All rights reserved. | 2 * Copyright (C) 2009, 2012 Ericsson AB. All rights reserved. |
| 3 * Copyright (C) 2010 Apple Inc. All rights reserved. | 3 * Copyright (C) 2010 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2011, Code Aurora Forum. All rights reserved. | 4 * Copyright (C) 2011, Code Aurora Forum. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 255 |
| 256 if (responseIsValid) { | 256 if (responseIsValid) { |
| 257 m_state = OPEN; | 257 m_state = OPEN; |
| 258 dispatchEvent(Event::create(EventTypeNames::open)); | 258 dispatchEvent(Event::create(EventTypeNames::open)); |
| 259 } else { | 259 } else { |
| 260 m_loader->cancel(); | 260 m_loader->cancel(); |
| 261 dispatchEvent(Event::create(EventTypeNames::error)); | 261 dispatchEvent(Event::create(EventTypeNames::error)); |
| 262 } | 262 } |
| 263 } | 263 } |
| 264 | 264 |
| 265 void EventSource::didReceiveData(const char* data, int length) | 265 void EventSource::didReceiveData(const char* data, unsigned length) |
| 266 { | 266 { |
| 267 ASSERT(m_state == OPEN); | 267 ASSERT(m_state == OPEN); |
| 268 ASSERT(m_requestInFlight); | 268 ASSERT(m_requestInFlight); |
| 269 | 269 |
| 270 append(m_receiveBuf, m_decoder->decode(data, length)); | 270 append(m_receiveBuf, m_decoder->decode(data, length)); |
| 271 parseEventStream(); | 271 parseEventStream(); |
| 272 } | 272 } |
| 273 | 273 |
| 274 void EventSource::didFinishLoading(unsigned long, double) | 274 void EventSource::didFinishLoading(unsigned long, double) |
| 275 { | 275 { |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 | 431 |
| 432 PassRefPtrWillBeRawPtr<MessageEvent> EventSource::createMessageEvent() | 432 PassRefPtrWillBeRawPtr<MessageEvent> EventSource::createMessageEvent() |
| 433 { | 433 { |
| 434 RefPtrWillBeRawPtr<MessageEvent> event = MessageEvent::create(); | 434 RefPtrWillBeRawPtr<MessageEvent> event = MessageEvent::create(); |
| 435 event->initMessageEvent(m_eventName.isEmpty() ? EventTypeNames::message : m_
eventName, false, false, SerializedScriptValue::create(String(m_data)), m_eventS
treamOrigin, m_lastEventId, 0, nullptr); | 435 event->initMessageEvent(m_eventName.isEmpty() ? EventTypeNames::message : m_
eventName, false, false, SerializedScriptValue::create(String(m_data)), m_eventS
treamOrigin, m_lastEventId, 0, nullptr); |
| 436 m_data.clear(); | 436 m_data.clear(); |
| 437 return event.release(); | 437 return event.release(); |
| 438 } | 438 } |
| 439 | 439 |
| 440 } // namespace blink | 440 } // namespace blink |
| OLD | NEW |