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

Side by Side Diff: chrome/browser/devtools/device/android_device_manager.cc

Issue 502293002: Remove implicit conversions from scoped_refptr to T* in chrome/browser/devtools/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/devtools/device/android_device_manager.h" 5 #include "chrome/browser/devtools/device/android_device_manager.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "net/base/io_buffer.h" 10 #include "net/base/io_buffer.h"
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 const DevicesCallback& callback, 480 const DevicesCallback& callback,
481 DeviceDescriptors* descriptors_raw) { 481 DeviceDescriptors* descriptors_raw) {
482 scoped_ptr<DeviceDescriptors> descriptors(descriptors_raw); 482 scoped_ptr<DeviceDescriptors> descriptors(descriptors_raw);
483 Devices response; 483 Devices response;
484 DeviceWeakMap new_devices; 484 DeviceWeakMap new_devices;
485 for (DeviceDescriptors::const_iterator it = descriptors->begin(); 485 for (DeviceDescriptors::const_iterator it = descriptors->begin();
486 it != descriptors->end(); 486 it != descriptors->end();
487 ++it) { 487 ++it) {
488 DeviceWeakMap::iterator found = devices_.find(it->serial); 488 DeviceWeakMap::iterator found = devices_.find(it->serial);
489 scoped_refptr<Device> device; 489 scoped_refptr<Device> device;
490 if (found == devices_.end() || !found->second 490 if (found == devices_.end() || !found->second ||
491 || found->second->provider_ != it->provider) { 491 found->second->provider_.get() != it->provider.get()) {
492 device = new Device(handler_thread_->message_loop(), 492 device = new Device(handler_thread_->message_loop(),
493 it->provider, it->serial); 493 it->provider, it->serial);
494 } else { 494 } else {
495 device = found->second.get(); 495 device = found->second.get();
496 } 496 }
497 response.push_back(device); 497 response.push_back(device);
498 new_devices[it->serial] = device->weak_factory_.GetWeakPtr(); 498 new_devices[it->serial] = device->weak_factory_.GetWeakPtr();
499 } 499 }
500 devices_.swap(new_devices); 500 devices_.swap(new_devices);
501 callback.Run(response); 501 callback.Run(response);
502 } 502 }
OLDNEW
« no previous file with comments | « chrome/browser/devtools/device/adb/mock_adb_server.cc ('k') | chrome/browser/devtools/device/port_forwarding_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698