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

Side by Side Diff: chrome/browser/renderer_host/pepper/monitor_finder_mac.mm

Issue 1100293004: [chrome/browser/renderer_host] favor DCHECK_CURRENTLY_ON for better logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing changes Created 5 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/renderer_host/pepper/monitor_finder_mac.h" 5 #include "chrome/browser/renderer_host/pepper/monitor_finder_mac.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 #include "content/public/browser/render_frame_host.h" 10 #include "content/public/browser/render_frame_host.h"
(...skipping 24 matching lines...) Expand all
35 base::Bind(&MonitorFinder::FetchMonitorFromWidget, this)); 35 base::Bind(&MonitorFinder::FetchMonitorFromWidget, this));
36 return display_id_; 36 return display_id_;
37 } 37 }
38 38
39 // static 39 // static
40 bool MonitorFinder::IsMonitorBuiltIn(int64_t display_id) { 40 bool MonitorFinder::IsMonitorBuiltIn(int64_t display_id) {
41 return CGDisplayIsBuiltin(display_id); 41 return CGDisplayIsBuiltin(display_id);
42 } 42 }
43 43
44 void MonitorFinder::FetchMonitorFromWidget() { 44 void MonitorFinder::FetchMonitorFromWidget() {
45 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 45 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
46 content::RenderFrameHost* rfh = 46 content::RenderFrameHost* rfh =
47 content::RenderFrameHost::FromID(process_id_, render_frame_id_); 47 content::RenderFrameHost::FromID(process_id_, render_frame_id_);
48 if (!rfh) 48 if (!rfh)
49 return; 49 return;
50 50
51 gfx::NativeView native_view = rfh->GetNativeView(); 51 gfx::NativeView native_view = rfh->GetNativeView();
52 NSWindow* window = [native_view window]; 52 NSWindow* window = [native_view window];
53 NSScreen* screen = [window screen]; 53 NSScreen* screen = [window screen];
54 CGDirectDisplayID display_id = 54 CGDirectDisplayID display_id =
55 [[[screen deviceDescription] objectForKey:@"NSScreenNumber"] intValue]; 55 [[[screen deviceDescription] objectForKey:@"NSScreenNumber"] intValue];
56 56
57 base::AutoLock lock(mutex_); 57 base::AutoLock lock(mutex_);
58 request_sent_ = false; 58 request_sent_ = false;
59 display_id_ = display_id; 59 display_id_ = display_id;
60 } 60 }
61 61
62 } // namespace chrome 62 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698