diff options
15 files changed, 166 insertions, 210 deletions
diff --git a/base/numerics/safe_numerics_unittest.cc b/base/numerics/safe_numerics_unittest.cc index 5242e13..cb63ad0 100644 --- a/base/numerics/safe_numerics_unittest.cc +++ b/base/numerics/safe_numerics_unittest.cc @@ -350,7 +350,6 @@ struct TestNumericConversion<Dst, Src, SIGN_PRESERVING_VALUE_PRESERVING> { "Comparison must be sign preserving and value preserving"); const CheckedNumeric<Dst> checked_dst = SrcLimits::max(); - ; TEST_EXPECTED_VALIDITY(RANGE_VALID, checked_dst); if (MaxExponent<Dst>::value > MaxExponent<Src>::value) { if (MaxExponent<Dst>::value >= MaxExponent<Src>::value * 2 - 1) { diff --git a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc index 2f71c1e..f3e98fc 100644 --- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc +++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc @@ -81,217 +81,191 @@ namespace libgtk2ui { namespace { class GtkThemeIconSource : public gfx::ImageSkiaSource { - public: - GtkThemeIconSource(int id, const char* icon, bool enabled) - : id_(id), - icon_(icon), - enabled_(enabled) { - } + public: + GtkThemeIconSource(int id, const char* icon, bool enabled) + : id_(id), icon_(icon), enabled_(enabled) {} - ~GtkThemeIconSource() override {} + ~GtkThemeIconSource() override {} - gfx::ImageSkiaRep GetImageForScale(float scale) override { - ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); - SkBitmap default_icon = rb.GetImageNamed(id_).AsBitmap(); + gfx::ImageSkiaRep GetImageForScale(float scale) override { + ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); + SkBitmap default_icon = rb.GetImageNamed(id_).AsBitmap(); - int scalew = default_icon.width() * scale; - int scaleh = default_icon.height() * scale; + int scalew = default_icon.width() * scale; + int scaleh = default_icon.height() * scale; - // Ask GTK to render the icon to a buffer, which we will steal from. - GtkIconTheme* icon_theme = gtk_icon_theme_get_default(); - GdkPixbuf* gdk_icon = gtk_icon_theme_load_icon( - icon_theme, - icon_, - 20 * scale, - (GtkIconLookupFlags)0, - NULL); + // Ask GTK to render the icon to a buffer, which we will steal from. + GtkIconTheme* icon_theme = gtk_icon_theme_get_default(); + GdkPixbuf* gdk_icon = gtk_icon_theme_load_icon( + icon_theme, icon_, 20 * scale, (GtkIconLookupFlags)0, NULL); - // This can theoretically happen if an icon theme doesn't provide a - // specific image. This should realistically never happen, but I bet there - // are some theme authors who don't reliably provide all icons. - if (!gdk_icon) - return gfx::ImageSkiaRep(); + // This can theoretically happen if an icon theme doesn't provide a + // specific image. This should realistically never happen, but I bet there + // are some theme authors who don't reliably provide all icons. + if (!gdk_icon) + return gfx::ImageSkiaRep(); #if GTK_MAJOR_VERSION == 2 - GtkIconSource* icon_source = gtk_icon_source_new(); - gtk_icon_source_set_pixbuf(icon_source, gdk_icon); - - GdkPixbuf* temp = gtk_style_render_icon( - gtk_rc_get_style(NativeThemeGtk2::instance()->GetButton()), - icon_source, - GTK_TEXT_DIR_NONE, - enabled_ ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, - (GtkIconSize)-1, - NativeThemeGtk2::instance()->GetButton(), - NULL); - - gtk_icon_source_free(icon_source); - g_object_unref(gdk_icon); - - gdk_icon = temp; + GtkIconSource* icon_source = gtk_icon_source_new(); + gtk_icon_source_set_pixbuf(icon_source, gdk_icon); + + GdkPixbuf* temp = gtk_style_render_icon( + gtk_rc_get_style(NativeThemeGtk2::instance()->GetButton()), icon_source, + GTK_TEXT_DIR_NONE, enabled_ ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, + (GtkIconSize)-1, NativeThemeGtk2::instance()->GetButton(), NULL); + + gtk_icon_source_free(icon_source); + g_object_unref(gdk_icon); + + gdk_icon = temp; #endif - SkBitmap retval; - retval.allocN32Pixels(scalew, scaleh); - retval.eraseColor(0); + SkBitmap retval; + retval.allocN32Pixels(scalew, scaleh); + retval.eraseColor(0); - const SkBitmap icon = GdkPixbufToImageSkia(gdk_icon); - g_object_unref(gdk_icon); + const SkBitmap icon = GdkPixbufToImageSkia(gdk_icon); + g_object_unref(gdk_icon); - SkCanvas canvas(retval); - SkPaint paint; + SkCanvas canvas(retval); + SkPaint paint; #if GTK_MAJOR_VERSION > 2 - if (!enabled_) - paint.setAlpha(128); + if (!enabled_) + paint.setAlpha(128); #endif - canvas.drawBitmap(icon, - (scalew / 2) - (icon.width() / 2), - (scaleh / 2) - (icon.height() / 2), - &paint); + canvas.drawBitmap(icon, (scalew / 2) - (icon.width() / 2), + (scaleh / 2) - (icon.height() / 2), &paint); - return gfx::ImageSkiaRep(retval, scale); - } + return gfx::ImageSkiaRep(retval, scale); + } - private: - int id_; - const char* icon_; - bool enabled_; + private: + int id_; + const char* icon_; + bool enabled_; - DISALLOW_COPY_AND_ASSIGN(GtkThemeIconSource); + DISALLOW_COPY_AND_ASSIGN(GtkThemeIconSource); }; - class GtkButtonImageSource : public gfx::ImageSkiaSource { - public: - GtkButtonImageSource(const char* idr_string, gfx::Size size) - : width_(size.width()), - height_(size.height()) { - is_blue_ = !!strstr(idr_string, "IDR_BLUE"); - focus_ = !!strstr(idr_string, "_FOCUSED_"); - - if (strstr(idr_string, "_DISABLED")) { - state_ = ui::NativeTheme::kDisabled; - } else if (strstr(idr_string, "_HOVER")) { - state_ = ui::NativeTheme::kHovered; - } else if (strstr(idr_string, "_PRESSED")) { - state_ = ui::NativeTheme::kPressed; - } else { - state_ = ui::NativeTheme::kNormal; - } + public: + GtkButtonImageSource(const char* idr_string, gfx::Size size) + : width_(size.width()), height_(size.height()) { + is_blue_ = !!strstr(idr_string, "IDR_BLUE"); + focus_ = !!strstr(idr_string, "_FOCUSED_"); + + if (strstr(idr_string, "_DISABLED")) { + state_ = ui::NativeTheme::kDisabled; + } else if (strstr(idr_string, "_HOVER")) { + state_ = ui::NativeTheme::kHovered; + } else if (strstr(idr_string, "_PRESSED")) { + state_ = ui::NativeTheme::kPressed; + } else { + state_ = ui::NativeTheme::kNormal; } + } - ~GtkButtonImageSource() override {} - - gfx::ImageSkiaRep GetImageForScale(float scale) override { - int width = width_ * scale; - int height = height_ * scale; + ~GtkButtonImageSource() override {} - SkBitmap border; - border.allocN32Pixels(width, height); - border.eraseColor(0); + gfx::ImageSkiaRep GetImageForScale(float scale) override { + int width = width_ * scale; + int height = height_ * scale; - // Create a temporary GTK button to snapshot - GtkWidget* window = gtk_offscreen_window_new(); - GtkWidget* button = gtk_toggle_button_new(); + SkBitmap border; + border.allocN32Pixels(width, height); + border.eraseColor(0); - if (state_ == ui::NativeTheme::kPressed) - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), true); - else if (state_ == ui::NativeTheme::kDisabled) - gtk_widget_set_sensitive(button, false); + // Create a temporary GTK button to snapshot + GtkWidget* window = gtk_offscreen_window_new(); + GtkWidget* button = gtk_toggle_button_new(); - gtk_widget_set_size_request(button, width, height); - gtk_container_add(GTK_CONTAINER(window), button); + if (state_ == ui::NativeTheme::kPressed) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), true); + else if (state_ == ui::NativeTheme::kDisabled) + gtk_widget_set_sensitive(button, false); - if (is_blue_) - TurnButtonBlue(button); + gtk_widget_set_size_request(button, width, height); + gtk_container_add(GTK_CONTAINER(window), button); - gtk_widget_show_all(window); + if (is_blue_) + TurnButtonBlue(button); + gtk_widget_show_all(window); - cairo_surface_t* surface = cairo_image_surface_create_for_data( + cairo_surface_t* surface = cairo_image_surface_create_for_data( static_cast<unsigned char*>(border.getAddr(0, 0)), - CAIRO_FORMAT_ARGB32, - width, height, - width * 4); - cairo_t* cr = cairo_create(surface); + CAIRO_FORMAT_ARGB32, width, height, width * 4); + cairo_t* cr = cairo_create(surface); #if GTK_MAJOR_VERSION == 2 - if (focus_) - GTK_WIDGET_SET_FLAGS(button, GTK_HAS_FOCUS); - - int w, h; - GdkPixmap* pixmap; - - { - // http://crbug.com/346740 - ANNOTATE_SCOPED_MEMORY_LEAK; - pixmap = gtk_widget_get_snapshot(button, NULL); - } - - gdk_drawable_get_size(GDK_DRAWABLE(pixmap), &w, &h); - GdkColormap* colormap = gdk_drawable_get_colormap(pixmap); - GdkPixbuf* pixbuf = gdk_pixbuf_get_from_drawable(NULL, - GDK_DRAWABLE(pixmap), - colormap, - 0, 0, 0, 0, w, h); - - gdk_cairo_set_source_pixbuf(cr, pixbuf, 0, 0); - cairo_paint(cr); - - g_object_unref(pixbuf); - g_object_unref(pixmap); -#else - gtk_widget_draw(button, cr); + if (focus_) + GTK_WIDGET_SET_FLAGS(button, GTK_HAS_FOCUS); - // There's probably a better way to do this - if (focus_) - gtk_render_focus(gtk_widget_get_style_context(button), - cr, 0, 0, width, height); -#endif + int w, h; + GdkPixmap* pixmap; - cairo_destroy(cr); - cairo_surface_destroy(surface); + { + // http://crbug.com/346740 + ANNOTATE_SCOPED_MEMORY_LEAK; + pixmap = gtk_widget_get_snapshot(button, NULL); + } - gtk_widget_destroy(window); + gdk_drawable_get_size(GDK_DRAWABLE(pixmap), &w, &h); + GdkColormap* colormap = gdk_drawable_get_colormap(pixmap); + GdkPixbuf* pixbuf = gdk_pixbuf_get_from_drawable( + NULL, GDK_DRAWABLE(pixmap), colormap, 0, 0, 0, 0, w, h); - return gfx::ImageSkiaRep(border, scale); - } + gdk_cairo_set_source_pixbuf(cr, pixbuf, 0, 0); + cairo_paint(cr); - private: - bool is_blue_; - bool focus_; - ui::NativeTheme::State state_; - int width_; - int height_; + g_object_unref(pixbuf); + g_object_unref(pixmap); +#else + gtk_widget_draw(button, cr); - DISALLOW_COPY_AND_ASSIGN(GtkButtonImageSource); -}; + // There's probably a better way to do this + if (focus_) + gtk_render_focus(gtk_widget_get_style_context(button), cr, 0, 0, + width, height); +#endif + cairo_destroy(cr); + cairo_surface_destroy(surface); -class GtkButtonPainter : public views::Painter { - public: - explicit GtkButtonPainter(std::string idr) : idr_(idr) {} - ~GtkButtonPainter() override {} + gtk_widget_destroy(window); - gfx::Size GetMinimumSize() const override { - return gfx::Size(); - } - void Paint(gfx::Canvas* canvas, const gfx::Size& size) override { - gfx::ImageSkiaSource* source = - new GtkButtonImageSource(idr_.c_str(), size); - gfx::ImageSkia image(source, 1); - canvas->DrawImageInt(image, 0, 0); - } + return gfx::ImageSkiaRep(border, scale); + } - private: - std::string idr_; + private: + bool is_blue_; + bool focus_; + ui::NativeTheme::State state_; + int width_; + int height_; - DISALLOW_COPY_AND_ASSIGN(GtkButtonPainter); + DISALLOW_COPY_AND_ASSIGN(GtkButtonImageSource); }; +class GtkButtonPainter : public views::Painter { + public: + explicit GtkButtonPainter(std::string idr) : idr_(idr) {} + ~GtkButtonPainter() override {} + + gfx::Size GetMinimumSize() const override { return gfx::Size(); } + void Paint(gfx::Canvas* canvas, const gfx::Size& size) override { + gfx::ImageSkiaSource* source = new GtkButtonImageSource(idr_.c_str(), size); + gfx::ImageSkia image(source, 1); + canvas->DrawImageInt(image, 0, 0); + } + + private: + std::string idr_; + DISALLOW_COPY_AND_ASSIGN(GtkButtonPainter); +}; struct GObjectDeleter { void operator()(void* ptr) { @@ -783,7 +757,6 @@ scoped_ptr<views::Border> Gtk2UI::CreateNativeBorder( } return std::move(gtk_border); - ; } void Gtk2UI::AddWindowButtonOrderObserver( diff --git a/components/autofill/core/browser/autofill_external_delegate_unittest.cc b/components/autofill/core/browser/autofill_external_delegate_unittest.cc index ee4db91..9897db4 100644 --- a/components/autofill/core/browser/autofill_external_delegate_unittest.cc +++ b/components/autofill/core/browser/autofill_external_delegate_unittest.cc @@ -329,7 +329,6 @@ TEST_F(AutofillExternalDelegateUnitTest, DuplicateAutofillDatalistValues) { autofill_item.push_back(Suggestion()); autofill_item[0].value = ASCIIToUTF16("Rick"); autofill_item[0].frontend_id = kAutofillProfileId; - ; external_delegate_->OnSuggestionsReturned(kQueryId, autofill_item); } diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_tamper_detection_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_tamper_detection_unittest.cc index 636e7e1..ea8bd2d 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_tamper_detection_unittest.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_tamper_detection_unittest.cc @@ -40,8 +40,9 @@ std::string GetEncoded(const std::string& input) { base::MD5Digest digest; base::MD5Sum(input.c_str(), input.size(), &digest); std::string base64encoded; - base::Base64Encode(std::string((char*)digest.a, arraysize(digest.a)), - &base64encoded); + base::Base64Encode( + std::string(reinterpret_cast<char*>(digest.a), arraysize(digest.a)), + &base64encoded); return base64encoded; } @@ -98,9 +99,7 @@ void InitEnv() { namespace data_reduction_proxy { -class DataReductionProxyTamperDetectionTest : public testing::Test { - -}; +using DataReductionProxyTamperDetectionTest = testing::Test; // Tests function ValidateChromeProxyHeader. TEST_F(DataReductionProxyTamperDetectionTest, ChromeProxy) { @@ -709,7 +708,6 @@ TEST_F(DataReductionProxyTamperDetectionTest, CompressionRatio) { int original_content_length; int content_length; int compression_ratio; - ; } tests[] = { // Checks the correctness of histogram for Video {"HTTP/1.1 200 OK\n" @@ -847,4 +845,4 @@ TEST_F(DataReductionProxyTamperDetectionTest, DetectAndReport) { } } -} // namespace +} // namespace data_reduction_proxy diff --git a/components/message_port/web_message_port_channel_impl.cc b/components/message_port/web_message_port_channel_impl.cc index 8a85173e..dca8b4f 100644 --- a/components/message_port/web_message_port_channel_impl.cc +++ b/components/message_port/web_message_port_channel_impl.cc @@ -34,7 +34,6 @@ void WebMessagePortChannelImpl::CreatePair( } *channel1 = new WebMessagePortChannelImpl(std::move(pipe1)); - ; *channel2 = new WebMessagePortChannelImpl(std::move(pipe2)); } diff --git a/components/test_runner/event_sender.cc b/components/test_runner/event_sender.cc index df15076..a5fcc7b 100644 --- a/components/test_runner/event_sender.cc +++ b/components/test_runner/event_sender.cc @@ -636,8 +636,6 @@ EventSenderBindings::GetObjectTemplateBuilder(v8::Isolate* isolate) { .SetProperty("forceLayoutOnEvents", &EventSenderBindings::ForceLayoutOnEvents, &EventSenderBindings::SetForceLayoutOnEvents) - .SetProperty("dragMode", &EventSenderBindings::IsDragMode, - &EventSenderBindings::SetIsDragMode) #if defined(OS_WIN) .SetProperty("WM_KEYDOWN", &EventSenderBindings::WmKeyDown, &EventSenderBindings::SetWmKeyDown) @@ -654,10 +652,10 @@ EventSenderBindings::GetObjectTemplateBuilder(v8::Isolate* isolate) { .SetProperty("WM_SYSCHAR", &EventSenderBindings::WmSysChar, &EventSenderBindings::SetWmSysChar) .SetProperty("WM_SYSDEADCHAR", &EventSenderBindings::WmSysDeadChar, - &EventSenderBindings::SetWmSysDeadChar); -#else - ; + &EventSenderBindings::SetWmSysDeadChar) #endif + .SetProperty("dragMode", &EventSenderBindings::IsDragMode, + &EventSenderBindings::SetIsDragMode); } void EventSenderBindings::EnableDOMUIEventLogging() { @@ -996,7 +994,7 @@ void EventSenderBindings::SetMouseButtonState(gin::Arguments* args) { return; } - int modifiers = -1; // Default to the modifier implied by button_number + int modifiers = -1; // Default to the modifier implied by button_number if (!args->PeekNext().IsEmpty()) { modifiers = GetKeyModifiersFromV8(args->isolate(), args->PeekNext()); } @@ -1493,7 +1491,7 @@ void EventSender::KeyDown(const std::string& code_str, event_down.modifiers |= WebInputEvent::ShiftKey; // See if KeyLocation argument is given. - switch(location) { + switch (location) { case DOMKeyLocationStandard: break; case DOMKeyLocationLeft: @@ -1596,7 +1594,7 @@ std::vector<std::string> EventSender::ContextClick() { #if defined(OS_WIN) current_buttons_ &= ~GetWebMouseEventModifierForButton(WebMouseEvent::ButtonRight); - pressed_button_= WebMouseEvent::ButtonNone; + pressed_button_ = WebMouseEvent::ButtonNone; InitMouseEvent(WebInputEvent::MouseUp, WebMouseEvent::ButtonRight, @@ -2004,7 +2002,7 @@ void EventSender::MouseLeave() { click_count_, 0, &event); - HandleInputEventOnViewOrPopup(event); + HandleInputEventOnViewOrPopup(event); } @@ -2047,7 +2045,7 @@ void EventSender::TrackpadScrollEnd() { } void EventSender::MouseScrollBy(gin::Arguments* args) { - WebMouseWheelEvent event; + WebMouseWheelEvent event; InitMouseWheelEvent(args, false, &event); HandleInputEventOnViewOrPopup(event); } @@ -2096,8 +2094,9 @@ void EventSender::SendCurrentTouchEvent(WebInputEvent::Type type, || touch_point->state == WebTouchPoint::StateCancelled) { touch_points_.erase(touch_points_.begin() + i); --i; - } else + } else { touch_point->state = WebTouchPoint::StateStationary; + } } } diff --git a/content/renderer/media/media_stream_video_capturer_source_unittest.cc b/content/renderer/media/media_stream_video_capturer_source_unittest.cc index 79a2298..b26d74d5 100644 --- a/content/renderer/media/media_stream_video_capturer_source_unittest.cc +++ b/content/renderer/media/media_stream_video_capturer_source_unittest.cc @@ -57,7 +57,6 @@ class MockVideoCapturerSource : public media::VideoCapturerSource { formats.push_back(kFormatLarge); callback.Run(formats); } - }; class MediaStreamVideoCapturerSourceTest : public testing::Test { @@ -214,8 +213,7 @@ TEST_F(MediaStreamVideoCapturerSourceTest, StartCapture( testing::Field(&media::VideoCaptureParams::resolution_change_policy, media::RESOLUTION_POLICY_FIXED_ASPECT_RATIO), - _, _)) - ; + _, _)); blink::WebMediaStreamTrack track = StartSource(); // When the track goes out of scope, the source will be stopped. EXPECT_CALL(mock_delegate(), StopCapture()); @@ -249,8 +247,7 @@ TEST_F(MediaStreamVideoCapturerSourceTest, StartCapture( testing::Field(&media::VideoCaptureParams::resolution_change_policy, media::RESOLUTION_POLICY_ANY_WITHIN_LIMIT), - _, _)) - ; + _, _)); blink::WebMediaStreamTrack track = StartSource(); // When the track goes out of scope, the source will be stopped. EXPECT_CALL(mock_delegate(), StopCapture()); diff --git a/content/renderer/media/render_media_client_unittest.cc b/content/renderer/media/render_media_client_unittest.cc index f40d0c5..5147c49 100644 --- a/content/renderer/media/render_media_client_unittest.cc +++ b/content/renderer/media/render_media_client_unittest.cc @@ -67,7 +67,7 @@ class TestContentRendererClient : public ContentRendererClient { #if defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) bool ContainsWidevine( const std::vector<media::KeySystemInfo>& key_systems_info) { - for (const auto& key_system_info: key_systems_info) { + for (const auto& key_system_info : key_systems_info) { if (key_system_info.key_system == kWidevineKeySystem) return true; } @@ -121,7 +121,6 @@ TEST_F(RenderMediaClientTest, KeySystemNameForUMA) { EXPECT_TRUE(clearkey_uma_name.empty()) << "Clear Key is added by media/ and " "should not be added by the " "MediaClient."; - ; } TEST_F(RenderMediaClientTest, IsKeySystemsUpdateNeeded) { diff --git a/device/bluetooth/bluetooth_socket_bluez.cc b/device/bluetooth/bluetooth_socket_bluez.cc index 5a82ef1..5365aca 100644 --- a/device/bluetooth/bluetooth_socket_bluez.cc +++ b/device/bluetooth/bluetooth_socket_bluez.cc @@ -457,14 +457,12 @@ void BluetoothSocketBlueZ::DoNewConnection( LOG(WARNING) << uuid_.canonical_value() << " :" << fd->value() << ": Invalid file descriptor received from Bluetooth Daemon."; ui_task_runner()->PostTask(FROM_HERE, base::Bind(callback, REJECTED)); - ; return; } if (tcp_socket()) { LOG(WARNING) << uuid_.canonical_value() << ": Already connected"; ui_task_runner()->PostTask(FROM_HERE, base::Bind(callback, REJECTED)); - ; return; } @@ -478,7 +476,6 @@ void BluetoothSocketBlueZ::DoNewConnection( LOG(WARNING) << uuid_.canonical_value() << ": Error adopting socket: " << std::string(net::ErrorToString(net_result)); ui_task_runner()->PostTask(FROM_HERE, base::Bind(callback, REJECTED)); - ; return; } @@ -486,7 +483,6 @@ void BluetoothSocketBlueZ::DoNewConnection( << ": Taking descriptor, confirming success."; fd->TakeValue(); ui_task_runner()->PostTask(FROM_HERE, base::Bind(callback, SUCCESS)); - ; } void BluetoothSocketBlueZ::OnNewConnection( diff --git a/media/blink/multibuffer_unittest.cc b/media/blink/multibuffer_unittest.cc index 63478ff..1b5f76b 100644 --- a/media/blink/multibuffer_unittest.cc +++ b/media/blink/multibuffer_unittest.cc @@ -286,8 +286,8 @@ TEST_F(MultiBufferTest, ReadAllAdvanceFirst) { unsigned char buffer[27]; buffer[17] = 17; size_t to_read = std::min<size_t>(end - pos, 17); - while (AdvanceAll()) - ; + while (AdvanceAll()) { + } int64_t bytes = reader.TryRead(buffer, to_read); EXPECT_GT(bytes, 0); EXPECT_EQ(buffer[17], 17); @@ -316,8 +316,8 @@ TEST_F(MultiBufferTest, ReadAllAdvanceFirst_NeverDefer) { unsigned char buffer[27]; buffer[17] = 17; size_t to_read = std::min<size_t>(end - pos, 17); - while (AdvanceAll()) - ; + while (AdvanceAll()) { + } int64_t bytes = reader.TryRead(buffer, to_read); EXPECT_GT(bytes, 0); EXPECT_EQ(buffer[17], 17); @@ -347,8 +347,8 @@ TEST_F(MultiBufferTest, ReadAllAdvanceFirst_NeverDefer2) { unsigned char buffer[27]; buffer[17] = 17; size_t to_read = std::min<size_t>(end - pos, 17); - while (AdvanceAll()) - ; + while (AdvanceAll()) { + } int64_t bytes = reader.TryRead(buffer, to_read); EXPECT_GT(bytes, 0); EXPECT_EQ(buffer[17], 17); @@ -375,8 +375,8 @@ TEST_F(MultiBufferTest, LRUTest) { // Note, no pinning, all data should end up in LRU. EXPECT_EQ(current_size, lru_->Size()); current_size += max_size; - while (AdvanceAll()) - ; + while (AdvanceAll()) { + } EXPECT_EQ(current_size, lru_->Size()); lru_->IncrementMaxSize(-max_size); lru_->Prune(3); diff --git a/net/quic/congestion_control/cubic.cc b/net/quic/congestion_control/cubic.cc index 6cd6557..9a924b5 100644 --- a/net/quic/congestion_control/cubic.cc +++ b/net/quic/congestion_control/cubic.cc @@ -70,7 +70,6 @@ float Cubic::Beta() const { void Cubic::Reset() { epoch_ = QuicTime::Zero(); // Reset time. app_limited_start_time_ = QuicTime::Zero(); - ; last_update_time_ = QuicTime::Zero(); // Reset time. last_congestion_window_ = 0; last_max_congestion_window_ = 0; diff --git a/net/tools/flip_server/mem_cache.cc b/net/tools/flip_server/mem_cache.cc index 9dd71e3..15c4f79 100644 --- a/net/tools/flip_server/mem_cache.cc +++ b/net/tools/flip_server/mem_cache.cc @@ -206,7 +206,6 @@ FileData* MemoryCache::GetFileData(const std::string& filename) { return NULL; } return fi->second.get(); - ; } bool MemoryCache::AssignFileData(const std::string& filename, diff --git a/remoting/host/it2me/it2me_native_messaging_host.cc b/remoting/host/it2me/it2me_native_messaging_host.cc index 294e23d..2f37cfa 100644 --- a/remoting/host/it2me/it2me_native_messaging_host.cc +++ b/remoting/host/it2me/it2me_native_messaging_host.cc @@ -281,7 +281,7 @@ void It2MeNativeMessagingHost::OnStateChanged( break; default: - ; + break; } SendMessageToClient(std::move(message)); diff --git a/storage/browser/fileapi/file_system_usage_cache.cc b/storage/browser/fileapi/file_system_usage_cache.cc index d9a2d00..8b6ec22 100644 --- a/storage/browser/fileapi/file_system_usage_cache.cc +++ b/storage/browser/fileapi/file_system_usage_cache.cc @@ -133,7 +133,6 @@ bool FileSystemUsageCache::AtomicUpdateUsageByDelta( bool is_valid = true; uint32_t dirty = 0; int64_t usage = 0; - ; if (!Read(usage_file_path, &is_valid, &dirty, &usage)) return false; return Write(usage_file_path, is_valid, dirty, usage + delta); diff --git a/tools/android/forwarder2/forwarder.cc b/tools/android/forwarder2/forwarder.cc index d717c9e..9945674 100644 --- a/tools/android/forwarder2/forwarder.cc +++ b/tools/android/forwarder2/forwarder.cc @@ -98,7 +98,7 @@ class Forwarder::BufferedCopier { case STATE_CLOSING: break; // T10 case STATE_CLOSED: - ; + break; } } @@ -196,7 +196,7 @@ class Forwarder::BufferedCopier { break; case STATE_CLOSED: - ; + break; } } |