| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #import "ios/web/webui/mojo_facade.h" | 5 #import "ios/web/webui/mojo_facade.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #import <Foundation/Foundation.h> | 9 #import <Foundation/Foundation.h> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 namespace web { | 27 namespace web { |
| 28 | 28 |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 // Wraps an integer into |base::Value| as |Type::INTEGER|. | 31 // Wraps an integer into |base::Value| as |Type::INTEGER|. |
| 32 template <typename IntegerT> | 32 template <typename IntegerT> |
| 33 std::unique_ptr<base::Value> ValueFromInteger(IntegerT handle) { | 33 std::unique_ptr<base::Value> ValueFromInteger(IntegerT handle) { |
| 34 return std::unique_ptr<base::Value>( | 34 return std::unique_ptr<base::Value>( |
| 35 new base::FundamentalValue(static_cast<int>(handle))); | 35 new base::Value(static_cast<int>(handle))); |
| 36 } | 36 } |
| 37 | 37 |
| 38 } // namespace | 38 } // namespace |
| 39 | 39 |
| 40 MojoFacade::MojoFacade( | 40 MojoFacade::MojoFacade( |
| 41 service_manager::mojom::InterfaceProvider* interface_provider, | 41 service_manager::mojom::InterfaceProvider* interface_provider, |
| 42 id<CRWJSInjectionEvaluator> script_evaluator) | 42 id<CRWJSInjectionEvaluator> script_evaluator) |
| 43 : interface_provider_(interface_provider), | 43 : interface_provider_(interface_provider), |
| 44 script_evaluator_(script_evaluator) { | 44 script_evaluator_(script_evaluator) { |
| 45 DCHECK_CURRENTLY_ON(WebThread::UI); | 45 DCHECK_CURRENTLY_ON(WebThread::UI); |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 | 267 |
| 268 std::unique_ptr<base::Value> MojoFacade::HandleSupportCancelWatch( | 268 std::unique_ptr<base::Value> MojoFacade::HandleSupportCancelWatch( |
| 269 const base::DictionaryValue* args) { | 269 const base::DictionaryValue* args) { |
| 270 int watch_id = 0; | 270 int watch_id = 0; |
| 271 CHECK(args->GetInteger("watchId", &watch_id)); | 271 CHECK(args->GetInteger("watchId", &watch_id)); |
| 272 watchers_.erase(watch_id); | 272 watchers_.erase(watch_id); |
| 273 return nullptr; | 273 return nullptr; |
| 274 } | 274 } |
| 275 | 275 |
| 276 } // namespace web | 276 } // namespace web |
| OLD | NEW |