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

Side by Side Diff: ui/base/x/selection_owner.cc

Issue 828633002: replace COMPILE_ASSERT with static_assert in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix for rebase 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 | « ui/base/resource/data_pack.cc ('k') | ui/base/x/selection_requestor.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/x/selection_owner.h" 5 #include "ui/base/x/selection_owner.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 #include <X11/Xatom.h> 9 #include <X11/Xatom.h>
10 10
(...skipping 22 matching lines...) Expand all
33 }; 33 };
34 34
35 // The period of |incremental_transfer_abort_timer_|. Arbitrary but must be <= 35 // The period of |incremental_transfer_abort_timer_|. Arbitrary but must be <=
36 // than kIncrementalTransferTimeoutMs. 36 // than kIncrementalTransferTimeoutMs.
37 const int kTimerPeriodMs = 1000; 37 const int kTimerPeriodMs = 1000;
38 38
39 // The amount of time to wait for the selection requestor to process the data 39 // The amount of time to wait for the selection requestor to process the data
40 // sent by the selection owner before aborting an incremental data transfer. 40 // sent by the selection owner before aborting an incremental data transfer.
41 const int kIncrementalTransferTimeoutMs = 10000; 41 const int kIncrementalTransferTimeoutMs = 10000;
42 42
43 COMPILE_ASSERT(kTimerPeriodMs <= kIncrementalTransferTimeoutMs, 43 static_assert(kTimerPeriodMs <= kIncrementalTransferTimeoutMs,
44 timer_period_must_be_less_or_equal_to_transfer_timeout); 44 "timer period must be <= transfer timeout");
45 45
46 // Returns a conservative max size of the data we can pass into 46 // Returns a conservative max size of the data we can pass into
47 // XChangeProperty(). Copied from GTK. 47 // XChangeProperty(). Copied from GTK.
48 size_t GetMaxRequestSize(XDisplay* display) { 48 size_t GetMaxRequestSize(XDisplay* display) {
49 long extended_max_size = XExtendedMaxRequestSize(display); 49 long extended_max_size = XExtendedMaxRequestSize(display);
50 long max_size = 50 long max_size =
51 (extended_max_size ? extended_max_size : XMaxRequestSize(display)) - 100; 51 (extended_max_size ? extended_max_size : XMaxRequestSize(display)) - 100;
52 return std::min(static_cast<long>(0x40000), 52 return std::min(static_cast<long>(0x40000),
53 std::max(static_cast<long>(0), max_size)); 53 std::max(static_cast<long>(0), max_size));
54 } 54 }
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 data(data), 375 data(data),
376 offset(offset), 376 offset(offset),
377 timeout(timeout), 377 timeout(timeout),
378 foreign_window_manager_id(foreign_window_manager_id) { 378 foreign_window_manager_id(foreign_window_manager_id) {
379 } 379 }
380 380
381 SelectionOwner::IncrementalTransfer::~IncrementalTransfer() { 381 SelectionOwner::IncrementalTransfer::~IncrementalTransfer() {
382 } 382 }
383 383
384 } // namespace ui 384 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/resource/data_pack.cc ('k') | ui/base/x/selection_requestor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698