| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "extensions/renderer/api_binding_hooks.h" |
| 6 |
| 7 namespace extensions { |
| 8 |
| 9 APIBindingHooks::APIBindingHooks() {} |
| 10 APIBindingHooks::~APIBindingHooks() {} |
| 11 |
| 12 void APIBindingHooks::RegisterHandleRequest(const std::string& method_name, |
| 13 const HandleRequestHook& hook) { |
| 14 request_hooks_[method_name] = hook; |
| 15 } |
| 16 |
| 17 APIBindingHooks::HandleRequestHook APIBindingHooks::GetHandleRequest( |
| 18 const std::string& method_name) { |
| 19 auto iter = request_hooks_.find(method_name); |
| 20 if (iter != request_hooks_.end()) |
| 21 return iter->second; |
| 22 |
| 23 return HandleRequestHook(); |
| 24 } |
| 25 |
| 26 } // namespace extensions |
| OLD | NEW |