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

Side by Side Diff: third_party/WebKit/Source/core/clipboard/DataObject.cpp

Issue 2873293002: Replace ASSERT with DCHECK_EQ as appropriate (Closed)
Patch Set: rebase Created 3 years, 7 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) 2008, 2009, 2012 Google Inc. All rights reserved. 2 * Copyright (c) 2008, 2009, 2012 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 DataObjectItem* DataObject::FindStringItem(const String& type) const { 241 DataObjectItem* DataObject::FindStringItem(const String& type) const {
242 for (size_t i = 0; i < item_list_.size(); ++i) { 242 for (size_t i = 0; i < item_list_.size(); ++i) {
243 if (item_list_[i]->Kind() == DataObjectItem::kStringKind && 243 if (item_list_[i]->Kind() == DataObjectItem::kStringKind &&
244 item_list_[i]->GetType() == type) 244 item_list_[i]->GetType() == type)
245 return item_list_[i]; 245 return item_list_[i];
246 } 246 }
247 return nullptr; 247 return nullptr;
248 } 248 }
249 249
250 bool DataObject::InternalAddStringItem(DataObjectItem* item) { 250 bool DataObject::InternalAddStringItem(DataObjectItem* item) {
251 ASSERT(item->Kind() == DataObjectItem::kStringKind); 251 DCHECK_EQ(item->Kind(), DataObjectItem::kStringKind);
252 for (size_t i = 0; i < item_list_.size(); ++i) { 252 for (size_t i = 0; i < item_list_.size(); ++i) {
253 if (item_list_[i]->Kind() == DataObjectItem::kStringKind && 253 if (item_list_[i]->Kind() == DataObjectItem::kStringKind &&
254 item_list_[i]->GetType() == item->GetType()) 254 item_list_[i]->GetType() == item->GetType())
255 return false; 255 return false;
256 } 256 }
257 257
258 item_list_.push_back(item); 258 item_list_.push_back(item);
259 return true; 259 return true;
260 } 260 }
261 261
262 void DataObject::InternalAddFileItem(DataObjectItem* item) { 262 void DataObject::InternalAddFileItem(DataObjectItem* item) {
263 ASSERT(item->Kind() == DataObjectItem::kFileKind); 263 DCHECK_EQ(item->Kind(), DataObjectItem::kFileKind);
264 item_list_.push_back(item); 264 item_list_.push_back(item);
265 } 265 }
266 266
267 DEFINE_TRACE(DataObject) { 267 DEFINE_TRACE(DataObject) {
268 visitor->Trace(item_list_); 268 visitor->Trace(item_list_);
269 Supplementable<DataObject>::Trace(visitor); 269 Supplementable<DataObject>::Trace(visitor);
270 } 270 }
271 271
272 DataObject* DataObject::Create(WebDragData data) { 272 DataObject* DataObject::Create(WebDragData data) {
273 DataObject* data_object = Create(); 273 DataObject* data_object = Create();
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 } else { 369 } else {
370 NOTREACHED(); 370 NOTREACHED();
371 } 371 }
372 item_list[i] = item; 372 item_list[i] = item;
373 } 373 }
374 data.SwapItems(item_list); 374 data.SwapItems(item_list);
375 return data; 375 return data;
376 } 376 }
377 377
378 } // namespace blink 378 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698