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

Side by Side Diff: remoting/host/linux/x_server_clipboard.cc

Issue 824383002: replace COMPILE_ASSERT with static_assert in remoting/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 5 years, 11 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 | « remoting/host/fake_desktop_capturer.cc ('k') | no next file » | 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 "remoting/host/linux/x_server_clipboard.h" 5 #include "remoting/host/linux/x_server_clipboard.h"
6 6
7 #include <X11/extensions/Xfixes.h> 7 #include <X11/extensions/Xfixes.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 Atom atoms[kNumAtomNames]; 70 Atom atoms[kNumAtomNames];
71 if (XInternAtoms(display_, const_cast<char**>(kAtomNames), kNumAtomNames, 71 if (XInternAtoms(display_, const_cast<char**>(kAtomNames), kNumAtomNames,
72 False, atoms)) { 72 False, atoms)) {
73 clipboard_atom_ = atoms[0]; 73 clipboard_atom_ = atoms[0];
74 large_selection_atom_ = atoms[1]; 74 large_selection_atom_ = atoms[1];
75 selection_string_atom_ = atoms[2]; 75 selection_string_atom_ = atoms[2];
76 targets_atom_ = atoms[3]; 76 targets_atom_ = atoms[3];
77 timestamp_atom_ = atoms[4]; 77 timestamp_atom_ = atoms[4];
78 utf8_string_atom_ = atoms[5]; 78 utf8_string_atom_ = atoms[5];
79 COMPILE_ASSERT(kNumAtomNames >= 6, kAtomNames_too_small); 79 static_assert(kNumAtomNames >= 6, "kAtomNames is too small");
80 } else { 80 } else {
81 LOG(ERROR) << "XInternAtoms failed"; 81 LOG(ERROR) << "XInternAtoms failed";
82 } 82 }
83 83
84 XFixesSelectSelectionInput(display_, clipboard_window_, clipboard_atom_, 84 XFixesSelectSelectionInput(display_, clipboard_window_, clipboard_atom_,
85 XFixesSetSelectionOwnerNotifyMask); 85 XFixesSetSelectionOwnerNotifyMask);
86 } 86 }
87 87
88 void XServerClipboard::SetClipboard(const std::string& mime_type, 88 void XServerClipboard::SetClipboard(const std::string& mime_type,
89 const std::string& data) { 89 const std::string& data) {
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 } else { 366 } else {
367 LOG(ERROR) << "XSetSelectionOwner failed for selection " << selection; 367 LOG(ERROR) << "XSetSelectionOwner failed for selection " << selection;
368 } 368 }
369 } 369 }
370 370
371 bool XServerClipboard::IsSelectionOwner(Atom selection) { 371 bool XServerClipboard::IsSelectionOwner(Atom selection) {
372 return selections_owned_.find(selection) != selections_owned_.end(); 372 return selections_owned_.find(selection) != selections_owned_.end();
373 } 373 }
374 374
375 } // namespace remoting 375 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/fake_desktop_capturer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698