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

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

Issue 2858963002: Replace ASSERT with DCHECK in core/ (Closed)
Patch Set: WorkerBackingThread 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 type_(type), 111 type_(type),
112 sequence_number_(sequence_number) {} 112 sequence_number_(sequence_number) {}
113 113
114 File* DataObjectItem::GetAsFile() const { 114 File* DataObjectItem::GetAsFile() const {
115 if (Kind() != kFileKind) 115 if (Kind() != kFileKind)
116 return nullptr; 116 return nullptr;
117 117
118 if (source_ == kInternalSource) { 118 if (source_ == kInternalSource) {
119 if (file_) 119 if (file_)
120 return file_.Get(); 120 return file_.Get();
121 ASSERT(shared_buffer_); 121 DCHECK(shared_buffer_);
122 // FIXME: This code is currently impossible--we never populate 122 // FIXME: This code is currently impossible--we never populate
123 // m_sharedBuffer when dragging in. At some point though, we may need to 123 // m_sharedBuffer when dragging in. At some point though, we may need to
124 // support correctly converting a shared buffer into a file. 124 // support correctly converting a shared buffer into a file.
125 return nullptr; 125 return nullptr;
126 } 126 }
127 127
128 ASSERT(source_ == kPasteboardSource); 128 ASSERT(source_ == kPasteboardSource);
129 if (GetType() == kMimeTypeImagePng) { 129 if (GetType() == kMimeTypeImagePng) {
130 WebBlobInfo blob_info = Platform::Current()->Clipboard()->ReadImage( 130 WebBlobInfo blob_info = Platform::Current()->Clipboard()->ReadImage(
131 WebClipboard::kBufferStandard); 131 WebClipboard::kBufferStandard);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 183
184 String DataObjectItem::FileSystemId() const { 184 String DataObjectItem::FileSystemId() const {
185 return file_system_id_; 185 return file_system_id_;
186 } 186 }
187 187
188 DEFINE_TRACE(DataObjectItem) { 188 DEFINE_TRACE(DataObjectItem) {
189 visitor->Trace(file_); 189 visitor->Trace(file_);
190 } 190 }
191 191
192 } // namespace blink 192 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/clipboard/DataObject.cpp ('k') | third_party/WebKit/Source/core/clipboard/DataTransfer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698