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

Side by Side Diff: ui/gfx/win/singleton_hwnd.cc

Issue 141683005: Removes MessageLoop::Type checks in favor of IsCurrent on MessageLoops. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: base:: Created 6 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 | Annotate | Revision Log
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 "ui/gfx/win/singleton_hwnd.h" 5 #include "ui/gfx/win/singleton_hwnd.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 9
10 namespace gfx { 10 namespace gfx {
(...skipping 19 matching lines...) Expand all
30 LPARAM lparam, 30 LPARAM lparam,
31 LRESULT& result, 31 LRESULT& result,
32 DWORD msg_map_id) { 32 DWORD msg_map_id) {
33 FOR_EACH_OBSERVER(Observer, 33 FOR_EACH_OBSERVER(Observer,
34 observer_list_, 34 observer_list_,
35 OnWndProc(window, message, wparam, lparam)); 35 OnWndProc(window, message, wparam, lparam));
36 return false; 36 return false;
37 } 37 }
38 38
39 SingletonHwnd::SingletonHwnd() { 39 SingletonHwnd::SingletonHwnd() {
40 if (!base::MessageLoop::current() || 40 if (!base::MessageLoopForUI::IsCurrent()) {
41 base::MessageLoop::current()->type() != base::MessageLoop::TYPE_UI) {
42 // Creating this window in (e.g.) a renderer inhibits shutdown on 41 // Creating this window in (e.g.) a renderer inhibits shutdown on
43 // Windows. See http://crbug.com/230122 and http://crbug.com/236039. 42 // Windows. See http://crbug.com/230122 and http://crbug.com/236039.
44 DLOG(ERROR) << "Cannot create windows on non-UI thread!"; 43 DLOG(ERROR) << "Cannot create windows on non-UI thread!";
45 return; 44 return;
46 } 45 }
47 WindowImpl::Init(NULL, Rect()); 46 WindowImpl::Init(NULL, Rect());
48 } 47 }
49 48
50 SingletonHwnd::~SingletonHwnd() { 49 SingletonHwnd::~SingletonHwnd() {
51 } 50 }
52 51
53 } // namespace gfx 52 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/ozone/dri/dri_surface_factory.cc ('k') | webkit/browser/appcache/appcache_update_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698