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

Side by Side Diff: third_party/WebKit/Source/core/html/imports/HTMLImportLoader.cpp

Issue 1571233003: Fix errors caused by unsafe conversions to/from size_t (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improved ALLOW_NUMERIC_ARG_TYPES_PROMOTABLE_TO Created 4 years, 11 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
OLDNEW
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 ASSERT_UNUSED(handle, !handle); 78 ASSERT_UNUSED(handle, !handle);
79 // Resource may already have been loaded with the import loader 79 // Resource may already have been loaded with the import loader
80 // being added as a client later & now being notified. Fail early. 80 // being added as a client later & now being notified. Fail early.
81 if (resource->loadFailedOrCanceled() || response.httpStatusCode() >= 400 || !response.httpHeaderField(HTTPNames::Content_Disposition).isNull()) { 81 if (resource->loadFailedOrCanceled() || response.httpStatusCode() >= 400 || !response.httpHeaderField(HTTPNames::Content_Disposition).isNull()) {
82 setState(StateError); 82 setState(StateError);
83 return; 83 return;
84 } 84 }
85 setState(startWritingAndParsing(response)); 85 setState(startWritingAndParsing(response));
86 } 86 }
87 87
88 void HTMLImportLoader::dataReceived(Resource*, const char* data, unsigned length ) 88 void HTMLImportLoader::dataReceived(Resource*, const char* data, size_t length)
89 { 89 {
90 RefPtrWillBeRawPtr<DocumentWriter> protectingWriter(m_writer.get()); 90 RefPtrWillBeRawPtr<DocumentWriter> protectingWriter(m_writer.get());
91 m_writer->addData(data, length); 91 m_writer->addData(data, length);
92 } 92 }
93 93
94 void HTMLImportLoader::notifyFinished(Resource* resource) 94 void HTMLImportLoader::notifyFinished(Resource* resource)
95 { 95 {
96 // The writer instance indicates that a part of the document can be already loaded. 96 // The writer instance indicates that a part of the document can be already loaded.
97 // We don't take such a case as an error because the partially-loaded docume nt has been visible from script at this point. 97 // We don't take such a case as an error because the partially-loaded docume nt has been visible from script at this point.
98 if (resource->loadFailedOrCanceled() && !m_writer) { 98 if (resource->loadFailedOrCanceled() && !m_writer) {
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 #if ENABLE(OILPAN) 224 #if ENABLE(OILPAN)
225 visitor->trace(m_imports); 225 visitor->trace(m_imports);
226 #endif 226 #endif
227 visitor->trace(m_document); 227 visitor->trace(m_document);
228 visitor->trace(m_writer); 228 visitor->trace(m_writer);
229 visitor->trace(m_microtaskQueue); 229 visitor->trace(m_microtaskQueue);
230 DocumentParserClient::trace(visitor); 230 DocumentParserClient::trace(visitor);
231 } 231 }
232 232
233 } // namespace blink 233 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698