OLD | NEW |
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 "extensions/renderer/messaging_bindings.h" | 5 #include "extensions/renderer/messaging_bindings.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 "PortRelease", | 94 "PortRelease", |
95 base::Bind(&ExtensionImpl::PortRelease, base::Unretained(this))); | 95 base::Bind(&ExtensionImpl::PortRelease, base::Unretained(this))); |
96 RouteFunction( | 96 RouteFunction( |
97 "PostMessage", | 97 "PostMessage", |
98 base::Bind(&ExtensionImpl::PostMessage, base::Unretained(this))); | 98 base::Bind(&ExtensionImpl::PostMessage, base::Unretained(this))); |
99 // TODO(fsamuel, kalman): Move BindToGC out of messaging natives. | 99 // TODO(fsamuel, kalman): Move BindToGC out of messaging natives. |
100 RouteFunction("BindToGC", | 100 RouteFunction("BindToGC", |
101 base::Bind(&ExtensionImpl::BindToGC, base::Unretained(this))); | 101 base::Bind(&ExtensionImpl::BindToGC, base::Unretained(this))); |
102 } | 102 } |
103 | 103 |
104 virtual ~ExtensionImpl() {} | 104 ~ExtensionImpl() override {} |
105 | 105 |
106 private: | 106 private: |
107 void ClearPortDataAndNotifyDispatcher(int port_id) { | 107 void ClearPortDataAndNotifyDispatcher(int port_id) { |
108 ClearPortData(port_id); | 108 ClearPortData(port_id); |
109 dispatcher_->ClearPortData(port_id); | 109 dispatcher_->ClearPortData(port_id); |
110 } | 110 } |
111 | 111 |
112 // Sends a message along the given channel. | 112 // Sends a message along the given channel. |
113 void PostMessage(const v8::FunctionCallbackInfo<v8::Value>& args) { | 113 void PostMessage(const v8::FunctionCallbackInfo<v8::Value>& args) { |
114 content::RenderView* renderview = context()->GetRenderView(); | 114 content::RenderView* renderview = context()->GetRenderView(); |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 const ScriptContextSet& context_set, | 425 const ScriptContextSet& context_set, |
426 int port_id, | 426 int port_id, |
427 const std::string& error_message, | 427 const std::string& error_message, |
428 content::RenderView* restrict_to_render_view) { | 428 content::RenderView* restrict_to_render_view) { |
429 context_set.ForEach( | 429 context_set.ForEach( |
430 restrict_to_render_view, | 430 restrict_to_render_view, |
431 base::Bind(&DispatchOnDisconnectToScriptContext, port_id, error_message)); | 431 base::Bind(&DispatchOnDisconnectToScriptContext, port_id, error_message)); |
432 } | 432 } |
433 | 433 |
434 } // namespace extensions | 434 } // namespace extensions |
OLD | NEW |