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

Side by Side Diff: headless/lib/browser/headless_web_contents_impl.cc

Issue 2255133002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « headless/lib/browser/headless_devtools.cc ('k') | headless/lib/headless_browser_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "headless/lib/browser/headless_web_contents_impl.h" 5 #include "headless/lib/browser/headless_web_contents_impl.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 178 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
179 browser_context()->DestroyWebContents(this); 179 browser_context()->DestroyWebContents(this);
180 } 180 }
181 181
182 std::string HeadlessWebContentsImpl::GetDevToolsAgentHostId() { 182 std::string HeadlessWebContentsImpl::GetDevToolsAgentHostId() {
183 return agent_host_->GetId(); 183 return agent_host_->GetId();
184 } 184 }
185 185
186 void HeadlessWebContentsImpl::AddObserver(Observer* observer) { 186 void HeadlessWebContentsImpl::AddObserver(Observer* observer) {
187 DCHECK(observer_map_.find(observer) == observer_map_.end()); 187 DCHECK(observer_map_.find(observer) == observer_map_.end());
188 observer_map_[observer] = base::WrapUnique( 188 observer_map_[observer] = base::MakeUnique<WebContentsObserverAdapter>(
189 new WebContentsObserverAdapter(web_contents_.get(), observer)); 189 web_contents_.get(), observer);
190 } 190 }
191 191
192 void HeadlessWebContentsImpl::RemoveObserver(Observer* observer) { 192 void HeadlessWebContentsImpl::RemoveObserver(Observer* observer) {
193 ObserverMap::iterator it = observer_map_.find(observer); 193 ObserverMap::iterator it = observer_map_.find(observer);
194 DCHECK(it != observer_map_.end()); 194 DCHECK(it != observer_map_.end());
195 observer_map_.erase(it); 195 observer_map_.erase(it);
196 } 196 }
197 197
198 HeadlessDevToolsTarget* HeadlessWebContentsImpl::GetDevToolsTarget() { 198 HeadlessDevToolsTarget* HeadlessWebContentsImpl::GetDevToolsTarget() {
199 return web_contents()->GetMainFrame()->IsRenderFrameLive() ? this : nullptr; 199 return web_contents()->GetMainFrame()->IsRenderFrameLive() ? this : nullptr;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 HeadlessWebContents::Builder::MojoService::MojoService() {} 256 HeadlessWebContents::Builder::MojoService::MojoService() {}
257 257
258 HeadlessWebContents::Builder::MojoService::MojoService( 258 HeadlessWebContents::Builder::MojoService::MojoService(
259 const std::string& service_name, 259 const std::string& service_name,
260 const base::Callback<void(mojo::ScopedMessagePipeHandle)>& service_factory) 260 const base::Callback<void(mojo::ScopedMessagePipeHandle)>& service_factory)
261 : service_name(service_name), service_factory(service_factory) {} 261 : service_name(service_name), service_factory(service_factory) {}
262 262
263 HeadlessWebContents::Builder::MojoService::~MojoService() {} 263 HeadlessWebContents::Builder::MojoService::~MojoService() {}
264 264
265 } // namespace headless 265 } // namespace headless
OLDNEW
« no previous file with comments | « headless/lib/browser/headless_devtools.cc ('k') | headless/lib/headless_browser_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698