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

Side by Side Diff: Source/core/clipboard/Pasteboard.h

Issue 1171223004: Sanitize SVG animation attributes which could set JavaScript URL values. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | « no previous file | Source/core/core.gypi » ('j') | Source/core/svg/SVGAnimateElement.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Computer, 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 28 matching lines...) Expand all
39 class KURL; 39 class KURL;
40 40
41 class Pasteboard { 41 class Pasteboard {
42 WTF_MAKE_NONCOPYABLE(Pasteboard); WTF_MAKE_FAST_ALLOCATED(Pasteboard); 42 WTF_MAKE_NONCOPYABLE(Pasteboard); WTF_MAKE_FAST_ALLOCATED(Pasteboard);
43 public: 43 public:
44 enum SmartReplaceOption { 44 enum SmartReplaceOption {
45 CanSmartReplace, 45 CanSmartReplace,
46 CannotSmartReplace 46 CannotSmartReplace
47 }; 47 };
48 48
49 Pasteboard();
dcheng 2015/06/10 09:35:28 Can we just use Pasteboard::generalPasteboard() in
50
49 static Pasteboard* generalPasteboard(); 51 static Pasteboard* generalPasteboard();
50 void writePlainText(const String&, SmartReplaceOption); 52 void writePlainText(const String&, SmartReplaceOption);
51 void writeImage(Image*, const KURL&, const String& title); 53 void writeImage(Image*, const KURL&, const String& title);
52 void writeDataObject(DataObject*); 54 void writeDataObject(DataObject*);
53 bool canSmartReplace(); 55 bool canSmartReplace();
54 bool isHTMLAvailable(); 56 bool isHTMLAvailable();
55 String plainText(); 57 String plainText();
56 58
57 // If no data is read, an empty string will be returned and all out paramete rs will be cleared. 59 // If no data is read, an empty string will be returned and all out paramete rs will be cleared.
58 // If applicable, the page URL will be assigned to the KURL parameter. 60 // If applicable, the page URL will be assigned to the KURL parameter.
59 // fragmentStart and fragmentEnd are indexes into the returned markup that i ndicate 61 // fragmentStart and fragmentEnd are indexes into the returned markup that i ndicate
60 // the start and end of the returned markup. If there is no additional conte xt, 62 // the start and end of the returned markup. If there is no additional conte xt,
61 // fragmentStart will be zero and fragmentEnd will be the same as the length of the markup. 63 // fragmentStart will be zero and fragmentEnd will be the same as the length of the markup.
62 String readHTML(KURL&, unsigned& fragmentStart, unsigned& fragmentEnd); 64 String readHTML(KURL&, unsigned& fragmentStart, unsigned& fragmentEnd);
63 65
64 void writeHTML(const String& markup, const KURL& documentURL, const String& plainText, bool canSmartCopyOrDelete); 66 void writeHTML(const String& markup, const KURL& documentURL, const String& plainText, bool canSmartCopyOrDelete);
65 67
66 bool isSelectionMode() const; 68 bool isSelectionMode() const;
67 void setSelectionMode(bool); 69 void setSelectionMode(bool);
68 70
69 WebClipboard::Buffer buffer() const { return m_buffer; } 71 WebClipboard::Buffer buffer() const { return m_buffer; }
70 72
71 private: 73 private:
72 Pasteboard();
73
74 WebClipboard::Buffer m_buffer; 74 WebClipboard::Buffer m_buffer;
75 }; 75 };
76 76
77 } // namespace blink 77 } // namespace blink
78 78
79 #endif // Pasteboard_h 79 #endif // Pasteboard_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/core.gypi » ('j') | Source/core/svg/SVGAnimateElement.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698