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

Side by Side Diff: chrome/browser/media/media_stream_devices_controller.cc

Issue 2230203002: chrome: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed accidental components/ change Created 4 years, 4 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 "chrome/browser/media/media_stream_devices_controller.h" 5 #include "chrome/browser/media/media_stream_devices_controller.h"
6 6
7 #include <map> 7 #include <map>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 using RequestMap = std::map<std::pair<int, int>, 108 using RequestMap = std::map<std::pair<int, int>,
109 std::unique_ptr<MediaPermissionRequestLogger>>; 109 std::unique_ptr<MediaPermissionRequestLogger>>;
110 110
111 public: 111 public:
112 static void LogRequest(content::WebContents* contents, 112 static void LogRequest(content::WebContents* contents,
113 int render_process_id, 113 int render_process_id,
114 int render_frame_id, 114 int render_frame_id,
115 bool is_secure) { 115 bool is_secure) {
116 RequestMap::key_type key = 116 RequestMap::key_type key =
117 std::make_pair(render_process_id, render_frame_id); 117 std::make_pair(render_process_id, render_frame_id);
118 if (!ContainsKey(GetRequestMap(), key)) { 118 if (!base::ContainsKey(GetRequestMap(), key)) {
119 UMA_HISTOGRAM_BOOLEAN("Pepper.SecureOrigin.MediaStreamRequest", 119 UMA_HISTOGRAM_BOOLEAN("Pepper.SecureOrigin.MediaStreamRequest",
120 is_secure); 120 is_secure);
121 GetRequestMap()[key] = 121 GetRequestMap()[key] =
122 base::WrapUnique(new MediaPermissionRequestLogger(contents, key)); 122 base::WrapUnique(new MediaPermissionRequestLogger(contents, key));
123 } 123 }
124 } 124 }
125 125
126 private: 126 private:
127 MediaPermissionRequestLogger(content::WebContents* contents, 127 MediaPermissionRequestLogger(content::WebContents* contents,
128 RequestMap::key_type key) 128 RequestMap::key_type key)
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 if (android_permission_blocked) 640 if (android_permission_blocked)
641 return false; 641 return false;
642 642
643 // Don't approve device requests if the tab was hidden. 643 // Don't approve device requests if the tab was hidden.
644 // TODO(qinmin): Add a test for this. http://crbug.com/396869. 644 // TODO(qinmin): Add a test for this. http://crbug.com/396869.
645 // TODO(raymes): Shouldn't this apply to all permissions not just audio/video? 645 // TODO(raymes): Shouldn't this apply to all permissions not just audio/video?
646 return web_contents_->GetRenderWidgetHostView()->IsShowing(); 646 return web_contents_->GetRenderWidgetHostView()->IsShowing();
647 #endif 647 #endif
648 return true; 648 return true;
649 } 649 }
OLDNEW
« no previous file with comments | « chrome/browser/local_discovery/service_discovery_device_lister.cc ('k') | chrome/browser/media/router/media_sinks_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698