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

Side by Side Diff: ui/base/clipboard/clipboard.h

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 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
« no previous file with comments | « ui/aura/env.cc ('k') | ui/base/clipboard/clipboard.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 #ifndef UI_BASE_CLIPBOARD_CLIPBOARD_H_ 5 #ifndef UI_BASE_CLIPBOARD_CLIPBOARD_H_
6 #define UI_BASE_CLIPBOARD_CLIPBOARD_H_ 6 #define UI_BASE_CLIPBOARD_CLIPBOARD_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 friend class TestClipboard; 327 friend class TestClipboard;
328 // For SetClipboardForCurrentThread's argument. 328 // For SetClipboardForCurrentThread's argument.
329 friend struct std::default_delete<Clipboard>; 329 friend struct std::default_delete<Clipboard>;
330 330
331 static base::PlatformThreadId GetAndValidateThreadID(); 331 static base::PlatformThreadId GetAndValidateThreadID();
332 332
333 // A list of allowed threads. By default, this is empty and no thread checking 333 // A list of allowed threads. By default, this is empty and no thread checking
334 // is done (in the unit test case), but a user (like content) can set which 334 // is done (in the unit test case), but a user (like content) can set which
335 // threads are allowed to call this method. 335 // threads are allowed to call this method.
336 typedef std::vector<base::PlatformThreadId> AllowedThreadsVector; 336 typedef std::vector<base::PlatformThreadId> AllowedThreadsVector;
337 static base::LazyInstance<AllowedThreadsVector> allowed_threads_; 337 static base::LazyInstance<AllowedThreadsVector>::DestructorAtExit
338 allowed_threads_;
338 339
339 // Mapping from threads to clipboard objects. 340 // Mapping from threads to clipboard objects.
340 typedef std::map<base::PlatformThreadId, std::unique_ptr<Clipboard>> 341 typedef std::map<base::PlatformThreadId, std::unique_ptr<Clipboard>>
341 ClipboardMap; 342 ClipboardMap;
342 static base::LazyInstance<ClipboardMap> clipboard_map_; 343 static base::LazyInstance<ClipboardMap>::DestructorAtExit clipboard_map_;
343 344
344 // Mutex that controls access to |g_clipboard_map|. 345 // Mutex that controls access to |g_clipboard_map|.
345 static base::LazyInstance<base::Lock>::Leaky clipboard_map_lock_; 346 static base::LazyInstance<base::Lock>::Leaky clipboard_map_lock_;
346 347
347 DISALLOW_COPY_AND_ASSIGN(Clipboard); 348 DISALLOW_COPY_AND_ASSIGN(Clipboard);
348 }; 349 };
349 350
350 } // namespace ui 351 } // namespace ui
351 352
352 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_ 353 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_
OLDNEW
« no previous file with comments | « ui/aura/env.cc ('k') | ui/base/clipboard/clipboard.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698