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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc

Issue 1162943002: Replace more ObserverList with base::ObserverList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@observer
Patch Set: Created 5 years, 6 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
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 "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 void TearDown() override { TearDownEnvironment(); } 437 void TearDown() override { TearDownEnvironment(); }
438 438
439 void set_widget_host_uses_shutdown_to_destroy(bool use) { 439 void set_widget_host_uses_shutdown_to_destroy(bool use) {
440 widget_host_uses_shutdown_to_destroy_ = use; 440 widget_host_uses_shutdown_to_destroy_ = use;
441 } 441 }
442 442
443 void SimulateMemoryPressure( 443 void SimulateMemoryPressure(
444 base::MemoryPressureListener::MemoryPressureLevel level) { 444 base::MemoryPressureListener::MemoryPressureLevel level) {
445 // Here should be base::MemoryPressureListener::NotifyMemoryPressure, but 445 // Here should be base::MemoryPressureListener::NotifyMemoryPressure, but
446 // since the RendererFrameManager is installing a MemoryPressureListener 446 // since the RendererFrameManager is installing a MemoryPressureListener
447 // which uses ObserverListThreadSafe, which furthermore remembers the 447 // which uses base::ObserverListThreadSafe, which furthermore remembers the
448 // message loop for the thread it was created in. Between tests, the 448 // message loop for the thread it was created in. Between tests, the
449 // RendererFrameManager singleton survives and and the MessageLoop gets 449 // RendererFrameManager singleton survives and and the MessageLoop gets
450 // destroyed. The correct fix would be to have ObserverListThreadSafe look 450 // destroyed. The correct fix would be to have base::ObserverListThreadSafe
451 // look
451 // up the proper message loop every time (see crbug.com/443824.) 452 // up the proper message loop every time (see crbug.com/443824.)
452 RendererFrameManager::GetInstance()->OnMemoryPressure(level); 453 RendererFrameManager::GetInstance()->OnMemoryPressure(level);
453 } 454 }
454 455
455 void SendInputEventACK(WebInputEvent::Type type, 456 void SendInputEventACK(WebInputEvent::Type type,
456 InputEventAckState ack_result) { 457 InputEventAckState ack_result) {
457 DCHECK(!WebInputEvent::isTouchEventType(type)); 458 DCHECK(!WebInputEvent::isTouchEventType(type));
458 InputEventAck ack(type, ack_result); 459 InputEventAck ack(type, ack_result);
459 InputHostMsg_HandleInputEvent_ACK response(0, ack); 460 InputHostMsg_HandleInputEvent_ACK response(0, ack);
460 widget_host_->OnMessageReceived(response); 461 widget_host_->OnMessageReceived(response);
(...skipping 3109 matching lines...) Expand 10 before | Expand all | Expand 10 after
3570 ViewMsg_SetSurfaceIdNamespace::Read(msg, &params); 3571 ViewMsg_SetSurfaceIdNamespace::Read(msg, &params);
3571 view_->InitAsChild(NULL); 3572 view_->InitAsChild(NULL);
3572 view_->Show(); 3573 view_->Show();
3573 view_->SetSize(size); 3574 view_->SetSize(size);
3574 view_->OnSwapCompositorFrame(0, 3575 view_->OnSwapCompositorFrame(0,
3575 MakeDelegatedFrame(1.f, size, gfx::Rect(size))); 3576 MakeDelegatedFrame(1.f, size, gfx::Rect(size)));
3576 EXPECT_EQ(view_->GetSurfaceIdNamespace(), base::get<0>(params)); 3577 EXPECT_EQ(view_->GetSurfaceIdNamespace(), base::get<0>(params));
3577 } 3578 }
3578 3579
3579 } // namespace content 3580 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.h ('k') | content/browser/service_worker/embedded_worker_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698