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 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
8 | 8 |
9 #include "base/ios/block_types.h" | 9 #include "base/ios/block_types.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
11 #include "base/json/json_writer.h" | 11 #include "base/json/json_writer.h" |
12 #include "base/mac/bind_objc_block.h" | 12 #include "base/mac/bind_objc_block.h" |
13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #import "ios/web/public/web_state/js/crw_js_injection_evaluator.h" | 15 #import "ios/web/public/web_state/js/crw_js_injection_evaluator.h" |
16 #include "ios/web/public/web_thread.h" | 16 #include "ios/web/public/web_thread.h" |
17 #include "mojo/public/cpp/system/core.h" | 17 #include "mojo/public/cpp/system/core.h" |
18 #include "services/shell/public/interfaces/interface_provider.mojom.h" | 18 #include "services/shell/public/interfaces/interface_provider.mojom.h" |
19 | 19 |
| 20 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 21 #error "This file requires ARC support." |
| 22 #endif |
| 23 |
20 namespace web { | 24 namespace web { |
21 | 25 |
22 namespace { | 26 namespace { |
23 | 27 |
24 // Wraps an integer into |base::Value| as |TYPE_INTEGER|. | 28 // Wraps an integer into |base::Value| as |TYPE_INTEGER|. |
25 template <typename IntegerT> | 29 template <typename IntegerT> |
26 std::unique_ptr<base::Value> ValueFromInteger(IntegerT handle) { | 30 std::unique_ptr<base::Value> ValueFromInteger(IntegerT handle) { |
27 return std::unique_ptr<base::Value>( | 31 return std::unique_ptr<base::Value>( |
28 new base::FundamentalValue(static_cast<int>(handle))); | 32 new base::FundamentalValue(static_cast<int>(handle))); |
29 } | 33 } |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 262 |
259 std::unique_ptr<base::Value> MojoFacade::HandleSupportCancelWatch( | 263 std::unique_ptr<base::Value> MojoFacade::HandleSupportCancelWatch( |
260 const base::DictionaryValue* args) { | 264 const base::DictionaryValue* args) { |
261 int watch_id = 0; | 265 int watch_id = 0; |
262 CHECK(args->GetInteger("watchId", &watch_id)); | 266 CHECK(args->GetInteger("watchId", &watch_id)); |
263 watchers_.erase(watch_id); | 267 watchers_.erase(watch_id); |
264 return nullptr; | 268 return nullptr; |
265 } | 269 } |
266 | 270 |
267 } // namespace web | 271 } // namespace web |
OLD | NEW |