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

Side by Side Diff: ui/base/clipboard/clipboard_aura.cc

Issue 199763002: Verify FormatType in ScopedClipboardWriter::WritePickledData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Linux GTK Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « ui/base/clipboard/clipboard_android.cc ('k') | ui/base/clipboard/clipboard_aurax11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/clipboard/clipboard.h" 5 #include "ui/base/clipboard/clipboard.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 ClipboardDataBuilder::WriteBitmap(bitmap); 594 ClipboardDataBuilder::WriteBitmap(bitmap);
595 } 595 }
596 596
597 void Clipboard::WriteData(const FormatType& format, 597 void Clipboard::WriteData(const FormatType& format,
598 const char* data_data, 598 const char* data_data,
599 size_t data_len) { 599 size_t data_len) {
600 ClipboardDataBuilder::WriteData(format.ToString(), data_data, data_len); 600 ClipboardDataBuilder::WriteData(format.ToString(), data_data, data_len);
601 } 601 }
602 602
603 // static 603 // static
604 Clipboard::FormatType Clipboard::GetFormatType( 604 Clipboard::FormatType Clipboard::GetFormatTypeInternal(
605 const std::string& format_string) { 605 const std::string& format_string) {
606 return FormatType::Deserialize(format_string); 606 return FormatType::Deserialize(format_string);
607 } 607 }
608 608
609 // static 609 // static
610 const Clipboard::FormatType& Clipboard::GetUrlFormatType() { 610 const Clipboard::FormatType& Clipboard::GetUrlFormatType() {
611 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypeURIList)); 611 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypeURIList));
612 return type; 612 return type;
613 } 613 }
614 614
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 } 658 }
659 659
660 // static 660 // static
661 const Clipboard::FormatType& Clipboard::GetWebKitSmartPasteFormatType() { 661 const Clipboard::FormatType& Clipboard::GetWebKitSmartPasteFormatType() {
662 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypeWebkitSmartPaste)); 662 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypeWebkitSmartPaste));
663 return type; 663 return type;
664 } 664 }
665 665
666 // static 666 // static
667 const Clipboard::FormatType& Clipboard::GetWebCustomDataFormatType() { 667 const Clipboard::FormatType& Clipboard::GetWebCustomDataFormatType() {
668 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypeWebCustomData)); 668 CR_DEFINE_STATIC_LOCAL(
669 FormatType, type, (GetFormatType(kMimeTypeWebCustomData)));
669 return type; 670 return type;
670 } 671 }
671 672
672 // static 673 // static
673 const Clipboard::FormatType& Clipboard::GetPepperCustomDataFormatType() { 674 const Clipboard::FormatType& Clipboard::GetPepperCustomDataFormatType() {
674 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypePepperCustomData)); 675 CR_DEFINE_STATIC_LOCAL(
676 FormatType, type, (GetFormatType(kMimeTypePepperCustomData)));
675 return type; 677 return type;
676 } 678 }
677 679
678 } // namespace ui 680 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard_android.cc ('k') | ui/base/clipboard/clipboard_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698