| OLD | NEW |
| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 void Clipboard::DestroyClipboardForCurrentThread() { | 79 void Clipboard::DestroyClipboardForCurrentThread() { |
| 80 base::AutoLock lock(clipboard_map_lock_.Get()); | 80 base::AutoLock lock(clipboard_map_lock_.Get()); |
| 81 | 81 |
| 82 ClipboardMap* clipboard_map = clipboard_map_.Pointer(); | 82 ClipboardMap* clipboard_map = clipboard_map_.Pointer(); |
| 83 base::PlatformThreadId id = base::PlatformThread::CurrentId(); | 83 base::PlatformThreadId id = base::PlatformThread::CurrentId(); |
| 84 ClipboardMap::iterator it = clipboard_map->find(id); | 84 ClipboardMap::iterator it = clipboard_map->find(id); |
| 85 if (it != clipboard_map->end()) | 85 if (it != clipboard_map->end()) |
| 86 clipboard_map->erase(it); | 86 clipboard_map->erase(it); |
| 87 } | 87 } |
| 88 | 88 |
| 89 base::Time Clipboard::GetClipboardLastModifiedTime() const { | 89 base::Time Clipboard::GetLastModifiedTime() const { |
| 90 return base::Time(); | 90 return base::Time(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void Clipboard::ClearLastModifiedTime() {} |
| 94 |
| 93 void Clipboard::DispatchObject(ObjectType type, const ObjectMapParams& params) { | 95 void Clipboard::DispatchObject(ObjectType type, const ObjectMapParams& params) { |
| 94 // Ignore writes with empty parameters. | 96 // Ignore writes with empty parameters. |
| 95 for (const auto& param : params) { | 97 for (const auto& param : params) { |
| 96 if (param.empty()) | 98 if (param.empty()) |
| 97 return; | 99 return; |
| 98 } | 100 } |
| 99 | 101 |
| 100 switch (type) { | 102 switch (type) { |
| 101 case CBF_TEXT: | 103 case CBF_TEXT: |
| 102 WriteText(&(params[0].front()), params[0].size()); | 104 WriteText(&(params[0].front()), params[0].size()); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 std::find(allowed_threads->begin(), allowed_threads->end(), id) == | 163 std::find(allowed_threads->begin(), allowed_threads->end(), id) == |
| 162 allowed_threads->end()) { | 164 allowed_threads->end()) { |
| 163 NOTREACHED(); | 165 NOTREACHED(); |
| 164 base::debug::DumpWithoutCrashing(); | 166 base::debug::DumpWithoutCrashing(); |
| 165 } | 167 } |
| 166 | 168 |
| 167 return id; | 169 return id; |
| 168 } | 170 } |
| 169 | 171 |
| 170 } // namespace ui | 172 } // namespace ui |
| OLD | NEW |