| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "components/webdata/common/web_data_request_manager.h" | 5 #include "components/webdata/common/web_data_request_manager.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 8 #include "base/location.h" | 10 #include "base/location.h" |
| 9 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 10 #include "base/profiler/scoped_tracker.h" | 12 #include "base/profiler/scoped_tracker.h" |
| 11 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
| 12 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
| 13 | 15 |
| 14 //////////////////////////////////////////////////////////////////////////////// | 16 //////////////////////////////////////////////////////////////////////////////// |
| 15 // | 17 // |
| 16 // WebDataRequest implementation. | 18 // WebDataRequest implementation. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 cancelled_ = true; | 58 cancelled_ = true; |
| 57 consumer_ = NULL; | 59 consumer_ = NULL; |
| 58 manager_ = NULL; | 60 manager_ = NULL; |
| 59 } | 61 } |
| 60 | 62 |
| 61 void WebDataRequest::OnComplete() { | 63 void WebDataRequest::OnComplete() { |
| 62 manager_= NULL; | 64 manager_= NULL; |
| 63 } | 65 } |
| 64 | 66 |
| 65 void WebDataRequest::SetResult(scoped_ptr<WDTypedResult> r) { | 67 void WebDataRequest::SetResult(scoped_ptr<WDTypedResult> r) { |
| 66 result_ = r.Pass(); | 68 result_ = std::move(r); |
| 67 } | 69 } |
| 68 | 70 |
| 69 scoped_ptr<WDTypedResult> WebDataRequest::GetResult(){ | 71 scoped_ptr<WDTypedResult> WebDataRequest::GetResult(){ |
| 70 return result_.Pass(); | 72 return std::move(result_); |
| 71 } | 73 } |
| 72 | 74 |
| 73 //////////////////////////////////////////////////////////////////////////////// | 75 //////////////////////////////////////////////////////////////////////////////// |
| 74 // | 76 // |
| 75 // WebDataRequestManager implementation. | 77 // WebDataRequestManager implementation. |
| 76 // | 78 // |
| 77 //////////////////////////////////////////////////////////////////////////////// | 79 //////////////////////////////////////////////////////////////////////////////// |
| 78 | 80 |
| 79 WebDataRequestManager::WebDataRequestManager() | 81 WebDataRequestManager::WebDataRequestManager() |
| 80 : next_request_handle_(1) { | 82 : next_request_handle_(1) { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 if (!request->IsCancelled()) { | 153 if (!request->IsCancelled()) { |
| 152 WebDataServiceConsumer* consumer = request->GetConsumer(); | 154 WebDataServiceConsumer* consumer = request->GetConsumer(); |
| 153 request->OnComplete(); | 155 request->OnComplete(); |
| 154 if (consumer) { | 156 if (consumer) { |
| 155 scoped_ptr<WDTypedResult> r = request->GetResult(); | 157 scoped_ptr<WDTypedResult> r = request->GetResult(); |
| 156 consumer->OnWebDataServiceRequestDone(request->GetHandle(), r.get()); | 158 consumer->OnWebDataServiceRequestDone(request->GetHandle(), r.get()); |
| 157 } | 159 } |
| 158 } | 160 } |
| 159 | 161 |
| 160 } | 162 } |
| OLD | NEW |