Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: Source/core/page/EventSource.cpp

Issue 618583002: Correct data size argument type in resource loading path to unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add static_cast to RELEASE_ASSERT in AssociatedURLLoader::ClientAdapter::didReceiveData Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/page/EventSource.h ('k') | Source/core/workers/WorkerScriptLoader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/page/EventSource.h ('k') | Source/core/workers/WorkerScriptLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698