| 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 } | 241 } |
| 242 | 242 |
| 243 ExecutionContext* EventSource::getExecutionContext() const { | 243 ExecutionContext* EventSource::getExecutionContext() const { |
| 244 return ActiveDOMObject::getExecutionContext(); | 244 return ActiveDOMObject::getExecutionContext(); |
| 245 } | 245 } |
| 246 | 246 |
| 247 void EventSource::didReceiveResponse( | 247 void EventSource::didReceiveResponse( |
| 248 unsigned long, | 248 unsigned long, |
| 249 const ResourceResponse& response, | 249 const ResourceResponse& response, |
| 250 std::unique_ptr<WebDataConsumerHandle> handle) { | 250 std::unique_ptr<WebDataConsumerHandle> handle) { |
| 251 ASSERT_UNUSED(handle, !handle); | 251 DCHECK(!handle); |
| 252 DCHECK_EQ(kConnecting, m_state); | 252 DCHECK_EQ(kConnecting, m_state); |
| 253 DCHECK(m_loader); | 253 DCHECK(m_loader); |
| 254 | 254 |
| 255 m_currentURL = response.url(); | 255 m_currentURL = response.url(); |
| 256 m_eventStreamOrigin = SecurityOrigin::create(response.url())->toString(); | 256 m_eventStreamOrigin = SecurityOrigin::create(response.url())->toString(); |
| 257 int statusCode = response.httpStatusCode(); | 257 int statusCode = response.httpStatusCode(); |
| 258 bool mimeTypeIsValid = response.mimeType() == "text/event-stream"; | 258 bool mimeTypeIsValid = response.mimeType() == "text/event-stream"; |
| 259 bool responseIsValid = statusCode == 200 && mimeTypeIsValid; | 259 bool responseIsValid = statusCode == 200 && mimeTypeIsValid; |
| 260 if (responseIsValid) { | 260 if (responseIsValid) { |
| 261 const String& charset = response.textEncodingName(); | 261 const String& charset = response.textEncodingName(); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 | 378 |
| 379 DEFINE_TRACE(EventSource) { | 379 DEFINE_TRACE(EventSource) { |
| 380 visitor->trace(m_parser); | 380 visitor->trace(m_parser); |
| 381 visitor->trace(m_loader); | 381 visitor->trace(m_loader); |
| 382 EventTargetWithInlineData::trace(visitor); | 382 EventTargetWithInlineData::trace(visitor); |
| 383 ActiveDOMObject::trace(visitor); | 383 ActiveDOMObject::trace(visitor); |
| 384 EventSourceParser::Client::trace(visitor); | 384 EventSourceParser::Client::trace(visitor); |
| 385 } | 385 } |
| 386 | 386 |
| 387 } // namespace blink | 387 } // namespace blink |
| OLD | NEW |